aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2019-02-11 07:51:44 +0000
committerChandler Carruth <chandlerc@gmail.com>2019-02-11 07:51:44 +0000
commit751d95fb9b3d66731eca0a17bcd7392ca96bb8d9 (patch)
tree7c1a2c76efcb97119c0ce19712af9e18f89f98b0 /llvm/lib/Analysis/InlineCost.cpp
parent3160734af13ba9797c82ce98be75b63db0c37c50 (diff)
downloadllvm-751d95fb9b3d66731eca0a17bcd7392ca96bb8d9.zip
llvm-751d95fb9b3d66731eca0a17bcd7392ca96bb8d9.tar.gz
llvm-751d95fb9b3d66731eca0a17bcd7392ca96bb8d9.tar.bz2
[CallSite removal] Migrate ConstantFolding APIs and implementation to
`CallBase`. Users have been updated. You can see how to update any out-of-tree usages: pass `cast<CallBase>(CS.getInstruction())`. llvm-svn: 353661
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 0e20739..574a1b6 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1177,7 +1177,7 @@ bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) {
// because we have to continually rebuild the argument list even when no
// simplifications can be performed. Until that is fixed with remapping
// inside of instsimplify, directly constant fold calls here.
- if (!canConstantFoldCallTo(CS, F))
+ if (!canConstantFoldCallTo(cast<CallBase>(CS.getInstruction()), F))
return false;
// Try to re-map the arguments to constants.
@@ -1193,7 +1193,8 @@ bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) {
ConstantArgs.push_back(C);
}
- if (Constant *C = ConstantFoldCall(CS, F, ConstantArgs)) {
+ if (Constant *C = ConstantFoldCall(cast<CallBase>(CS.getInstruction()), F,
+ ConstantArgs)) {
SimplifiedValues[CS.getInstruction()] = C;
return true;
}