Skip to content

Commit 9d4f557

Browse files
committed
TargetLowering: Avoid a use of PointerType::getUnqual
Use the default globals address space
1 parent 0b49f2f commit 9d4f557

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,9 @@ bool TargetLoweringBase::isLegalAddressingMode(const DataLayout &DL,
19911991
Value *TargetLoweringBase::getIRStackGuard(IRBuilderBase &IRB) const {
19921992
if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
19931993
Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
1994-
PointerType *PtrTy = PointerType::getUnqual(M.getContext());
1994+
const DataLayout &DL = M.getDataLayout();
1995+
PointerType *PtrTy =
1996+
PointerType::get(M.getContext(), DL.getDefaultGlobalsAddressSpace());
19951997
GlobalVariable *G = M.getOrInsertGlobal("__guard_local", PtrTy);
19961998
G->setVisibility(GlobalValue::HiddenVisibility);
19971999
return G;

0 commit comments

Comments
 (0)