From 416f1c465db62d829283f6902ef35e027e127aa7 Mon Sep 17 00:00:00 2001 From: Mats Jun Larsen Date: Tue, 21 Jan 2025 00:32:56 +0900 Subject: [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. --- llvm/lib/Transforms/Utils/ModuleUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Utils/ModuleUtils.cpp') 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 llvm::createSanitizerCtorAndInitFunctions( BasicBlock::Create(M.getContext(), "callfunc", Ctor, RetBB); auto *InitFn = cast(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)); -- cgit v1.1