aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringBase.cpp
diff options
context:
space:
mode:
authorPaulo Matos <pmatos@igalia.com>2023-11-07 17:26:26 +0100
committerGitHub <noreply@github.com>2023-11-07 17:26:26 +0100
commit7b9d73c2f90c0ed8497339a16fc39785349d9610 (patch)
tree5f31fd1d5ffc20ce828ccf3b3d26a969f0528ba7 /llvm/lib/CodeGen/TargetLoweringBase.cpp
parent75d6795e420274346b14aca8b6bd49bfe6030eeb (diff)
downloadllvm-7b9d73c2f90c0ed8497339a16fc39785349d9610.zip
llvm-7b9d73c2f90c0ed8497339a16fc39785349d9610.tar.gz
llvm-7b9d73c2f90c0ed8497339a16fc39785349d9610.tar.bz2
[NFC] Remove Type::getInt8PtrTy (#71029)
Replace this with PointerType::getUnqual(). Followup to the opaque pointer transition. Fixes an in-code TODO item.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringBase.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp
index 722cefb..7be1ebe 100644
--- a/llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1911,7 +1911,7 @@ TargetLoweringBase::getDefaultSafeStackPointerLocation(IRBuilderBase &IRB,
auto UnsafeStackPtr =
dyn_cast_or_null<GlobalVariable>(M->getNamedValue(UnsafeStackPtrVar));
- Type *StackPtrTy = Type::getInt8PtrTy(M->getContext());
+ Type *StackPtrTy = PointerType::getUnqual(M->getContext());
if (!UnsafeStackPtr) {
auto TLSModel = UseTLS ?
@@ -1942,7 +1942,7 @@ TargetLoweringBase::getSafeStackPointerLocation(IRBuilderBase &IRB) const {
// Android provides a libc function to retrieve the address of the current
// thread's unsafe stack pointer.
Module *M = IRB.GetInsertBlock()->getParent()->getParent();
- Type *StackPtrTy = Type::getInt8PtrTy(M->getContext());
+ Type *StackPtrTy = PointerType::getUnqual(M->getContext());
FunctionCallee Fn = M->getOrInsertFunction("__safestack_pointer_address",
StackPtrTy->getPointerTo(0));
return IRB.CreateCall(Fn);
@@ -1998,7 +1998,7 @@ bool TargetLoweringBase::isLegalAddressingMode(const DataLayout &DL,
Value *TargetLoweringBase::getIRStackGuard(IRBuilderBase &IRB) const {
if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
Module &M = *IRB.GetInsertBlock()->getParent()->getParent();
- PointerType *PtrTy = Type::getInt8PtrTy(M.getContext());
+ 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);
@@ -2011,9 +2011,9 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilderBase &IRB) const {
// TODO: add LOAD_STACK_GUARD support.
void TargetLoweringBase::insertSSPDeclarations(Module &M) const {
if (!M.getNamedValue("__stack_chk_guard")) {
- auto *GV = new GlobalVariable(M, Type::getInt8PtrTy(M.getContext()), false,
- GlobalVariable::ExternalLinkage, nullptr,
- "__stack_chk_guard");
+ auto *GV = new GlobalVariable(M, PointerType::getUnqual(M.getContext()),
+ false, GlobalVariable::ExternalLinkage,
+ nullptr, "__stack_chk_guard");
// FreeBSD has "__stack_chk_guard" defined externally on libc.so
if (M.getDirectAccessExternalData() &&