diff options
author | Chris Lattner <sabre@nondot.org> | 2002-01-20 22:54:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-01-20 22:54:45 +0000 |
commit | 697954c15da58bd8b186dbafdedd8b06db770201 (patch) | |
tree | e119a71f09b5c2513c8c270161ae2a858c6f3b96 /include/llvm/CodeGen | |
parent | 13c4659220bc78a0a3529f4d9e57546e898088e3 (diff) | |
download | external_llvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.gz external_llvm-697954c15da58bd8b186dbafdedd8b06db770201.tar.bz2 external_llvm-697954c15da58bd8b186dbafdedd8b06db770201.zip |
Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/InstrForest.h | 9 | ||||
-rw-r--r-- | include/llvm/CodeGen/InstrSelection.h | 5 | ||||
-rw-r--r-- | include/llvm/CodeGen/InstrSelectionSupport.h | 13 | ||||
-rw-r--r-- | include/llvm/CodeGen/InterferenceGraph.h | 12 | ||||
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 40 | ||||
-rw-r--r-- | include/llvm/CodeGen/RegClass.h | 16 | ||||
-rw-r--r-- | include/llvm/CodeGen/ValueSet.h | 29 |
7 files changed, 44 insertions, 80 deletions
diff --git a/include/llvm/CodeGen/InstrForest.h b/include/llvm/CodeGen/InstrForest.h index aa101f934d..0f614a6a9f 100644 --- a/include/llvm/CodeGen/InstrForest.h +++ b/include/llvm/CodeGen/InstrForest.h @@ -27,8 +27,7 @@ #include "llvm/Instruction.h" #include "Support/NonCopyable.h" #include "Support/HashExtras.h" -#include <hash_map> -#include <hash_set> +#include <ext/hash_set> class Constant; class BasicBlock; @@ -239,9 +238,9 @@ protected: // //------------------------------------------------------------------------ -class InstrForest : private hash_map<const Instruction *, InstructionNode*> { +class InstrForest : private std::hash_map<const Instruction *, InstructionNode*> { private: - hash_set<InstructionNode*> treeRoots; + std::hash_set<InstructionNode*> treeRoots; public: /*ctor*/ InstrForest (Method *M); @@ -251,7 +250,7 @@ public: return (*this)[instr]; } - inline const hash_set<InstructionNode*> &getRootSet() const { + inline const std::hash_set<InstructionNode*> &getRootSet() const { return treeRoots; } diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h index 27e3ebe553..287992a47c 100644 --- a/include/llvm/CodeGen/InstrSelection.h +++ b/include/llvm/CodeGen/InstrSelection.h @@ -84,7 +84,8 @@ class TmpInstruction : public Instruction { public: // Constructor that uses the type of S1 as the type of the temporary. // s1 must be a valid value. s2 may be NULL. - TmpInstruction(OtherOps opcode, Value *s1, Value* s2, const string &name="") + TmpInstruction(OtherOps opcode, Value *s1, Value* s2, + const std::string &name = "") : Instruction(s1->getType(), opcode, name) { assert(s1 != NULL && "Use different constructor if both operands are 0"); @@ -94,7 +95,7 @@ public: // Constructor that allows the type of the temporary to be specified. // Both S1 and S2 may be NULL. TmpInstruction(OtherOps opcode, const Type* tmpType, - Value *s1, Value* s2, const string &name = "") + Value *s1, Value* s2, const std::string &name = "") : Instruction(tmpType, opcode, name) { Initialize(opcode, s1, s2); diff --git a/include/llvm/CodeGen/InstrSelectionSupport.h b/include/llvm/CodeGen/InstrSelectionSupport.h index 2cce1dc754..33af635d8e 100644 --- a/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/include/llvm/CodeGen/InstrSelectionSupport.h @@ -24,8 +24,6 @@ class TmpInstruction; class Constant; class TargetMachine; -//************************ Exported Functions ******************************/ - //--------------------------------------------------------------------------- // Function GetConstantValueAsSignedInt @@ -54,7 +52,7 @@ int64_t GetConstantValueAsSignedInt (const Value *V, //--------------------------------------------------------------------------- Value* FoldGetElemChain (const InstructionNode* getElemInstrNode, - vector<Value*>& chainIdxVec); + std::vector<Value*>& chainIdxVec); //------------------------------------------------------------------------ @@ -130,11 +128,8 @@ MachineOperand::MachineOperandType // fall under case 3; these must be inserted before `minstr'. //--------------------------------------------------------------------------- -vector<MachineInstr*> FixConstantOperandsForInstr (Instruction* vmInstr, - MachineInstr* minstr, - TargetMachine& target); - - -//**************************************************************************/ +std::vector<MachineInstr*> FixConstantOperandsForInstr (Instruction* vmInstr, + MachineInstr* minstr, + TargetMachine& target); #endif diff --git a/include/llvm/CodeGen/InterferenceGraph.h b/include/llvm/CodeGen/InterferenceGraph.h index 99dea8fbe0..408bee4558 100644 --- a/include/llvm/CodeGen/InterferenceGraph.h +++ b/include/llvm/CodeGen/InterferenceGraph.h @@ -1,4 +1,4 @@ -/* Title: InterferenceGraph.h +/* Title: InterferenceGraph.h -*- C++ -*- Author: Ruchira Sasanka Date: July 20, 01 Purpose: Interference Graph used for register coloring. @@ -24,7 +24,7 @@ #include "llvm/CodeGen/IGNode.h" -typedef vector <IGNode *> IGNodeListType; +typedef std::vector <IGNode *> IGNodeListType; class InterferenceGraph @@ -47,6 +47,8 @@ class InterferenceGraph // to create it after adding all IGNodes to the IGNodeList InterferenceGraph(RegClass *const RC); + ~InterferenceGraph(); + void createGraph(); void addLRToIG(LiveRange *const LR); @@ -65,12 +67,6 @@ class InterferenceGraph void printIG() const; void printIGNodeList() const; - - ~InterferenceGraph(); - - }; - #endif - diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index d6b8ef7154..4c5dd1056c 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -22,8 +22,6 @@ #include "llvm/Annotation.h" #include "llvm/Method.h" #include <iterator> -#include <hash_map> -#include <hash_set> #include <values.h> template<class _MI, class _V> class ValOpIterator; @@ -131,7 +129,7 @@ public: } public: - friend ostream& operator<<(ostream& os, const MachineOperand& mop); + friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); private: @@ -262,9 +260,9 @@ class MachineInstr : public NonCopyable { private: MachineOpCode opCode; OpCodeMask opCodeMask; // extra bits for variants of an opcode - vector<MachineOperand> operands; - vector<Value*> implicitRefs; // values implicitly referenced by this - vector<bool> implicitIsDef; // machine instruction (eg, call args) + std::vector<MachineOperand> operands; + std::vector<Value*> implicitRefs; // values implicitly referenced by this + std::vector<bool> implicitIsDef; // machine instruction (eg, call args) public: typedef ValOpIterator<const MachineInstr, const Value> val_const_op_iterator; @@ -306,9 +304,9 @@ public: public: - friend ostream& operator<<(ostream& os, const MachineInstr& minstr); - friend val_const_op_iterator; - friend val_op_iterator; + friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr); + friend class val_const_op_iterator; + friend class val_op_iterator; public: // Access to set the operands when building the machine instruction @@ -449,17 +447,17 @@ public: // //--------------------------------------------------------------------------- -class MachineCodeForVMInstr: public vector<MachineInstr*> +class MachineCodeForVMInstr: public std::vector<MachineInstr*> { private: - vector<Value*> tempVec; // used by m/c instr but not VM instr + std::vector<Value*> tempVec; // used by m/c instr but not VM instr public: /*ctor*/ MachineCodeForVMInstr () {} /*ctor*/ ~MachineCodeForVMInstr (); - const vector<Value*>& getTempValues () const { return tempVec; } - vector<Value*>& getTempValues () { return tempVec; } + const std::vector<Value*>& getTempValues () const { return tempVec; } + std::vector<Value*>& getTempValues () { return tempVec; } void addTempValue (Value* val) { tempVec.push_back(val); } @@ -499,10 +497,10 @@ MachineCodeForVMInstr::~MachineCodeForVMInstr() //--------------------------------------------------------------------------- -class MachineCodeForBasicBlock: public vector<MachineInstr*> { +class MachineCodeForBasicBlock: public std::vector<MachineInstr*> { public: - typedef vector<MachineInstr*>::iterator iterator; - typedef vector<const MachineInstr*>::const_iterator const_iterator; + typedef std::vector<MachineInstr*>::iterator iterator; + typedef std::vector<MachineInstr*>::const_iterator const_iterator; }; @@ -529,8 +527,8 @@ private: unsigned currentOptionalArgsSize; unsigned maxOptionalArgsSize; unsigned currentTmpValuesSize; - hash_set<const Constant*> constantsForConstPool; - hash_map<const Value*, int> offsets; + std::hash_set<const Constant*> constantsForConstPool; + std::hash_map<const Value*, int> offsets; // hash_map<const Value*, int> offsetsFromSP; public: @@ -572,7 +570,7 @@ public: inline unsigned getMaxOptionalArgsSize() const { return maxOptionalArgsSize;} inline unsigned getCurrentOptionalArgsSize() const { return currentOptionalArgsSize;} - inline const hash_set<const Constant*>& + inline const std::hash_set<const Constant*>& getConstantPoolValues() const {return constantsForConstPool;} // @@ -628,10 +626,10 @@ private: //--------------------------------------------------------------------------- -ostream& operator<< (ostream& os, const MachineInstr& minstr); +std::ostream& operator<< (std::ostream& os, const MachineInstr& minstr); -ostream& operator<< (ostream& os, const MachineOperand& mop); +std::ostream& operator<< (std::ostream& os, const MachineOperand& mop); void PrintMachineInstructions(const Method *method); diff --git a/include/llvm/CodeGen/RegClass.h b/include/llvm/CodeGen/RegClass.h index d6cbaf892b..fe25986f40 100644 --- a/include/llvm/CodeGen/RegClass.h +++ b/include/llvm/CodeGen/RegClass.h @@ -13,8 +13,9 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/MachineRegInfo.h" #include <stack> +#include <iostream> -typedef vector<unsigned int> ReservedColorListType; +typedef std::vector<unsigned int> ReservedColorListType; //----------------------------------------------------------------------------- @@ -46,7 +47,7 @@ class RegClass InterferenceGraph IG; // Interference graph - constructed by // buildInterferenceGraph - stack <IGNode *> IGNodeStack; // the stack used for coloring + std::stack<IGNode *> IGNodeStack; // the stack used for coloring const ReservedColorListType *const ReservedColorList; // @@ -117,21 +118,14 @@ class RegClass inline void printIGNodeList() const { - cerr << "IG Nodes for Register Class " << RegClassID << ":" << endl; + std::cerr << "IG Nodes for Register Class " << RegClassID << ":" << "\n"; IG.printIGNodeList(); } inline void printIG() { - cerr << "IG for Register Class " << RegClassID << ":" << endl; + std::cerr << "IG for Register Class " << RegClassID << ":" << "\n"; IG.printIG(); } - }; - - - - - - #endif diff --git a/include/llvm/CodeGen/ValueSet.h b/include/llvm/CodeGen/ValueSet.h index ee6aa15aab..d17e0229a1 100644 --- a/include/llvm/CodeGen/ValueSet.h +++ b/include/llvm/CodeGen/ValueSet.h @@ -1,4 +1,4 @@ -/* Title: ValueSet.h +/* Title: ValueSet.h -*- C++ -*- Author: Ruchira Sasanka Date: Jun 30, 01 Purpose: Contains a mathematical set of Values. LiveVarSet is derived from @@ -8,24 +8,9 @@ #ifndef VALUE_SET_H #define VALUE_SET_H -#include <stdlib.h> - -#include <hash_set> -#include <algorithm> -//#include <fstream> -#include <iostream> - -#include "llvm/Value.h" - - -//------------------------ Support functions --------------------------------- - -struct hashFuncValue { // sturcture containing the hash func - inline size_t operator () (const Value *const val) const - { return (size_t) val; } -}; - - +class Value; +#include "Support/HashExtras.h" +#include <ext/hash_set> //------------------- Class Definition for ValueSet -------------------------- @@ -33,12 +18,8 @@ void printValue( const Value *const v); // func to print a Value -class ValueSet : public hash_set<const Value *, hashFuncValue > -{ - +class ValueSet : public std::hash_set<const Value *> { public: - ValueSet(); // constructor - inline void add(const Value *const val) { assert( val ); insert(val);} // for adding a live variable to set |