Chris seems fond of #include <vector>.  Fix these. Also convert use list in
Value to a vector instead of a list.

Move SchedGraph.h & SchedPriorities.h into lib/CodeGen/InstrScheduling


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@572 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h
index 0a8a927..e07ebd7 100644
--- a/include/llvm/CodeGen/InstrSelection.h
+++ b/include/llvm/CodeGen/InstrSelection.h
@@ -13,7 +13,6 @@
 #define LLVM_CODEGEN_INSTR_SELECTION_H
 
 #include "llvm/Instruction.h"
-#include <vector>
 class Method;
 class InstrForest;
 class MachineInstr;
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index 9903f09..29e832d 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -19,7 +19,7 @@
 #include "llvm/CodeGen/InstrForest.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/NonCopyable.h"
-#include "llvm/Target/Machine.h"
+#include "llvm/Target/InstInfo.h"
 
 template<class _MI, class _V> class ValOpIterator;
 
diff --git a/include/llvm/ConstPoolVals.h b/include/llvm/ConstPoolVals.h
index 09260b5..71ca6a7 100644
--- a/include/llvm/ConstPoolVals.h
+++ b/include/llvm/ConstPoolVals.h
@@ -10,7 +10,6 @@
 
 #include "llvm/User.h"
 #include "llvm/Support/DataTypes.h"
-#include <vector>
 
 class ArrayType;
 class StructType;
diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h
index e024ed3..3f93459 100644
--- a/include/llvm/DerivedTypes.h
+++ b/include/llvm/DerivedTypes.h
@@ -12,7 +12,6 @@
 #define LLVM_DERIVED_TYPES_H
 
 #include "llvm/Type.h"
-#include <vector>
 
 class DerivedType : public Type {
   // AbstractTypeUsers - Implement a list of the users that need to be notified
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h
index 1f771e6..75c4943 100644
--- a/include/llvm/InstrTypes.h
+++ b/include/llvm/InstrTypes.h
@@ -10,8 +10,6 @@
 #define LLVM_INSTRUCTION_TYPES_H
 
 #include "llvm/Instruction.h"
-#include <list>
-#include <vector>
 
 class Method;
 class SymTabValue;
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 2bb590b..3bbb8e7 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -13,7 +13,7 @@
 class Type;
 class BasicBlock;
 class Method;
-class MachineInstr;		// do not include header file MachineInstr.h
+class MachineInstr;
 class MachineCodeForVMInstr;
 
 class Instruction : public User {
diff --git a/include/llvm/SymbolTable.h b/include/llvm/SymbolTable.h
index a53608f..18ccf13 100644
--- a/include/llvm/SymbolTable.h
+++ b/include/llvm/SymbolTable.h
@@ -17,7 +17,6 @@
 #define LLVM_SYMBOL_TABLE_H
 
 #include "llvm/Value.h"
-#include <vector>
 #include <map>
 
 class Value;
diff --git a/include/llvm/Target/Data.h b/include/llvm/Target/Data.h
index 5573950..aa0afbc 100644
--- a/include/llvm/Target/Data.h
+++ b/include/llvm/Target/Data.h
@@ -14,7 +14,6 @@
 #define LLVM_TARGET_DATA_H
 
 #include "llvm/Type.h"
-#include <vector>
 
 class StructType;
 class StructLayout;
diff --git a/include/llvm/Target/RegInfo.h b/include/llvm/Target/RegInfo.h
index 726baab..bb1b029 100644
--- a/include/llvm/Target/RegInfo.h
+++ b/include/llvm/Target/RegInfo.h
@@ -8,9 +8,14 @@
 #ifndef LLVM_TARGET_REGINFO_H
 #define LLVM_TARGET_REGINFO_H
 
-class LiveRangeInfo;
-class Method;
+#include "llvm/Support/NonCopyable.h"
+#include <hash_map>
+#include <string>
+
+class Value;
 class Instruction;
+class Method;
+class LiveRangeInfo;
 class LiveRange;
 class AddedInstrns;
 class MachineInstr;
diff --git a/include/llvm/User.h b/include/llvm/User.h
index d914b1f..535dd1e 100644
--- a/include/llvm/User.h
+++ b/include/llvm/User.h
@@ -13,7 +13,6 @@
 #define LLVM_USER_H
 
 #include "llvm/Value.h"
-#include <vector>
 
 class User : public Value {
   User(const User &);             // Do not implement
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index dd97d35..d2bf4cd 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -8,7 +8,7 @@
 #ifndef LLVM_VALUE_H
 #define LLVM_VALUE_H
 
-#include <list>
+#include <vector>
 #include "llvm/Annotation.h"
 #include "llvm/AbstractTypeUser.h"
 
@@ -44,7 +44,7 @@
   };
 
 private:
-  list<User *> Uses;
+  vector<User *> Uses;
   string Name;
   PATypeHandle<Type> Ty;
   ValueTy VTy;
@@ -130,10 +130,10 @@
   virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
 
   //----------------------------------------------------------------------
-  // Methods for handling the list of uses of this DEF.
+  // Methods for handling the vector of uses of this Value.
   //
-  typedef list<User*>::iterator       use_iterator;
-  typedef list<User*>::const_iterator use_const_iterator;
+  typedef vector<User*>::iterator       use_iterator;
+  typedef vector<User*>::const_iterator use_const_iterator;
 
   inline unsigned           use_size()  const { return Uses.size();  }
   inline bool               use_empty() const { return Uses.empty(); }
diff --git a/include/llvm/iOther.h b/include/llvm/iOther.h
index 97f3262..e723d4e 100644
--- a/include/llvm/iOther.h
+++ b/include/llvm/iOther.h
@@ -10,7 +10,6 @@
 
 #include "llvm/InstrTypes.h"
 #include "llvm/Method.h"
-#include <vector>
 
 //===----------------------------------------------------------------------===//
 //                               PHINode Class
diff --git a/lib/CodeGen/InstrSched/InstrScheduling.cpp b/lib/CodeGen/InstrSched/InstrScheduling.cpp
index 494da31..382dc3b 100644
--- a/lib/CodeGen/InstrSched/InstrScheduling.cpp
+++ b/lib/CodeGen/InstrSched/InstrScheduling.cpp
@@ -9,7 +9,7 @@
 //***************************************************************************
 
 #include "llvm/CodeGen/InstrScheduling.h"
-#include "llvm/CodeGen/SchedPriorities.h"
+#include "SchedPriorities.h"
 #include "llvm/Analysis/LiveVar/BBLiveVar.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Support/CommandLine.h"
diff --git a/lib/CodeGen/InstrSched/SchedGraph.cpp b/lib/CodeGen/InstrSched/SchedGraph.cpp
index 1ad2b0f..5f0de8b 100644
--- a/lib/CodeGen/InstrSched/SchedGraph.cpp
+++ b/lib/CodeGen/InstrSched/SchedGraph.cpp
@@ -11,11 +11,11 @@
  *	7/20/01	 -  Vikram Adve  -  Created
  ***************************************************************************/
 
+#include "SchedGraph.h"
 #include "llvm/InstrTypes.h"
 #include "llvm/Instruction.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Method.h"
-#include "llvm/CodeGen/SchedGraph.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Target/InstInfo.h"
 #include "llvm/Support/StringExtras.h"
diff --git a/include/llvm/CodeGen/SchedGraph.h b/lib/CodeGen/InstrSched/SchedGraph.h
similarity index 100%
rename from include/llvm/CodeGen/SchedGraph.h
rename to lib/CodeGen/InstrSched/SchedGraph.h
diff --git a/lib/CodeGen/InstrSched/SchedPriorities.cpp b/lib/CodeGen/InstrSched/SchedPriorities.cpp
index c09f9fc..a4396c2 100644
--- a/lib/CodeGen/InstrSched/SchedPriorities.cpp
+++ b/lib/CodeGen/InstrSched/SchedPriorities.cpp
@@ -18,7 +18,7 @@
  *	7/30/01	 -  Vikram Adve  -  Created
  ***************************************************************************/
 
-#include "llvm/CodeGen/SchedPriorities.h"
+#include "SchedPriorities.h"
 
 
 SchedPriorities::SchedPriorities(const Method* method,
diff --git a/include/llvm/CodeGen/SchedPriorities.h b/lib/CodeGen/InstrSched/SchedPriorities.h
similarity index 98%
rename from include/llvm/CodeGen/SchedPriorities.h
rename to lib/CodeGen/InstrSched/SchedPriorities.h
index 45f19b4..1765dba 100644
--- a/include/llvm/CodeGen/SchedPriorities.h
+++ b/lib/CodeGen/InstrSched/SchedPriorities.h
@@ -21,9 +21,9 @@
 #ifndef LLVM_CODEGEN_SCHEDPRIORITIES_H
 #define LLVM_CODEGEN_SCHEDPRIORITIES_H
 
+#include "SchedGraph.h"
 #include "llvm/CodeGen/InstrScheduling.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
-#include "llvm/CodeGen/SchedGraph.h"
 #include "llvm/Target/SchedInfo.h"
 
 class Method;
diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
index 494da31..382dc3b 100644
--- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
+++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
@@ -9,7 +9,7 @@
 //***************************************************************************
 
 #include "llvm/CodeGen/InstrScheduling.h"
-#include "llvm/CodeGen/SchedPriorities.h"
+#include "SchedPriorities.h"
 #include "llvm/Analysis/LiveVar/BBLiveVar.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Support/CommandLine.h"
diff --git a/lib/Target/SparcV9/InstrSched/SchedGraph.cpp b/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
index 1ad2b0f..5f0de8b 100644
--- a/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
+++ b/lib/Target/SparcV9/InstrSched/SchedGraph.cpp
@@ -11,11 +11,11 @@
  *	7/20/01	 -  Vikram Adve  -  Created
  ***************************************************************************/
 
+#include "SchedGraph.h"
 #include "llvm/InstrTypes.h"
 #include "llvm/Instruction.h"
 #include "llvm/BasicBlock.h"
 #include "llvm/Method.h"
-#include "llvm/CodeGen/SchedGraph.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Target/InstInfo.h"
 #include "llvm/Support/StringExtras.h"
diff --git a/include/llvm/CodeGen/SchedGraph.h b/lib/Target/SparcV9/InstrSched/SchedGraph.h
similarity index 100%
copy from include/llvm/CodeGen/SchedGraph.h
copy to lib/Target/SparcV9/InstrSched/SchedGraph.h
diff --git a/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp b/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
index c09f9fc..a4396c2 100644
--- a/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
+++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
@@ -18,7 +18,7 @@
  *	7/30/01	 -  Vikram Adve  -  Created
  ***************************************************************************/
 
-#include "llvm/CodeGen/SchedPriorities.h"
+#include "SchedPriorities.h"
 
 
 SchedPriorities::SchedPriorities(const Method* method,
diff --git a/include/llvm/CodeGen/SchedPriorities.h b/lib/Target/SparcV9/InstrSched/SchedPriorities.h
similarity index 98%
copy from include/llvm/CodeGen/SchedPriorities.h
copy to lib/Target/SparcV9/InstrSched/SchedPriorities.h
index 45f19b4..1765dba 100644
--- a/include/llvm/CodeGen/SchedPriorities.h
+++ b/lib/Target/SparcV9/InstrSched/SchedPriorities.h
@@ -21,9 +21,9 @@
 #ifndef LLVM_CODEGEN_SCHEDPRIORITIES_H
 #define LLVM_CODEGEN_SCHEDPRIORITIES_H
 
+#include "SchedGraph.h"
 #include "llvm/CodeGen/InstrScheduling.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
-#include "llvm/CodeGen/SchedGraph.h"
 #include "llvm/Target/SchedInfo.h"
 
 class Method;
diff --git a/lib/Target/SparcV9/SparcV9Internals.h b/lib/Target/SparcV9/SparcV9Internals.h
index f9a344b..e4f0a8b 100644
--- a/lib/Target/SparcV9/SparcV9Internals.h
+++ b/lib/Target/SparcV9/SparcV9Internals.h
@@ -8,11 +8,10 @@
 #ifndef SPARC_INTERNALS_H
 #define SPARC_INTERNALS_H
 
-#include "llvm/Target/Machine.h"
 #include "SparcRegInfo.h"
-
-#include <sys/types.h>
+#include "llvm/Target/SchedInfo.h"
 #include "llvm/Type.h"
+#include <sys/types.h>
 
 class UltraSparc;
 
@@ -39,17 +38,6 @@
   SPARC_NUM_SCHED_CLASSES = SPARC_INV
 };
 
-// inline operator int (const SparcInstrSchedClass& si) {
-//   return (int) si;
-// }
-// 
-// inline operator SparcInstrSchedClass (int i) {
-//   return (SparcInstrSchedClass) si;
-// }
-// 
-// inline operator const SparcInstrSchedClass (int i) {
-//   return (const SparcInstrSchedClass) si;
-// }
 
 //---------------------------------------------------------------------------
 // enum SparcMachineOpCode. 
@@ -60,7 +48,6 @@
 // 
 //---------------------------------------------------------------------------
 
-
 enum SparcMachineOpCode {
 
   NOP,
diff --git a/lib/Target/SparcV9/SparcV9RegInfo.h b/lib/Target/SparcV9/SparcV9RegInfo.h
index 3ebef55..67aa3a6 100644
--- a/lib/Target/SparcV9/SparcV9RegInfo.h
+++ b/lib/Target/SparcV9/SparcV9RegInfo.h
@@ -7,7 +7,7 @@
 #ifndef SPARC_INT_REG_CLASS_H
 #define SPARC_INT_REG_CLASS_H
 
-#include "llvm/Target/Machine.h"
+#include "llvm/Target/RegInfo.h"
 
 //-----------------------------------------------------------------------------
 // Integer Register Class
diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
index cf09734..f1be406 100644
--- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp
+++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp
@@ -8,12 +8,16 @@
 //	7/15/01	 -  Vikram Adve  -  Created
 //**************************************************************************/
 
-#include "llvm/CodeGen/Sparc.h"
+#include "llvm/Target/Sparc.h"
 #include "SparcInternals.h"
 #include "llvm/Method.h"
 #include "llvm/CodeGen/InstrScheduling.h"
 #include "llvm/CodeGen/InstrSelection.h"
 
+// allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine
+// that implements the Sparc backend. (the llvm/CodeGen/Sparc.h interface)
+//
+TargetMachine *allocateSparcTargetMachine() { return new UltraSparc(); }
 
 
 //---------------------------------------------------------------------------
@@ -115,7 +119,3 @@
   return false;
 }
 
-// allocateSparcTargetMachine - Allocate and return a subclass of TargetMachine
-// that implements the Sparc backend.
-//
-TargetMachine *allocateSparcTargetMachine() { return new UltraSparc(); }
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index e48341e..a41262d 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -1,6 +1,6 @@
 //===-- Value.cpp - Implement the Value class -----------------------------===//
 //
-// This file implements the Value class. 
+// This file implements the Value, User, and SymTabValue classes. 
 //
 //===----------------------------------------------------------------------===//
 
@@ -44,7 +44,7 @@
   assert(D && "Value::replaceAllUsesWith(<null>) is invalid!");
   assert(D != this && "V->replaceAllUsesWith(V) is NOT valid!");
   while (!Uses.empty()) {
-    User *Use = Uses.front();
+    User *Use = Uses.back();
 #ifndef NDEBUG
     unsigned NumUses = Uses.size();
 #endif