summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
diff options
context:
space:
mode:
authorJames Y Knight <jyknight@google.com>2019-02-01 20:44:54 +0000
committerJames Y Knight <jyknight@google.com>2019-02-01 20:44:54 +0000
commit291f791ef1ecba3856b6192e3a81856c15d2e161 (patch)
treee4c02100f7aca4de6f15cbcd3f14da4f88c7dd94 /llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
parent7716075a1729ead67844574fdb34579894122992 (diff)
downloadbcm5719-llvm-291f791ef1ecba3856b6192e3a81856c15d2e161.tar.gz
bcm5719-llvm-291f791ef1ecba3856b6192e3a81856c15d2e161.zip
[opaque pointer types] Pass function type for CallBase::setCalledFunction.
Differential Revision: https://reviews.llvm.org/D57174 llvm-svn: 352914
Diffstat (limited to 'llvm/lib/Transforms/Utils/CallPromotionUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CallPromotionUtils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp b/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
index 681c5a7de93..1cb883517e8 100644
--- a/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
+++ b/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
@@ -366,8 +366,9 @@ Instruction *llvm::promoteCall(CallSite CS, Function *Callee,
CastInst **RetBitCast) {
assert(!CS.getCalledFunction() && "Only indirect call sites can be promoted");
- // Set the called function of the call site to be the given callee.
- CS.setCalledFunction(Callee);
+ // Set the called function of the call site to be the given callee (but don't
+ // change the type).
+ cast<CallBase>(CS.getInstruction())->setCalledOperand(Callee);
// Since the call site will no longer be direct, we must clear metadata that
// is only appropriate for indirect calls. This includes !prof and !callees
OpenPOWER on IntegriCloud