aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2007-04-22 15:00:52 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2007-04-22 15:00:52 +0000
commita0c96a068ca7027644b5f1972f9c388fa542d278 (patch)
tree3aa73b566bdb6974015c7a072e986f024c7f8c39
parentcb75731bf481a109d4706fc602cc233007843457 (diff)
downloadexternal_llvm-a0c96a068ca7027644b5f1972f9c388fa542d278.zip
external_llvm-a0c96a068ca7027644b5f1972f9c388fa542d278.tar.gz
external_llvm-a0c96a068ca7027644b5f1972f9c388fa542d278.tar.bz2
Teach Visual Studio about Bitcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36341 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Bitcode/BitstreamReader.h10
-rw-r--r--include/llvm/Bitcode/BitstreamWriter.h3
-rw-r--r--win32/Bitcode/Bitcode.vcproj161
-rw-r--r--win32/llvm.sln10
4 files changed, 179 insertions, 5 deletions
diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h
index ceae5af..feaf84f 100644
--- a/include/llvm/Bitcode/BitstreamReader.h
+++ b/include/llvm/Bitcode/BitstreamReader.h
@@ -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;
}
};
diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h
index 4aef53b..5de8293 100644
--- a/include/llvm/Bitcode/BitstreamWriter.h
+++ b/include/llvm/Bitcode/BitstreamWriter.h
@@ -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;
diff --git a/win32/Bitcode/Bitcode.vcproj b/win32/Bitcode/Bitcode.vcproj
new file mode 100644
index 0000000..18ff00a
--- /dev/null
+++ b/win32/Bitcode/Bitcode.vcproj
@@ -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>
diff --git a/win32/llvm.sln b/win32/llvm.sln
index 07e65bf..88c9ce5 100644
--- a/win32/llvm.sln
+++ b/win32/llvm.sln
@@ -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