From: Jeff Cohen Date: Sun, 6 May 2007 03:12:47 +0000 (+0000) Subject: Unbreak VC++. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=332376bc601fcff8d8a4558c2834ddd0189c12d1;p=oota-llvm.git Unbreak VC++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36831 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Bitcode/BitCodes.h b/include/llvm/Bitcode/BitCodes.h index 1d3087c5a0c..59d57e77f28 100644 --- a/include/llvm/Bitcode/BitCodes.h +++ b/include/llvm/Bitcode/BitCodes.h @@ -136,6 +136,7 @@ public: 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 @@ public: if (V == 62) return '.'; if (V == 63) return '_'; assert(0 && "Not a value Char6 character!"); + return ' '; } }; diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index e34dd092194..6e855b945c8 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -110,8 +110,8 @@ public: /// 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 @@ private: 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 @@ public: } } - unsigned Code = Vals[0]; + unsigned Code = (unsigned)Vals[0]; Vals.erase(Vals.begin()); return Code; } @@ -451,7 +451,7 @@ public: 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; } } diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index 70c7bf821a5..20bcc1c8b54 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -255,10 +255,10 @@ private: 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); diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 0d420fff633..65da264b2af 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -808,7 +808,7 @@ static void WriteInstruction(const Instruction &I, unsigned InstID, case Instruction::Call: { Code = bitc::FUNC_CODE_INST_CALL; Vals.push_back((cast(I).getCallingConv() << 1) | - cast(I).isTailCall()); + unsigned(cast(I).isTailCall())); PushValueAndType(I.getOperand(0), InstID, Vals, VE); // Callee // Emit value #'s for the fixed parameters. diff --git a/win32/Bitcode/Bitcode.vcproj b/win32/Bitcode/Bitcode.vcproj index 828e44c5a04..083947cb7c8 100644 --- a/win32/Bitcode/Bitcode.vcproj +++ b/win32/Bitcode/Bitcode.vcproj @@ -108,6 +108,9 @@ Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> + + diff --git a/win32/llvm.sln b/win32/llvm.sln index 88c9ce5153e..9bb3964045e 100644 --- a/win32/llvm.sln +++ b/win32/llvm.sln @@ -175,6 +175,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opt", "opt\opt.vcproj", "{0 {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}