aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ModuleUtils.cpp
diff options
context:
space:
mode:
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));