mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user