1 //===-- MethodInlining.h - Functions that perform Inlining -------*- C++ -*--=//
3 // This family of functions is useful for performing method inlining.
5 //===----------------------------------------------------------------------===//
7 #ifndef LLVM_OPT_METHOD_INLINING_H
8 #define LLVM_OPT_METHOD_INLINING_H
10 #include "llvm/Module.h"
11 #include "llvm/BasicBlock.h"
16 // DoMethodInlining - Use a heuristic based approach to inline methods that seem
19 bool DoMethodInlining(Method *M);
21 static inline bool DoMethodInlining(Module *M) {
22 return M->reduceApply(DoMethodInlining);
25 // InlineMethod - This function forcibly inlines the called method into the
26 // basic block of the caller. This returns true if it is not possible to inline
27 // this call. The program is still in a well defined state if this occurs
30 // Note that this only does one level of inlining. For example, if the
31 // instruction 'call B' is inlined, and 'B' calls 'C', then the call to 'C' now
32 // exists in the instruction stream. Similiarly this will inline a recursive
33 // method by one level.
35 bool InlineMethod(CallInst *C);
36 bool InlineMethod(BasicBlock::iterator CI); // *CI must be CallInst
38 } // end namespace opt