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

Chris Lattner lattner at cs.uiuc.edu
Sun Aug 24 08:49:01 PDT 2003


Changes in directory llvm/lib/Bytecode/Writer:

Writer.cpp updated: 1.35 -> 1.36

---
Log message:

Allow modules to have 'any' pointer size and endianness.  Luckily, we had 
some space for extra flags, so we don't need to bump the revision number.



---
Diffs of the changes:

Index: llvm/lib/Bytecode/Writer/Writer.cpp
diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.35 llvm/lib/Bytecode/Writer/Writer.cpp:1.36
--- llvm/lib/Bytecode/Writer/Writer.cpp:1.35	Mon Jun 30 16:58:41 2003
+++ llvm/lib/Bytecode/Writer/Writer.cpp	Sun Aug 24 08:47:36 2003
@@ -43,11 +43,14 @@
   // Emit the top level CLASS block.
   BytecodeBlock ModuleBlock(BytecodeFormat::Module, Out);
 
-  bool isBigEndian = M->isBigEndian();
-  bool hasLongPointers = M->has64BitPointers();
+  bool isBigEndian      = M->getEndianness() == Module::BigEndian;
+  bool hasLongPointers  = M->getPointerSize() == Module::Pointer64;
+  bool hasNoEndianness  = M->getEndianness() == Module::AnyEndianness;
+  bool hasNoPointerSize = M->getPointerSize() == Module::AnyPointerSize;
 
   // Output the version identifier... we are currently on bytecode version #2
-  unsigned Version = (2 << 4) | isBigEndian | (hasLongPointers << 1);
+  unsigned Version = (2 << 4) | isBigEndian | (hasLongPointers << 1) |
+                     (hasNoEndianness << 2) | (hasNoPointerSize << 3);
   output_vbr(Version, Out);
   align32(Out);
 





More information about the llvm-commits mailing list