From fa9b80eb64127b3d9691e18537975635520e51e9 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 31 Jan 2008 01:05:10 +0000 Subject: [PATCH] Avoid unnecessarily casting away const, fixing a FIXME. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46591 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/ConstantFolding.h | 2 +- lib/Analysis/ConstantFolding.cpp | 2 +- lib/Analysis/ScalarEvolution.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/llvm/Analysis/ConstantFolding.h b/include/llvm/Analysis/ConstantFolding.h index 240df6cf26a..a22913a0b90 100644 --- a/include/llvm/Analysis/ConstantFolding.h +++ b/include/llvm/Analysis/ConstantFolding.h @@ -56,7 +56,7 @@ Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE); /// canConstantFoldCallTo - Return true if its even possible to fold a call to /// the specified function. -bool canConstantFoldCallTo(Function *F); +bool canConstantFoldCallTo(const Function *F); /// ConstantFoldCall - Attempt to constant fold a call to the specified function /// with the specified arguments, returning null if unsuccessful. diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 21e19444cfe..e29b2dba86c 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -508,7 +508,7 @@ Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C, /// canConstantFoldCallTo - Return true if its even possible to fold a call to /// the specified function. bool -llvm::canConstantFoldCallTo(Function *F) { +llvm::canConstantFoldCallTo(const Function *F) { switch (F->getIntrinsicID()) { case Intrinsic::sqrt: case Intrinsic::powi: diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index e373478f113..10f05bc8dd0 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1979,7 +1979,7 @@ static bool CanConstantFold(const Instruction *I) { if (const CallInst *CI = dyn_cast(I)) if (const Function *F = CI->getCalledFunction()) - return canConstantFoldCallTo((Function*)F); // FIXME: elim cast + return canConstantFoldCallTo(F); return false; } -- 2.11.0