Skip to content

Commit a446300

Browse files
authored
TargetLowering: Avoid a use of PointerType::getUnqual (#147884)
Use the default globals address space
1 parent 361a659 commit a446300

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
@@ -2031,7 +2031,9 @@ bool TargetLoweringBase::isLegalAddressingMode(const DataLayout &DL,
20312031
Value *TargetLoweringBase::getIRStackGuard(IRBuilderBase &IRB) const {
20322032
if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
20332033
Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
2034-
PointerType *PtrTy = PointerType::getUnqual(M.getContext());
2034+
const DataLayout &DL = M.getDataLayout();
2035+
PointerType *PtrTy =
2036+
PointerType::get(M.getContext(), DL.getDefaultGlobalsAddressSpace());
20352037
GlobalVariable *G = M.getOrInsertGlobal("__guard_local", PtrTy);
20362038
G->setVisibility(GlobalValue::HiddenVisibility);
20372039
return G;

0 commit comments

Comments
 (0)