[llvm-commits] CVS: llvm/include/llvm/Bitcode/BitCodes.h BitstreamReader.h BitstreamWriter.h

Jeff Cohen jeffc at jolt-lang.org
Sat May 5 20:13:18 PDT 2007



Changes in directory llvm/include/llvm/Bitcode:

BitCodes.h updated: 1.7 -> 1.8
BitstreamReader.h updated: 1.18 -> 1.19
BitstreamWriter.h updated: 1.13 -> 1.14
---
Log message:

Unbreak VC++.

---
Diffs of the changes:  (+10 -8)

 BitCodes.h        |    2 ++
 BitstreamReader.h |   12 ++++++------
 BitstreamWriter.h |    4 ++--
 3 files changed, 10 insertions(+), 8 deletions(-)


Index: llvm/include/llvm/Bitcode/BitCodes.h
diff -u llvm/include/llvm/Bitcode/BitCodes.h:1.7 llvm/include/llvm/Bitcode/BitCodes.h:1.8
--- llvm/include/llvm/Bitcode/BitCodes.h:1.7	Fri May  4 20:15:42 2007
+++ llvm/include/llvm/Bitcode/BitCodes.h	Sat May  5 22:12:47 2007
@@ -136,6 +136,7 @@
     if (C == '.') return 62;
     if (C == '_') return 63;
     assert(0 && "Not a value Char6 character!");
+    return 0;
   }
   
   static char DecodeChar6(unsigned V) {
@@ -146,6 +147,7 @@
     if (V == 62) return '.';
     if (V == 63) return '_';
     assert(0 && "Not a value Char6 character!");
+    return ' ';
   }
   
 };


Index: llvm/include/llvm/Bitcode/BitstreamReader.h
diff -u llvm/include/llvm/Bitcode/BitstreamReader.h:1.18 llvm/include/llvm/Bitcode/BitstreamReader.h:1.19
--- llvm/include/llvm/Bitcode/BitstreamReader.h:1.18	Sat May  5 20:43:38 2007
+++ llvm/include/llvm/Bitcode/BitstreamReader.h	Sat May  5 22:12:47 2007
@@ -110,8 +110,8 @@
   
   /// JumpToBit - Reset the stream to the specified bit number.
   void JumpToBit(uint64_t BitNo) {
-    unsigned ByteNo = (BitNo/8) & ~3;
-    unsigned WordBitNo = BitNo & 31;
+    unsigned ByteNo = unsigned(BitNo/8) & ~3;
+    unsigned WordBitNo = unsigned(BitNo) & 31;
     assert(ByteNo < (unsigned)(LastChar-FirstChar) && "Invalid location");
     
     // Move the cursor to the right word.
@@ -327,10 +327,10 @@
       switch (Op.getEncoding()) {
       default: assert(0 && "Unknown encoding!");
       case BitCodeAbbrevOp::Fixed:
-        Vals.push_back(Read(Op.getEncodingData()));
+        Vals.push_back(Read((unsigned)Op.getEncodingData()));
         break;
       case BitCodeAbbrevOp::VBR:
-        Vals.push_back(ReadVBR64(Op.getEncodingData()));
+        Vals.push_back(ReadVBR64((unsigned)Op.getEncodingData()));
         break;
       case BitCodeAbbrevOp::Char6:
         Vals.push_back(BitCodeAbbrevOp::DecodeChar6(Read(6)));
@@ -370,7 +370,7 @@
       }
     }
     
-    unsigned Code = Vals[0];
+    unsigned Code = (unsigned)Vals[0];
     Vals.erase(Vals.begin());
     return Code;
   }
@@ -451,7 +451,7 @@
       default: break;  // Default behavior, ignore unknown content.
       case bitc::BLOCKINFO_CODE_SETBID:
         if (Record.size() < 1) return true;
-        CurBlockInfo = &getOrCreateBlockInfo(Record[0]);
+        CurBlockInfo = &getOrCreateBlockInfo((unsigned)Record[0]);
         break;
       }
     }      


Index: llvm/include/llvm/Bitcode/BitstreamWriter.h
diff -u llvm/include/llvm/Bitcode/BitstreamWriter.h:1.13 llvm/include/llvm/Bitcode/BitstreamWriter.h:1.14
--- llvm/include/llvm/Bitcode/BitstreamWriter.h:1.13	Sat May  5 18:40:48 2007
+++ llvm/include/llvm/Bitcode/BitstreamWriter.h	Sat May  5 22:12:47 2007
@@ -255,10 +255,10 @@
     switch (Op.getEncoding()) {
     default: assert(0 && "Unknown encoding!");
     case BitCodeAbbrevOp::Fixed:
-      Emit(V, Op.getEncodingData());
+      Emit((unsigned)V, (unsigned)Op.getEncodingData());
       break;
     case BitCodeAbbrevOp::VBR:
-      EmitVBR64(V, Op.getEncodingData());
+      EmitVBR64(V, (unsigned)Op.getEncodingData());
       break;
     case BitCodeAbbrevOp::Char6:
       Emit(BitCodeAbbrevOp::EncodeChar6((char)V), 6);






More information about the llvm-commits mailing list