Convert optimizations to use the Pass infrastructure

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@871 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-10-18 01:31:58 +00:00
parent 6db0f4795c
commit 475369e255
6 changed files with 108 additions and 43 deletions

View File

@@ -7,20 +7,22 @@
#ifndef LLVM_OPT_METHOD_INLINING_H
#define LLVM_OPT_METHOD_INLINING_H
#include "llvm/Module.h"
#include "llvm/Transforms/Pass.h"
#include "llvm/BasicBlock.h"
class CallInst;
namespace opt {
// DoMethodInlining - Use a heuristic based approach to inline methods that seem
// to look good.
//
bool DoMethodInlining(Method *M);
struct MethodInlining : public StatelessPass<MethodInlining> {
// DoMethodInlining - Use a heuristic based approach to inline methods that
// seem to look good.
//
static bool doMethodInlining(Method *M);
static inline bool DoMethodInlining(Module *M) {
return M->reduceApply(DoMethodInlining);
}
inline static bool doPerMethodWork(Method *M) {
return doMethodInlining(M);
}
};
// InlineMethod - This function forcibly inlines the called method into the
// basic block of the caller. This returns true if it is not possible to inline