[llvm-commits] [llvm] r49426 - in /llvm/branches/ggreif/use-diet/lib/Bitcode/Reader: BitcodeReader.cpp BitcodeReader.h

Gabor Greif ggreif at gmail.com
Wed Apr 9 08:17:50 PDT 2008


Author: ggreif
Date: Wed Apr  9 10:17:50 2008
New Revision: 49426

URL: http://llvm.org/viewvc/llvm-project?rev=49426&view=rev
Log:
get BitcodeReader compiling by commenting out stuff :-). Next: resolve linker references

Modified:
    llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.h

Modified: llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp?rev=49426&r1=49425&r2=49426&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.cpp Wed Apr  9 10:17:50 2008
@@ -122,15 +122,14 @@
   class ConstantPlaceHolder : public ConstantExpr {
     ConstantPlaceHolder();                       // DO NOT IMPLEMENT
     void operator=(const ConstantPlaceHolder &); // DO NOT IMPLEMENT
-    Use Op;
   public:
     // allocate space for exactly one operand
     void *operator new(size_t s) {
       return User::operator new(s, 1);
     }
     explicit ConstantPlaceHolder(const Type *Ty)
-      : ConstantExpr(Ty, Instruction::UserOp1, &Op, 1),
-        Op(UndefValue::get(Type::Int32Ty), this) {
+      : ConstantExpr(Ty, Instruction::UserOp1, /*&Op*/NULL, 1) {
+      Op<0>() = UndefValue::get(Type::Int32Ty);
     }
   };
 }
@@ -139,41 +138,41 @@
                                                     const Type *Ty) {
   if (Idx >= size()) {
     // Insert a bunch of null values.
-    Uses.resize(Idx+1);
-    OperandList = &Uses[0];
+//    Uses.resize(Idx+1);
+//    OperandList = &Uses[0];
     NumOperands = Idx+1;
   }
 
-  if (Value *V = Uses[Idx]) {
-    assert(Ty == V->getType() && "Type mismatch in constant table!");
-    return cast<Constant>(V);
-  }
+//  if (Value *V = Uses[Idx]) {
+//    assert(Ty == V->getType() && "Type mismatch in constant table!");
+//    return cast<Constant>(V);
+//  }
 
   // Create and return a placeholder, which will later be RAUW'd.
   Constant *C = new ConstantPlaceHolder(Ty);
-  Uses[Idx].init(C, this);
+//  Uses[Idx].init(C, this);
   return C;
 }
 
 Value *BitcodeReaderValueList::getValueFwdRef(unsigned Idx, const Type *Ty) {
   if (Idx >= size()) {
     // Insert a bunch of null values.
-    Uses.resize(Idx+1);
-    OperandList = &Uses[0];
+//    Uses.resize(Idx+1);
+//    OperandList = &Uses[0];
     NumOperands = Idx+1;
   }
   
-  if (Value *V = Uses[Idx]) {
+/*  if (Value *V = Uses[Idx]) {
     assert((Ty == 0 || Ty == V->getType()) && "Type mismatch in value table!");
     return V;
-  }
+  }*/
   
   // No type specified, must be invalid reference.
   if (Ty == 0) return 0;
   
   // Create and return a placeholder, which will later be RAUW'd.
   Value *V = new Argument(Ty);
-  Uses[Idx].init(V, this);
+//  Uses[Idx].init(V, this);
   return V;
 }
 

Modified: llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.h?rev=49426&r1=49425&r2=49426&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.h (original)
+++ llvm/branches/ggreif/use-diet/lib/Bitcode/Reader/BitcodeReader.h Wed Apr  9 10:17:50 2008
@@ -27,30 +27,29 @@
   class MemoryBuffer;
   
 class BitcodeReaderValueList : public User {
-  std::vector<Use> Uses;
 public:
   BitcodeReaderValueList() : User(Type::VoidTy, Value::ArgumentVal, 0, 0) {}
   
   // vector compatibility methods
   unsigned size() const { return getNumOperands(); }
   void push_back(Value *V) {
-    Uses.push_back(Use(V, this));
-    OperandList = &Uses[0];
+//    Uses.push_back(Use(V, this));
+//    OperandList = &Uses[0];
     ++NumOperands;
   }
   
   void clear() {
-    std::vector<Use>().swap(Uses);
+//    std::vector<Use>().swap(Uses);
   }
   
   Value *operator[](unsigned i) const { return getOperand(i); }
   
-  Value *back() const { return Uses.back(); }
-  void pop_back() { Uses.pop_back(); --NumOperands; }
+  Value *back() const { /*return Uses.back();*/ }
+  void pop_back() { /*Uses.pop_back(); --NumOperands;*/ }
   bool empty() const { return NumOperands == 0; }
   void shrinkTo(unsigned N) {
     assert(N <= NumOperands && "Invalid shrinkTo request!");
-    Uses.resize(N);
+//    Uses.resize(N);
     NumOperands = N;
   }
   virtual void print(std::ostream&) const {}
@@ -73,8 +72,8 @@
   
 private:
   void initVal(unsigned Idx, Value *V) {
-    assert(Uses[Idx] == 0 && "Cannot init an already init'd Use!");
-    Uses[Idx].init(V, this);
+//    assert(Uses[Idx] == 0 && "Cannot init an already init'd Use!");
+//    Uses[Idx].init(V, this);
   }
 };
   





More information about the llvm-commits mailing list