Avoid unnecessarily casting away const, fixing a FIXME.
authorDan Gohman <gohman@apple.com>
Thu, 31 Jan 2008 01:05:10 +0000 (01:05 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 31 Jan 2008 01:05:10 +0000 (01:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46591 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ConstantFolding.h
lib/Analysis/ConstantFolding.cpp
lib/Analysis/ScalarEvolution.cpp

index 240df6cf26a10b44462b5df7f8f2cad9cb6cd4b0..a22913a0b9023349cf35549004fd21078a1bc0d9 100644 (file)
@@ -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.
index 21e19444cfe5414b5fb39d74427eec0879644be6..e29b2dba86c3f4fd7a838b9a0085f9d9b0d83be9 100644 (file)
@@ -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:
index e373478f11346a4e4638048bbd848b76a14b0e7f..10f05bc8dd0a88c3430518a80241cfa2e6d003dd 100644 (file)
@@ -1979,7 +1979,7 @@ static bool CanConstantFold(const Instruction *I) {
 
   if (const CallInst *CI = dyn_cast<CallInst>(I))
     if (const Function *F = CI->getCalledFunction())
-      return canConstantFoldCallTo((Function*)F);  // FIXME: elim cast
+      return canConstantFoldCallTo(F);
   return false;
 }