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 /lib | |
parent | bcd8e0313853473f72a138e51072f9bd545fadd2 (diff) |
Rename Method to Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/LiveVar/BBLiveVar.h | 1 | ||||
-rw-r--r-- | lib/Analysis/Makefile | 2 | ||||
-rw-r--r-- | lib/Bytecode/Reader/ReaderInternals.h | 6 | ||||
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.h | 7 | ||||
-rw-r--r-- | lib/CodeGen/InstrSched/SchedGraph.h | 8 | ||||
-rw-r--r-- | lib/CodeGen/InstrSched/SchedPriorities.h | 5 | ||||
-rw-r--r-- | lib/CodeGen/RegAlloc/LiveRangeInfo.h | 10 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSched/SchedGraph.h | 8 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSched/SchedPriorities.h | 5 | ||||
-rw-r--r-- | lib/Target/SparcV9/LiveVar/BBLiveVar.h | 1 | ||||
-rw-r--r-- | lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h | 10 | ||||
-rw-r--r-- | lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp | 1 | ||||
-rw-r--r-- | lib/VMCore/Function.cpp | 15 | ||||
-rw-r--r-- | lib/VMCore/PassManagerT.h | 24 |
14 files changed, 49 insertions, 54 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.h b/lib/Analysis/LiveVar/BBLiveVar.h index 6eac8fb7c4..aaee45fd45 100644 --- a/lib/Analysis/LiveVar/BBLiveVar.h +++ b/lib/Analysis/LiveVar/BBLiveVar.h @@ -11,7 +11,6 @@ #include "llvm/Analysis/LiveVar/ValueSet.h" #include "llvm/Annotation.h" #include <map> -class Method; class BasicBlock; class Value; diff --git a/lib/Analysis/Makefile b/lib/Analysis/Makefile index 69359afb8f..bbf1238703 100644 --- a/lib/Analysis/Makefile +++ b/lib/Analysis/Makefile @@ -3,7 +3,7 @@ LEVEL = ../.. LIBRARYNAME = analysis -DIRS = LiveVar IPA +DIRS = LiveVar IPA DataStructure include $(LEVEL)/Makefile.common diff --git a/lib/Bytecode/Reader/ReaderInternals.h b/lib/Bytecode/Reader/ReaderInternals.h index a5b3b7acfd..54cda44a6b 100644 --- a/lib/Bytecode/Reader/ReaderInternals.h +++ b/lib/Bytecode/Reader/ReaderInternals.h @@ -27,12 +27,6 @@ #define BCR_TRACE(n, X) #endif -class BasicBlock; -class Method; -class Module; -class Type; -class PointerType; - typedef unsigned char uchar; struct RawInst { // The raw fields out of the bytecode stream... diff --git a/lib/Bytecode/Writer/SlotCalculator.h b/lib/Bytecode/Writer/SlotCalculator.h index 95282447a5..e8fead76bb 100644 --- a/lib/Bytecode/Writer/SlotCalculator.h +++ b/lib/Bytecode/Writer/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/lib/CodeGen/InstrSched/SchedGraph.h b/lib/CodeGen/InstrSched/SchedGraph.h index fb6087c44d..99e20576b8 100644 --- a/lib/CodeGen/InstrSched/SchedGraph.h +++ b/lib/CodeGen/InstrSched/SchedGraph.h @@ -28,7 +28,7 @@ class Value; class Instruction; class TerminatorInst; class BasicBlock; -class Method; +class Function; class TargetMachine; class SchedGraphEdge; class SchedGraphNode; @@ -339,7 +339,7 @@ class SchedGraphSet : private std::hash_map<const BasicBlock*, SchedGraph*> { private: - const Method* method; + const Function* method; public: typedef std::hash_map<const BasicBlock*, SchedGraph*> map_base; @@ -347,7 +347,7 @@ public: using map_base::const_iterator; public: - /*ctor*/ SchedGraphSet (const Method* _method, + /*ctor*/ SchedGraphSet (const Function * function, const TargetMachine& target); /*dtor*/ ~SchedGraphSet (); @@ -379,7 +379,7 @@ private: // // Graph builder // - void buildGraphsForMethod (const Method *method, + void buildGraphsForMethod (const Function *F, const TargetMachine& target); }; diff --git a/lib/CodeGen/InstrSched/SchedPriorities.h b/lib/CodeGen/InstrSched/SchedPriorities.h index f99d7ce86e..2d0bff9765 100644 --- a/lib/CodeGen/InstrSched/SchedPriorities.h +++ b/lib/CodeGen/InstrSched/SchedPriorities.h @@ -28,7 +28,7 @@ #include <list> #include <ext/hash_set> #include <iostream> -class Method; +class Function; class MachineInstr; class SchedulingManager; class MethodLiveVarInfo; @@ -125,7 +125,8 @@ private: class SchedPriorities: public NonCopyable { public: - SchedPriorities(const Method *M, const SchedGraph *G, MethodLiveVarInfo &LVI); + SchedPriorities(const Function *F, const SchedGraph *G, + MethodLiveVarInfo &LVI); // This must be called before scheduling begins. diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/lib/CodeGen/RegAlloc/LiveRangeInfo.h index 48e81c1068..4af73f0699 100644 --- a/lib/CodeGen/RegAlloc/LiveRangeInfo.h +++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.h @@ -1,4 +1,4 @@ -//===-- LiveRangeInfo.h - Track all LiveRanges for a Method ------*- C++ -*-==// +//===-- LiveRangeInfo.h - Track all LiveRanges for a Function ----*- C++ -*-==// // // This file contains the class LiveRangeInfo which constructs and keeps // the LiveRangMap which contains all the live ranges used in a method. @@ -28,7 +28,7 @@ class RegClass; class MachineRegInfo; class TargetMachine; class Value; -class Method; +class Function; class Instruction; typedef std::hash_map<const Value*, LiveRange*> LiveRangeMapType; @@ -42,7 +42,7 @@ typedef std::vector<const MachineInstr*> CallRetInstrListType; //---------------------------------------------------------------------------- class LiveRangeInfo { - const Method *const Meth; // Method for which live range info is held + const Function *const Meth; // Func for which live range info is held LiveRangeMapType LiveRangeMap; // A map from Value * to LiveRange * to // record all live ranges in a method // created by constructLiveRanges @@ -64,11 +64,11 @@ class LiveRangeInfo { void suggestRegs4CallRets(); - const Method* getMethod() { return Meth; } + const Function *getMethod() { return Meth; } public: - LiveRangeInfo(const Method *M, + LiveRangeInfo(const Function *F, const TargetMachine& tm, std::vector<RegClass *> & RCList); diff --git a/lib/Target/SparcV9/InstrSched/SchedGraph.h b/lib/Target/SparcV9/InstrSched/SchedGraph.h index fb6087c44d..99e20576b8 100644 --- a/lib/Target/SparcV9/InstrSched/SchedGraph.h +++ b/lib/Target/SparcV9/InstrSched/SchedGraph.h @@ -28,7 +28,7 @@ class Value; class Instruction; class TerminatorInst; class BasicBlock; -class Method; +class Function; class TargetMachine; class SchedGraphEdge; class SchedGraphNode; @@ -339,7 +339,7 @@ class SchedGraphSet : private std::hash_map<const BasicBlock*, SchedGraph*> { private: - const Method* method; + const Function* method; public: typedef std::hash_map<const BasicBlock*, SchedGraph*> map_base; @@ -347,7 +347,7 @@ public: using map_base::const_iterator; public: - /*ctor*/ SchedGraphSet (const Method* _method, + /*ctor*/ SchedGraphSet (const Function * function, const TargetMachine& target); /*dtor*/ ~SchedGraphSet (); @@ -379,7 +379,7 @@ private: // // Graph builder // - void buildGraphsForMethod (const Method *method, + void buildGraphsForMethod (const Function *F, const TargetMachine& target); }; diff --git a/lib/Target/SparcV9/InstrSched/SchedPriorities.h b/lib/Target/SparcV9/InstrSched/SchedPriorities.h index f99d7ce86e..2d0bff9765 100644 --- a/lib/Target/SparcV9/InstrSched/SchedPriorities.h +++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.h @@ -28,7 +28,7 @@ #include <list> #include <ext/hash_set> #include <iostream> -class Method; +class Function; class MachineInstr; class SchedulingManager; class MethodLiveVarInfo; @@ -125,7 +125,8 @@ private: class SchedPriorities: public NonCopyable { public: - SchedPriorities(const Method *M, const SchedGraph *G, MethodLiveVarInfo &LVI); + SchedPriorities(const Function *F, const SchedGraph *G, + MethodLiveVarInfo &LVI); // This must be called before scheduling begins. diff --git a/lib/Target/SparcV9/LiveVar/BBLiveVar.h b/lib/Target/SparcV9/LiveVar/BBLiveVar.h index 6eac8fb7c4..aaee45fd45 100644 --- a/lib/Target/SparcV9/LiveVar/BBLiveVar.h +++ b/lib/Target/SparcV9/LiveVar/BBLiveVar.h @@ -11,7 +11,6 @@ #include "llvm/Analysis/LiveVar/ValueSet.h" #include "llvm/Annotation.h" #include <map> -class Method; class BasicBlock; class Value; diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h index 48e81c1068..4af73f0699 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h +++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h @@ -1,4 +1,4 @@ -//===-- LiveRangeInfo.h - Track all LiveRanges for a Method ------*- C++ -*-==// +//===-- LiveRangeInfo.h - Track all LiveRanges for a Function ----*- C++ -*-==// // // This file contains the class LiveRangeInfo which constructs and keeps // the LiveRangMap which contains all the live ranges used in a method. @@ -28,7 +28,7 @@ class RegClass; class MachineRegInfo; class TargetMachine; class Value; -class Method; +class Function; class Instruction; typedef std::hash_map<const Value*, LiveRange*> LiveRangeMapType; @@ -42,7 +42,7 @@ typedef std::vector<const MachineInstr*> CallRetInstrListType; //---------------------------------------------------------------------------- class LiveRangeInfo { - const Method *const Meth; // Method for which live range info is held + const Function *const Meth; // Func for which live range info is held LiveRangeMapType LiveRangeMap; // A map from Value * to LiveRange * to // record all live ranges in a method // created by constructLiveRanges @@ -64,11 +64,11 @@ class LiveRangeInfo { void suggestRegs4CallRets(); - const Method* getMethod() { return Meth; } + const Function *getMethod() { return Meth; } public: - LiveRangeInfo(const Method *M, + LiveRangeInfo(const Function *F, const TargetMachine& tm, std::vector<RegClass *> & RCList); diff --git a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp index 4111c1002c..5f8b2136f2 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp @@ -16,7 +16,6 @@ #include "llvm/iOperators.h" #include "llvm/iPHINode.h" -class Method; using std::vector; //get the code to be inserted on the edge diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index e7d10c1496..286ef7fbe1 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -25,13 +25,14 @@ template class ValueHolder<MethodArgument, Method, Method>; template class ValueHolder<BasicBlock , Method, Method>; -Method::Method(const MethodType *Ty, bool isInternal, const std::string &name) +Function::Function(const MethodType *Ty, bool isInternal, + const std::string &name) : GlobalValue(PointerType::get(Ty), Value::MethodVal, isInternal, name), SymTabValue(this), BasicBlocks(this), ArgumentList(this, this) { assert(::isa<MethodType>(Ty) && "Method signature must be of method type!"); } -Method::~Method() { +Function::~Function() { dropAllReferences(); // After this it is safe to delete instructions. // TODO: Should remove from the end, not the beginning of vector! @@ -45,7 +46,7 @@ Method::~Method() { } // Specialize setName to take care of symbol table majik -void Method::setName(const std::string &name, SymbolTable *ST) { +void Function::setName(const std::string &name, SymbolTable *ST) { Module *P; assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) && "Invalid symtab argument!"); @@ -54,18 +55,18 @@ void Method::setName(const std::string &name, SymbolTable *ST) { if (P && getName() != "") P->getSymbolTableSure()->insert(this); } -void Method::setParent(Module *parent) { +void Function::setParent(Module *parent) { Parent = parent; // Relink symbol tables together... setParentSymTab(Parent ? Parent->getSymbolTableSure() : 0); } -const MethodType *Method::getMethodType() const { +const MethodType *Function::getMethodType() const { return cast<MethodType>(cast<PointerType>(getType())->getElementType()); } -const Type *Method::getReturnType() const { +const Type *Function::getReturnType() const { return getMethodType()->getReturnType(); } @@ -77,7 +78,7 @@ const Type *Method::getReturnType() const { // valid on an object that has "dropped all references", except operator // delete. // -void Method::dropAllReferences() { +void Function::dropAllReferences() { for_each(begin(), end(), std::mem_fun(&BasicBlock::dropAllReferences)); } diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h index d990d89f5a..7999db11b6 100644 --- a/lib/VMCore/PassManagerT.h +++ b/lib/VMCore/PassManagerT.h @@ -347,7 +347,7 @@ template<> struct PassManagerTraits<BasicBlock> : public BasicBlockPass { typedef PassClass BatcherClass; // ParentClass - The type of the parent PassManager... - typedef PassManagerT<Method> ParentClass; + typedef PassManagerT<Function> ParentClass; // PMType - The type of the passmanager that subclasses this class typedef PassManagerT<BasicBlock> PMType; @@ -371,12 +371,12 @@ template<> struct PassManagerTraits<BasicBlock> : public BasicBlockPass { //===----------------------------------------------------------------------===// -// PassManagerTraits<Method> Specialization +// PassManagerTraits<Function> Specialization // // This pass manager is used to group together all of the MethodPass's // into a single unit. // -template<> struct PassManagerTraits<Method> : public MethodPass { +template<> struct PassManagerTraits<Function> : public MethodPass { // PassClass - The type of passes tracked by this PassManager typedef MethodPass PassClass; @@ -390,20 +390,20 @@ template<> struct PassManagerTraits<Method> : public MethodPass { typedef PassManagerT<Module> ParentClass; // PMType - The type of the passmanager that subclasses this class - typedef PassManagerT<Method> PMType; + typedef PassManagerT<Function> PMType; // runPass - Specify how the pass should be run on the UnitType - static bool runPass(PassClass *P, Method *M) { + static bool runPass(PassClass *P, Function *M) { return P->runOnMethod(M); } // getPMName() - Return the name of the unit the PassManager operates on for // debugging. - const char *getPMName() const { return "Method"; } + const char *getPMName() const { return "Function"; } // Implement the MethodPass interface... virtual bool doInitialization(Module *M); - virtual bool runOnMethod(Method *M); + virtual bool runOnMethod(Function *M); virtual bool doFinalization(Module *M); }; @@ -422,7 +422,7 @@ template<> struct PassManagerTraits<Module> : public Pass { typedef MethodPass SubPassClass; // BatcherClass - The type to use for collation of subtypes... - typedef PassManagerT<Method> BatcherClass; + typedef PassManagerT<Function> BatcherClass; // ParentClass - The type of the parent PassManager... typedef AnalysisResolver ParentClass; @@ -467,20 +467,20 @@ inline bool PassManagerTraits<BasicBlock>::doFinalization(Module *M) { } -// PassManagerTraits<Method> Implementations +// PassManagerTraits<Function> Implementations // -inline bool PassManagerTraits<Method>::doInitialization(Module *M) { +inline bool PassManagerTraits<Function>::doInitialization(Module *M) { bool Changed = false; for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i) ((PMType*)this)->Passes[i]->doInitialization(M); return Changed; } -inline bool PassManagerTraits<Method>::runOnMethod(Method *M) { +inline bool PassManagerTraits<Function>::runOnMethod(Function *M) { return ((PMType*)this)->runOnUnit(M); } -inline bool PassManagerTraits<Method>::doFinalization(Module *M) { +inline bool PassManagerTraits<Function>::doFinalization(Module *M) { bool Changed = false; for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i) ((PMType*)this)->Passes[i]->doFinalization(M); |