blob: b284e8cac1e06a569a367be2e4f1945fdf358052 [file] [log] [blame]
Chris Lattnercaee0dc2007-04-22 06:23:29 +00001//===- BitcodeReader.h - Internal BitcodeReader impl ------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattnercaee0dc2007-04-22 06:23:29 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This header defines the BitcodeReader class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef BITCODE_READER_H
15#define BITCODE_READER_H
16
Chandler Carrutha1514e22012-12-04 07:12:27 +000017#include "llvm/ADT/DenseMap.h"
Chris Lattner48f84872007-05-01 04:59:48 +000018#include "llvm/Bitcode/BitstreamReader.h"
Chris Lattner47f96bf2007-04-23 01:01:37 +000019#include "llvm/Bitcode/LLVMBitCodes.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000020#include "llvm/GVMaterializer.h"
Chandler Carruth0b8c9a82013-01-02 11:36:10 +000021#include "llvm/IR/Attributes.h"
22#include "llvm/IR/OperandTraits.h"
23#include "llvm/IR/Type.h"
Chris Lattner46e77402009-03-31 22:55:09 +000024#include "llvm/Support/ValueHandle.h"
Chris Lattnercaee0dc2007-04-22 06:23:29 +000025#include <vector>
26
27namespace llvm {
Chris Lattnerc453f762007-04-29 07:54:31 +000028 class MemoryBuffer;
Benjamin Kramer12ddd402009-08-11 17:45:13 +000029 class LLVMContext;
Joe Abbey170a15e2012-11-25 15:23:39 +000030
Gabor Greifefe65362008-05-10 08:32:32 +000031//===----------------------------------------------------------------------===//
32// BitcodeReaderValueList Class
33//===----------------------------------------------------------------------===//
34
Benjamin Kramer55c06ae2013-09-11 18:05:11 +000035class BitcodeReaderValueList {
Chris Lattner46e77402009-03-31 22:55:09 +000036 std::vector<WeakVH> ValuePtrs;
Joe Abbey170a15e2012-11-25 15:23:39 +000037
Chris Lattnerea693df2008-08-21 02:34:16 +000038 /// ResolveConstants - As we resolve forward-referenced constants, we add
39 /// information about them to this vector. This allows us to resolve them in
40 /// bulk instead of resolving each reference at a time. See the code in
41 /// ResolveConstantForwardRefs for more information about this.
42 ///
43 /// The key of this vector is the placeholder constant, the value is the slot
44 /// number that holds the resolved value.
45 typedef std::vector<std::pair<Constant*, unsigned> > ResolveConstantsTy;
46 ResolveConstantsTy ResolveConstants;
Chris Lattner7af453a2011-07-07 05:12:37 +000047 LLVMContext &Context;
Chris Lattner522b7b12007-04-24 05:48:56 +000048public:
Chris Lattner7af453a2011-07-07 05:12:37 +000049 BitcodeReaderValueList(LLVMContext &C) : Context(C) {}
Chris Lattnerea693df2008-08-21 02:34:16 +000050 ~BitcodeReaderValueList() {
51 assert(ResolveConstants.empty() && "Constants not resolved?");
52 }
Gabor Greifefe65362008-05-10 08:32:32 +000053
Chris Lattner522b7b12007-04-24 05:48:56 +000054 // vector compatibility methods
Chris Lattner46e77402009-03-31 22:55:09 +000055 unsigned size() const { return ValuePtrs.size(); }
56 void resize(unsigned N) { ValuePtrs.resize(N); }
Chris Lattner522b7b12007-04-24 05:48:56 +000057 void push_back(Value *V) {
Chris Lattner46e77402009-03-31 22:55:09 +000058 ValuePtrs.push_back(V);
Chris Lattner522b7b12007-04-24 05:48:56 +000059 }
Joe Abbey170a15e2012-11-25 15:23:39 +000060
Chris Lattnerb348bb82007-05-18 04:02:46 +000061 void clear() {
Chris Lattnerea693df2008-08-21 02:34:16 +000062 assert(ResolveConstants.empty() && "Constants not resolved?");
Chris Lattner46e77402009-03-31 22:55:09 +000063 ValuePtrs.clear();
Chris Lattnerb348bb82007-05-18 04:02:46 +000064 }
Joe Abbey170a15e2012-11-25 15:23:39 +000065
Chris Lattner46e77402009-03-31 22:55:09 +000066 Value *operator[](unsigned i) const {
67 assert(i < ValuePtrs.size());
68 return ValuePtrs[i];
69 }
Joe Abbey170a15e2012-11-25 15:23:39 +000070
Chris Lattner46e77402009-03-31 22:55:09 +000071 Value *back() const { return ValuePtrs.back(); }
72 void pop_back() { ValuePtrs.pop_back(); }
73 bool empty() const { return ValuePtrs.empty(); }
Chris Lattner198f34a2007-04-26 03:27:58 +000074 void shrinkTo(unsigned N) {
Chris Lattner46e77402009-03-31 22:55:09 +000075 assert(N <= size() && "Invalid shrinkTo request!");
76 ValuePtrs.resize(N);
Chris Lattner198f34a2007-04-26 03:27:58 +000077 }
Joe Abbey170a15e2012-11-25 15:23:39 +000078
Chris Lattnerdb125cf2011-07-18 04:54:35 +000079 Constant *getConstantFwdRef(unsigned Idx, Type *Ty);
80 Value *getValueFwdRef(unsigned Idx, Type *Ty);
Joe Abbey170a15e2012-11-25 15:23:39 +000081
Chris Lattner46e77402009-03-31 22:55:09 +000082 void AssignValue(Value *V, unsigned Idx);
Joe Abbey170a15e2012-11-25 15:23:39 +000083
Chris Lattnerea693df2008-08-21 02:34:16 +000084 /// ResolveConstantForwardRefs - Once all constants are read, this method bulk
85 /// resolves any forward references.
86 void ResolveConstantForwardRefs();
Chris Lattner522b7b12007-04-24 05:48:56 +000087};
Gabor Greifefe65362008-05-10 08:32:32 +000088
Devang Pateld5ac4042009-08-04 06:00:18 +000089
90//===----------------------------------------------------------------------===//
91// BitcodeReaderMDValueList Class
92//===----------------------------------------------------------------------===//
93
Benjamin Kramer55c06ae2013-09-11 18:05:11 +000094class BitcodeReaderMDValueList {
Devang Pateld5ac4042009-08-04 06:00:18 +000095 std::vector<WeakVH> MDValuePtrs;
Joe Abbey170a15e2012-11-25 15:23:39 +000096
Chris Lattner50b136d2009-10-28 05:53:48 +000097 LLVMContext &Context;
Devang Pateld5ac4042009-08-04 06:00:18 +000098public:
99 BitcodeReaderMDValueList(LLVMContext& C) : Context(C) {}
100
101 // vector compatibility methods
102 unsigned size() const { return MDValuePtrs.size(); }
103 void resize(unsigned N) { MDValuePtrs.resize(N); }
104 void push_back(Value *V) { MDValuePtrs.push_back(V); }
105 void clear() { MDValuePtrs.clear(); }
106 Value *back() const { return MDValuePtrs.back(); }
107 void pop_back() { MDValuePtrs.pop_back(); }
108 bool empty() const { return MDValuePtrs.empty(); }
Joe Abbey170a15e2012-11-25 15:23:39 +0000109
Devang Pateld5ac4042009-08-04 06:00:18 +0000110 Value *operator[](unsigned i) const {
111 assert(i < MDValuePtrs.size());
112 return MDValuePtrs[i];
113 }
Joe Abbey170a15e2012-11-25 15:23:39 +0000114
Devang Pateld5ac4042009-08-04 06:00:18 +0000115 void shrinkTo(unsigned N) {
116 assert(N <= size() && "Invalid shrinkTo request!");
117 MDValuePtrs.resize(N);
118 }
119
120 Value *getValueFwdRef(unsigned Idx);
121 void AssignValue(Value *V, unsigned Idx);
122};
123
Benjamin Kramer55c06ae2013-09-11 18:05:11 +0000124class BitcodeReader : public GVMaterializer {
Chris Lattner50b136d2009-10-28 05:53:48 +0000125 LLVMContext &Context;
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000126 Module *TheModule;
Chris Lattnerc453f762007-04-29 07:54:31 +0000127 MemoryBuffer *Buffer;
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000128 bool BufferOwned;
Derek Schuff2ea93872012-02-06 22:30:29 +0000129 OwningPtr<BitstreamReader> StreamFile;
Chris Lattner962dde32009-04-26 20:59:02 +0000130 BitstreamCursor Stream;
Derek Schuff2ea93872012-02-06 22:30:29 +0000131 DataStreamer *LazyStreamer;
132 uint64_t NextUnreadBit;
133 bool SeenValueSymbolTable;
Joe Abbey170a15e2012-11-25 15:23:39 +0000134
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000135 const char *ErrorString;
Joe Abbey170a15e2012-11-25 15:23:39 +0000136
Chris Lattner1afcace2011-07-09 17:41:24 +0000137 std::vector<Type*> TypeList;
Chris Lattner522b7b12007-04-24 05:48:56 +0000138 BitcodeReaderValueList ValueList;
Devang Pateld5ac4042009-08-04 06:00:18 +0000139 BitcodeReaderMDValueList MDValueList;
Devang Patele8e02132009-09-18 19:26:43 +0000140 SmallVector<Instruction *, 64> InstructionList;
Chad Rosiercbbb0962011-12-07 21:44:12 +0000141 SmallVector<SmallVector<uint64_t, 64>, 64> UseListRecords;
Devang Patele8e02132009-09-18 19:26:43 +0000142
Chris Lattnere16504e2007-04-24 03:30:34 +0000143 std::vector<std::pair<GlobalVariable*, unsigned> > GlobalInits;
Chris Lattner07d98b42007-04-26 02:46:40 +0000144 std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits;
Peter Collingbourne1e3037f2013-09-16 01:08:15 +0000145 std::vector<std::pair<Function*, unsigned> > FunctionPrefixes;
Joe Abbey170a15e2012-11-25 15:23:39 +0000146
Manman Ren804f0342013-09-28 00:22:27 +0000147 SmallVector<Instruction*, 64> InstsWithTBAATag;
148
Devang Patel19c87462008-09-26 22:53:05 +0000149 /// MAttributes - The set of attributes by index. Index zero in the
Chris Lattner48c85b82007-05-04 03:30:17 +0000150 /// file is for null, and is thus not represented here. As such all indices
151 /// are off by one.
Bill Wendling99faa3b2012-12-07 23:16:57 +0000152 std::vector<AttributeSet> MAttributes;
Joe Abbey170a15e2012-11-25 15:23:39 +0000153
Bill Wendlingc3ba0a82013-02-10 23:24:25 +0000154 /// \brief The set of attribute groups.
Bill Wendling04ef4be2013-02-11 22:32:29 +0000155 std::map<unsigned, AttributeSet> MAttributeGroups;
Bill Wendlingc3ba0a82013-02-10 23:24:25 +0000156
Chris Lattner980e5aa2007-05-01 05:52:21 +0000157 /// FunctionBBs - While parsing a function body, this is a list of the basic
158 /// blocks for the function.
159 std::vector<BasicBlock*> FunctionBBs;
Joe Abbey170a15e2012-11-25 15:23:39 +0000160
Chris Lattner48f84872007-05-01 04:59:48 +0000161 // When reading the module header, this list is populated with functions that
162 // have bodies later in the file.
163 std::vector<Function*> FunctionsWithBodies;
Chandler Carruth69940402007-08-04 01:51:18 +0000164
Joe Abbey170a15e2012-11-25 15:23:39 +0000165 // When intrinsic functions are encountered which require upgrading they are
Chandler Carruth69940402007-08-04 01:51:18 +0000166 // stored here with their replacement function.
167 typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap;
168 UpgradedIntrinsicMap UpgradedIntrinsics;
Dan Gohman19538d12010-07-20 21:42:28 +0000169
170 // Map the bitcode's custom MDKind ID to the Module's MDKind ID.
171 DenseMap<unsigned, unsigned> MDKindMap;
Joe Abbey170a15e2012-11-25 15:23:39 +0000172
Derek Schuff2ea93872012-02-06 22:30:29 +0000173 // Several operations happen after the module header has been read, but
174 // before function bodies are processed. This keeps track of whether
175 // we've done this yet.
176 bool SeenFirstFunctionBody;
Joe Abbey170a15e2012-11-25 15:23:39 +0000177
Chris Lattner48f84872007-05-01 04:59:48 +0000178 /// DeferredFunctionInfo - When function bodies are initially scanned, this
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000179 /// map contains info about where to find deferred function body in the
180 /// stream.
181 DenseMap<Function*, uint64_t> DeferredFunctionInfo;
Joe Abbey170a15e2012-11-25 15:23:39 +0000182
Chris Lattner50b136d2009-10-28 05:53:48 +0000183 /// BlockAddrFwdRefs - These are blockaddr references to basic blocks. These
184 /// are resolved lazily when functions are loaded.
185 typedef std::pair<unsigned, GlobalVariable*> BlockAddrRefTy;
186 DenseMap<Function*, std::vector<BlockAddrRefTy> > BlockAddrFwdRefs;
Dan Gohman9b10dfb2010-09-13 18:00:48 +0000187
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000188 /// UseRelativeIDs - Indicates that we are using a new encoding for
Jan Wen Voung7b8d9492012-10-11 21:45:16 +0000189 /// instruction operands where most operands in the current
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000190 /// FUNCTION_BLOCK are encoded relative to the instruction number,
191 /// for a more compact encoding. Some instruction operands are not
192 /// relative to the instruction ID: basic block numbers, and types.
193 /// Once the old style function blocks have been phased out, we would
194 /// not need this flag.
195 bool UseRelativeIDs;
196
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000197public:
Chris Lattner08113472009-12-29 09:01:33 +0000198 explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C)
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000199 : Context(C), TheModule(0), Buffer(buffer), BufferOwned(false),
Derek Schuff0ffe6982012-02-29 00:07:09 +0000200 LazyStreamer(0), NextUnreadBit(0), SeenValueSymbolTable(false),
201 ErrorString(0), ValueList(C), MDValueList(C),
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000202 SeenFirstFunctionBody(false), UseRelativeIDs(false) {
Derek Schuff2ea93872012-02-06 22:30:29 +0000203 }
204 explicit BitcodeReader(DataStreamer *streamer, LLVMContext &C)
205 : Context(C), TheModule(0), Buffer(0), BufferOwned(false),
Derek Schuff0ffe6982012-02-29 00:07:09 +0000206 LazyStreamer(streamer), NextUnreadBit(0), SeenValueSymbolTable(false),
207 ErrorString(0), ValueList(C), MDValueList(C),
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000208 SeenFirstFunctionBody(false), UseRelativeIDs(false) {
Chris Lattner48f84872007-05-01 04:59:48 +0000209 }
Chris Lattnerb348bb82007-05-18 04:02:46 +0000210 ~BitcodeReader() {
211 FreeState();
212 }
Rafael Espindola47f79bb2012-01-02 07:49:53 +0000213
214 void materializeForwardReferencedFunctions();
215
Chris Lattnerb348bb82007-05-18 04:02:46 +0000216 void FreeState();
Joe Abbey170a15e2012-11-25 15:23:39 +0000217
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000218 /// setBufferOwned - If this is true, the reader will destroy the MemoryBuffer
219 /// when the reader is destroyed.
220 void setBufferOwned(bool Owned) { BufferOwned = Owned; }
Joe Abbey170a15e2012-11-25 15:23:39 +0000221
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000222 virtual bool isMaterializable(const GlobalValue *GV) const;
223 virtual bool isDematerializable(const GlobalValue *GV) const;
224 virtual bool Materialize(GlobalValue *GV, std::string *ErrInfo = 0);
225 virtual bool MaterializeModule(Module *M, std::string *ErrInfo = 0);
226 virtual void Dematerialize(GlobalValue *GV);
Chris Lattnerd67c6322007-05-15 06:29:44 +0000227
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000228 bool Error(const char *Str) {
229 ErrorString = Str;
230 return true;
231 }
232 const char *getErrorString() const { return ErrorString; }
Joe Abbey170a15e2012-11-25 15:23:39 +0000233
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000234 /// @brief Main interface to parsing a bitcode buffer.
235 /// @returns true if an error occurred.
Jeffrey Yasskinf0356fe2010-01-27 20:34:15 +0000236 bool ParseBitcodeInto(Module *M);
Bill Wendling34711742010-10-06 01:22:42 +0000237
238 /// @brief Cheap mechanism to just extract module triple
239 /// @returns true if an error occurred.
240 bool ParseTriple(std::string &Triple);
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000241
242 static uint64_t decodeSignRotatedValue(uint64_t V);
243
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000244private:
Chris Lattner1afcace2011-07-09 17:41:24 +0000245 Type *getTypeByID(unsigned ID);
Chris Lattnerdb125cf2011-07-18 04:54:35 +0000246 Value *getFnValueByID(unsigned ID, Type *Ty) {
Chris Lattnercbd40f82011-07-07 05:29:18 +0000247 if (Ty && Ty->isMetadataTy())
Devang Pateld5ac4042009-08-04 06:00:18 +0000248 return MDValueList.getValueFwdRef(ID);
Chris Lattner7af453a2011-07-07 05:12:37 +0000249 return ValueList.getValueFwdRef(ID, Ty);
Chris Lattnera7c49aa2007-05-01 07:01:57 +0000250 }
Chris Lattnerf4c8e522007-05-02 05:46:45 +0000251 BasicBlock *getBasicBlock(unsigned ID) const {
252 if (ID >= FunctionBBs.size()) return 0; // Invalid ID
253 return FunctionBBs[ID];
254 }
Bill Wendling99faa3b2012-12-07 23:16:57 +0000255 AttributeSet getAttributes(unsigned i) const {
Devang Patel19c87462008-09-26 22:53:05 +0000256 if (i-1 < MAttributes.size())
257 return MAttributes[i-1];
Bill Wendling99faa3b2012-12-07 23:16:57 +0000258 return AttributeSet();
Chris Lattner48c85b82007-05-04 03:30:17 +0000259 }
Joe Abbey170a15e2012-11-25 15:23:39 +0000260
Chris Lattner7337ab92007-05-06 00:00:00 +0000261 /// getValueTypePair - Read a value/type pair out of the specified record from
262 /// slot 'Slot'. Increment Slot past the number of slots used in the record.
263 /// Return true on failure.
Craig Topper9e639e82013-07-11 16:22:38 +0000264 bool getValueTypePair(SmallVectorImpl<uint64_t> &Record, unsigned &Slot,
Chris Lattner7337ab92007-05-06 00:00:00 +0000265 unsigned InstNum, Value *&ResVal) {
266 if (Slot == Record.size()) return true;
Jeff Cohen650c9382007-05-06 03:23:14 +0000267 unsigned ValNo = (unsigned)Record[Slot++];
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000268 // Adjust the ValNo, if it was encoded relative to the InstNum.
269 if (UseRelativeIDs)
270 ValNo = InstNum - ValNo;
Chris Lattner7337ab92007-05-06 00:00:00 +0000271 if (ValNo < InstNum) {
272 // If this is not a forward reference, just return the value we already
273 // have.
274 ResVal = getFnValueByID(ValNo, 0);
275 return ResVal == 0;
276 } else if (Slot == Record.size()) {
277 return true;
278 }
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000279
Jeff Cohen650c9382007-05-06 03:23:14 +0000280 unsigned TypeNo = (unsigned)Record[Slot++];
Chris Lattner7337ab92007-05-06 00:00:00 +0000281 ResVal = getFnValueByID(ValNo, getTypeByID(TypeNo));
282 return ResVal == 0;
283 }
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000284
285 /// popValue - Read a value out of the specified record from slot 'Slot'.
286 /// Increment Slot past the number of slots used by the value in the record.
287 /// Return true if there is an error.
Craig Topper9e639e82013-07-11 16:22:38 +0000288 bool popValue(SmallVectorImpl<uint64_t> &Record, unsigned &Slot,
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000289 unsigned InstNum, Type *Ty, Value *&ResVal) {
290 if (getValue(Record, Slot, InstNum, Ty, ResVal))
291 return true;
292 // All values currently take a single record slot.
293 ++Slot;
294 return false;
295 }
296
297 /// getValue -- Like popValue, but does not increment the Slot number.
Craig Topper9e639e82013-07-11 16:22:38 +0000298 bool getValue(SmallVectorImpl<uint64_t> &Record, unsigned Slot,
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000299 unsigned InstNum, Type *Ty, Value *&ResVal) {
300 ResVal = getValue(Record, Slot, InstNum, Ty);
Chris Lattner7337ab92007-05-06 00:00:00 +0000301 return ResVal == 0;
302 }
Chris Lattner48c85b82007-05-04 03:30:17 +0000303
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000304 /// getValue -- Version of getValue that returns ResVal directly,
305 /// or 0 if there is an error.
Craig Topper9e639e82013-07-11 16:22:38 +0000306 Value *getValue(SmallVectorImpl<uint64_t> &Record, unsigned Slot,
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000307 unsigned InstNum, Type *Ty) {
308 if (Slot == Record.size()) return 0;
309 unsigned ValNo = (unsigned)Record[Slot];
310 // Adjust the ValNo, if it was encoded relative to the InstNum.
311 if (UseRelativeIDs)
312 ValNo = InstNum - ValNo;
313 return getFnValueByID(ValNo, Ty);
314 }
315
316 /// getValueSigned -- Like getValue, but decodes signed VBRs.
Craig Topper9e639e82013-07-11 16:22:38 +0000317 Value *getValueSigned(SmallVectorImpl<uint64_t> &Record, unsigned Slot,
Jan Wen Voungd9a3bad2012-10-11 20:20:40 +0000318 unsigned InstNum, Type *Ty) {
319 if (Slot == Record.size()) return 0;
320 unsigned ValNo = (unsigned)decodeSignRotatedValue(Record[Slot]);
321 // Adjust the ValNo, if it was encoded relative to the InstNum.
322 if (UseRelativeIDs)
323 ValNo = InstNum - ValNo;
324 return getFnValueByID(ValNo, Ty);
325 }
326
Tobias Grossere7bc5bb2013-07-26 04:16:55 +0000327 bool ParseAttrKind(uint64_t Code, Attribute::AttrKind *Kind);
Derek Schuff2ea93872012-02-06 22:30:29 +0000328 bool ParseModule(bool Resume);
Devang Patel05988662008-09-25 21:00:45 +0000329 bool ParseAttributeBlock();
Bill Wendlingc3ba0a82013-02-10 23:24:25 +0000330 bool ParseAttributeGroupBlock();
Chris Lattner86697142007-05-01 05:01:34 +0000331 bool ParseTypeTable();
Chris Lattner1afcace2011-07-09 17:41:24 +0000332 bool ParseTypeTableBody();
333
Chris Lattner86697142007-05-01 05:01:34 +0000334 bool ParseValueSymbolTable();
335 bool ParseConstants();
Chris Lattner980e5aa2007-05-01 05:52:21 +0000336 bool RememberAndSkipFunctionBody();
337 bool ParseFunctionBody(Function *F);
Derek Schuff2ea93872012-02-06 22:30:29 +0000338 bool GlobalCleanup();
Chris Lattner07d98b42007-04-26 02:46:40 +0000339 bool ResolveGlobalAndAliasInits();
Devang Patele54abc92009-07-22 17:43:22 +0000340 bool ParseMetadata();
Devang Patele8e02132009-09-18 19:26:43 +0000341 bool ParseMetadataAttachment();
Bill Wendling34711742010-10-06 01:22:42 +0000342 bool ParseModuleTriple(std::string &Triple);
Chad Rosiercbbb0962011-12-07 21:44:12 +0000343 bool ParseUseLists();
Derek Schuff2ea93872012-02-06 22:30:29 +0000344 bool InitStream();
345 bool InitStreamFromBuffer();
346 bool InitLazyStream();
347 bool FindFunctionInStream(Function *F,
348 DenseMap<Function*, uint64_t>::iterator DeferredFunctionInfoIterator);
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000349};
Joe Abbey170a15e2012-11-25 15:23:39 +0000350
Chris Lattnercaee0dc2007-04-22 06:23:29 +0000351} // End llvm namespace
352
353#endif