diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 0a077b7..6feeb19 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -2031,7 +2031,9 @@ bool TargetLoweringBase::isLegalAddressingMode(const DataLayout &DL, Value *TargetLoweringBase::getIRStackGuard(IRBuilderBase &IRB) const { if (getTargetMachine().getTargetTriple().isOSOpenBSD()) { Module &M = *IRB.GetInsertBlock()->getParent()->getParent(); - PointerType *PtrTy = PointerType::getUnqual(M.getContext()); + const DataLayout &DL = M.getDataLayout(); + PointerType *PtrTy = + PointerType::get(M.getContext(), DL.getDefaultGlobalsAddressSpace()); GlobalVariable *G = M.getOrInsertGlobal("__guard_local", PtrTy); G->setVisibility(GlobalValue::HiddenVisibility); return G; |