diff options
author | Chris Lattner <sabre@nondot.org> | 2002-03-23 22:51:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-03-23 22:51:58 +0000 |
commit | e7506a366e8bd56c97d10beb68e4db953aebaeca (patch) | |
tree | 2ed9896ec8647934d3c26cb740dc4ed16d9ae57b /include/llvm | |
parent | bcd8e0313853473f72a138e51072f9bd545fadd2 (diff) | |
download | external_llvm-e7506a366e8bd56c97d10beb68e4db953aebaeca.zip external_llvm-e7506a366e8bd56c97d10beb68e4db953aebaeca.tar.gz external_llvm-e7506a366e8bd56c97d10beb68e4db953aebaeca.tar.bz2 |
Rename Method to Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
25 files changed, 113 insertions, 110 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h index 7f083ad..3c8b2c4 100644 --- a/include/llvm/Analysis/CallGraph.h +++ b/include/llvm/Analysis/CallGraph.h @@ -43,7 +43,7 @@ #include "Support/GraphTraits.h" #include "llvm/Pass.h" -class Method; +class Function; class Module; class CallGraphNode; @@ -53,7 +53,7 @@ class CallGraphNode; class CallGraph : public Pass { Module *Mod; // The module this call graph represents - typedef std::map<const Method *, CallGraphNode *> MethodMapTy; + typedef std::map<const Function *, CallGraphNode *> MethodMapTy; MethodMapTy MethodMap; // Map from a method to its node // Root is root of the call graph, or the external node if a 'main' function @@ -77,13 +77,13 @@ public: // Subscripting operators, return the call graph node for the provided method - inline const CallGraphNode *operator[](const Method *M) const { - const_iterator I = MethodMap.find(M); + inline const CallGraphNode *operator[](const Function *F) const { + const_iterator I = MethodMap.find(F); assert(I != MethodMap.end() && "Method not in callgraph!"); return I->second; } - inline CallGraphNode *operator[](const Method *M) { - const_iterator I = MethodMap.find(M); + inline CallGraphNode *operator[](const Function *F) { + const_iterator I = MethodMap.find(F); assert(I != MethodMap.end() && "Method not in callgraph!"); return I->second; } @@ -92,7 +92,7 @@ public: // Methods to keep a call graph up to date with a method that has been // modified // - void addMethodToModule(Method *Meth); + void addMethodToModule(Function *Meth); // removeMethodFromModule - Unlink the method from this module, returning it. @@ -101,8 +101,8 @@ public: // methods (ie, there are no edges in it's CGN). The easiest way to do this // is to dropAllReferences before calling this. // - Method *removeMethodFromModule(CallGraphNode *CGN); - Method *removeMethodFromModule(Method *Meth) { + Function *removeMethodFromModule(CallGraphNode *CGN); + Function *removeMethodFromModule(Function *Meth) { return removeMethodFromModule((*this)[Meth]); } @@ -135,15 +135,15 @@ private: // Implementation of CallGraph construction // - // getNodeFor - Return the node for the specified method or create one if it + // getNodeFor - Return the node for the specified function or create one if it // does not already exist. // - CallGraphNode *getNodeFor(Method *M); + CallGraphNode *getNodeFor(Function *F); - // addToCallGraph - Add a method to the call graph, and link the node to all + // addToCallGraph - Add a function to the call graph, and link the node to all // of the methods that it calls. // - void addToCallGraph(Method *M); + void addToCallGraph(Function *F); // destroy - Release memory for the call graph void destroy(); @@ -154,7 +154,7 @@ private: // CallGraphNode class definition // class CallGraphNode { - Method *Meth; + Function *Meth; std::vector<CallGraphNode*> CalledMethods; CallGraphNode(const CallGraphNode &); // Do not implement @@ -167,7 +167,7 @@ public: typedef std::vector<CallGraphNode*>::const_iterator const_iterator; // getMethod - Return the method that this call graph node represents... - Method *getMethod() const { return Meth; } + Function *getMethod() const { return Meth; } inline iterator begin() { return CalledMethods.begin(); } inline iterator end() { return CalledMethods.end(); } @@ -193,7 +193,7 @@ private: // Stuff to construct the node, used by CallGraph friend class CallGraph; // CallGraphNode ctor - Create a node for the specified method... - inline CallGraphNode(Method *M) : Meth(M) {} + inline CallGraphNode(Function *F) : Meth(F) {} // addCalledMethod add a method to the list of methods called by this one void addCalledMethod(CallGraphNode *M) { diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index 1a85082..ca0a80e 100644 --- a/include/llvm/Analysis/ConstantsScanner.h +++ b/include/llvm/Analysis/ConstantsScanner.h @@ -28,15 +28,15 @@ class constant_iterator } public: - inline constant_iterator(const Method *M) : InstI(inst_begin(M)), OpIdx(0) { + inline constant_iterator(const Function *F) : InstI(inst_begin(F)), OpIdx(0) { // Advance to first constant... if we are not already at constant or end - if (InstI != inst_end(M) && // InstI is valid? + if (InstI != inst_end(F) && // InstI is valid? (InstI->getNumOperands() == 0 || !isAtConstant())) // Not at constant? operator++(); } - inline constant_iterator(const Method *M, bool) // end ctor - : InstI(inst_end(M)), OpIdx(0) { + inline constant_iterator(const Function *F, bool) // end ctor + : InstI(inst_end(F)), OpIdx(0) { } inline bool operator==(const _Self& x) const { return OpIdx == x.OpIdx && @@ -72,12 +72,12 @@ public: inline bool atEnd() const { return InstI.atEnd(); } }; -inline constant_iterator constant_begin(const Method *M) { - return constant_iterator(M); +inline constant_iterator constant_begin(const Function *F) { + return constant_iterator(F); } -inline constant_iterator constant_end(const Method *M) { - return constant_iterator(M, true); +inline constant_iterator constant_end(const Function *F) { + return constant_iterator(F, true); } #endif diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 6de4e5b..d860ec5 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -55,8 +55,8 @@ public: private: DomSetMapType Doms; - void calcForwardDominatorSet(Method *M); - void calcPostDominatorSet(Method *M); + void calcForwardDominatorSet(Function *F); + void calcPostDominatorSet(Function *F); public: // DominatorSet ctor - Build either the dominator set or the post-dominator // set for a method... @@ -66,7 +66,7 @@ public: DominatorSet(AnalysisID id) : DominatorBase(id == PostDomID) {} - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *F); // Accessor interface: typedef DomSetMapType::const_iterator const_iterator; @@ -120,7 +120,7 @@ public: ImmediateDominators(AnalysisID id) : DominatorBase(id == PostDomID) {} - virtual bool runOnMethod(Method *M) { + virtual bool runOnMethod(Function *F) { IDoms.clear(); // Reset from the last time we were run... DominatorSet *DS; if (isPostDominator()) @@ -213,7 +213,7 @@ public: DominatorTree(AnalysisID id) : DominatorBase(id == PostDomID) {} ~DominatorTree() { reset(); } - virtual bool runOnMethod(Method *M) { + virtual bool runOnMethod(Function *F) { reset(); DominatorSet *DS; if (isPostDominator()) @@ -270,7 +270,7 @@ public: DominanceFrontier(AnalysisID id) : DominatorBase(id == PostDomID) {} - virtual bool runOnMethod(Method *M) { + virtual bool runOnMethod(Function *) { Frontiers.clear(); DominatorTree *DT; if (isPostDominator()) diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h index 16b3c9c..10f5317 100644 --- a/include/llvm/Analysis/IntervalPartition.h +++ b/include/llvm/Analysis/IntervalPartition.h @@ -42,7 +42,7 @@ public: IntervalPartition(AnalysisID AID) : RootInterval(0) { assert(AID == ID); } // run - Calculate the interval partition for this method - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *F); // IntervalPartition ctor - Build a reduced interval partition from an // existing interval graph. This takes an additional boolean parameter to diff --git a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h index 8785334..435f177 100644 --- a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h +++ b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h @@ -8,7 +8,7 @@ It must be called like: - MethodLiveVarInfo MLVI( Mehtod *); // initializes data structures + MethodLiveVarInfo MLVI(Function *); // initializes data structures MLVI.analyze(); // do the actural live variable anal After the analysis, getInSetOfBB or getOutSetofBB can be called to get @@ -86,16 +86,16 @@ class MethodLiveVarInfo : public MethodPass { // Machine Instr to LiveVarSet Map for providing LVset AFTER each inst std::map<const MachineInstr *, const ValueSet *> MInst2LVSetAI; - // Stored Method that the data is computed with respect to - const Method *M; + // Stored Function that the data is computed with respect to + const Function *M; // --------- private methods ----------------------------------------- // constructs BBLiveVars and init Def and In sets - void constructBBs(const Method *M); + void constructBBs(const Function *F); // do one backward pass over the CFG - bool doSingleBackwardPass(const Method *M, unsigned int iter); + bool doSingleBackwardPass(const Function *F, unsigned int iter); // calculates live var sets for instructions in a BB void calcLiveVarSetsForBB(const BasicBlock *BB); @@ -108,7 +108,7 @@ public: // --------- Implement the MethodPass interface ---------------------- // runOnMethod - Perform analysis, update internal data structures. - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *F); // releaseMemory - After LiveVariable analysis has been used, forget! virtual void releaseMemory(); diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index f36550e..13535bc7 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -101,7 +101,7 @@ public: #endif // runOnMethod - Pass framework implementation - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *F); // getAnalysisUsageInfo - Provide loop info, require dominator set // diff --git a/include/llvm/Analysis/SlotCalculator.h b/include/llvm/Analysis/SlotCalculator.h index 9528244..e8fead7 100644 --- a/include/llvm/Analysis/SlotCalculator.h +++ b/include/llvm/Analysis/SlotCalculator.h @@ -14,7 +14,7 @@ #include <map> class Value; class Module; -class Method; +class Function; class MethodArgument; class BasicBlock; class Instruction; @@ -34,7 +34,8 @@ class SlotCalculator { public: SlotCalculator(const Module *M, bool IgnoreNamed); - SlotCalculator(const Method *M, bool IgnoreNamed);// Start out in incorp state + // Start out in incorp state + SlotCalculator(const Function *M, bool IgnoreNamed); inline ~SlotCalculator() {} // getValSlot returns < 0 on error! @@ -52,7 +53,7 @@ public: // If you'd like to deal with a method, use these two methods to get its data // into the SlotCalculator! // - void incorporateMethod(const Method *M); + void incorporateMethod(const Function *F); void purgeMethod(); protected: diff --git a/include/llvm/Analysis/Verifier.h b/include/llvm/Analysis/Verifier.h index d6f4a93..7a0ab00 100644 --- a/include/llvm/Analysis/Verifier.h +++ b/include/llvm/Analysis/Verifier.h @@ -15,7 +15,7 @@ class Pass; class Module; -class Method; +class Function; // createVerifierPass - Check a module or method for validity. If errors are // detected, error messages corresponding to the problem are printed to stderr. @@ -29,6 +29,6 @@ bool verifyModule(const Module *M); // verifyMethod - Check a method for errors, useful for use when debugging a // pass. -bool verifyMethod(const Method *M); +bool verifyMethod(const Function *M); #endif diff --git a/include/llvm/Assembly/Writer.h b/include/llvm/Assembly/Writer.h index 6ef33ad..5d5a746 100644 --- a/include/llvm/Assembly/Writer.h +++ b/include/llvm/Assembly/Writer.h @@ -21,7 +21,7 @@ class Module; class GlobalVariable; -class Method; +class Function; class BasicBlock; class Instruction; class SlotCalculator; @@ -32,7 +32,7 @@ class SlotCalculator; // void WriteToAssembly(const Module *Module, std::ostream &o); void WriteToAssembly(const GlobalVariable *G, std::ostream &o); -void WriteToAssembly(const Method *Method, std::ostream &o); +void WriteToAssembly(const Function *F , std::ostream &o); void WriteToAssembly(const BasicBlock *BB, std::ostream &o); void WriteToAssembly(const Instruction *In, std::ostream &o); void WriteToAssembly(const Constant *V, std::ostream &o); @@ -58,7 +58,7 @@ std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true, // suffix. // void WriteToVCG(const Module *Module, const std::string &Filename); -void WriteToVCG(const Method *Method, const std::string &Filename); +void WriteToVCG(const Function *Func, const std::string &Filename); @@ -74,8 +74,8 @@ inline std::ostream &operator<<(std::ostream &o, const GlobalVariable *G) { WriteToAssembly(G, o); return o; } -inline std::ostream &operator<<(std::ostream &o, const Method *M) { - WriteToAssembly(M, o); return o; +inline std::ostream &operator<<(std::ostream &o, const Function *F) { + WriteToAssembly(F, o); return o; } inline std::ostream &operator<<(std::ostream &o, const BasicBlock *B) { @@ -103,7 +103,7 @@ inline std::ostream &operator<<(std::ostream &o, const Value *I) { case Value::MethodArgumentVal: return o << I->getType() << " "<< I->getName(); case Value::InstructionVal:WriteToAssembly(cast<Instruction>(I) , o); break; case Value::BasicBlockVal: WriteToAssembly(cast<BasicBlock>(I) , o); break; - case Value::MethodVal: WriteToAssembly(cast<Method>(I) , o); break; + case Value::MethodVal: WriteToAssembly(cast<Function>(I) , o); break; case Value::GlobalVariableVal: WriteToAssembly(cast<GlobalVariable>(I), o); break; case Value::ModuleVal: WriteToAssembly(cast<Module>(I) , o); break; diff --git a/include/llvm/CodeGen/FunctionLiveVarInfo.h b/include/llvm/CodeGen/FunctionLiveVarInfo.h index 8785334..435f177 100644 --- a/include/llvm/CodeGen/FunctionLiveVarInfo.h +++ b/include/llvm/CodeGen/FunctionLiveVarInfo.h @@ -8,7 +8,7 @@ It must be called like: - MethodLiveVarInfo MLVI( Mehtod *); // initializes data structures + MethodLiveVarInfo MLVI(Function *); // initializes data structures MLVI.analyze(); // do the actural live variable anal After the analysis, getInSetOfBB or getOutSetofBB can be called to get @@ -86,16 +86,16 @@ class MethodLiveVarInfo : public MethodPass { // Machine Instr to LiveVarSet Map for providing LVset AFTER each inst std::map<const MachineInstr *, const ValueSet *> MInst2LVSetAI; - // Stored Method that the data is computed with respect to - const Method *M; + // Stored Function that the data is computed with respect to + const Function *M; // --------- private methods ----------------------------------------- // constructs BBLiveVars and init Def and In sets - void constructBBs(const Method *M); + void constructBBs(const Function *F); // do one backward pass over the CFG - bool doSingleBackwardPass(const Method *M, unsigned int iter); + bool doSingleBackwardPass(const Function *F, unsigned int iter); // calculates live var sets for instructions in a BB void calcLiveVarSetsForBB(const BasicBlock *BB); @@ -108,7 +108,7 @@ public: // --------- Implement the MethodPass interface ---------------------- // runOnMethod - Perform analysis, update internal data structures. - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *F); // releaseMemory - After LiveVariable analysis has been used, forget! virtual void releaseMemory(); diff --git a/include/llvm/CodeGen/InstrForest.h b/include/llvm/CodeGen/InstrForest.h index 0f614a6..834899d 100644 --- a/include/llvm/CodeGen/InstrForest.h +++ b/include/llvm/CodeGen/InstrForest.h @@ -31,7 +31,7 @@ class Constant; class BasicBlock; -class Method; +class Function; class InstrTreeNode; class InstrForest; @@ -243,7 +243,7 @@ private: std::hash_set<InstructionNode*> treeRoots; public: - /*ctor*/ InstrForest (Method *M); + /*ctor*/ InstrForest (Function *F); /*dtor*/ ~InstrForest (); inline InstructionNode *getTreeNodeForInstr(Instruction* instr) { diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h index fa4f21a..4d5e497 100644 --- a/include/llvm/CodeGen/InstrSelection.h +++ b/include/llvm/CodeGen/InstrSelection.h @@ -14,7 +14,7 @@ #define LLVM_CODEGEN_INSTR_SELECTION_H #include "llvm/Instruction.h" -class Method; +class Function; class InstrForest; class MachineInstr; class InstructionNode; @@ -55,7 +55,7 @@ extern bool ThisIsAChainRule (int eruleno); // Implemented in machine-specific instruction selection file. //--------------------------------------------------------------------------- -bool SelectInstructionsForMethod (Method* method, +bool SelectInstructionsForMethod (Function* function, TargetMachine &Target); diff --git a/include/llvm/CodeGen/MachineCodeForMethod.h b/include/llvm/CodeGen/MachineCodeForMethod.h index 631e823..9970c1f 100644 --- a/include/llvm/CodeGen/MachineCodeForMethod.h +++ b/include/llvm/CodeGen/MachineCodeForMethod.h @@ -14,14 +14,14 @@ #include "Support/HashExtras.h" #include <ext/hash_set> class Value; -class Method; +class Function; class Constant; class Type; class TargetMachine; class MachineCodeForMethod : private Annotation { - const Method* method; + const Function* method; bool compiledAsLeaf; unsigned staticStackSize; unsigned automaticVarsSize; @@ -33,7 +33,7 @@ class MachineCodeForMethod : private Annotation { std::hash_map<const Value*, int> offsets; public: - /*ctor*/ MachineCodeForMethod(const Method* method, + /*ctor*/ MachineCodeForMethod(const Function* function, const TargetMachine& target); // The next two methods are used to construct and to retrieve @@ -43,10 +43,10 @@ public: // This should not be called before "construct()" // for a given Method. // - static MachineCodeForMethod& construct(const Method *method, + static MachineCodeForMethod& construct(const Function *method, const TargetMachine &target); - static void destruct(const Method *M); - static MachineCodeForMethod& get(const Method* method); + static void destruct(const Function *F); + static MachineCodeForMethod& get(const Function* function); // // Accessors for global information about generated code for a method. diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 631e823..9970c1f 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -14,14 +14,14 @@ #include "Support/HashExtras.h" #include <ext/hash_set> class Value; -class Method; +class Function; class Constant; class Type; class TargetMachine; class MachineCodeForMethod : private Annotation { - const Method* method; + const Function* method; bool compiledAsLeaf; unsigned staticStackSize; unsigned automaticVarsSize; @@ -33,7 +33,7 @@ class MachineCodeForMethod : private Annotation { std::hash_map<const Value*, int> offsets; public: - /*ctor*/ MachineCodeForMethod(const Method* method, + /*ctor*/ MachineCodeForMethod(const Function* function, const TargetMachine& target); // The next two methods are used to construct and to retrieve @@ -43,10 +43,10 @@ public: // This should not be called before "construct()" // for a given Method. // - static MachineCodeForMethod& construct(const Method *method, + static MachineCodeForMethod& construct(const Function *method, const TargetMachine &target); - static void destruct(const Method *M); - static MachineCodeForMethod& get(const Method* method); + static void destruct(const Function *F); + static MachineCodeForMethod& get(const Function* function); // // Accessors for global information about generated code for a method. diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 729d37b..7893304 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -452,7 +452,7 @@ std::ostream& operator<< (std::ostream& os, const MachineInstr& minstr); std::ostream& operator<< (std::ostream& os, const MachineOperand& mop); -void PrintMachineInstructions(const Method *method); +void PrintMachineInstructions(const Function *F); //**************************************************************************/ diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 78cc92a..8b45c0e 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -22,7 +22,7 @@ #include <map> class Value; class BasicBlock; -class Method; +class Function; class Module; class AnalysisID; class Pass; @@ -105,7 +105,7 @@ protected: private: friend class PassManagerT<Module>; - friend class PassManagerT<Method>; + friend class PassManagerT<Function>; friend class PassManagerT<BasicBlock>; virtual void addToPassManager(PassManagerT<Module> *PM, AnalysisSet &Req, AnalysisSet &Destroyed, AnalysisSet &Provided); @@ -129,7 +129,7 @@ struct MethodPass : public Pass { // runOnMethod - Virtual method overriden by subclasses to do the per-method // processing of the pass. // - virtual bool runOnMethod(Method *M) = 0; + virtual bool runOnMethod(Function *M) = 0; // doFinalization - Virtual method overriden by subclasses to do any post // processing needed after all passes have run. @@ -143,15 +143,15 @@ struct MethodPass : public Pass { // run - On a method, we simply initialize, run the method, then finalize. // - bool run(Method *M); + bool run(Function *M); private: friend class PassManagerT<Module>; - friend class PassManagerT<Method>; + friend class PassManagerT<Function>; friend class PassManagerT<BasicBlock>; virtual void addToPassManager(PassManagerT<Module> *PM, AnalysisSet &Req, AnalysisSet &Dest, AnalysisSet &Prov); - virtual void addToPassManager(PassManagerT<Method> *PM,AnalysisSet &Req, + virtual void addToPassManager(PassManagerT<Function> *PM,AnalysisSet &Req, AnalysisSet &Dest, AnalysisSet &Prov); }; @@ -176,7 +176,7 @@ struct BasicBlockPass : public MethodPass { // To run this pass on a method, we simply call runOnBasicBlock once for each // method. // - virtual bool runOnMethod(Method *BB); + virtual bool runOnMethod(Function *F); // To run directly on the basic block, we initialize, runOnBasicBlock, then // finalize. @@ -184,9 +184,9 @@ struct BasicBlockPass : public MethodPass { bool run(BasicBlock *BB); private: - friend class PassManagerT<Method>; + friend class PassManagerT<Function>; friend class PassManagerT<BasicBlock>; - virtual void addToPassManager(PassManagerT<Method> *PM, AnalysisSet &, + virtual void addToPassManager(PassManagerT<Function> *PM, AnalysisSet &, AnalysisSet &, AnalysisSet &); virtual void addToPassManager(PassManagerT<BasicBlock> *PM, AnalysisSet &, AnalysisSet &, AnalysisSet &); diff --git a/include/llvm/SlotCalculator.h b/include/llvm/SlotCalculator.h index 9528244..e8fead7 100644 --- a/include/llvm/SlotCalculator.h +++ b/include/llvm/SlotCalculator.h @@ -14,7 +14,7 @@ #include <map> class Value; class Module; -class Method; +class Function; class MethodArgument; class BasicBlock; class Instruction; @@ -34,7 +34,8 @@ class SlotCalculator { public: SlotCalculator(const Module *M, bool IgnoreNamed); - SlotCalculator(const Method *M, bool IgnoreNamed);// Start out in incorp state + // Start out in incorp state + SlotCalculator(const Function *M, bool IgnoreNamed); inline ~SlotCalculator() {} // getValSlot returns < 0 on error! @@ -52,7 +53,7 @@ public: // If you'd like to deal with a method, use these two methods to get its data // into the SlotCalculator! // - void incorporateMethod(const Method *M); + void incorporateMethod(const Function *F); void purgeMethod(); protected: diff --git a/include/llvm/Target/MachineInstrInfo.h b/include/llvm/Target/MachineInstrInfo.h index b21d4c8..de6a870 100644 --- a/include/llvm/Target/MachineInstrInfo.h +++ b/include/llvm/Target/MachineInstrInfo.h @@ -18,7 +18,7 @@ class MachineInstr; class TargetMachine; class Value; class Instruction; -class Method; +class Function; //--------------------------------------------------------------------------- // Data types used to define information about a single machine instruction @@ -248,7 +248,7 @@ public: // The generated instructions are returned in `minstrVec'. // Any temp. registers (TmpInstruction) created are returned in `tempVec'. // - virtual void CreateCodeToLoadConst(Method* method, + virtual void CreateCodeToLoadConst(Function* method, Value* val, Instruction* dest, std::vector<MachineInstr*>& minstrVec, @@ -260,7 +260,7 @@ public: // The generated instructions are returned in `minstrVec'. // Any temp. registers (TmpInstruction) created are returned in `tempVec'. // - virtual void CreateCodeToCopyIntToFloat(Method* method, + virtual void CreateCodeToCopyIntToFloat(Function* method, Value* val, Instruction* dest, std::vector<MachineInstr*>& minstVec, @@ -271,7 +271,7 @@ public: // `val' to an integer value `dest' by copying to memory and back. // See the previous function for information about return values. // - virtual void CreateCodeToCopyFloatToInt(Method* method, + virtual void CreateCodeToCopyFloatToInt(Function* method, Value* val, Instruction* dest, std::vector<MachineInstr*>& minstVec, @@ -281,7 +281,7 @@ public: // create copy instruction(s) virtual void CreateCopyInstructionsByType(const TargetMachine& target, - Method* method, + Function* method, Value* src, Instruction* dest, std::vector<MachineInstr*>& minstrVec) diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h index b21d4c8..de6a870 100644 --- a/include/llvm/Target/TargetInstrInfo.h +++ b/include/llvm/Target/TargetInstrInfo.h @@ -18,7 +18,7 @@ class MachineInstr; class TargetMachine; class Value; class Instruction; -class Method; +class Function; //--------------------------------------------------------------------------- // Data types used to define information about a single machine instruction @@ -248,7 +248,7 @@ public: // The generated instructions are returned in `minstrVec'. // Any temp. registers (TmpInstruction) created are returned in `tempVec'. // - virtual void CreateCodeToLoadConst(Method* method, + virtual void CreateCodeToLoadConst(Function* method, Value* val, Instruction* dest, std::vector<MachineInstr*>& minstrVec, @@ -260,7 +260,7 @@ public: // The generated instructions are returned in `minstrVec'. // Any temp. registers (TmpInstruction) created are returned in `tempVec'. // - virtual void CreateCodeToCopyIntToFloat(Method* method, + virtual void CreateCodeToCopyIntToFloat(Function* method, Value* val, Instruction* dest, std::vector<MachineInstr*>& minstVec, @@ -271,7 +271,7 @@ public: // `val' to an integer value `dest' by copying to memory and back. // See the previous function for information about return values. // - virtual void CreateCodeToCopyFloatToInt(Method* method, + virtual void CreateCodeToCopyFloatToInt(Function* method, Value* val, Instruction* dest, std::vector<MachineInstr*>& minstVec, @@ -281,7 +281,7 @@ public: // create copy instruction(s) virtual void CreateCopyInstructionsByType(const TargetMachine& target, - Method* method, + Function* method, Value* src, Instruction* dest, std::vector<MachineInstr*>& minstrVec) diff --git a/include/llvm/Target/TargetRegInfo.h b/include/llvm/Target/TargetRegInfo.h index 9b787bb..5b3bf70 100644 --- a/include/llvm/Target/TargetRegInfo.h +++ b/include/llvm/Target/TargetRegInfo.h @@ -17,7 +17,7 @@ class IGNode; class Type; class Value; class LiveRangeInfo; -class Method; +class Function; class Instruction; class LiveRange; class AddedInstrns; @@ -108,7 +108,7 @@ public: // method args and return values etc.) with specific hardware registers // as required. See SparcRegInfo.cpp for the implementation for Sparc. // - virtual void suggestRegs4MethodArgs(const Method *Meth, + virtual void suggestRegs4MethodArgs(const Function *Func, LiveRangeInfo &LRI) const = 0; virtual void suggestRegs4CallArgs(const MachineInstr *CallI, @@ -117,7 +117,7 @@ public: virtual void suggestReg4RetValue(const MachineInstr *RetI, LiveRangeInfo &LRI) const = 0; - virtual void colorMethodArgs(const Method *Meth, LiveRangeInfo &LRI, + virtual void colorMethodArgs(const Function *Func, LiveRangeInfo &LRI, AddedInstrns *FirstAI) const = 0; virtual void colorCallArgs(const MachineInstr *CalI, diff --git a/include/llvm/Transforms/MutateStructTypes.h b/include/llvm/Transforms/MutateStructTypes.h index f1132fd..4ed7440 100644 --- a/include/llvm/Transforms/MutateStructTypes.h +++ b/include/llvm/Transforms/MutateStructTypes.h @@ -88,7 +88,7 @@ private: // transformMethod - This transforms the instructions of the method to use the // new types. // - void transformMethod(Method *M); + void transformMethod(Function *F); // removeDeadGlobals - This removes the old versions of methods that are no // longer needed. diff --git a/include/llvm/Transforms/Scalar/InductionVars.h b/include/llvm/Transforms/Scalar/InductionVars.h index 7c79afa..b40f8f3 100644 --- a/include/llvm/Transforms/Scalar/InductionVars.h +++ b/include/llvm/Transforms/Scalar/InductionVars.h @@ -14,9 +14,9 @@ namespace cfg { class IntervalPartition; } struct InductionVariableCannonicalize : public MethodPass { // doInductionVariableCannonicalize - Simplify induction variables in loops // - static bool doIt(Method *M, cfg::IntervalPartition &IP); + static bool doIt(Function *M, cfg::IntervalPartition &IP); - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *M); // getAnalysisUsageInfo - Declare that we need IntervalPartitions void getAnalysisUsageInfo(Pass::AnalysisSet &Required, diff --git a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h index 4c87b09..86784ed 100644 --- a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -23,11 +23,11 @@ public: // // If there are no return stmts in the Method, a null pointer is returned. // - static bool doit(Method *M, BasicBlock *&ExitNode); + static bool doit(Function *F, BasicBlock *&ExitNode); - virtual bool runOnMethod(Method *M) { - return doit(M, ExitNode); + virtual bool runOnMethod(Function *F) { + return doit(F, ExitNode); } BasicBlock *getExitNode() const { return ExitNode; } diff --git a/include/llvm/Value.h b/include/llvm/Value.h index 1983970..bb321df 100644 --- a/include/llvm/Value.h +++ b/include/llvm/Value.h @@ -23,7 +23,8 @@ class MethodArgument; class Instruction; class BasicBlock; class GlobalValue; -class Method; +class Function; +typedef Function Method; class GlobalVariable; class Module; class SymbolTable; @@ -274,10 +275,10 @@ template <> inline bool isa<BasicBlock, const Value*>(const Value *Val) { template <> inline bool isa<BasicBlock, Value*>(Value *Val) { return Val->getValueType() == Value::BasicBlockVal; } -template <> inline bool isa<Method, const Value*>(const Value *Val) { +template <> inline bool isa<Function, const Value*>(const Value *Val) { return Val->getValueType() == Value::MethodVal; } -template <> inline bool isa<Method, Value*>(Value *Val) { +template <> inline bool isa<Function, Value*>(Value *Val) { return Val->getValueType() == Value::MethodVal; } template <> inline bool isa<GlobalVariable, const Value*>(const Value *Val) { @@ -287,10 +288,10 @@ template <> inline bool isa<GlobalVariable, Value*>(Value *Val) { return Val->getValueType() == Value::GlobalVariableVal; } template <> inline bool isa<GlobalValue, const Value*>(const Value *Val) { - return isa<GlobalVariable>(Val) || isa<Method>(Val); + return isa<GlobalVariable>(Val) || isa<Function>(Val); } template <> inline bool isa<GlobalValue, Value*>(Value *Val) { - return isa<GlobalVariable>(Val) || isa<Method>(Val); + return isa<GlobalVariable>(Val) || isa<Function>(Val); } template <> inline bool isa<Module, const Value*>(const Value *Val) { return Val->getValueType() == Value::ModuleVal; diff --git a/include/llvm/iTerminators.h b/include/llvm/iTerminators.h index 6ed75fa..c414283 100644 --- a/include/llvm/iTerminators.h +++ b/include/llvm/iTerminators.h @@ -205,8 +205,8 @@ public: // getCalledMethod - Return the method called, or null if this is an indirect // method invocation... // - inline const Method *getCalledMethod() const { - return dyn_cast<Method>(Operands[0].get()); + inline const Function *getCalledMethod() const { + return dyn_cast<Function>(Operands[0].get()); } inline Method *getCalledMethod() { return dyn_cast<Method>(Operands[0].get()); |