blob: f765a2ae4e6ceba2d4b273c480785824887d14dc [file] [log] [blame]
Chris Lattnerdf986172009-01-02 07:01:27 +00001//===-- LLParser.h - Parser Class -------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the parser class for .ll files.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_ASMPARSER_LLPARSER_H
15#define LLVM_ASMPARSER_LLPARSER_H
16
17#include "LLLexer.h"
Owen Andersonfba933c2009-07-01 23:57:11 +000018#include "llvm/Module.h"
Chris Lattnerdf986172009-01-02 07:01:27 +000019#include "llvm/Type.h"
Chris Lattnerb45218f2010-04-01 05:20:21 +000020#include "llvm/ADT/DenseMap.h"
Chris Lattner56608462009-12-28 08:20:46 +000021#include "llvm/Support/ValueHandle.h"
Chris Lattnere80250e2009-12-29 21:43:58 +000022#include <map>
Chris Lattnerdf986172009-01-02 07:01:27 +000023
24namespace llvm {
25 class Module;
26 class OpaqueType;
27 class Function;
28 class Value;
29 class BasicBlock;
30 class Instruction;
31 class Constant;
32 class GlobalValue;
Nick Lewycky21cc4462009-04-04 07:22:01 +000033 class MDString;
34 class MDNode;
Chris Lattnerfdfeb692010-02-12 20:49:41 +000035 class UnionType;
Misha Brukman9ea40342009-01-02 22:46:48 +000036
Chris Lattner09d9ef42009-10-28 03:39:23 +000037 /// ValID - Represents a reference of a definition of some sort with no type.
38 /// There are several cases where we have to parse the value but where the
39 /// type can depend on later context. This may either be a numeric reference
40 /// or a symbolic (%var) reference. This is just a discriminated union.
41 struct ValID {
42 enum {
43 t_LocalID, t_GlobalID, // ID in UIntVal.
44 t_LocalName, t_GlobalName, // Name in StrVal.
45 t_APSInt, t_APFloat, // Value in APSIntVal/APFloatVal.
46 t_Null, t_Undef, t_Zero, // No value.
47 t_EmptyArray, // No value: []
48 t_Constant, // Value in ConstantVal.
49 t_InlineAsm, // Value in StrVal/StrVal2/UIntVal.
Chris Lattner287881d2009-12-30 02:11:14 +000050 t_MDNode, // Value in MDNodeVal.
51 t_MDString // Value in MDStringVal.
Chris Lattner09d9ef42009-10-28 03:39:23 +000052 } Kind;
53
54 LLLexer::LocTy Loc;
55 unsigned UIntVal;
56 std::string StrVal, StrVal2;
57 APSInt APSIntVal;
58 APFloat APFloatVal;
59 Constant *ConstantVal;
Chris Lattner287881d2009-12-30 02:11:14 +000060 MDNode *MDNodeVal;
61 MDString *MDStringVal;
Chris Lattner09d9ef42009-10-28 03:39:23 +000062 ValID() : APFloatVal(0.0) {}
63
64 bool operator<(const ValID &RHS) const {
65 if (Kind == t_LocalID || Kind == t_GlobalID)
66 return UIntVal < RHS.UIntVal;
67 assert((Kind == t_LocalName || Kind == t_GlobalName) &&
68 "Ordering not defined for this ValID kind yet");
69 return StrVal < RHS.StrVal;
70 }
71 };
72
Chris Lattnerdf986172009-01-02 07:01:27 +000073 class LLParser {
74 public:
75 typedef LLLexer::LocTy LocTy;
76 private:
Chris Lattner4ba9d9b2010-04-07 04:08:57 +000077 LLVMContext &Context;
Chris Lattnerdf986172009-01-02 07:01:27 +000078 LLLexer Lex;
79 Module *M;
Chris Lattner449c3102010-04-01 05:14:45 +000080
81 // Instruction metadata resolution. Each instruction can have a list of
82 // MDRef info associated with them.
83 struct MDRef {
84 SMLoc Loc;
85 unsigned MDKind, MDSlot;
86 };
87 DenseMap<Instruction*, std::vector<MDRef> > ForwardRefInstMetadata;
Misha Brukman9ea40342009-01-02 22:46:48 +000088
Chris Lattnerdf986172009-01-02 07:01:27 +000089 // Type resolution handling data structures.
90 std::map<std::string, std::pair<PATypeHolder, LocTy> > ForwardRefTypes;
91 std::map<unsigned, std::pair<PATypeHolder, LocTy> > ForwardRefTypeIDs;
92 std::vector<PATypeHolder> NumberedTypes;
Chris Lattner0834e6a2009-12-30 04:51:58 +000093 std::vector<TrackingVH<MDNode> > NumberedMetadata;
Chris Lattnere80250e2009-12-29 21:43:58 +000094 std::map<unsigned, std::pair<TrackingVH<MDNode>, LocTy> > ForwardRefMDNodes;
Chris Lattnerdf986172009-01-02 07:01:27 +000095 struct UpRefRecord {
96 /// Loc - This is the location of the upref.
97 LocTy Loc;
Misha Brukman9ea40342009-01-02 22:46:48 +000098
Chris Lattnerdf986172009-01-02 07:01:27 +000099 /// NestingLevel - The number of nesting levels that need to be popped
100 /// before this type is resolved.
101 unsigned NestingLevel;
Misha Brukman9ea40342009-01-02 22:46:48 +0000102
Chris Lattnerdf986172009-01-02 07:01:27 +0000103 /// LastContainedTy - This is the type at the current binding level for
104 /// the type. Every time we reduce the nesting level, this gets updated.
105 const Type *LastContainedTy;
Misha Brukman9ea40342009-01-02 22:46:48 +0000106
Chris Lattnerdf986172009-01-02 07:01:27 +0000107 /// UpRefTy - This is the actual opaque type that the upreference is
108 /// represented with.
109 OpaqueType *UpRefTy;
Misha Brukman9ea40342009-01-02 22:46:48 +0000110
Chris Lattnerdf986172009-01-02 07:01:27 +0000111 UpRefRecord(LocTy L, unsigned NL, OpaqueType *URTy)
112 : Loc(L), NestingLevel(NL), LastContainedTy((Type*)URTy),
113 UpRefTy(URTy) {}
114 };
115 std::vector<UpRefRecord> UpRefs;
116
117 // Global Value reference information.
118 std::map<std::string, std::pair<GlobalValue*, LocTy> > ForwardRefVals;
119 std::map<unsigned, std::pair<GlobalValue*, LocTy> > ForwardRefValIDs;
120 std::vector<GlobalValue*> NumberedVals;
Chris Lattner09d9ef42009-10-28 03:39:23 +0000121
122 // References to blockaddress. The key is the function ValID, the value is
123 // a list of references to blocks in that function.
124 std::map<ValID, std::vector<std::pair<ValID, GlobalValue*> > >
125 ForwardRefBlockAddresses;
126
127 Function *MallocF;
Chris Lattnerdf986172009-01-02 07:01:27 +0000128 public:
Chris Lattnereeb4a842009-07-02 23:08:13 +0000129 LLParser(MemoryBuffer *F, SourceMgr &SM, SMDiagnostic &Err, Module *m) :
Victor Hernandez13ad5aa2009-10-17 00:00:19 +0000130 Context(m->getContext()), Lex(F, SM, Err, m->getContext()),
131 M(m), MallocF(NULL) {}
Chris Lattnerad7d1e22009-01-04 20:44:11 +0000132 bool Run();
Misha Brukman9ea40342009-01-02 22:46:48 +0000133
Owen Andersonb43eae72009-07-02 17:04:01 +0000134 LLVMContext& getContext() { return Context; }
135
Chris Lattnerdf986172009-01-02 07:01:27 +0000136 private:
137
138 bool Error(LocTy L, const std::string &Msg) const {
139 return Lex.Error(L, Msg);
140 }
141 bool TokError(const std::string &Msg) const {
142 return Error(Lex.getLoc(), Msg);
143 }
Misha Brukman9ea40342009-01-02 22:46:48 +0000144
Chris Lattnerdf986172009-01-02 07:01:27 +0000145 /// GetGlobalVal - Get a value with the specified name or ID, creating a
146 /// forward reference record if needed. This can return null if the value
147 /// exists but does not have the right type.
148 GlobalValue *GetGlobalVal(const std::string &N, const Type *Ty, LocTy Loc);
149 GlobalValue *GetGlobalVal(unsigned ID, const Type *Ty, LocTy Loc);
Misha Brukman9ea40342009-01-02 22:46:48 +0000150
Chris Lattnerdf986172009-01-02 07:01:27 +0000151 // Helper Routines.
152 bool ParseToken(lltok::Kind T, const char *ErrMsg);
Chris Lattner3ed88ef2009-01-02 08:05:26 +0000153 bool EatIfPresent(lltok::Kind T) {
154 if (Lex.getKind() != T) return false;
155 Lex.Lex();
156 return true;
157 }
Chris Lattnerdf986172009-01-02 07:01:27 +0000158 bool ParseOptionalToken(lltok::Kind T, bool &Present) {
159 if (Lex.getKind() != T) {
160 Present = false;
161 } else {
162 Lex.Lex();
163 Present = true;
164 }
165 return false;
166 }
Chris Lattner3ed88ef2009-01-02 08:05:26 +0000167 bool ParseStringConstant(std::string &Result);
168 bool ParseUInt32(unsigned &Val);
169 bool ParseUInt32(unsigned &Val, LocTy &Loc) {
Chris Lattnerdf986172009-01-02 07:01:27 +0000170 Loc = Lex.getLoc();
Chris Lattner3ed88ef2009-01-02 08:05:26 +0000171 return ParseUInt32(Val);
Chris Lattnerdf986172009-01-02 07:01:27 +0000172 }
173 bool ParseOptionalAddrSpace(unsigned &AddrSpace);
174 bool ParseOptionalAttrs(unsigned &Attrs, unsigned AttrKind);
175 bool ParseOptionalLinkage(unsigned &Linkage, bool &HasLinkage);
176 bool ParseOptionalLinkage(unsigned &Linkage) {
177 bool HasLinkage; return ParseOptionalLinkage(Linkage, HasLinkage);
178 }
179 bool ParseOptionalVisibility(unsigned &Visibility);
Sandeep Patel65c3c8f2009-09-02 08:44:58 +0000180 bool ParseOptionalCallingConv(CallingConv::ID &CC);
Chris Lattnerdf986172009-01-02 07:01:27 +0000181 bool ParseOptionalAlignment(unsigned &Alignment);
Charles Davis1e063d12010-02-12 00:31:15 +0000182 bool ParseOptionalStackAlignment(unsigned &Alignment);
Chris Lattnerfe805242010-04-01 04:51:13 +0000183 bool ParseInstructionMetadata(Instruction *Inst);
Chris Lattnerc3a6c5c2009-12-30 05:44:30 +0000184 bool ParseOptionalCommaAlign(unsigned &Alignment, bool &AteExtraComma);
Chris Lattner628c13a2009-12-30 05:14:00 +0000185 bool ParseIndexList(SmallVectorImpl<unsigned> &Indices,bool &AteExtraComma);
186 bool ParseIndexList(SmallVectorImpl<unsigned> &Indices) {
187 bool AteExtraComma;
188 if (ParseIndexList(Indices, AteExtraComma)) return true;
189 if (AteExtraComma)
190 return TokError("expected index");
191 return false;
192 }
Misha Brukman9ea40342009-01-02 22:46:48 +0000193
Chris Lattnerdf986172009-01-02 07:01:27 +0000194 // Top-Level Entities
195 bool ParseTopLevelEntities();
196 bool ValidateEndOfModule();
197 bool ParseTargetDefinition();
198 bool ParseDepLibs();
199 bool ParseModuleAsm();
200 bool ParseUnnamedType();
201 bool ParseNamedType();
202 bool ParseDeclare();
203 bool ParseDefine();
Misha Brukman9ea40342009-01-02 22:46:48 +0000204
Chris Lattnerdf986172009-01-02 07:01:27 +0000205 bool ParseGlobalType(bool &IsConstant);
Dan Gohman3845e502009-08-12 23:32:33 +0000206 bool ParseUnnamedGlobal();
Chris Lattnerdf986172009-01-02 07:01:27 +0000207 bool ParseNamedGlobal();
208 bool ParseGlobal(const std::string &Name, LocTy Loc, unsigned Linkage,
209 bool HasLinkage, unsigned Visibility);
210 bool ParseAlias(const std::string &Name, LocTy Loc, unsigned Visibility);
Devang Patel923078c2009-07-01 19:21:12 +0000211 bool ParseStandaloneMetadata();
Devang Pateleff2ab62009-07-29 00:34:02 +0000212 bool ParseNamedMetadata();
Chris Lattner442ffa12009-12-29 21:53:55 +0000213 bool ParseMDString(MDString *&Result);
Chris Lattner4a72efc2009-12-30 04:15:23 +0000214 bool ParseMDNodeID(MDNode *&Result);
Chris Lattner449c3102010-04-01 05:14:45 +0000215 bool ParseMDNodeID(MDNode *&Result, unsigned &SlotNo);
Misha Brukman9ea40342009-01-02 22:46:48 +0000216
Chris Lattnerdf986172009-01-02 07:01:27 +0000217 // Type Parsing.
Chris Lattnera9a9e072009-03-09 04:49:14 +0000218 bool ParseType(PATypeHolder &Result, bool AllowVoid = false);
219 bool ParseType(PATypeHolder &Result, LocTy &Loc, bool AllowVoid = false) {
Chris Lattnerdf986172009-01-02 07:01:27 +0000220 Loc = Lex.getLoc();
Chris Lattnera9a9e072009-03-09 04:49:14 +0000221 return ParseType(Result, AllowVoid);
Chris Lattnerdf986172009-01-02 07:01:27 +0000222 }
223 bool ParseTypeRec(PATypeHolder &H);
224 bool ParseStructType(PATypeHolder &H, bool Packed);
Chris Lattnerfdfeb692010-02-12 20:49:41 +0000225 bool ParseUnionType(PATypeHolder &H);
Chris Lattnerdf986172009-01-02 07:01:27 +0000226 bool ParseArrayVectorType(PATypeHolder &H, bool isVector);
227 bool ParseFunctionType(PATypeHolder &Result);
228 PATypeHolder HandleUpRefs(const Type *Ty);
229
Chris Lattnerdf986172009-01-02 07:01:27 +0000230 // Function Semantic Analysis.
231 class PerFunctionState {
232 LLParser &P;
233 Function &F;
234 std::map<std::string, std::pair<Value*, LocTy> > ForwardRefVals;
235 std::map<unsigned, std::pair<Value*, LocTy> > ForwardRefValIDs;
236 std::vector<Value*> NumberedVals;
Chris Lattner09d9ef42009-10-28 03:39:23 +0000237
238 /// FunctionNumber - If this is an unnamed function, this is the slot
239 /// number of it, otherwise it is -1.
240 int FunctionNumber;
Chris Lattnerdf986172009-01-02 07:01:27 +0000241 public:
Chris Lattner09d9ef42009-10-28 03:39:23 +0000242 PerFunctionState(LLParser &p, Function &f, int FunctionNumber);
Chris Lattnerdf986172009-01-02 07:01:27 +0000243 ~PerFunctionState();
Misha Brukman9ea40342009-01-02 22:46:48 +0000244
Chris Lattnerdf986172009-01-02 07:01:27 +0000245 Function &getFunction() const { return F; }
Misha Brukman9ea40342009-01-02 22:46:48 +0000246
Chris Lattner09d9ef42009-10-28 03:39:23 +0000247 bool FinishFunction();
Misha Brukman9ea40342009-01-02 22:46:48 +0000248
Chris Lattnerdf986172009-01-02 07:01:27 +0000249 /// GetVal - Get a value with the specified name or ID, creating a
250 /// forward reference record if needed. This can return null if the value
251 /// exists but does not have the right type.
252 Value *GetVal(const std::string &Name, const Type *Ty, LocTy Loc);
253 Value *GetVal(unsigned ID, const Type *Ty, LocTy Loc);
Misha Brukman9ea40342009-01-02 22:46:48 +0000254
Chris Lattnerdf986172009-01-02 07:01:27 +0000255 /// SetInstName - After an instruction is parsed and inserted into its
256 /// basic block, this installs its name.
257 bool SetInstName(int NameID, const std::string &NameStr, LocTy NameLoc,
258 Instruction *Inst);
Misha Brukman9ea40342009-01-02 22:46:48 +0000259
Chris Lattnerdf986172009-01-02 07:01:27 +0000260 /// GetBB - Get a basic block with the specified name or ID, creating a
261 /// forward reference record if needed. This can return null if the value
262 /// is not a BasicBlock.
263 BasicBlock *GetBB(const std::string &Name, LocTy Loc);
264 BasicBlock *GetBB(unsigned ID, LocTy Loc);
Misha Brukman9ea40342009-01-02 22:46:48 +0000265
Chris Lattnerdf986172009-01-02 07:01:27 +0000266 /// DefineBB - Define the specified basic block, which is either named or
267 /// unnamed. If there is an error, this returns null otherwise it returns
268 /// the block being defined.
269 BasicBlock *DefineBB(const std::string &Name, LocTy Loc);
270 };
Misha Brukman9ea40342009-01-02 22:46:48 +0000271
Chris Lattnerdf986172009-01-02 07:01:27 +0000272 bool ConvertValIDToValue(const Type *Ty, ValID &ID, Value *&V,
Victor Hernandez92f238d2010-01-11 22:31:58 +0000273 PerFunctionState *PFS);
Misha Brukman9ea40342009-01-02 22:46:48 +0000274
Chris Lattnerdf986172009-01-02 07:01:27 +0000275 bool ParseValue(const Type *Ty, Value *&V, PerFunctionState &PFS);
276 bool ParseValue(const Type *Ty, Value *&V, LocTy &Loc,
277 PerFunctionState &PFS) {
278 Loc = Lex.getLoc();
279 return ParseValue(Ty, V, PFS);
280 }
Misha Brukman9ea40342009-01-02 22:46:48 +0000281
Chris Lattnerdf986172009-01-02 07:01:27 +0000282 bool ParseTypeAndValue(Value *&V, PerFunctionState &PFS);
283 bool ParseTypeAndValue(Value *&V, LocTy &Loc, PerFunctionState &PFS) {
284 Loc = Lex.getLoc();
285 return ParseTypeAndValue(V, PFS);
286 }
Chris Lattnerf9be95f2009-10-27 19:13:16 +0000287 bool ParseTypeAndBasicBlock(BasicBlock *&BB, LocTy &Loc,
288 PerFunctionState &PFS);
289 bool ParseTypeAndBasicBlock(BasicBlock *&BB, PerFunctionState &PFS) {
290 LocTy Loc;
291 return ParseTypeAndBasicBlock(BB, Loc, PFS);
292 }
Victor Hernandez19715562009-12-03 23:40:58 +0000293
Chris Lattnerfdfeb692010-02-12 20:49:41 +0000294 bool ParseUnionValue(const UnionType* utype, ValID &ID, Value *&V);
295
Chris Lattnerdf986172009-01-02 07:01:27 +0000296 struct ParamInfo {
297 LocTy Loc;
298 Value *V;
299 unsigned Attrs;
Misha Brukman9ea40342009-01-02 22:46:48 +0000300 ParamInfo(LocTy loc, Value *v, unsigned attrs)
Chris Lattnerdf986172009-01-02 07:01:27 +0000301 : Loc(loc), V(v), Attrs(attrs) {}
302 };
303 bool ParseParameterList(SmallVectorImpl<ParamInfo> &ArgList,
304 PerFunctionState &PFS);
Misha Brukman9ea40342009-01-02 22:46:48 +0000305
Victor Hernandezbf170d42010-01-05 22:22:14 +0000306 // Constant Parsing.
307 bool ParseValID(ValID &ID, PerFunctionState *PFS = NULL);
Victor Hernandezbf170d42010-01-05 22:22:14 +0000308 bool ParseGlobalValue(const Type *Ty, Constant *&V);
309 bool ParseGlobalTypeAndValue(Constant *&V);
310 bool ParseGlobalValueVector(SmallVectorImpl<Constant*> &Elts);
Dan Gohman83448032010-07-14 18:26:50 +0000311 bool ParseMetadataValue(ValID &ID, PerFunctionState *PFS);
Victor Hernandez24e64df2010-01-10 07:14:18 +0000312 bool ParseMDNodeVector(SmallVectorImpl<Value*> &, PerFunctionState *PFS);
Victor Hernandezbf170d42010-01-05 22:22:14 +0000313
Chris Lattnerdf986172009-01-02 07:01:27 +0000314 // Function Parsing.
315 struct ArgInfo {
316 LocTy Loc;
317 PATypeHolder Type;
318 unsigned Attrs;
319 std::string Name;
320 ArgInfo(LocTy L, PATypeHolder Ty, unsigned Attr, const std::string &N)
321 : Loc(L), Type(Ty), Attrs(Attr), Name(N) {}
322 };
323 bool ParseArgumentList(std::vector<ArgInfo> &ArgList,
Chris Lattnerdfd19dd2009-01-05 18:34:07 +0000324 bool &isVarArg, bool inType);
Chris Lattnerdf986172009-01-02 07:01:27 +0000325 bool ParseFunctionHeader(Function *&Fn, bool isDefine);
326 bool ParseFunctionBody(Function &Fn);
327 bool ParseBasicBlock(PerFunctionState &PFS);
Misha Brukman9ea40342009-01-02 22:46:48 +0000328
Chris Lattnerf1bc7ce2009-12-30 05:23:43 +0000329 // Instruction Parsing. Each instruction parsing routine can return with a
330 // normal result, an error result, or return having eaten an extra comma.
331 enum InstResult { InstNormal = 0, InstError = 1, InstExtraComma = 2 };
332 int ParseInstruction(Instruction *&Inst, BasicBlock *BB,
333 PerFunctionState &PFS);
Chris Lattnerdf986172009-01-02 07:01:27 +0000334 bool ParseCmpPredicate(unsigned &Pred, unsigned Opc);
Misha Brukman9ea40342009-01-02 22:46:48 +0000335
Chris Lattnerf1bc7ce2009-12-30 05:23:43 +0000336 int ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS);
Chris Lattnerdf986172009-01-02 07:01:27 +0000337 bool ParseBr(Instruction *&Inst, PerFunctionState &PFS);
338 bool ParseSwitch(Instruction *&Inst, PerFunctionState &PFS);
Chris Lattnerab21db72009-10-28 00:19:10 +0000339 bool ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS);
Chris Lattnerdf986172009-01-02 07:01:27 +0000340 bool ParseInvoke(Instruction *&Inst, PerFunctionState &PFS);
Misha Brukman9ea40342009-01-02 22:46:48 +0000341
Chris Lattnere914b592009-01-05 08:24:46 +0000342 bool ParseArithmetic(Instruction *&I, PerFunctionState &PFS, unsigned Opc,
343 unsigned OperandType);
Chris Lattnerdf986172009-01-02 07:01:27 +0000344 bool ParseLogical(Instruction *&I, PerFunctionState &PFS, unsigned Opc);
345 bool ParseCompare(Instruction *&I, PerFunctionState &PFS, unsigned Opc);
346 bool ParseCast(Instruction *&I, PerFunctionState &PFS, unsigned Opc);
347 bool ParseSelect(Instruction *&I, PerFunctionState &PFS);
Chris Lattner0088a5c2009-01-05 08:18:44 +0000348 bool ParseVA_Arg(Instruction *&I, PerFunctionState &PFS);
Chris Lattnerdf986172009-01-02 07:01:27 +0000349 bool ParseExtractElement(Instruction *&I, PerFunctionState &PFS);
350 bool ParseInsertElement(Instruction *&I, PerFunctionState &PFS);
351 bool ParseShuffleVector(Instruction *&I, PerFunctionState &PFS);
Chris Lattnera7d7f2c2009-12-30 05:27:33 +0000352 int ParsePHI(Instruction *&I, PerFunctionState &PFS);
Chris Lattnerdf986172009-01-02 07:01:27 +0000353 bool ParseCall(Instruction *&I, PerFunctionState &PFS, bool isTail);
Chris Lattnerc3a6c5c2009-12-30 05:44:30 +0000354 int ParseAlloc(Instruction *&I, PerFunctionState &PFS,
Victor Hernandez13ad5aa2009-10-17 00:00:19 +0000355 BasicBlock *BB = 0, bool isAlloca = true);
Victor Hernandez66284e02009-10-24 04:23:03 +0000356 bool ParseFree(Instruction *&I, PerFunctionState &PFS, BasicBlock *BB);
Chris Lattnerc3a6c5c2009-12-30 05:44:30 +0000357 int ParseLoad(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
358 int ParseStore(Instruction *&I, PerFunctionState &PFS, bool isVolatile);
Chris Lattnerdf986172009-01-02 07:01:27 +0000359 bool ParseGetResult(Instruction *&I, PerFunctionState &PFS);
Chris Lattnera7d7f2c2009-12-30 05:27:33 +0000360 int ParseGetElementPtr(Instruction *&I, PerFunctionState &PFS);
361 int ParseExtractValue(Instruction *&I, PerFunctionState &PFS);
362 int ParseInsertValue(Instruction *&I, PerFunctionState &PFS);
Chris Lattner09d9ef42009-10-28 03:39:23 +0000363
364 bool ResolveForwardRefBlockAddresses(Function *TheFn,
365 std::vector<std::pair<ValID, GlobalValue*> > &Refs,
366 PerFunctionState *PFS);
Chris Lattnerdf986172009-01-02 07:01:27 +0000367 };
368} // End llvm namespace
369
370#endif