diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-07 20:49:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-07 20:49:59 +0000 |
commit | 2fbfdcffd3e0cf41422aaa6c526c37cb02b81341 (patch) | |
tree | c1991eac5d23807b38e5909f861609b243562f70 /lib/Transforms/Scalar | |
parent | dcc6d4cada290857ee74164816ec3c502c1db7a4 (diff) | |
download | external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.zip external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.tar.gz external_llvm-2fbfdcffd3e0cf41422aaa6c526c37cb02b81341.tar.bz2 |
Change references to the Method class to be references to the Function
class. The Method class is obsolete (renamed) and all references to it
are being converted over to Function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/ConstantProp.cpp | 12 | ||||
-rw-r--r-- | lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp | 10 | ||||
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SymbolStripping.cpp | 28 |
4 files changed, 29 insertions, 29 deletions
diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index 624e6da..8818b5d 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -24,7 +24,7 @@ #include "llvm/Transforms/Scalar/ConstantProp.h" #include "llvm/Transforms/Scalar/ConstantHandling.h" #include "llvm/Module.h" -#include "llvm/Method.h" +#include "llvm/Function.h" #include "llvm/BasicBlock.h" #include "llvm/iTerminators.h" #include "llvm/iPHINode.h" @@ -116,7 +116,7 @@ bool ConstantFoldTerminator(BasicBlock *BB, BasicBlock::iterator &II, BasicBlock *Destination = Cond->getValue() ? Dest1 : Dest2; BasicBlock *OldDest = Cond->getValue() ? Dest2 : Dest1; - //cerr << "Method: " << T->getParent()->getParent() + //cerr << "Function: " << T->getParent()->getParent() // << "\nRemoving branch from " << T->getParent() // << "\n\nTo: " << OldDest << endl; @@ -196,10 +196,10 @@ bool doConstantPropogation(BasicBlock *BB, BasicBlock::iterator &II) { // DoConstPropPass - Propogate constants and do constant folding on instructions // this returns true if something was changed, false if nothing was changed. // -static bool DoConstPropPass(Method *M) { +static bool DoConstPropPass(Function *F) { bool SomethingChanged = false; - for (Method::iterator BBI = M->begin(); BBI != M->end(); ++BBI) { + for (Method::iterator BBI = F->begin(); BBI != F->end(); ++BBI) { BasicBlock *BB = *BBI; for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ) if (doConstantPropogation(BB, I)) @@ -212,11 +212,11 @@ static bool DoConstPropPass(Method *M) { namespace { struct ConstantPropogation : public MethodPass { - inline bool runOnMethod(Method *M) { + inline bool runOnMethod(Function *F) { bool Modified = false; // Fold constants until we make no progress... - while (DoConstPropPass(M)) Modified = true; + while (DoConstPropPass(F)) Modified = true; return Modified; } diff --git a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp index 09bfd5c..3a76d6a 100644 --- a/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp +++ b/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp @@ -14,7 +14,7 @@ #include "llvm/iMemory.h" #include "llvm/iOther.h" #include "llvm/BasicBlock.h" -#include "llvm/Method.h" +#include "llvm/Function.h" #include "llvm/Pass.h" @@ -149,12 +149,12 @@ decomposeArrayRef(BasicBlock::iterator& BBI) //--------------------------------------------------------------------------- static bool -doDecomposeMultiDimRefs(Method *M) +doDecomposeMultiDimRefs(Function *F) { bool changed = false; - for (Method::iterator BI = M->begin(), BE = M->end(); BI != BE; ++BI) - for (BasicBlock::iterator newI, II=(*BI)->begin(); + for (Method::iterator BI = F->begin(), BE = F->end(); BI != BE; ++BI) + for (BasicBlock::iterator newI, II = (*BI)->begin(); II != (*BI)->end(); II = ++newI) { newI = II; @@ -172,7 +172,7 @@ doDecomposeMultiDimRefs(Method *M) namespace { struct DecomposeMultiDimRefsPass : public MethodPass { - virtual bool runOnMethod(Method *M) { return doDecomposeMultiDimRefs(M); } + virtual bool runOnMethod(Function *F) { return doDecomposeMultiDimRefs(F); } }; } diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 1b0196e..9bd95df 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -16,7 +16,7 @@ #include "llvm/Transforms/Scalar/InstructionCombining.h" #include "llvm/Transforms/Scalar/ConstantHandling.h" -#include "llvm/Method.h" +#include "llvm/Function.h" #include "llvm/iMemory.h" #include "llvm/InstrTypes.h" #include "llvm/Pass.h" @@ -147,8 +147,8 @@ static bool CombineInstruction(Instruction *I) { return true; } -static bool doInstCombining(Method *M) { - // Start the worklist out with all of the instructions in the method in it. +static bool doInstCombining(Function *M) { + // Start the worklist out with all of the instructions in the function in it. std::vector<Instruction*> WorkList(inst_begin(M), inst_end(M)); while (!WorkList.empty()) { @@ -172,7 +172,7 @@ static bool doInstCombining(Method *M) { namespace { struct InstructionCombining : public MethodPass { - virtual bool runOnMethod(Method *M) { return doInstCombining(M); } + virtual bool runOnMethod(Function *F) { return doInstCombining(F); } }; } diff --git a/lib/Transforms/Scalar/SymbolStripping.cpp b/lib/Transforms/Scalar/SymbolStripping.cpp index 8502082..a026fd6 100644 --- a/lib/Transforms/Scalar/SymbolStripping.cpp +++ b/lib/Transforms/Scalar/SymbolStripping.cpp @@ -1,11 +1,11 @@ -//===- SymbolStripping.cpp - Code to string symbols for methods and modules -=// +//===- SymbolStripping.cpp - Strip symbols for functions and modules ------===// // // This file implements stripping symbols out of symbol tables. // // Specifically, this allows you to strip all of the symbols out of: -// * A method -// * All methods in a module -// * All symbols in a module (all method symbols + all module scope symbols) +// * A function +// * All functions in a module +// * All symbols in a module (all function symbols + all module scope symbols) // // Notice that: // * This pass makes code much less readable, so it should only be used in @@ -16,7 +16,7 @@ #include "llvm/Transforms/SymbolStripping.h" #include "llvm/Module.h" -#include "llvm/Method.h" +#include "llvm/Function.h" #include "llvm/SymbolTable.h" #include "llvm/Pass.h" @@ -43,26 +43,26 @@ static bool StripSymbolTable(SymbolTable *SymTab) { } -// DoSymbolStripping - Remove all symbolic information from a method +// DoSymbolStripping - Remove all symbolic information from a function // -static bool doSymbolStripping(Method *M) { - return StripSymbolTable(M->getSymbolTable()); +static bool doSymbolStripping(Function *F) { + return StripSymbolTable(F->getSymbolTable()); } -// doStripGlobalSymbols - Remove all symbolic information from all methods -// in a module, and all module level symbols. (method names, etc...) +// doStripGlobalSymbols - Remove all symbolic information from all functions +// in a module, and all module level symbols. (function names, etc...) // static bool doStripGlobalSymbols(Module *M) { - // Remove all symbols from methods in this module... and then strip all of the - // symbols in this module... + // Remove all symbols from functions in this module... and then strip all of + // the symbols in this module... // return StripSymbolTable(M->getSymbolTable()); } namespace { struct SymbolStripping : public MethodPass { - virtual bool runOnMethod(Method *M) { - return doSymbolStripping(M); + virtual bool runOnMethod(Function *F) { + return doSymbolStripping(F); } }; |