llvm.org GIT mirror llvm / a0c96a0
Teach Visual Studio about Bitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36341 91177308-0d34-0410-b5e6-96231b3b80d8 Jeff Cohen 12 years ago
4 changed file(s) with 179 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
1616
1717 #include "llvm/Bitcode/BitCodes.h"
1818 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/Support/DataTypes.h"
1920 #include
2021
2122 namespace llvm {
9091
9192 uint32_t ReadVBR(unsigned NumBits) {
9293 uint32_t Piece = Read(NumBits);
93 if ((Piece & (1U << NumBits-1)) == 0)
94 if ((Piece & (1U << (NumBits-1))) == 0)
9495 return Piece;
9596
9697 uint32_t Result = 0;
9899 while (1) {
99100 Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
100101
101 if ((Piece & (1U << NumBits-1)) == 0)
102 if ((Piece & (1U << (NumBits-1))) == 0)
102103 return Result;
103104
104105 NextBit += NumBits-1;
108109
109110 uint64_t ReadVBR64(unsigned NumBits) {
110111 uint64_t Piece = Read(NumBits);
111 if ((Piece & (1U << NumBits-1)) == 0)
112 if ((Piece & (1U << (NumBits-1))) == 0)
112113 return Piece;
113114
114115 uint64_t Result = 0;
116117 while (1) {
117118 Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
118119
119 if ((Piece & (1U << NumBits-1)) == 0)
120 if ((Piece & (1U << (NumBits-1))) == 0)
120121 return Result;
121122
122123 NextBit += NumBits-1;
208209 }
209210
210211 assert(0 && "Reading with abbrevs not implemented!");
212 return 0;
211213 }
212214
213215 };
1616
1717 #include "llvm/Bitcode/BitCodes.h"
1818 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/Support/DataTypes.h"
1920 #include
2021 #include
2122
7172 Out.push_back((unsigned char)(V >> 24));
7273
7374 if (CurBit)
74 CurValue = Val >> 32-CurBit;
75 CurValue = Val >> (32-CurBit);
7576 else
7677 CurValue = 0;
7778 CurBit = (CurBit+NumBits) & 31;
0
1
2 ProjectType="Visual C++"
3 Version="7.10"
4 Name="Bitcode"
5 ProjectGUID="{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
6 Keyword="Win32Proj">
7
8
9 Name="Win32"/>
10
11
12
13 Name="Debug|Win32"
14 OutputDirectory="..\Debug"
15 IntermediateDirectory="Debug"
16 ConfigurationType="4"
17 CharacterSet="2">
18
19 Name="VCCLCompilerTool"
20 Optimization="0"
21 AdditionalIncludeDirectories="..\..\include;.."
22 PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_LIB;__STDC_LIMIT_MACROS"
23 StringPooling="TRUE"
24 MinimalRebuild="TRUE"
25 BasicRuntimeChecks="3"
26 RuntimeLibrary="3"
27 ForceConformanceInForLoopScope="TRUE"
28 RuntimeTypeInfo="TRUE"
29 UsePrecompiledHeader="0"
30 BrowseInformation="1"
31 WarningLevel="3"
32 Detect64BitPortabilityProblems="FALSE"
33 DebugInformationFormat="4"
34 DisableSpecificWarnings="4355,4146,4800"/>
35
36 Name="VCCustomBuildTool"/>
37
38 Name="VCLibrarianTool"
39 OutputFile="$(OutDir)/Bitcode.lib"/>
40
41 Name="VCMIDLTool"/>
42
43 Name="VCPostBuildEventTool"/>
44
45 Name="VCPreBuildEventTool"/>
46
47 Name="VCPreLinkEventTool"/>
48
49 Name="VCResourceCompilerTool"/>
50
51 Name="VCWebServiceProxyGeneratorTool"/>
52
53 Name="VCXMLDataGeneratorTool"/>
54
55 Name="VCManagedWrapperGeneratorTool"/>
56
57 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
58
59
60 Name="Release|Win32"
61 OutputDirectory="..\Release"
62 IntermediateDirectory="Release"
63 ConfigurationType="4"
64 CharacterSet="2">
65
66 Name="VCCLCompilerTool"
67 AdditionalIncludeDirectories="..\..\include;.."
68 PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_LIB;__STDC_LIMIT_MACROS"
69 StringPooling="TRUE"
70 RuntimeLibrary="2"
71 ForceConformanceInForLoopScope="TRUE"
72 RuntimeTypeInfo="TRUE"
73 UsePrecompiledHeader="0"
74 WarningLevel="3"
75 Detect64BitPortabilityProblems="FALSE"
76 DebugInformationFormat="3"
77 DisableSpecificWarnings="4355,4146,4800"/>
78
79 Name="VCCustomBuildTool"/>
80
81 Name="VCLibrarianTool"
82 OutputFile="$(OutDir)/Bitcode.lib"/>
83
84 Name="VCMIDLTool"/>
85
86 Name="VCPostBuildEventTool"/>
87
88 Name="VCPreBuildEventTool"/>
89
90 Name="VCPreLinkEventTool"/>
91
92 Name="VCResourceCompilerTool"/>
93
94 Name="VCWebServiceProxyGeneratorTool"/>
95
96 Name="VCXMLDataGeneratorTool"/>
97
98 Name="VCManagedWrapperGeneratorTool"/>
99
100 Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
101
102
103
104
105
106
107 Name="Source Files"
108 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
109 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
110
111 Name="Reader"
112 Filter="">
113
114 RelativePath="..\..\lib\Bitcode\Reader\BitcodeReader.cpp">
115
116
117 RelativePath="..\..\lib\Bitcode\Reader\BitcodeReader.h">
118
119
120 RelativePath="..\..\lib\Bitcode\Reader\ReaderWrappers.cpp">
121
122
123
124 Name="Writer"
125 Filter="">
126
127 RelativePath="..\..\lib\Bitcode\Writer\ValueEnumerator.cpp">
128
129
130 RelativePath="..\..\lib\Bitcode\Writer\ValueEnumerator.h">
131
132
133 RelativePath="..\..\lib\Bitcode\Writer\Writer.cpp">
134
135
136
137
138 Name="Header Files"
139 Filter="h;hpp;hxx;hm;inl;inc;xsd"
140 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
141
142 RelativePath="..\..\include\llvm\Bitcode\Bitcodes.h">
143
144
145 RelativePath="..\..\include\llvm\Bitcode\BitstreamReader.h">
146
147
148 RelativePath="..\..\include\llvm\Bitcode\BitstreamWriter.h">
149
150
151 RelativePath="..\..\include\llvm\Bitcode\ReaderWriter.h">
152
153
154 RelativePath="..\..\lib\Bitcode\LLVMBitCodes.h">
155
156
157
158
159
160
107107 {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
108108 {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
109109 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
110 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
110111 {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
111112 {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
112113 EndProjectSection
116117 {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508}
117118 {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E}
118119 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}
120 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}
119121 {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
120122 {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
121123 {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
231233 {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB}
232234 {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489}
233235 {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982}
236 EndProjectSection
237 EndProject
238 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bitcode", "Bitcode\Bitcode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}"
239 ProjectSection(ProjectDependencies) = postProject
234240 EndProjectSection
235241 EndProject
236242 Global
357363 {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Debug.Build.0 = Debug|Win32
358364 {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release.ActiveCfg = Release|Win32
359365 {57249192-8E29-4D85-8B7A-FEFF1760B1DA}.Release.Build.0 = Release|Win32
366 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug.ActiveCfg = Debug|Win32
367 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Debug.Build.0 = Debug|Win32
368 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release.ActiveCfg = Release|Win32
369 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D62}.Release.Build.0 = Release|Win32
360370 EndGlobalSection
361371 GlobalSection(ExtensibilityGlobals) = postSolution
362372 EndGlobalSection