blob: 48888ac9b667ba9a7ac6d5811d7c99de3d28a38c [file] [log] [blame]
Dan Gohmanf4423b12008-04-19 00:24:39 +00001/* A Bison parser, made by GNU Bison 2.3. */
2
3/* Skeleton interface for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
22
23/* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
32
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
35
36/* Tokens. */
37#ifndef YYTOKENTYPE
38# define YYTOKENTYPE
39 /* Put the tokens into the symbol table, so that GDB and other debuggers
40 know about them. */
41 enum yytokentype {
42 ESINT64VAL = 258,
43 EUINT64VAL = 259,
44 ESAPINTVAL = 260,
45 EUAPINTVAL = 261,
46 LOCALVAL_ID = 262,
47 GLOBALVAL_ID = 263,
48 FPVAL = 264,
49 VOID = 265,
50 INTTYPE = 266,
51 FLOAT = 267,
52 DOUBLE = 268,
53 X86_FP80 = 269,
54 FP128 = 270,
55 PPC_FP128 = 271,
56 LABEL = 272,
57 TYPE = 273,
58 LOCALVAR = 274,
59 GLOBALVAR = 275,
60 LABELSTR = 276,
61 STRINGCONSTANT = 277,
62 ATSTRINGCONSTANT = 278,
63 PCTSTRINGCONSTANT = 279,
64 ZEROINITIALIZER = 280,
65 TRUETOK = 281,
66 FALSETOK = 282,
67 BEGINTOK = 283,
68 ENDTOK = 284,
69 DECLARE = 285,
70 DEFINE = 286,
71 GLOBAL = 287,
72 CONSTANT = 288,
73 SECTION = 289,
74 ALIAS = 290,
75 VOLATILE = 291,
76 THREAD_LOCAL = 292,
77 TO = 293,
78 DOTDOTDOT = 294,
79 NULL_TOK = 295,
80 UNDEF = 296,
81 INTERNAL = 297,
82 LINKONCE = 298,
83 WEAK = 299,
84 APPENDING = 300,
85 DLLIMPORT = 301,
86 DLLEXPORT = 302,
87 EXTERN_WEAK = 303,
Dale Johannesenc7071cc2008-05-14 20:13:36 +000088 COMMON = 304,
89 OPAQUE = 305,
90 EXTERNAL = 306,
91 TARGET = 307,
92 TRIPLE = 308,
93 ALIGN = 309,
94 ADDRSPACE = 310,
95 DEPLIBS = 311,
96 CALL = 312,
97 TAIL = 313,
98 ASM_TOK = 314,
99 MODULE = 315,
100 SIDEEFFECT = 316,
101 CC_TOK = 317,
102 CCC_TOK = 318,
103 FASTCC_TOK = 319,
104 COLDCC_TOK = 320,
105 X86_STDCALLCC_TOK = 321,
106 X86_FASTCALLCC_TOK = 322,
Dale Johannesendfe8c842008-09-26 19:32:34 +0000107 DATALAYOUT = 323,
108 RET = 324,
109 BR = 325,
110 SWITCH = 326,
111 INVOKE = 327,
112 UNWIND = 328,
113 UNREACHABLE = 329,
114 ADD = 330,
115 SUB = 331,
116 MUL = 332,
117 UDIV = 333,
118 SDIV = 334,
119 FDIV = 335,
120 UREM = 336,
121 SREM = 337,
122 FREM = 338,
123 AND = 339,
124 OR = 340,
125 XOR = 341,
126 SHL = 342,
127 LSHR = 343,
128 ASHR = 344,
129 ICMP = 345,
130 FCMP = 346,
131 VICMP = 347,
132 VFCMP = 348,
133 EQ = 349,
134 NE = 350,
135 SLT = 351,
136 SGT = 352,
137 SLE = 353,
138 SGE = 354,
139 ULT = 355,
140 UGT = 356,
141 ULE = 357,
142 UGE = 358,
143 OEQ = 359,
144 ONE = 360,
145 OLT = 361,
146 OGT = 362,
147 OLE = 363,
148 OGE = 364,
149 ORD = 365,
150 UNO = 366,
151 UEQ = 367,
152 UNE = 368,
153 MALLOC = 369,
154 ALLOCA = 370,
155 FREE = 371,
156 LOAD = 372,
157 STORE = 373,
158 GETELEMENTPTR = 374,
159 TRUNC = 375,
160 ZEXT = 376,
161 SEXT = 377,
162 FPTRUNC = 378,
163 FPEXT = 379,
164 BITCAST = 380,
165 UITOFP = 381,
166 SITOFP = 382,
167 FPTOUI = 383,
168 FPTOSI = 384,
169 INTTOPTR = 385,
170 PTRTOINT = 386,
171 PHI_TOK = 387,
172 SELECT = 388,
173 VAARG = 389,
174 EXTRACTELEMENT = 390,
175 INSERTELEMENT = 391,
176 SHUFFLEVECTOR = 392,
177 GETRESULT = 393,
178 EXTRACTVALUE = 394,
179 INSERTVALUE = 395,
180 SIGNEXT = 396,
181 ZEROEXT = 397,
182 NORETURN = 398,
183 INREG = 399,
184 SRET = 400,
185 NOUNWIND = 401,
186 NOALIAS = 402,
187 BYVAL = 403,
188 NEST = 404,
189 READNONE = 405,
190 READONLY = 406,
191 GC = 407,
Devang Patel2c9c3e72008-09-26 23:51:19 +0000192 OPTSIZE = 408,
193 NOINLINE = 409,
194 ALWAYSINLINE = 410,
195 DEFAULT = 411,
196 HIDDEN = 412,
197 PROTECTED = 413
Dan Gohmanf4423b12008-04-19 00:24:39 +0000198 };
199#endif
200/* Tokens. */
201#define ESINT64VAL 258
202#define EUINT64VAL 259
203#define ESAPINTVAL 260
204#define EUAPINTVAL 261
205#define LOCALVAL_ID 262
206#define GLOBALVAL_ID 263
207#define FPVAL 264
208#define VOID 265
209#define INTTYPE 266
210#define FLOAT 267
211#define DOUBLE 268
212#define X86_FP80 269
213#define FP128 270
214#define PPC_FP128 271
215#define LABEL 272
216#define TYPE 273
217#define LOCALVAR 274
218#define GLOBALVAR 275
219#define LABELSTR 276
220#define STRINGCONSTANT 277
221#define ATSTRINGCONSTANT 278
222#define PCTSTRINGCONSTANT 279
223#define ZEROINITIALIZER 280
224#define TRUETOK 281
225#define FALSETOK 282
226#define BEGINTOK 283
227#define ENDTOK 284
228#define DECLARE 285
229#define DEFINE 286
230#define GLOBAL 287
231#define CONSTANT 288
232#define SECTION 289
233#define ALIAS 290
234#define VOLATILE 291
235#define THREAD_LOCAL 292
236#define TO 293
237#define DOTDOTDOT 294
238#define NULL_TOK 295
239#define UNDEF 296
240#define INTERNAL 297
241#define LINKONCE 298
242#define WEAK 299
243#define APPENDING 300
244#define DLLIMPORT 301
245#define DLLEXPORT 302
246#define EXTERN_WEAK 303
Dale Johannesenc7071cc2008-05-14 20:13:36 +0000247#define COMMON 304
248#define OPAQUE 305
249#define EXTERNAL 306
250#define TARGET 307
251#define TRIPLE 308
252#define ALIGN 309
253#define ADDRSPACE 310
254#define DEPLIBS 311
255#define CALL 312
256#define TAIL 313
257#define ASM_TOK 314
258#define MODULE 315
259#define SIDEEFFECT 316
260#define CC_TOK 317
261#define CCC_TOK 318
262#define FASTCC_TOK 319
263#define COLDCC_TOK 320
264#define X86_STDCALLCC_TOK 321
265#define X86_FASTCALLCC_TOK 322
Dale Johannesendfe8c842008-09-26 19:32:34 +0000266#define DATALAYOUT 323
267#define RET 324
268#define BR 325
269#define SWITCH 326
270#define INVOKE 327
271#define UNWIND 328
272#define UNREACHABLE 329
273#define ADD 330
274#define SUB 331
275#define MUL 332
276#define UDIV 333
277#define SDIV 334
278#define FDIV 335
279#define UREM 336
280#define SREM 337
281#define FREM 338
282#define AND 339
283#define OR 340
284#define XOR 341
285#define SHL 342
286#define LSHR 343
287#define ASHR 344
288#define ICMP 345
289#define FCMP 346
290#define VICMP 347
291#define VFCMP 348
292#define EQ 349
293#define NE 350
294#define SLT 351
295#define SGT 352
296#define SLE 353
297#define SGE 354
298#define ULT 355
299#define UGT 356
300#define ULE 357
301#define UGE 358
302#define OEQ 359
303#define ONE 360
304#define OLT 361
305#define OGT 362
306#define OLE 363
307#define OGE 364
308#define ORD 365
309#define UNO 366
310#define UEQ 367
311#define UNE 368
312#define MALLOC 369
313#define ALLOCA 370
314#define FREE 371
315#define LOAD 372
316#define STORE 373
317#define GETELEMENTPTR 374
318#define TRUNC 375
319#define ZEXT 376
320#define SEXT 377
321#define FPTRUNC 378
322#define FPEXT 379
323#define BITCAST 380
324#define UITOFP 381
325#define SITOFP 382
326#define FPTOUI 383
327#define FPTOSI 384
328#define INTTOPTR 385
329#define PTRTOINT 386
330#define PHI_TOK 387
331#define SELECT 388
332#define VAARG 389
333#define EXTRACTELEMENT 390
334#define INSERTELEMENT 391
335#define SHUFFLEVECTOR 392
336#define GETRESULT 393
337#define EXTRACTVALUE 394
338#define INSERTVALUE 395
339#define SIGNEXT 396
340#define ZEROEXT 397
341#define NORETURN 398
342#define INREG 399
343#define SRET 400
344#define NOUNWIND 401
345#define NOALIAS 402
346#define BYVAL 403
347#define NEST 404
348#define READNONE 405
349#define READONLY 406
350#define GC 407
Devang Patel2c9c3e72008-09-26 23:51:19 +0000351#define OPTSIZE 408
352#define NOINLINE 409
353#define ALWAYSINLINE 410
354#define DEFAULT 411
355#define HIDDEN 412
356#define PROTECTED 413
Dan Gohmanf4423b12008-04-19 00:24:39 +0000357
358
359
360
361#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
362typedef union YYSTYPE
Nuno Lopesaa386d02008-11-04 14:43:20 +0000363#line 986 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
Dan Gohmanf4423b12008-04-19 00:24:39 +0000364{
Reid Spencer68a24bd2005-08-27 18:50:39 +0000365 llvm::Module *ModuleVal;
366 llvm::Function *FunctionVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000367 llvm::BasicBlock *BasicBlockVal;
368 llvm::TerminatorInst *TermInstVal;
369 llvm::Instruction *InstVal;
Reid Spencera132e042006-12-03 05:46:11 +0000370 llvm::Constant *ConstVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000371
Reid Spencera132e042006-12-03 05:46:11 +0000372 const llvm::Type *PrimType;
Reid Spencer14310612006-12-31 05:40:51 +0000373 std::list<llvm::PATypeHolder> *TypeList;
Reid Spencera132e042006-12-03 05:46:11 +0000374 llvm::PATypeHolder *TypeVal;
375 llvm::Value *ValueVal;
Reid Spencera132e042006-12-03 05:46:11 +0000376 std::vector<llvm::Value*> *ValueList;
Dan Gohman81a0c0b2008-05-31 00:58:22 +0000377 std::vector<unsigned> *ConstantList;
Reid Spencer14310612006-12-31 05:40:51 +0000378 llvm::ArgListType *ArgList;
379 llvm::TypeWithAttrs TypeWithAttrs;
380 llvm::TypeWithAttrsList *TypeWithAttrsList;
Dale Johanneseneb57ea72007-11-05 21:20:28 +0000381 llvm::ParamList *ParamList;
Reid Spencer14310612006-12-31 05:40:51 +0000382
Reid Spencer68a24bd2005-08-27 18:50:39 +0000383 // Represent the RHS of PHI node
Reid Spencera132e042006-12-03 05:46:11 +0000384 std::list<std::pair<llvm::Value*,
385 llvm::BasicBlock*> > *PHIList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000386 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
Reid Spencera132e042006-12-03 05:46:11 +0000387 std::vector<llvm::Constant*> *ConstVector;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000388
389 llvm::GlobalValue::LinkageTypes Linkage;
Anton Korobeynikov178a3522007-01-12 19:22:51 +0000390 llvm::GlobalValue::VisibilityTypes Visibility;
Devang Patel05988662008-09-25 21:00:45 +0000391 llvm::Attributes Attributes;
Reid Spencer38c91a92007-02-28 02:24:54 +0000392 llvm::APInt *APIntVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000393 int64_t SInt64Val;
394 uint64_t UInt64Val;
395 int SIntVal;
396 unsigned UIntVal;
Dale Johannesen43421b32007-09-06 18:13:44 +0000397 llvm::APFloat *FPVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000398 bool BoolVal;
399
Reid Spencer0a8a16b2007-05-22 18:52:55 +0000400 std::string *StrVal; // This memory must be deleted
401 llvm::ValID ValIDVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000402
Reid Spencera132e042006-12-03 05:46:11 +0000403 llvm::Instruction::BinaryOps BinaryOpVal;
404 llvm::Instruction::TermOps TermOpVal;
405 llvm::Instruction::MemoryOps MemOpVal;
406 llvm::Instruction::CastOps CastOpVal;
407 llvm::Instruction::OtherOps OtherOpVal;
Reid Spencera132e042006-12-03 05:46:11 +0000408 llvm::ICmpInst::Predicate IPredicate;
409 llvm::FCmpInst::Predicate FPredicate;
Dan Gohmanf4423b12008-04-19 00:24:39 +0000410}
Nuno Lopes6ec8a252008-10-15 11:11:12 +0000411/* Line 1489 of yacc.c. */
Devang Patel2c9c3e72008-09-26 23:51:19 +0000412#line 413 "llvmAsmParser.tab.h"
Dan Gohmanf4423b12008-04-19 00:24:39 +0000413 YYSTYPE;
414# define yystype YYSTYPE /* obsolescent; will be withdrawn */
415# define YYSTYPE_IS_DECLARED 1
416# define YYSTYPE_IS_TRIVIAL 1
417#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000418
419extern YYSTYPE llvmAsmlval;
Dan Gohmanf4423b12008-04-19 00:24:39 +0000420