aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorBrad Smith <brad@comstyle.com>2020-08-27 17:17:38 -0400
committerBrad Smith <brad@comstyle.com>2020-08-27 17:17:38 -0400
commitd870e363263835bec96c83f51b20e64722cad742 (patch)
tree0d07dc790a7faf6782c51687dc08b882d7341c22 /llvm/lib/CodeGen/TargetLoweringBase.cpp
parentba1de5f2f7b078f69d5f6b0fe3af4911f76bb8fd (diff)
downloadllvm-d870e363263835bec96c83f51b20e64722cad742.zip
llvm-d870e363263835bec96c83f51b20e64722cad742.tar.gz
llvm-d870e363263835bec96c83f51b20e64722cad742.tar.bz2
[SSP] Restore setting the visibility of __guard_local to hidden for better code generation.
Patch by: Philip Guenther
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 868302a..40bb45a 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1844,7 +1844,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<> &IRB) const {
if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
PointerType *PtrTy = Type::getInt8PtrTy(M.getContext());
- return M.getOrInsertGlobal("__guard_local", PtrTy);
+ Constant *C = M.getOrInsertGlobal("__guard_local", PtrTy);
+ if (GlobalVariable *G = dyn_cast_or_null<GlobalVariable>(C))
+ G->setVisibility(GlobalValue::HiddenVisibility);
+ return C;
}
return nullptr;
}