For PR411:
[oota-llvm.git] / include / llvm / Value.h
index 157ef6e2b67cf3b4f6576f3410296bb8d52531ff..63af0f747d6b64a1a78cf21afa1324394b00e259 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/AbstractTypeUser.h"
 #include "llvm/Use.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/Streams.h"
 #include <string>
 
 namespace llvm {
@@ -30,7 +31,8 @@ class GlobalValue;
 class Function;
 class GlobalVariable;
 class InlineAsm;
-class SymbolTable;
+class ValueSymbolTable;
+class TypeSymbolTable;
 
 //===----------------------------------------------------------------------===//
 //                                 Value Class
@@ -47,7 +49,7 @@ class SymbolTable;
 /// using this Value.
 /// @brief LLVM Value Representation
 class Value {
-  unsigned short SubclassID;         // Subclass identifier (for isa/dyn_cast)
+  const unsigned short SubclassID;   // Subclass identifier (for isa/dyn_cast)
 protected:
   /// SubclassData - This member is defined by this class, but is not used for
   /// anything.  Subclasses can use it to hold whatever state they find useful.
@@ -75,6 +77,7 @@ public:
   /// print - Implement operator<< on Value...
   ///
   virtual void print(std::ostream &O) const = 0;
+  void print(std::ostream *O) const { if (O) print(*O); }
 
   /// All values are typed, get the type of this value.
   ///
@@ -150,7 +153,6 @@ public:
     UndefValueVal,            // This is an instance of UndefValue
     ConstantExprVal,          // This is an instance of ConstantExpr
     ConstantAggregateZeroVal, // This is an instance of ConstantAggregateNull
-    ConstantBoolVal,          // This is an instance of ConstantBool
     ConstantIntVal,           // This is an instance of ConstantInt
     ConstantFPVal,            // This is an instance of ConstantFP
     ConstantArrayVal,         // This is an instance of ConstantArray
@@ -184,11 +186,6 @@ public:
   /// getRawType - This should only be used to implement the vmcore library.
   ///
   const Type *getRawType() const { return Ty.getRawType(); }
-
-private:
-  /// FIXME: this is a gross hack, needed by another gross hack.  Eliminate!
-  void setValueType(unsigned short VT) { SubclassID = VT; }
-  friend class Instruction;
 };
 
 inline std::ostream &operator<<(std::ostream &OS, const Value &V) {