forked from OSchip/llvm-project
parent
beccb74eec
commit
e7518d5dd7
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "llvm/Bitcode/BitCodes.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <cassert>
|
||||
|
||||
namespace llvm {
|
||||
|
@ -91,7 +92,7 @@ public:
|
|||
|
||||
uint32_t ReadVBR(unsigned NumBits) {
|
||||
uint32_t Piece = Read(NumBits);
|
||||
if ((Piece & (1U << NumBits-1)) == 0)
|
||||
if ((Piece & (1U << (NumBits-1))) == 0)
|
||||
return Piece;
|
||||
|
||||
uint32_t Result = 0;
|
||||
|
@ -99,7 +100,7 @@ public:
|
|||
while (1) {
|
||||
Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
|
||||
|
||||
if ((Piece & (1U << NumBits-1)) == 0)
|
||||
if ((Piece & (1U << (NumBits-1))) == 0)
|
||||
return Result;
|
||||
|
||||
NextBit += NumBits-1;
|
||||
|
@ -109,7 +110,7 @@ public:
|
|||
|
||||
uint64_t ReadVBR64(unsigned NumBits) {
|
||||
uint64_t Piece = Read(NumBits);
|
||||
if ((Piece & (1U << NumBits-1)) == 0)
|
||||
if ((Piece & (1U << (NumBits-1))) == 0)
|
||||
return Piece;
|
||||
|
||||
uint64_t Result = 0;
|
||||
|
@ -117,7 +118,7 @@ public:
|
|||
while (1) {
|
||||
Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
|
||||
|
||||
if ((Piece & (1U << NumBits-1)) == 0)
|
||||
if ((Piece & (1U << (NumBits-1))) == 0)
|
||||
return Result;
|
||||
|
||||
NextBit += NumBits-1;
|
||||
|
@ -209,6 +210,7 @@ public:
|
|||
}
|
||||
|
||||
assert(0 && "Reading with abbrevs not implemented!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "llvm/Bitcode/BitCodes.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
|
@ -72,7 +73,7 @@ public:
|
|||
Out.push_back((unsigned char)(V >> 24));
|
||||
|
||||
if (CurBit)
|
||||
CurValue = Val >> 32-CurBit;
|
||||
CurValue = Val >> (32-CurBit);
|
||||
else
|
||||
CurValue = 0;
|
||||
CurBit = (CurBit+NumBits) & 31;
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="Bitcode"
|
||||
ProjectGUID="{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;.."
|
||||
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
|
||||
StringPooling="TRUE"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
ForceConformanceInForLoopScope="TRUE"
|
||||
RuntimeTypeInfo="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4355,4146,4800"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/Bitcode.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;.."
|
||||
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
ForceConformanceInForLoopScope="TRUE"
|
||||
RuntimeTypeInfo="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4355,4146,4800"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/Bitcode.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<Filter
|
||||
Name="Reader"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\Reader\BitcodeReader.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\Reader\BitcodeReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\Reader\ReaderWrappers.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Writer"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\Writer\ValueEnumerator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\Writer\ValueEnumerator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\Writer\Writer.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath="..\..\include\llvm\Bitcode\Bitcodes.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\llvm\Bitcode\BitstreamReader.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\llvm\Bitcode\BitstreamWriter.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\llvm\Bitcode\ReaderWriter.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Bitcode\LLVMBitCodes.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -108,6 +108,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-d
|
|||
{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}
|
||||
{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
|
||||
{0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
|
||||
EndProjectSection
|
||||
|
@ -117,6 +118,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.
|
|||
{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}
|
||||
{45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
|
||||
{0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
|
||||
{3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
|
||||
|
@ -234,6 +236,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bugpoint", "bugpoint\bugpoi
|
|||
{3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
|
@ -358,6 +364,10 @@ Global
|
|||
{57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug.Build.0 = Debug|Win32
|
||||
{57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release.ActiveCfg = Release|Win32
|
||||
{57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release.Build.0 = Release|Win32
|
||||
{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug.ActiveCfg = Debug|Win32
|
||||
{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug.Build.0 = Debug|Win32
|
||||
{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release.ActiveCfg = Release|Win32
|
||||
{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
|
Loading…
Reference in New Issue