Now that setcondinst has been eliminated, we can mark Value::SubclassID
authorChris Lattner <sabre@nondot.org>
Thu, 4 Jan 2007 02:15:37 +0000 (02:15 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 4 Jan 2007 02:15:37 +0000 (02:15 +0000)
const and remove the ugly mutator methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32860 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instruction.h
include/llvm/Value.h
lib/VMCore/Instruction.cpp

index a0376c785e5ca562d8687ab8ca062cb39d574a05..3e9f749602d792f75d23433f824dbb32667765ce 100644 (file)
@@ -39,12 +39,6 @@ class Instruction : public User {
   friend class SymbolTableListTraits<Instruction, BasicBlock, Function,
                                      ilist_traits<Instruction> >;
   void setParent(BasicBlock *P);
-
-private:
-  // FIXME: This is a dirty hack.  Setcc instructions shouldn't encode the CC
-  // into the opcode field.  When they don't, this will be unneeded.
-  void setOpcode(unsigned NewOpcode);
-  friend class BinaryOperator;
 protected:
   Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps,
               const std::string &Name = "",
index 262880a0e745647e7720ee3af07854bd7aa9a79f..0c3ddf67053290eeacedb1ad31caae0260b436e9 100644 (file)
@@ -48,7 +48,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.
@@ -186,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) {
index 2891269979122de4eb091a1eb4fb8a85d6a5a073..b2eb87d49e9fa7cf20eeae5dceac615de88ad2dd 100644 (file)
@@ -49,10 +49,6 @@ Instruction::~Instruction() {
 }
 
 
-void Instruction::setOpcode(unsigned opc) {
-  setValueType(Value::InstructionVal + opc);
-}
-
 void Instruction::setParent(BasicBlock *P) {
   if (getParent()) {
     if (!P) LeakDetector::addGarbageObject(this);