diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index c85f0c7..935afaf 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1975,10 +1975,9 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilderBase &IRB) const { if (getTargetMachine().getTargetTriple().isOSOpenBSD()) { Module &M = *IRB.GetInsertBlock()->getParent()->getParent(); PointerType *PtrTy = PointerType::getUnqual(M.getContext()); - Constant *C = M.getOrInsertGlobal("__guard_local", PtrTy); - if (GlobalVariable *G = dyn_cast_or_null<GlobalVariable>(C)) - G->setVisibility(GlobalValue::HiddenVisibility); - return C; + GlobalVariable *G = M.getOrInsertGlobal("__guard_local", PtrTy); + G->setVisibility(GlobalValue::HiddenVisibility); + return G; } return nullptr; } |