blob: 6f8962b6d4e89a10c3b1f012a94306fcd6300715 [file] [log] [blame]
Chris Lattnerac161bf2009-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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_ASMPARSER_LLPARSER_H
15#define LLVM_LIB_ASMPARSER_LLPARSER_H
Chris Lattnerac161bf2009-01-02 07:01:27 +000016
17#include "LLLexer.h"
George Burgess IV278199f2016-04-12 01:05:35 +000018#include "llvm/ADT/Optional.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000019#include "llvm/ADT/StringMap.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000020#include "llvm/IR/Attributes.h"
21#include "llvm/IR/Instructions.h"
22#include "llvm/IR/Module.h"
Teresa Johnson63ee0e72018-06-26 13:56:49 +000023#include "llvm/IR/ModuleSummaryIndex.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000024#include "llvm/IR/Operator.h"
25#include "llvm/IR/Type.h"
Chandler Carruth4220e9c2014-03-04 11:17:44 +000026#include "llvm/IR/ValueHandle.h"
Chris Lattner218b22f2009-12-29 21:43:58 +000027#include <map>
Chris Lattnerac161bf2009-01-02 07:01:27 +000028
29namespace llvm {
30 class Module;
31 class OpaqueType;
32 class Function;
33 class Value;
34 class BasicBlock;
35 class Instruction;
36 class Constant;
37 class GlobalValue;
David Majnemerdad0a642014-06-27 18:19:56 +000038 class Comdat;
Nick Lewycky49f89192009-04-04 07:22:01 +000039 class MDString;
40 class MDNode;
Alex Lorenz8955f7d2015-06-23 17:10:10 +000041 struct SlotMapping;
Chris Lattnerb1ed91f2011-07-09 17:41:24 +000042 class StructType;
Misha Brukman1d9a93d2009-01-02 22:46:48 +000043
Chris Lattner3432c622009-10-28 03:39:23 +000044 /// ValID - Represents a reference of a definition of some sort with no type.
45 /// There are several cases where we have to parse the value but where the
46 /// type can depend on later context. This may either be a numeric reference
47 /// or a symbolic (%var) reference. This is just a discriminated union.
Benjamin Kramer079b96e2013-09-11 18:05:11 +000048 struct ValID {
Chris Lattner3432c622009-10-28 03:39:23 +000049 enum {
David Majnemerf0f224d2015-11-11 21:57:16 +000050 t_LocalID, t_GlobalID, // ID in UIntVal.
51 t_LocalName, t_GlobalName, // Name in StrVal.
52 t_APSInt, t_APFloat, // Value in APSIntVal/APFloatVal.
53 t_Null, t_Undef, t_Zero, t_None, // No value.
54 t_EmptyArray, // No value: []
55 t_Constant, // Value in ConstantVal.
56 t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal.
57 t_ConstantStruct, // Value in ConstantStructElts.
58 t_PackedConstantStruct // Value in ConstantStructElts.
David Blaikieadbda4b2015-08-03 20:08:41 +000059 } Kind = t_LocalID;
Michael Ilseman26ee2b82012-11-15 22:34:00 +000060
Chris Lattner3432c622009-10-28 03:39:23 +000061 LLLexer::LocTy Loc;
62 unsigned UIntVal;
Karl Schimpf44876c52015-09-03 16:18:32 +000063 FunctionType *FTy = nullptr;
Chris Lattner3432c622009-10-28 03:39:23 +000064 std::string StrVal, StrVal2;
65 APSInt APSIntVal;
David Blaikieadbda4b2015-08-03 20:08:41 +000066 APFloat APFloatVal{0.0};
Chris Lattner3432c622009-10-28 03:39:23 +000067 Constant *ConstantVal;
David Blaikieadbda4b2015-08-03 20:08:41 +000068 std::unique_ptr<Constant *[]> ConstantStructElts;
Michael Ilseman26ee2b82012-11-15 22:34:00 +000069
David Blaikieadbda4b2015-08-03 20:08:41 +000070 ValID() = default;
David Blaikie69374412015-08-03 20:30:53 +000071 ValID(const ValID &RHS)
David Blaikieadbda4b2015-08-03 20:08:41 +000072 : Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy),
David Blaikie69374412015-08-03 20:30:53 +000073 StrVal(RHS.StrVal), StrVal2(RHS.StrVal2), APSIntVal(RHS.APSIntVal),
74 APFloatVal(RHS.APFloatVal), ConstantVal(RHS.ConstantVal) {
75 assert(!RHS.ConstantStructElts);
76 }
Michael Ilseman26ee2b82012-11-15 22:34:00 +000077
Chris Lattner3432c622009-10-28 03:39:23 +000078 bool operator<(const ValID &RHS) const {
79 if (Kind == t_LocalID || Kind == t_GlobalID)
80 return UIntVal < RHS.UIntVal;
Chris Lattnerb1ed91f2011-07-09 17:41:24 +000081 assert((Kind == t_LocalName || Kind == t_GlobalName ||
Michael Ilseman26ee2b82012-11-15 22:34:00 +000082 Kind == t_ConstantStruct || Kind == t_PackedConstantStruct) &&
Chris Lattner3432c622009-10-28 03:39:23 +000083 "Ordering not defined for this ValID kind yet");
84 return StrVal < RHS.StrVal;
85 }
86 };
Michael Ilseman26ee2b82012-11-15 22:34:00 +000087
Benjamin Kramer079b96e2013-09-11 18:05:11 +000088 class LLParser {
Chris Lattnerac161bf2009-01-02 07:01:27 +000089 public:
90 typedef LLLexer::LocTy LocTy;
91 private:
Chris Lattner2e664bd2010-04-07 04:08:57 +000092 LLVMContext &Context;
Chris Lattnerac161bf2009-01-02 07:01:27 +000093 LLLexer Lex;
Teresa Johnson63ee0e72018-06-26 13:56:49 +000094 // Module being parsed, null if we are only parsing summary index.
Chris Lattnerac161bf2009-01-02 07:01:27 +000095 Module *M;
Teresa Johnson63ee0e72018-06-26 13:56:49 +000096 // Summary index being parsed, null if we are only parsing Module.
97 ModuleSummaryIndex *Index;
Alex Lorenz8955f7d2015-06-23 17:10:10 +000098 SlotMapping *Slots;
Michael Ilseman26ee2b82012-11-15 22:34:00 +000099
Chris Lattner8eff0152010-04-01 05:14:45 +0000100 // Instruction metadata resolution. Each instruction can have a list of
101 // MDRef info associated with them.
Dan Gohman7c7f13a2010-08-24 14:31:06 +0000102 //
103 // The simpler approach of just creating temporary MDNodes and then calling
104 // RAUW on them when the definition is processed doesn't work because some
105 // instruction metadata kinds, such as dbg, get stored in the IR in an
106 // "optimized" format which doesn't participate in the normal value use
107 // lists. This means that RAUW doesn't work, even on temporary MDNodes
108 // which otherwise support RAUW. Instead, we defer resolving MDNode
109 // references until the definitions have been processed.
Chris Lattner8eff0152010-04-01 05:14:45 +0000110 struct MDRef {
111 SMLoc Loc;
112 unsigned MDKind, MDSlot;
113 };
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000114
Manman Ren209b17c2013-09-28 00:22:27 +0000115 SmallVector<Instruction*, 64> InstsWithTBAATag;
116
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000117 // Type resolution handling data structures. The location is set when we
118 // have processed a use of the type but not a definition yet.
119 StringMap<std::pair<Type*, LocTy> > NamedTypes;
David Majnemer19b51052015-02-11 07:43:56 +0000120 std::map<unsigned, std::pair<Type*, LocTy> > NumberedTypes;
Michael Ilseman26ee2b82012-11-15 22:34:00 +0000121
David Majnemer19b51052015-02-11 07:43:56 +0000122 std::map<unsigned, TrackingMDNodeRef> NumberedMetadata;
Duncan P. N. Exon Smith7d823132015-01-19 21:30:18 +0000123 std::map<unsigned, std::pair<TempMDTuple, LocTy>> ForwardRefMDNodes;
Chris Lattnerac161bf2009-01-02 07:01:27 +0000124
125 // Global Value reference information.
126 std::map<std::string, std::pair<GlobalValue*, LocTy> > ForwardRefVals;
127 std::map<unsigned, std::pair<GlobalValue*, LocTy> > ForwardRefValIDs;
128 std::vector<GlobalValue*> NumberedVals;
Michael Ilseman26ee2b82012-11-15 22:34:00 +0000129
David Majnemerdad0a642014-06-27 18:19:56 +0000130 // Comdat forward reference information.
131 std::map<std::string, LocTy> ForwardRefComdats;
132
Chris Lattner3432c622009-10-28 03:39:23 +0000133 // References to blockaddress. The key is the function ValID, the value is
134 // a list of references to blocks in that function.
Duncan P. N. Exon Smith17169902014-08-19 00:13:19 +0000135 std::map<ValID, std::map<ValID, GlobalValue *>> ForwardRefBlockAddresses;
136 class PerFunctionState;
137 /// Reference to per-function state to allow basic blocks to be
138 /// forward-referenced by blockaddress instructions within the same
139 /// function.
140 PerFunctionState *BlockAddressPFS;
Michael Ilseman26ee2b82012-11-15 22:34:00 +0000141
Bill Wendling63b88192013-02-06 06:52:58 +0000142 // Attribute builder reference information.
Bill Wendlingb32b0412013-02-08 06:32:06 +0000143 std::map<Value*, std::vector<unsigned> > ForwardRefAttrGroups;
144 std::map<unsigned, AttrBuilder> NumberedAttrBuilders;
Bill Wendling63b88192013-02-06 06:52:58 +0000145
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000146 // Summary global value reference information.
147 std::map<unsigned, std::vector<std::pair<ValueInfo *, LocTy>>>
148 ForwardRefValueInfos;
149 std::map<unsigned, std::vector<std::pair<AliasSummary *, LocTy>>>
150 ForwardRefAliasees;
151 std::vector<ValueInfo> NumberedValueInfos;
152
153 // Summary type id reference information.
154 std::map<unsigned, std::vector<std::pair<GlobalValue::GUID *, LocTy>>>
155 ForwardRefTypeIds;
156
157 // Map of module ID to path.
158 std::map<unsigned, StringRef> ModuleIdMap;
159
Adrian Prantla8b2ddb2017-10-02 18:31:29 +0000160 /// Only the llvm-as tool may set this to false to bypass
161 /// UpgradeDebuginfo so it can generate broken bitcode.
162 bool UpgradeDebugInfo;
163
Yaxun Liuc00d81e2018-01-30 22:32:39 +0000164 /// DataLayout string to override that in LLVM assembly.
165 StringRef DataLayoutStr;
166
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000167 std::string SourceFileName;
168
Chris Lattnerac161bf2009-01-02 07:01:27 +0000169 public:
Alex Lorenz8955f7d2015-06-23 17:10:10 +0000170 LLParser(StringRef F, SourceMgr &SM, SMDiagnostic &Err, Module *M,
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000171 ModuleSummaryIndex *Index, LLVMContext &Context,
Yaxun Liuc00d81e2018-01-30 22:32:39 +0000172 SlotMapping *Slots = nullptr, bool UpgradeDebugInfo = true,
173 StringRef DataLayoutString = "")
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000174 : Context(Context), Lex(F, SM, Err, Context), M(M), Index(Index),
Adrian Prantla8b2ddb2017-10-02 18:31:29 +0000175 Slots(Slots), BlockAddressPFS(nullptr),
Yaxun Liuc00d81e2018-01-30 22:32:39 +0000176 UpgradeDebugInfo(UpgradeDebugInfo), DataLayoutStr(DataLayoutString) {
177 if (!DataLayoutStr.empty())
178 M->setDataLayout(DataLayoutStr);
179 }
Chris Lattnerad6f3352009-01-04 20:44:11 +0000180 bool Run();
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000181
Alex Lorenz1de2acd2015-08-21 21:32:39 +0000182 bool parseStandaloneConstantValue(Constant *&C, const SlotMapping *Slots);
Alex Lorenzd2255952015-07-17 22:07:03 +0000183
Quentin Colombetdafed5d2016-03-08 00:37:07 +0000184 bool parseTypeAtBeginning(Type *&Ty, unsigned &Read,
185 const SlotMapping *Slots);
Quentin Colombet81e72b42016-03-07 22:09:05 +0000186
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000187 LLVMContext &getContext() { return Context; }
Owen Anderson09063ce2009-07-02 17:04:01 +0000188
Chris Lattnerac161bf2009-01-02 07:01:27 +0000189 private:
190
Benjamin Kramerc7583112010-09-27 17:42:11 +0000191 bool Error(LocTy L, const Twine &Msg) const {
Chris Lattnerac161bf2009-01-02 07:01:27 +0000192 return Lex.Error(L, Msg);
193 }
Benjamin Kramerc7583112010-09-27 17:42:11 +0000194 bool TokError(const Twine &Msg) const {
Chris Lattnerac161bf2009-01-02 07:01:27 +0000195 return Error(Lex.getLoc(), Msg);
196 }
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000197
Alex Lorenz1de2acd2015-08-21 21:32:39 +0000198 /// Restore the internal name and slot mappings using the mappings that
199 /// were created at an earlier parsing stage.
200 void restoreParsingState(const SlotMapping *Slots);
201
Chris Lattnerac161bf2009-01-02 07:01:27 +0000202 /// GetGlobalVal - Get a value with the specified name or ID, creating a
203 /// forward reference record if needed. This can return null if the value
204 /// exists but does not have the right type.
Alexander Richardson6bcf2ba2018-08-23 09:25:17 +0000205 GlobalValue *GetGlobalVal(const std::string &N, Type *Ty, LocTy Loc,
206 bool IsCall);
207 GlobalValue *GetGlobalVal(unsigned ID, Type *Ty, LocTy Loc, bool IsCall);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000208
David Majnemerdad0a642014-06-27 18:19:56 +0000209 /// Get a Comdat with the specified name, creating a forward reference
210 /// record if needed.
Fangrui Song28f69c72018-07-12 02:03:53 +0000211 Comdat *getComdat(const std::string &Name, LocTy Loc);
David Majnemerdad0a642014-06-27 18:19:56 +0000212
Chris Lattnerac161bf2009-01-02 07:01:27 +0000213 // Helper Routines.
214 bool ParseToken(lltok::Kind T, const char *ErrMsg);
Chris Lattner3822f632009-01-02 08:05:26 +0000215 bool EatIfPresent(lltok::Kind T) {
216 if (Lex.getKind() != T) return false;
217 Lex.Lex();
218 return true;
219 }
Michael Ilseman92053172012-11-27 00:42:44 +0000220
221 FastMathFlags EatFastMathFlagsIfPresent() {
222 FastMathFlags FMF;
223 while (true)
224 switch (Lex.getKind()) {
Sanjay Patel629c4112017-11-06 16:27:15 +0000225 case lltok::kw_fast: FMF.setFast(); Lex.Lex(); continue;
Michael Ilseman65f14352012-12-09 21:12:04 +0000226 case lltok::kw_nnan: FMF.setNoNaNs(); Lex.Lex(); continue;
227 case lltok::kw_ninf: FMF.setNoInfs(); Lex.Lex(); continue;
228 case lltok::kw_nsz: FMF.setNoSignedZeros(); Lex.Lex(); continue;
229 case lltok::kw_arcp: FMF.setAllowReciprocal(); Lex.Lex(); continue;
Adam Nemetcd847a82017-03-28 20:11:52 +0000230 case lltok::kw_contract:
231 FMF.setAllowContract(true);
232 Lex.Lex();
233 continue;
Sanjay Patel629c4112017-11-06 16:27:15 +0000234 case lltok::kw_reassoc: FMF.setAllowReassoc(); Lex.Lex(); continue;
235 case lltok::kw_afn: FMF.setApproxFunc(); Lex.Lex(); continue;
Michael Ilseman92053172012-11-27 00:42:44 +0000236 default: return FMF;
237 }
238 return FMF;
239 }
240
Craig Topperada08572014-04-16 04:21:27 +0000241 bool ParseOptionalToken(lltok::Kind T, bool &Present,
242 LocTy *Loc = nullptr) {
Chris Lattnerac161bf2009-01-02 07:01:27 +0000243 if (Lex.getKind() != T) {
244 Present = false;
245 } else {
Rafael Espindola026d1522011-01-13 01:30:30 +0000246 if (Loc)
247 *Loc = Lex.getLoc();
Chris Lattnerac161bf2009-01-02 07:01:27 +0000248 Lex.Lex();
249 Present = true;
250 }
251 return false;
252 }
Chris Lattner3822f632009-01-02 08:05:26 +0000253 bool ParseStringConstant(std::string &Result);
254 bool ParseUInt32(unsigned &Val);
255 bool ParseUInt32(unsigned &Val, LocTy &Loc) {
Chris Lattnerac161bf2009-01-02 07:01:27 +0000256 Loc = Lex.getLoc();
Chris Lattner3822f632009-01-02 08:05:26 +0000257 return ParseUInt32(Val);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000258 }
Hal Finkelb0407ba2014-07-18 15:51:28 +0000259 bool ParseUInt64(uint64_t &Val);
260 bool ParseUInt64(uint64_t &Val, LocTy &Loc) {
261 Loc = Lex.getLoc();
262 return ParseUInt64(Val);
263 }
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000264 bool ParseFlag(unsigned &Val);
Hans Wennborgcbe34b42012-06-23 11:37:03 +0000265
Artur Pilipenko17376c42015-08-03 14:31:49 +0000266 bool ParseStringAttribute(AttrBuilder &B);
267
Hans Wennborgcbe34b42012-06-23 11:37:03 +0000268 bool ParseTLSModel(GlobalVariable::ThreadLocalMode &TLM);
269 bool ParseOptionalThreadLocal(GlobalVariable::ThreadLocalMode &TLM);
Peter Collingbourne96efdd62016-06-14 21:01:22 +0000270 bool ParseOptionalUnnamedAddr(GlobalVariable::UnnamedAddr &UnnamedAddr);
Alexander Richardson6bcf2ba2018-08-23 09:25:17 +0000271 bool ParseOptionalAddrSpace(unsigned &AddrSpace, unsigned DefaultAS = 0);
272 bool ParseOptionalProgramAddrSpace(unsigned &AddrSpace) {
273 return ParseOptionalAddrSpace(
274 AddrSpace, M->getDataLayout().getProgramAddressSpace());
275 };
Bill Wendling34c2eb22012-12-04 23:40:58 +0000276 bool ParseOptionalParamAttrs(AttrBuilder &B);
277 bool ParseOptionalReturnAttrs(AttrBuilder &B);
Fangrui Song28f69c72018-07-12 02:03:53 +0000278 bool ParseOptionalLinkage(unsigned &Res, bool &HasLinkage,
Sean Fertilec70d28b2017-10-26 15:00:26 +0000279 unsigned &Visibility, unsigned &DLLStorageClass,
280 bool &DSOLocal);
281 void ParseOptionalDSOLocal(bool &DSOLocal);
Fangrui Song28f69c72018-07-12 02:03:53 +0000282 void ParseOptionalVisibility(unsigned &Res);
283 void ParseOptionalDLLStorageClass(unsigned &Res);
Alexey Samsonov17a9cff2014-09-10 18:00:17 +0000284 bool ParseOptionalCallingConv(unsigned &CC);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000285 bool ParseOptionalAlignment(unsigned &Alignment);
Sanjoy Das31ea6d12015-04-16 20:29:50 +0000286 bool ParseOptionalDerefAttrBytes(lltok::Kind AttrKind, uint64_t &Bytes);
Konstantin Zhuravlyovbb80d3e2017-07-11 22:23:00 +0000287 bool ParseScopeAndOrdering(bool isAtomic, SyncScope::ID &SSID,
Eli Friedmanfee02c62011-07-25 23:16:38 +0000288 AtomicOrdering &Ordering);
Konstantin Zhuravlyovbb80d3e2017-07-11 22:23:00 +0000289 bool ParseScope(SyncScope::ID &SSID);
Tim Northovere94a5182014-03-11 10:48:52 +0000290 bool ParseOrdering(AtomicOrdering &Ordering);
Charles Davisbe5557e2010-02-12 00:31:15 +0000291 bool ParseOptionalStackAlignment(unsigned &Alignment);
Chris Lattnerb2f39502009-12-30 05:44:30 +0000292 bool ParseOptionalCommaAlign(unsigned &Alignment, bool &AteExtraComma);
Matt Arsenault3c1fc762017-04-10 22:27:50 +0000293 bool ParseOptionalCommaAddrSpace(unsigned &AddrSpace, LocTy &Loc,
294 bool &AteExtraComma);
Reid Kleckner436c42e2014-01-17 23:58:17 +0000295 bool ParseOptionalCommaInAlloca(bool &IsInAlloca);
Fangrui Song28f69c72018-07-12 02:03:53 +0000296 bool parseAllocSizeArguments(unsigned &BaseSizeArg,
George Burgess IV278199f2016-04-12 01:05:35 +0000297 Optional<unsigned> &HowManyArg);
298 bool ParseIndexList(SmallVectorImpl<unsigned> &Indices,
299 bool &AteExtraComma);
Chris Lattner28f1eeb2009-12-30 05:14:00 +0000300 bool ParseIndexList(SmallVectorImpl<unsigned> &Indices) {
301 bool AteExtraComma;
302 if (ParseIndexList(Indices, AteExtraComma)) return true;
303 if (AteExtraComma)
304 return TokError("expected index");
305 return false;
306 }
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000307
Chris Lattnerac161bf2009-01-02 07:01:27 +0000308 // Top-Level Entities
309 bool ParseTopLevelEntities();
310 bool ValidateEndOfModule();
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000311 bool ValidateEndOfIndex();
Chris Lattnerac161bf2009-01-02 07:01:27 +0000312 bool ParseTargetDefinition();
Chris Lattnerac161bf2009-01-02 07:01:27 +0000313 bool ParseModuleAsm();
Teresa Johnson83c517c2016-03-30 18:15:08 +0000314 bool ParseSourceFileName();
Bill Wendling706d3d62012-11-28 08:41:48 +0000315 bool ParseDepLibs(); // FIXME: Remove in 4.0.
Chris Lattnerac161bf2009-01-02 07:01:27 +0000316 bool ParseUnnamedType();
317 bool ParseNamedType();
318 bool ParseDeclare();
319 bool ParseDefine();
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000320
Chris Lattnerac161bf2009-01-02 07:01:27 +0000321 bool ParseGlobalType(bool &IsConstant);
Dan Gohman466876b2009-08-12 23:32:33 +0000322 bool ParseUnnamedGlobal();
Chris Lattnerac161bf2009-01-02 07:01:27 +0000323 bool ParseNamedGlobal();
Fangrui Song28f69c72018-07-12 02:03:53 +0000324 bool ParseGlobal(const std::string &Name, LocTy NameLoc, unsigned Linkage,
Nico Rieck7157bb72014-01-14 15:22:47 +0000325 bool HasLinkage, unsigned Visibility,
Sean Fertilec70d28b2017-10-26 15:00:26 +0000326 unsigned DLLStorageClass, bool DSOLocal,
Peter Collingbourne96efdd62016-06-14 21:01:22 +0000327 GlobalVariable::ThreadLocalMode TLM,
328 GlobalVariable::UnnamedAddr UnnamedAddr);
Fangrui Song28f69c72018-07-12 02:03:53 +0000329 bool parseIndirectSymbol(const std::string &Name, LocTy NameLoc,
330 unsigned L, unsigned Visibility,
Sean Fertilec70d28b2017-10-26 15:00:26 +0000331 unsigned DLLStorageClass, bool DSOLocal,
Dmitry Polukhina3d5b0b2016-04-05 08:47:51 +0000332 GlobalVariable::ThreadLocalMode TLM,
Peter Collingbourne96efdd62016-06-14 21:01:22 +0000333 GlobalVariable::UnnamedAddr UnnamedAddr);
David Majnemerdad0a642014-06-27 18:19:56 +0000334 bool parseComdat();
Devang Patel39e64d42009-07-01 19:21:12 +0000335 bool ParseStandaloneMetadata();
Devang Patelbe626972009-07-29 00:34:02 +0000336 bool ParseNamedMetadata();
Chris Lattner1797fc72009-12-29 21:53:55 +0000337 bool ParseMDString(MDString *&Result);
Chris Lattner6dac02a2009-12-30 04:15:23 +0000338 bool ParseMDNodeID(MDNode *&Result);
Bill Wendling63b88192013-02-06 06:52:58 +0000339 bool ParseUnnamedAttrGrp();
Bill Wendlingb32b0412013-02-08 06:32:06 +0000340 bool ParseFnAttributeValuePairs(AttrBuilder &B,
341 std::vector<unsigned> &FwdRefAttrGrps,
Michael Gottesman41748d72013-06-27 00:25:01 +0000342 bool inAttrGrp, LocTy &BuiltinLoc);
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000343
344 // Module Summary Index Parsing.
Teresa Johnson08d5b4e2018-05-26 02:34:13 +0000345 bool SkipModuleSummaryEntry();
346 bool ParseSummaryEntry();
Teresa Johnson63ee0e72018-06-26 13:56:49 +0000347 bool ParseModuleEntry(unsigned ID);
348 bool ParseModuleReference(StringRef &ModulePath);
349 bool ParseGVReference(ValueInfo &VI, unsigned &GVId);
350 bool ParseGVEntry(unsigned ID);
351 bool ParseFunctionSummary(std::string Name, GlobalValue::GUID, unsigned ID);
352 bool ParseVariableSummary(std::string Name, GlobalValue::GUID, unsigned ID);
353 bool ParseAliasSummary(std::string Name, GlobalValue::GUID, unsigned ID);
354 bool ParseGVFlags(GlobalValueSummary::GVFlags &GVFlags);
355 bool ParseOptionalFFlags(FunctionSummary::FFlags &FFlags);
356 bool ParseOptionalCalls(std::vector<FunctionSummary::EdgeTy> &Calls);
357 bool ParseHotness(CalleeInfo::HotnessType &Hotness);
358 bool ParseOptionalTypeIdInfo(FunctionSummary::TypeIdInfo &TypeIdInfo);
359 bool ParseTypeTests(std::vector<GlobalValue::GUID> &TypeTests);
360 bool ParseVFuncIdList(lltok::Kind Kind,
361 std::vector<FunctionSummary::VFuncId> &VFuncIdList);
362 bool ParseConstVCallList(
363 lltok::Kind Kind,
364 std::vector<FunctionSummary::ConstVCall> &ConstVCallList);
365 using IdToIndexMapType =
366 std::map<unsigned, std::vector<std::pair<unsigned, LocTy>>>;
367 bool ParseConstVCall(FunctionSummary::ConstVCall &ConstVCall,
368 IdToIndexMapType &IdToIndexMap, unsigned Index);
369 bool ParseVFuncId(FunctionSummary::VFuncId &VFuncId,
370 IdToIndexMapType &IdToIndexMap, unsigned Index);
371 bool ParseOptionalRefs(std::vector<ValueInfo> &Refs);
372 bool ParseTypeIdEntry(unsigned ID);
373 bool ParseTypeIdSummary(TypeIdSummary &TIS);
374 bool ParseTypeTestResolution(TypeTestResolution &TTRes);
375 bool ParseOptionalWpdResolutions(
376 std::map<uint64_t, WholeProgramDevirtResolution> &WPDResMap);
377 bool ParseWpdRes(WholeProgramDevirtResolution &WPDRes);
378 bool ParseOptionalResByArg(
379 std::map<std::vector<uint64_t>, WholeProgramDevirtResolution::ByArg>
380 &ResByArg);
381 bool ParseArgs(std::vector<uint64_t> &Args);
382 void AddGlobalValueToIndex(std::string Name, GlobalValue::GUID,
383 GlobalValue::LinkageTypes Linkage, unsigned ID,
384 std::unique_ptr<GlobalValueSummary> Summary);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000385
Chris Lattnerac161bf2009-01-02 07:01:27 +0000386 // Type Parsing.
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +0000387 bool ParseType(Type *&Result, const Twine &Msg, bool AllowVoid = false);
388 bool ParseType(Type *&Result, bool AllowVoid = false) {
389 return ParseType(Result, "expected type", AllowVoid);
390 }
391 bool ParseType(Type *&Result, const Twine &Msg, LocTy &Loc,
392 bool AllowVoid = false) {
393 Loc = Lex.getLoc();
394 return ParseType(Result, Msg, AllowVoid);
395 }
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000396 bool ParseType(Type *&Result, LocTy &Loc, bool AllowVoid = false) {
Chris Lattnerac161bf2009-01-02 07:01:27 +0000397 Loc = Lex.getLoc();
Chris Lattnerf880ca22009-03-09 04:49:14 +0000398 return ParseType(Result, AllowVoid);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000399 }
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000400 bool ParseAnonStructType(Type *&Result, bool Packed);
401 bool ParseStructBody(SmallVectorImpl<Type*> &Body);
402 bool ParseStructDefinition(SMLoc TypeLoc, StringRef Name,
403 std::pair<Type*, LocTy> &Entry,
404 Type *&ResultTy);
405
406 bool ParseArrayVectorType(Type *&Result, bool isVector);
407 bool ParseFunctionType(Type *&Result);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000408
Chris Lattnerac161bf2009-01-02 07:01:27 +0000409 // Function Semantic Analysis.
410 class PerFunctionState {
411 LLParser &P;
412 Function &F;
413 std::map<std::string, std::pair<Value*, LocTy> > ForwardRefVals;
414 std::map<unsigned, std::pair<Value*, LocTy> > ForwardRefValIDs;
415 std::vector<Value*> NumberedVals;
Michael Ilseman26ee2b82012-11-15 22:34:00 +0000416
Chris Lattner3432c622009-10-28 03:39:23 +0000417 /// FunctionNumber - If this is an unnamed function, this is the slot
418 /// number of it, otherwise it is -1.
419 int FunctionNumber;
Chris Lattnerac161bf2009-01-02 07:01:27 +0000420 public:
Fangrui Song28f69c72018-07-12 02:03:53 +0000421 PerFunctionState(LLParser &p, Function &f, int functionNumber);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000422 ~PerFunctionState();
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000423
Chris Lattnerac161bf2009-01-02 07:01:27 +0000424 Function &getFunction() const { return F; }
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000425
Chris Lattner3432c622009-10-28 03:39:23 +0000426 bool FinishFunction();
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000427
Chris Lattnerac161bf2009-01-02 07:01:27 +0000428 /// GetVal - Get a value with the specified name or ID, creating a
429 /// forward reference record if needed. This can return null if the value
430 /// exists but does not have the right type.
Alexander Richardsonc11ae182018-02-27 11:15:11 +0000431 Value *GetVal(const std::string &Name, Type *Ty, LocTy Loc, bool IsCall);
432 Value *GetVal(unsigned ID, Type *Ty, LocTy Loc, bool IsCall);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000433
Chris Lattnerac161bf2009-01-02 07:01:27 +0000434 /// SetInstName - After an instruction is parsed and inserted into its
435 /// basic block, this installs its name.
436 bool SetInstName(int NameID, const std::string &NameStr, LocTy NameLoc,
437 Instruction *Inst);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000438
Chris Lattnerac161bf2009-01-02 07:01:27 +0000439 /// GetBB - Get a basic block with the specified name or ID, creating a
440 /// forward reference record if needed. This can return null if the value
441 /// is not a BasicBlock.
442 BasicBlock *GetBB(const std::string &Name, LocTy Loc);
443 BasicBlock *GetBB(unsigned ID, LocTy Loc);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000444
Chris Lattnerac161bf2009-01-02 07:01:27 +0000445 /// DefineBB - Define the specified basic block, which is either named or
446 /// unnamed. If there is an error, this returns null otherwise it returns
447 /// the block being defined.
448 BasicBlock *DefineBB(const std::string &Name, LocTy Loc);
Duncan P. N. Exon Smith17169902014-08-19 00:13:19 +0000449
450 bool resolveForwardRefBlockAddresses();
Chris Lattnerac161bf2009-01-02 07:01:27 +0000451 };
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000452
Chris Lattner229907c2011-07-18 04:54:35 +0000453 bool ConvertValIDToValue(Type *Ty, ValID &ID, Value *&V,
Alexander Richardsonc11ae182018-02-27 11:15:11 +0000454 PerFunctionState *PFS, bool IsCall);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000455
Alexander Richardson6bcf2ba2018-08-23 09:25:17 +0000456 Value *checkValidVariableType(LocTy Loc, const Twine &Name, Type *Ty,
457 Value *Val, bool IsCall);
458
Alex Lorenzd2255952015-07-17 22:07:03 +0000459 bool parseConstantValue(Type *Ty, Constant *&C);
David Majnemer8a1c45d2015-12-12 05:38:55 +0000460 bool ParseValue(Type *Ty, Value *&V, PerFunctionState *PFS);
461 bool ParseValue(Type *Ty, Value *&V, PerFunctionState &PFS) {
462 return ParseValue(Ty, V, &PFS);
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000463 }
David Majnemer8a1c45d2015-12-12 05:38:55 +0000464
Chris Lattner229907c2011-07-18 04:54:35 +0000465 bool ParseValue(Type *Ty, Value *&V, LocTy &Loc,
Chris Lattnerac161bf2009-01-02 07:01:27 +0000466 PerFunctionState &PFS) {
467 Loc = Lex.getLoc();
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000468 return ParseValue(Ty, V, &PFS);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000469 }
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000470
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000471 bool ParseTypeAndValue(Value *&V, PerFunctionState *PFS);
472 bool ParseTypeAndValue(Value *&V, PerFunctionState &PFS) {
473 return ParseTypeAndValue(V, &PFS);
474 }
Chris Lattnerac161bf2009-01-02 07:01:27 +0000475 bool ParseTypeAndValue(Value *&V, LocTy &Loc, PerFunctionState &PFS) {
476 Loc = Lex.getLoc();
477 return ParseTypeAndValue(V, PFS);
478 }
Chris Lattner3ed871f2009-10-27 19:13:16 +0000479 bool ParseTypeAndBasicBlock(BasicBlock *&BB, LocTy &Loc,
480 PerFunctionState &PFS);
481 bool ParseTypeAndBasicBlock(BasicBlock *&BB, PerFunctionState &PFS) {
482 LocTy Loc;
483 return ParseTypeAndBasicBlock(BB, Loc, PFS);
484 }
Victor Hernandezfa232232009-12-03 23:40:58 +0000485
Chris Lattner392be582010-02-12 20:49:41 +0000486
Chris Lattnerac161bf2009-01-02 07:01:27 +0000487 struct ParamInfo {
488 LocTy Loc;
489 Value *V;
Reid Klecknerc2cb5602017-04-12 00:38:00 +0000490 AttributeSet Attrs;
491 ParamInfo(LocTy loc, Value *v, AttributeSet attrs)
Reid Klecknerb5180542017-03-21 16:57:19 +0000492 : Loc(loc), V(v), Attrs(attrs) {}
Chris Lattnerac161bf2009-01-02 07:01:27 +0000493 };
494 bool ParseParameterList(SmallVectorImpl<ParamInfo> &ArgList,
Reid Kleckner83498642014-08-26 00:33:28 +0000495 PerFunctionState &PFS,
496 bool IsMustTailCall = false,
497 bool InVarArgsFunc = false);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000498
Sanjoy Dasb513a9f2015-09-24 23:34:52 +0000499 bool
500 ParseOptionalOperandBundles(SmallVectorImpl<OperandBundleDef> &BundleList,
501 PerFunctionState &PFS);
502
David Majnemer654e1302015-07-31 17:58:14 +0000503 bool ParseExceptionArgs(SmallVectorImpl<Value *> &Args,
504 PerFunctionState &PFS);
505
Victor Hernandezdc6e65a2010-01-05 22:22:14 +0000506 // Constant Parsing.
Craig Topperada08572014-04-16 04:21:27 +0000507 bool ParseValID(ValID &ID, PerFunctionState *PFS = nullptr);
Fangrui Song28f69c72018-07-12 02:03:53 +0000508 bool ParseGlobalValue(Type *Ty, Constant *&C);
Victor Hernandezdc6e65a2010-01-05 22:22:14 +0000509 bool ParseGlobalTypeAndValue(Constant *&V);
Peter Collingbourned93620b2016-11-10 22:34:55 +0000510 bool ParseGlobalValueVector(SmallVectorImpl<Constant *> &Elts,
511 Optional<unsigned> *InRangeOp = nullptr);
Rafael Espindola83a362c2015-01-06 22:55:16 +0000512 bool parseOptionalComdat(StringRef GlobalName, Comdat *&C);
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +0000513 bool ParseMetadataAsValue(Value *&V, PerFunctionState &PFS);
Duncan P. N. Exon Smith19fc5ed2015-02-13 01:26:47 +0000514 bool ParseValueAsMetadata(Metadata *&MD, const Twine &TypeMsg,
515 PerFunctionState *PFS);
Duncan P. N. Exon Smith5bf8fef2014-12-09 18:38:53 +0000516 bool ParseMetadata(Metadata *&MD, PerFunctionState *PFS);
Duncan P. N. Exon Smith58ef9d12015-01-12 21:23:11 +0000517 bool ParseMDTuple(MDNode *&MD, bool IsDistinct = false);
Fangrui Song28f69c72018-07-12 02:03:53 +0000518 bool ParseMDNode(MDNode *&N);
519 bool ParseMDNodeTail(MDNode *&N);
520 bool ParseMDNodeVector(SmallVectorImpl<Metadata *> &Elts);
Duncan P. N. Exon Smith19717ea2015-04-24 21:21:57 +0000521 bool ParseMetadataAttachment(unsigned &Kind, MDNode *&MD);
Duncan P. N. Exon Smith27d702c2015-04-24 21:29:36 +0000522 bool ParseInstructionMetadata(Instruction &Inst);
Peter Collingbournecceae7f2016-05-31 23:01:54 +0000523 bool ParseGlobalObjectMetadataAttachment(GlobalObject &GO);
Duncan P. N. Exon Smith3d4cd752015-04-24 22:04:41 +0000524 bool ParseOptionalFunctionMetadata(Function &F);
Victor Hernandezdc6e65a2010-01-05 22:22:14 +0000525
Duncan P. N. Exon Smith077c0312015-02-04 22:05:21 +0000526 template <class FieldTy>
527 bool ParseMDField(LocTy Loc, StringRef Name, FieldTy &Result);
Duncan P. N. Exon Smitha7477282015-01-20 02:42:29 +0000528 template <class FieldTy> bool ParseMDField(StringRef Name, FieldTy &Result);
Duncan P. N. Exon Smith13890af2015-01-19 23:32:36 +0000529 template <class ParserTy>
Duncan P. N. Exon Smith66ca92e2015-01-19 23:39:32 +0000530 bool ParseMDFieldsImplBody(ParserTy parseField);
531 template <class ParserTy>
Duncan P. N. Exon Smith13890af2015-01-19 23:32:36 +0000532 bool ParseMDFieldsImpl(ParserTy parseField, LocTy &ClosingLoc);
Duncan P. N. Exon Smith6a484832015-01-13 21:10:44 +0000533 bool ParseSpecializedMDNode(MDNode *&N, bool IsDistinct = false);
Duncan P. N. Exon Smithed458fa2015-02-10 01:08:16 +0000534
535#define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) \
536 bool Parse##CLASS(MDNode *&Result, bool IsDistinct);
537#include "llvm/IR/Metadata.def"
Duncan P. N. Exon Smith6a484832015-01-13 21:10:44 +0000538
Chris Lattnerac161bf2009-01-02 07:01:27 +0000539 // Function Parsing.
540 struct ArgInfo {
541 LocTy Loc;
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000542 Type *Ty;
Reid Klecknerc2cb5602017-04-12 00:38:00 +0000543 AttributeSet Attrs;
Chris Lattnerac161bf2009-01-02 07:01:27 +0000544 std::string Name;
Reid Klecknerc2cb5602017-04-12 00:38:00 +0000545 ArgInfo(LocTy L, Type *ty, AttributeSet Attr, const std::string &N)
Reid Klecknerb5180542017-03-21 16:57:19 +0000546 : Loc(L), Ty(ty), Attrs(Attr), Name(N) {}
Chris Lattnerac161bf2009-01-02 07:01:27 +0000547 };
Chris Lattnerb1ed91f2011-07-09 17:41:24 +0000548 bool ParseArgumentList(SmallVectorImpl<ArgInfo> &ArgList, bool &isVarArg);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000549 bool ParseFunctionHeader(Function *&Fn, bool isDefine);
550 bool ParseFunctionBody(Function &Fn);
551 bool ParseBasicBlock(PerFunctionState &PFS);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000552
Reid Kleckner5772b772014-04-24 20:14:34 +0000553 enum TailCallType { TCT_None, TCT_Tail, TCT_MustTail };
554
Chris Lattner77b89dc2009-12-30 05:23:43 +0000555 // Instruction Parsing. Each instruction parsing routine can return with a
556 // normal result, an error result, or return having eaten an extra comma.
557 enum InstResult { InstNormal = 0, InstError = 1, InstExtraComma = 2 };
558 int ParseInstruction(Instruction *&Inst, BasicBlock *BB,
559 PerFunctionState &PFS);
Fangrui Song28f69c72018-07-12 02:03:53 +0000560 bool ParseCmpPredicate(unsigned &P, unsigned Opc);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000561
Chris Lattner33de4272011-06-17 06:49:41 +0000562 bool ParseRet(Instruction *&Inst, BasicBlock *BB, PerFunctionState &PFS);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000563 bool ParseBr(Instruction *&Inst, PerFunctionState &PFS);
564 bool ParseSwitch(Instruction *&Inst, PerFunctionState &PFS);
Chris Lattnerd04cb6d2009-10-28 00:19:10 +0000565 bool ParseIndirectBr(Instruction *&Inst, PerFunctionState &PFS);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000566 bool ParseInvoke(Instruction *&Inst, PerFunctionState &PFS);
Bill Wendlingf891bf82011-07-31 06:30:59 +0000567 bool ParseResume(Instruction *&Inst, PerFunctionState &PFS);
David Majnemer654e1302015-07-31 17:58:14 +0000568 bool ParseCleanupRet(Instruction *&Inst, PerFunctionState &PFS);
569 bool ParseCatchRet(Instruction *&Inst, PerFunctionState &PFS);
David Majnemer8a1c45d2015-12-12 05:38:55 +0000570 bool ParseCatchSwitch(Instruction *&Inst, PerFunctionState &PFS);
David Majnemer654e1302015-07-31 17:58:14 +0000571 bool ParseCatchPad(Instruction *&Inst, PerFunctionState &PFS);
David Majnemer654e1302015-07-31 17:58:14 +0000572 bool ParseCleanupPad(Instruction *&Inst, PerFunctionState &PFS);
Misha Brukman1d9a93d2009-01-02 22:46:48 +0000573
Cameron McInallycbde0d92018-11-13 18:15:47 +0000574 bool ParseUnaryOp(Instruction *&Inst, PerFunctionState &PFS, unsigned Opc,
575 unsigned OperandType);
Fangrui Song28f69c72018-07-12 02:03:53 +0000576 bool ParseArithmetic(Instruction *&Inst, PerFunctionState &PFS, unsigned Opc,
Chris Lattnereeefa9a2009-01-05 08:24:46 +0000577 unsigned OperandType);
Fangrui Song28f69c72018-07-12 02:03:53 +0000578 bool ParseLogical(Instruction *&Inst, PerFunctionState &PFS, unsigned Opc);
579 bool ParseCompare(Instruction *&Inst, PerFunctionState &PFS, unsigned Opc);
580 bool ParseCast(Instruction *&Inst, PerFunctionState &PFS, unsigned Opc);
581 bool ParseSelect(Instruction *&Inst, PerFunctionState &PFS);
582 bool ParseVA_Arg(Instruction *&Inst, PerFunctionState &PFS);
583 bool ParseExtractElement(Instruction *&Inst, PerFunctionState &PFS);
584 bool ParseInsertElement(Instruction *&Inst, PerFunctionState &PFS);
585 bool ParseShuffleVector(Instruction *&Inst, PerFunctionState &PFS);
586 int ParsePHI(Instruction *&Inst, PerFunctionState &PFS);
587 bool ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS);
588 bool ParseCall(Instruction *&Inst, PerFunctionState &PFS,
589 CallInst::TailCallKind TCK);
590 int ParseAlloc(Instruction *&Inst, PerFunctionState &PFS);
591 int ParseLoad(Instruction *&Inst, PerFunctionState &PFS);
592 int ParseStore(Instruction *&Inst, PerFunctionState &PFS);
593 int ParseCmpXchg(Instruction *&Inst, PerFunctionState &PFS);
594 int ParseAtomicRMW(Instruction *&Inst, PerFunctionState &PFS);
595 int ParseFence(Instruction *&Inst, PerFunctionState &PFS);
596 int ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS);
597 int ParseExtractValue(Instruction *&Inst, PerFunctionState &PFS);
598 int ParseInsertValue(Instruction *&Inst, PerFunctionState &PFS);
Duncan P. N. Exon Smith0a448fb2014-08-19 21:30:15 +0000599
600 // Use-list order directives.
601 bool ParseUseListOrder(PerFunctionState *PFS = nullptr);
602 bool ParseUseListOrderBB();
603 bool ParseUseListOrderIndexes(SmallVectorImpl<unsigned> &Indexes);
604 bool sortUseListOrder(Value *V, ArrayRef<unsigned> Indexes, SMLoc Loc);
Chris Lattnerac161bf2009-01-02 07:01:27 +0000605 };
Alexander Kornienkof00654e2015-06-23 09:49:53 +0000606} // End llvm namespace
Chris Lattnerac161bf2009-01-02 07:01:27 +0000607
608#endif