[llvm-commits] CVS: llvm/lib/Bytecode/Writer/ConstantWriter.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Jan 15 12:48:03 PST 2004


Changes in directory llvm/lib/Bytecode/Writer:

ConstantWriter.cpp updated: 1.31 -> 1.32

---
Log message:

ConstantPointerRef's are no longer emitted.  This saves 20028 bytes in the 
bytecode files when compiling 176.gcc, but more importantly will make it 
easier to eliminate CPR's in the future (no new .bc revision will be 
required to support them)



---
Diffs of the changes:  (+3 -7)

Index: llvm/lib/Bytecode/Writer/ConstantWriter.cpp
diff -u llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.31 llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.32
--- llvm/lib/Bytecode/Writer/ConstantWriter.cpp:1.31	Wed Jan 14 17:36:54 2004
+++ llvm/lib/Bytecode/Writer/ConstantWriter.cpp	Thu Jan 15 12:46:56 2004
@@ -194,13 +194,9 @@
     break;
   }
 
-  case Type::PointerTyID: {
-    const ConstantPointerRef *CPR = cast<ConstantPointerRef>(CPV);
-    int Slot = Table.getSlot((Value*)CPR->getValue());
-    assert(Slot != -1 && "Global used but not available!!");
-    output_vbr((unsigned)Slot, Out);
-    break;
-  }
+  case Type::PointerTyID:
+    assert(0 && "No non-null, non-constant-expr constants allowed!");
+    abort();
 
   case Type::FloatTyID: {   // Floating point types...
     float Tmp = (float)cast<ConstantFP>(CPV)->getValue();





More information about the llvm-commits mailing list