aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/FunctionInlining.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-18 01:31:58 +0000
committerChris Lattner <sabre@nondot.org>2001-10-18 01:31:58 +0000
commit475369e255bbdd70de3fb870bbd9fae3d6b1038f (patch)
treecd718cac568ffe8b871a8645a21252b28da005e0 /include/llvm/Transforms/FunctionInlining.h
parent6db0f4795cbd9b58add13c2b2f0c7124112ab9b7 (diff)
Convert optimizations to use the Pass infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/FunctionInlining.h')
-rw-r--r--include/llvm/Transforms/FunctionInlining.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/llvm/Transforms/FunctionInlining.h b/include/llvm/Transforms/FunctionInlining.h
index b314b97bed..5a87c1b8e5 100644
--- a/include/llvm/Transforms/FunctionInlining.h
+++ b/include/llvm/Transforms/FunctionInlining.h
@@ -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