mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
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
This commit is contained in:
parent
bbfb9c57c7
commit
fa9b80eb64
@ -56,7 +56,7 @@ Constant *ConstantFoldLoadThroughGEPConstantExpr(Constant *C, ConstantExpr *CE);
|
|||||||
|
|
||||||
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
||||||
/// the specified function.
|
/// the specified function.
|
||||||
bool canConstantFoldCallTo(Function *F);
|
bool canConstantFoldCallTo(const Function *F);
|
||||||
|
|
||||||
/// ConstantFoldCall - Attempt to constant fold a call to the specified function
|
/// ConstantFoldCall - Attempt to constant fold a call to the specified function
|
||||||
/// with the specified arguments, returning null if unsuccessful.
|
/// with the specified arguments, returning null if unsuccessful.
|
||||||
|
@ -508,7 +508,7 @@ Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
|
|||||||
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
/// canConstantFoldCallTo - Return true if its even possible to fold a call to
|
||||||
/// the specified function.
|
/// the specified function.
|
||||||
bool
|
bool
|
||||||
llvm::canConstantFoldCallTo(Function *F) {
|
llvm::canConstantFoldCallTo(const Function *F) {
|
||||||
switch (F->getIntrinsicID()) {
|
switch (F->getIntrinsicID()) {
|
||||||
case Intrinsic::sqrt:
|
case Intrinsic::sqrt:
|
||||||
case Intrinsic::powi:
|
case Intrinsic::powi:
|
||||||
|
@ -1979,7 +1979,7 @@ static bool CanConstantFold(const Instruction *I) {
|
|||||||
|
|
||||||
if (const CallInst *CI = dyn_cast<CallInst>(I))
|
if (const CallInst *CI = dyn_cast<CallInst>(I))
|
||||||
if (const Function *F = CI->getCalledFunction())
|
if (const Function *F = CI->getCalledFunction())
|
||||||
return canConstantFoldCallTo((Function*)F); // FIXME: elim cast
|
return canConstantFoldCallTo(F);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user