From c8e665431be235941eedfd0e6434fa5386d632d1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 27 Apr 2002 06:56:12 +0000 Subject: * 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 --- llvm/lib/Transforms/IPO/InlineSimple.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Transforms/IPO/InlineSimple.cpp') 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(*CIIt) && "InlineMethod only works on CallInst nodes!"); +bool InlineFunction(BasicBlock::iterator CIIt) { + assert(isa(*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(); } -- cgit v1.2.3