Expose the TCE pass

llvm-svn: 8619
This commit is contained in:
Chris Lattner 2003-09-20 05:14:13 +00:00
parent 2e9014cb1b
commit 0016085602
2 changed files with 10 additions and 0 deletions

View File

@ -241,6 +241,13 @@ void SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0);
Pass *createLoopPreheaderInsertionPass();
extern const PassInfo *LoopPreheadersID;
//===----------------------------------------------------------------------===//
//
// This pass eliminates call instructions to the current function which occur
// immediately before return instructions.
//
FunctionPass *createTailCallEliminationPass();
//===----------------------------------------------------------------------===//
// This pass convert malloc and free instructions to %malloc & %free function

View File

@ -19,6 +19,7 @@
//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Scalar.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
@ -34,6 +35,8 @@ namespace {
RegisterOpt<TailCallElim> X("tailcallelim", "Tail Call Elimination");
}
FunctionPass *createTailCallEliminationPass() { return new TailCallElim(); }
bool TailCallElim::runOnFunction(Function &F) {
// If this function is a varargs function, we won't be able to PHI the args