[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp ReaderInternals.h

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 9 01:15:01 PDT 2003


Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.71 -> 1.72
ReaderInternals.h updated: 1.52 -> 1.53

---
Log message:

Eliminate the instruction placeholder.  Simplify a bunch of code.
This results in no significant speedup, but does provide simpler code


---
Diffs of the changes:  (+1 -15)

Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.71 llvm/lib/Bytecode/Reader/Reader.cpp:1.72
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.71	Thu Oct  9 01:05:39 2003
+++ llvm/lib/Bytecode/Reader/Reader.cpp	Thu Oct  9 01:14:26 2003
@@ -134,7 +134,7 @@
   if (I != ForwardReferences.end() && I->first == KeyValue)
     return I->second;   // We have already created this placeholder
 
-  Value *Val = new ValPHolder(getType(type), oNum);
+  Value *Val = new Argument(getType(type));
   ForwardReferences.insert(I, std::make_pair(KeyValue, Val));
   return Val;
 }


Index: llvm/lib/Bytecode/Reader/ReaderInternals.h
diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.52 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.53
--- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.52	Thu Oct  9 01:05:40 2003
+++ llvm/lib/Bytecode/Reader/ReaderInternals.h	Thu Oct  9 01:14:26 2003
@@ -203,20 +203,12 @@
   unsigned getID() { return ID; }
 };
 
-struct InstPlaceHolderHelper : public Instruction {
-  InstPlaceHolderHelper(const Type *Ty) : Instruction(Ty, UserOp1, "") {}
-  virtual const char *getOpcodeName() const { return "placeholder"; }
-
-  virtual Instruction *clone() const { abort(); return 0; }
-};
-
 struct ConstantPlaceHolderHelper : public Constant {
   ConstantPlaceHolderHelper(const Type *Ty)
     : Constant(Ty) {}
   virtual bool isNullValue() const { return false; }
 };
 
-typedef PlaceholderDef<InstPlaceHolderHelper>  ValPHolder;
 typedef PlaceholderDef<ConstantPlaceHolderHelper>  ConstPHolder;
 
 // Some common errors we find
@@ -224,12 +216,6 @@
 static const std::string Error_read      = "read(): error reading.";
 static const std::string Error_inputdata = "input_data(): error reading.";
 static const std::string Error_DestSlot  = "No destination slot found.";
-
-static inline unsigned getValueIDNumberFromPlaceHolder(Value *Val) {
-  if (isa<Constant>(Val))
-    return ((ConstPHolder*)Val)->getID();
-  return ((ValPHolder*)Val)->getID();
-}
 
 static inline void readBlock(const unsigned char *&Buf,
                              const unsigned char *EndBuf, 





More information about the llvm-commits mailing list