Refactor code a bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8952 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-10-07 22:32:43 +00:00
parent 9eacf8aac8
commit a44d8a2897

View File

@ -99,6 +99,7 @@ namespace {
Instruction *visitInstruction(Instruction &I) { return 0; }
private:
Instruction *visitCallSite(CallSite CS);
bool transformConstExprCastCall(CallSite CS);
// InsertNewInstBefore - insert an instruction New before instruction Old
@ -1581,15 +1582,13 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
// CallInst simplification
//
Instruction *InstCombiner::visitCallInst(CallInst &CI) {
if (transformConstExprCastCall(&CI)) return 0;
return 0;
return visitCallSite(&CI);
}
// InvokeInst simplification
//
Instruction *InstCombiner::visitInvokeInst(InvokeInst &II) {
if (transformConstExprCastCall(&II)) return 0;
return 0;
return visitCallSite(&II);
}
// getPromotedType - Return the specified type promoted as it would be to pass
@ -1605,6 +1604,15 @@ static const Type *getPromotedType(const Type *Ty) {
}
}
// visitCallSite - Improvements for call and invoke instructions.
//
Instruction *InstCombiner::visitCallSite(CallSite CS) {
if (transformConstExprCastCall(CS)) return 0;
return 0;
}
// transformConstExprCastCall - If the callee is a constexpr cast of a function,
// attempt to move the cast to the arguments of the call/invoke.
//