diff options
author | James Y Knight <jyknight@google.com> | 2019-02-01 20:43:25 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2019-02-01 20:43:25 +0000 |
commit | 7976eb58382b25d0e17490b9d77fb06cb000c95b (patch) | |
tree | 286450abb61ef79d2e7356e0d0d80dbbce0a728a /llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | |
parent | c456309f67a9ea44038fb5d8a96c90d9c6965b67 (diff) | |
download | bcm5719-llvm-7976eb58382b25d0e17490b9d77fb06cb000c95b.tar.gz bcm5719-llvm-7976eb58382b25d0e17490b9d77fb06cb000c95b.zip |
[opaque pointer types] Pass function types to CallInst creation.
This cleans up all CallInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.
Differential Revision: https://reviews.llvm.org/D57170
llvm-svn: 352909
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp index 44e372bdc36..3ad80426ce5 100644 --- a/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp +++ b/llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp @@ -235,13 +235,14 @@ void makeStub(Function &F, Value &ImplPointer) { assert(F.isDeclaration() && "Can't turn a definition into a stub."); assert(F.getParent() && "Function isn't in a module."); Module &M = *F.getParent(); + FunctionType *FTy = F.getFunctionType(); BasicBlock *EntryBlock = BasicBlock::Create(M.getContext(), "entry", &F); IRBuilder<> Builder(EntryBlock); LoadInst *ImplAddr = Builder.CreateLoad(&ImplPointer); std::vector<Value*> CallArgs; for (auto &A : F.args()) CallArgs.push_back(&A); - CallInst *Call = Builder.CreateCall(ImplAddr, CallArgs); + CallInst *Call = Builder.CreateCall(FTy, ImplAddr, CallArgs); Call->setTailCall(); Call->setAttributes(F.getAttributes()); if (F.getReturnType()->isVoidTy()) |