From 751d95fb9b3d66731eca0a17bcd7392ca96bb8d9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 11 Feb 2019 07:51:44 +0000 Subject: [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(CS.getInstruction())`. llvm-svn: 353661 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/SCCP.cpp') diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 39d294f8602..e75a5dbddba 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -1243,7 +1243,7 @@ CallOverdefined: // Otherwise, if we have a single return value case, and if the function is // a declaration, maybe we can constant fold it. if (F && F->isDeclaration() && !I->getType()->isStructTy() && - canConstantFoldCallTo(CS, F)) { + canConstantFoldCallTo(cast(CS.getInstruction()), F)) { SmallVector Operands; for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); AI != E; ++AI) { @@ -1264,7 +1264,8 @@ CallOverdefined: // If we can constant fold this, mark the result of the call as a // constant. - if (Constant *C = ConstantFoldCall(CS, F, Operands, TLI)) { + if (Constant *C = ConstantFoldCall(cast(CS.getInstruction()), F, + Operands, TLI)) { // call -> undef. if (isa(C)) return; -- cgit v1.2.3