summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/InlineSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-27 06:56:12 +0000
committerChris Lattner <sabre@nondot.org>2002-04-27 06:56:12 +0000
commitc8e665431be235941eedfd0e6434fa5386d632d1 (patch)
treeec509bce054e36357111e58ecd2207fcc8238b9b /llvm/lib/Transforms/IPO/InlineSimple.cpp
parent66cfaf1da24e732948b75d1d82272793da8ec5ae (diff)
downloadbcm5719-llvm-c8e665431be235941eedfd0e6434fa5386d632d1.tar.gz
bcm5719-llvm-c8e665431be235941eedfd0e6434fa5386d632d1.zip
* Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction * Transform getAnalysisUsageInfo into getAnalysisUsage - Method is now const - It now takes one AnalysisUsage object to fill in instead of 3 vectors to fill in - Pass's now specify which other passes they _preserve_ not which ones they modify (be conservative!) - A pass can specify that it preserves all analyses (because it never modifies the underlying program) * s/Method/Function/g in other random places as well llvm-svn: 2333
Diffstat (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/InlineSimple.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/IPO/InlineSimple.cpp b/llvm/lib/Transforms/IPO/InlineSimple.cpp
index 7f962782656..fcb1e4fa40e 100644
--- a/llvm/lib/Transforms/IPO/InlineSimple.cpp
+++ b/llvm/lib/Transforms/IPO/InlineSimple.cpp
@@ -53,7 +53,7 @@ static inline void RemapInstruction(Instruction *I,
}
}
-// InlineMethod - This function forcibly inlines the called function into the
+// InlineFunction - This function forcibly 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 though.
@@ -63,8 +63,8 @@ static inline void RemapInstruction(Instruction *I,
// exists in the instruction stream. Similiarly this will inline a recursive
// function by one level.
//
-bool InlineMethod(BasicBlock::iterator CIIt) {
- assert(isa<CallInst>(*CIIt) && "InlineMethod only works on CallInst nodes!");
+bool InlineFunction(BasicBlock::iterator CIIt) {
+ assert(isa<CallInst>(*CIIt) && "InlineFunction only works on CallInst nodes");
assert((*CIIt)->getParent() && "Instruction not embedded in basic block!");
assert((*CIIt)->getParent()->getParent() && "Instruction not in function!");
@@ -209,7 +209,7 @@ bool InlineMethod(BasicBlock::iterator CIIt) {
return true;
}
-bool InlineMethod(CallInst *CI) {
+bool InlineFunction(CallInst *CI) {
assert(CI->getParent() && "CallInst not embeded in BasicBlock!");
BasicBlock *PBB = CI->getParent();
@@ -217,12 +217,12 @@ bool InlineMethod(CallInst *CI) {
assert(CallIt != PBB->end() &&
"CallInst has parent that doesn't contain CallInst?!?");
- return InlineMethod(CallIt);
+ return InlineFunction(CallIt);
}
static inline bool ShouldInlineFunction(const CallInst *CI, const Function *F) {
assert(CI->getParent() && CI->getParent()->getParent() &&
- "Call not embedded into a method!");
+ "Call not embedded into a function!");
// Don't inline a recursive call.
if (CI->getParent()->getParent() == F) return false;
@@ -244,7 +244,7 @@ static inline bool DoFunctionInlining(BasicBlock *BB) {
// Check to see if we should inline this function
Function *F = CI->getCalledFunction();
if (F && ShouldInlineFunction(CI, F))
- return InlineMethod(I);
+ return InlineFunction(I);
}
}
return false;
@@ -270,11 +270,11 @@ static bool doFunctionInlining(Function *F) {
}
namespace {
- struct FunctionInlining : public MethodPass {
- virtual bool runOnMethod(Function *F) {
+ struct FunctionInlining : public FunctionPass {
+ virtual bool runOnFunction(Function *F) {
return doFunctionInlining(F);
}
};
}
-Pass *createMethodInliningPass() { return new FunctionInlining(); }
+Pass *createFunctionInliningPass() { return new FunctionInlining(); }
OpenPOWER on IntegriCloud