[llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Cloning.h
Chris Lattner
lattner at cs.uiuc.edu
Sat Jan 14 12:05:34 PST 2006
Changes in directory llvm/include/llvm/Transforms/Utils:
Cloning.h updated: 1.17 -> 1.18
---
Log message:
Teach inline function how to update the callgraph when it makes changes.
---
Diffs of the changes: (+13 -9)
Cloning.h | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
Index: llvm/include/llvm/Transforms/Utils/Cloning.h
diff -u llvm/include/llvm/Transforms/Utils/Cloning.h:1.17 llvm/include/llvm/Transforms/Utils/Cloning.h:1.18
--- llvm/include/llvm/Transforms/Utils/Cloning.h:1.17 Fri Jan 13 12:38:08 2006
+++ llvm/include/llvm/Transforms/Utils/Cloning.h Sat Jan 14 14:05:06 2006
@@ -32,6 +32,7 @@
class ReturnInst;
class CallSite;
class Trace;
+class CallGraph;
/// CloneModule - Return an exact copy of the specified module
///
@@ -136,6 +137,12 @@
std::map<const Value*, Value*> &ValueMap,
const char *NameSuffix);
+/// CloneTrace - Returns a copy of the specified trace.
+/// It takes a vector of basic blocks clones the basic blocks, removes internal
+/// phi nodes, adds it to the same function as the original (although there is
+/// no jump to it) and returns the new vector of basic blocks.
+std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
+
/// InlineFunction - This function inlines the called function into the basic
/// block of the caller. This returns false if it is not possible to inline
/// this call. The program is still in a well defined state if this occurs
@@ -146,15 +153,12 @@
/// exists in the instruction stream. Similiarly this will inline a recursive
/// function by one level.
///
-bool InlineFunction(CallInst *C);
-bool InlineFunction(InvokeInst *II);
-bool InlineFunction(CallSite CS);
-
-/// CloneTrace - Returns a copy of the specified trace.
-/// It takes a vector of basic blocks clones the basic blocks, removes internal
-/// phi nodes, adds it to the same function as the original (although there is
-/// no jump to it) and returns the new vector of basic blocks.
-std::vector<BasicBlock *> CloneTrace(const std::vector<BasicBlock*> &origTrace);
+/// If a non-null callgraph pointer is provided, these functions update the
+/// CallGraph to represent the program after inlining.
+///
+bool InlineFunction(CallInst *C, CallGraph *CG = 0);
+bool InlineFunction(InvokeInst *II, CallGraph *CG = 0);
+bool InlineFunction(CallSite CS, CallGraph *CG = 0);
} // End llvm namespace
More information about the llvm-commits
mailing list