aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ModuleUtils.cpp
diff options
context:
space:
mode:
authorMats Jun Larsen <mats@jun.codes>2025-01-21 00:32:56 +0900
committerGitHub <noreply@github.com>2025-01-21 00:32:56 +0900
commit416f1c465db62d829283f6902ef35e027e127aa7 (patch)
tree876ba62997d586d463159f4cfe977d4c0cea5b05 /llvm/lib/Transforms/Utils/ModuleUtils.cpp
parent9c7e02d579db7ba81a414cd2212ce2b48b927941 (diff)
downloadllvm-416f1c465db62d829283f6902ef35e027e127aa7.zip
llvm-416f1c465db62d829283f6902ef35e027e127aa7.tar.gz
llvm-416f1c465db62d829283f6902ef35e027e127aa7.tar.bz2
[IR] Replace of PointerType::get(Type) with opaque version (NFC) (#123617)
In accordance with https://github.com/llvm/llvm-project/issues/123569 In order to keep the patch at reasonable size, this PR only covers for the llvm subproject, unittests excluded.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ModuleUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ModuleUtils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 7249571..df31a3d 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -45,9 +45,9 @@ static void appendToGlobalArray(StringRef ArrayName, Module &M, Function *F,
}
GVCtor->eraseFromParent();
} else {
- EltTy = StructType::get(IRB.getInt32Ty(),
- PointerType::get(FnTy, F->getAddressSpace()),
- IRB.getPtrTy());
+ EltTy = StructType::get(
+ IRB.getInt32Ty(),
+ PointerType::get(M.getContext(), F->getAddressSpace()), IRB.getPtrTy());
}
// Build a 3 field global_ctor entry. We don't take a comdat key.
@@ -268,7 +268,7 @@ std::pair<Function *, FunctionCallee> llvm::createSanitizerCtorAndInitFunctions(
BasicBlock::Create(M.getContext(), "callfunc", Ctor, RetBB);
auto *InitFn = cast<Function>(InitFunction.getCallee());
auto *InitFnPtr =
- PointerType::get(InitFn->getType(), InitFn->getAddressSpace());
+ PointerType::get(M.getContext(), InitFn->getAddressSpace());
IRB.SetInsertPoint(EntryBB);
Value *InitNotNull =
IRB.CreateICmpNE(InitFn, ConstantPointerNull::get(InitFnPtr));