diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2019-02-11 07:51:44 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2019-02-11 07:51:44 +0000 |
commit | 751d95fb9b3d66731eca0a17bcd7392ca96bb8d9 (patch) | |
tree | 7c1a2c76efcb97119c0ce19712af9e18f89f98b0 /llvm/lib/Transforms/Utils | |
parent | 3160734af13ba9797c82ce98be75b63db0c37c50 (diff) | |
download | bcm5719-llvm-751d95fb9b3d66731eca0a17bcd7392ca96bb8d9.tar.gz bcm5719-llvm-751d95fb9b3d66731eca0a17bcd7392ca96bb8d9.zip |
[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/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/Evaluator.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Evaluator.cpp b/llvm/lib/Transforms/Utils/Evaluator.cpp index 4a8ec438c28..fb8cb3ddea6 100644 --- a/llvm/lib/Transforms/Utils/Evaluator.cpp +++ b/llvm/lib/Transforms/Utils/Evaluator.cpp @@ -540,7 +540,8 @@ bool Evaluator::EvaluateBlock(BasicBlock::iterator CurInst, if (Callee->isDeclaration()) { // If this is a function we can constant fold, do it. - if (Constant *C = ConstantFoldCall(CS, Callee, Formals, TLI)) { + if (Constant *C = ConstantFoldCall(cast<CallBase>(CS.getInstruction()), + Callee, Formals, TLI)) { InstResult = castCallResultIfNeeded(CS.getCalledValue(), C); if (!InstResult) return false; diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b7e69669839..f10bc6520a8 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -415,8 +415,8 @@ bool llvm::wouldInstructionBeTriviallyDead(Instruction *I, if (Constant *C = dyn_cast<Constant>(CI->getArgOperand(0))) return C->isNullValue() || isa<UndefValue>(C); - if (CallSite CS = CallSite(I)) - if (isMathLibCallNoop(CS, TLI)) + if (auto *Call = dyn_cast<CallBase>(I)) + if (isMathLibCallNoop(Call, TLI)) return true; return false; |