blob: 645b041ff0c5029fd338de296fdb1a1d0f5302db [file] [log] [blame]
Reid Spencere4d87aa2006-12-23 06:05:41 +00001/* A Bison parser, made by GNU Bison 2.1. */
Reid Spencer3822ff52006-11-08 06:47:33 +00002
Andrew Lenharth6353e052006-12-08 18:07:09 +00003/* Skeleton parser for Yacc-like parsing with Bison,
Reid Spencere4d87aa2006-12-23 06:05:41 +00004 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Reid Spencer3822ff52006-11-08 06:47:33 +00005
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
Reid Spencere4d87aa2006-12-23 06:05:41 +000018 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
Reid Spencer3822ff52006-11-08 06:47:33 +000020
Andrew Lenharth6353e052006-12-08 18:07:09 +000021/* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
Reid Spencer3822ff52006-11-08 06:47:33 +000025
26/* Tokens. */
27#ifndef YYTOKENTYPE
28# define YYTOKENTYPE
29 /* Put the tokens into the symbol table, so that GDB and other debuggers
30 know about them. */
31 enum yytokentype {
32 ESINT64VAL = 258,
33 EUINT64VAL = 259,
34 SINTVAL = 260,
35 UINTVAL = 261,
36 FPVAL = 262,
37 VOID = 263,
38 BOOL = 264,
Reid Spencer14310612006-12-31 05:40:51 +000039 INT8 = 265,
40 INT16 = 266,
41 INT32 = 267,
42 INT64 = 268,
43 FLOAT = 269,
44 DOUBLE = 270,
45 LABEL = 271,
46 TYPE = 272,
47 VAR_ID = 273,
48 LABELSTR = 274,
49 STRINGCONSTANT = 275,
50 IMPLEMENTATION = 276,
51 ZEROINITIALIZER = 277,
52 TRUETOK = 278,
53 FALSETOK = 279,
54 BEGINTOK = 280,
55 ENDTOK = 281,
56 DECLARE = 282,
57 DEFINE = 283,
58 GLOBAL = 284,
59 CONSTANT = 285,
60 SECTION = 286,
61 VOLATILE = 287,
62 TO = 288,
63 DOTDOTDOT = 289,
64 NULL_TOK = 290,
65 UNDEF = 291,
66 INTERNAL = 292,
67 LINKONCE = 293,
68 WEAK = 294,
69 APPENDING = 295,
70 DLLIMPORT = 296,
71 DLLEXPORT = 297,
72 EXTERN_WEAK = 298,
73 OPAQUE = 299,
74 NOT = 300,
75 EXTERNAL = 301,
76 TARGET = 302,
77 TRIPLE = 303,
78 ENDIAN = 304,
79 POINTERSIZE = 305,
80 LITTLE = 306,
81 BIG = 307,
82 ALIGN = 308,
83 DEPLIBS = 309,
84 CALL = 310,
85 TAIL = 311,
86 ASM_TOK = 312,
87 MODULE = 313,
88 SIDEEFFECT = 314,
89 CC_TOK = 315,
90 CCC_TOK = 316,
91 CSRETCC_TOK = 317,
92 FASTCC_TOK = 318,
93 COLDCC_TOK = 319,
94 X86_STDCALLCC_TOK = 320,
95 X86_FASTCALLCC_TOK = 321,
96 DATALAYOUT = 322,
97 RET = 323,
98 BR = 324,
99 SWITCH = 325,
100 INVOKE = 326,
101 UNWIND = 327,
102 UNREACHABLE = 328,
103 ADD = 329,
104 SUB = 330,
105 MUL = 331,
106 UDIV = 332,
107 SDIV = 333,
108 FDIV = 334,
109 UREM = 335,
110 SREM = 336,
111 FREM = 337,
112 AND = 338,
113 OR = 339,
114 XOR = 340,
115 ICMP = 341,
116 FCMP = 342,
117 EQ = 343,
118 NE = 344,
119 SLT = 345,
120 SGT = 346,
121 SLE = 347,
122 SGE = 348,
123 ULT = 349,
124 UGT = 350,
125 ULE = 351,
126 UGE = 352,
127 OEQ = 353,
128 ONE = 354,
129 OLT = 355,
130 OGT = 356,
131 OLE = 357,
132 OGE = 358,
133 ORD = 359,
134 UNO = 360,
135 UEQ = 361,
136 UNE = 362,
137 MALLOC = 363,
138 ALLOCA = 364,
139 FREE = 365,
140 LOAD = 366,
141 STORE = 367,
142 GETELEMENTPTR = 368,
143 TRUNC = 369,
144 ZEXT = 370,
145 SEXT = 371,
146 FPTRUNC = 372,
147 FPEXT = 373,
148 BITCAST = 374,
149 UITOFP = 375,
150 SITOFP = 376,
151 FPTOUI = 377,
152 FPTOSI = 378,
153 INTTOPTR = 379,
154 PTRTOINT = 380,
155 PHI_TOK = 381,
156 SELECT = 382,
157 SHL = 383,
158 LSHR = 384,
159 ASHR = 385,
160 VAARG = 386,
161 EXTRACTELEMENT = 387,
162 INSERTELEMENT = 388,
Reid Spencer218ded22007-01-05 17:07:23 +0000163 SHUFFLEVECTOR = 389,
164 NORETURN = 390
Reid Spencer3822ff52006-11-08 06:47:33 +0000165 };
166#endif
Reid Spencere4d87aa2006-12-23 06:05:41 +0000167/* Tokens. */
Reid Spencer3822ff52006-11-08 06:47:33 +0000168#define ESINT64VAL 258
169#define EUINT64VAL 259
170#define SINTVAL 260
171#define UINTVAL 261
172#define FPVAL 262
173#define VOID 263
174#define BOOL 264
Reid Spencer14310612006-12-31 05:40:51 +0000175#define INT8 265
176#define INT16 266
177#define INT32 267
178#define INT64 268
179#define FLOAT 269
180#define DOUBLE 270
181#define LABEL 271
182#define TYPE 272
183#define VAR_ID 273
184#define LABELSTR 274
185#define STRINGCONSTANT 275
186#define IMPLEMENTATION 276
187#define ZEROINITIALIZER 277
188#define TRUETOK 278
189#define FALSETOK 279
190#define BEGINTOK 280
191#define ENDTOK 281
192#define DECLARE 282
193#define DEFINE 283
194#define GLOBAL 284
195#define CONSTANT 285
196#define SECTION 286
197#define VOLATILE 287
198#define TO 288
199#define DOTDOTDOT 289
200#define NULL_TOK 290
201#define UNDEF 291
202#define INTERNAL 292
203#define LINKONCE 293
204#define WEAK 294
205#define APPENDING 295
206#define DLLIMPORT 296
207#define DLLEXPORT 297
208#define EXTERN_WEAK 298
209#define OPAQUE 299
210#define NOT 300
211#define EXTERNAL 301
212#define TARGET 302
213#define TRIPLE 303
214#define ENDIAN 304
215#define POINTERSIZE 305
216#define LITTLE 306
217#define BIG 307
218#define ALIGN 308
219#define DEPLIBS 309
220#define CALL 310
221#define TAIL 311
222#define ASM_TOK 312
223#define MODULE 313
224#define SIDEEFFECT 314
225#define CC_TOK 315
226#define CCC_TOK 316
227#define CSRETCC_TOK 317
228#define FASTCC_TOK 318
229#define COLDCC_TOK 319
230#define X86_STDCALLCC_TOK 320
231#define X86_FASTCALLCC_TOK 321
232#define DATALAYOUT 322
233#define RET 323
234#define BR 324
235#define SWITCH 325
236#define INVOKE 326
237#define UNWIND 327
238#define UNREACHABLE 328
239#define ADD 329
240#define SUB 330
241#define MUL 331
242#define UDIV 332
243#define SDIV 333
244#define FDIV 334
245#define UREM 335
246#define SREM 336
247#define FREM 337
248#define AND 338
249#define OR 339
250#define XOR 340
251#define ICMP 341
252#define FCMP 342
253#define EQ 343
254#define NE 344
255#define SLT 345
256#define SGT 346
257#define SLE 347
258#define SGE 348
259#define ULT 349
260#define UGT 350
261#define ULE 351
262#define UGE 352
263#define OEQ 353
264#define ONE 354
265#define OLT 355
266#define OGT 356
267#define OLE 357
268#define OGE 358
269#define ORD 359
270#define UNO 360
271#define UEQ 361
272#define UNE 362
273#define MALLOC 363
274#define ALLOCA 364
275#define FREE 365
276#define LOAD 366
277#define STORE 367
278#define GETELEMENTPTR 368
279#define TRUNC 369
280#define ZEXT 370
281#define SEXT 371
282#define FPTRUNC 372
283#define FPEXT 373
284#define BITCAST 374
285#define UITOFP 375
286#define SITOFP 376
287#define FPTOUI 377
288#define FPTOSI 378
289#define INTTOPTR 379
290#define PTRTOINT 380
291#define PHI_TOK 381
292#define SELECT 382
293#define SHL 383
294#define LSHR 384
295#define ASHR 385
296#define VAARG 386
297#define EXTRACTELEMENT 387
298#define INSERTELEMENT 388
299#define SHUFFLEVECTOR 389
Reid Spencer218ded22007-01-05 17:07:23 +0000300#define NORETURN 390
Reid Spencer3822ff52006-11-08 06:47:33 +0000301
302
303
304
Andrew Lenharth6353e052006-12-08 18:07:09 +0000305#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencer4fe16d62007-01-11 18:21:29 +0000306#line 876 "/proj/llvm/llvm-4/lib/AsmParser/llvmAsmParser.y"
Andrew Lenharth6353e052006-12-08 18:07:09 +0000307typedef union YYSTYPE {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000308 llvm::Module *ModuleVal;
309 llvm::Function *FunctionVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000310 llvm::BasicBlock *BasicBlockVal;
311 llvm::TerminatorInst *TermInstVal;
312 llvm::Instruction *InstVal;
Reid Spencera132e042006-12-03 05:46:11 +0000313 llvm::Constant *ConstVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000314
Reid Spencera132e042006-12-03 05:46:11 +0000315 const llvm::Type *PrimType;
Reid Spencer14310612006-12-31 05:40:51 +0000316 std::list<llvm::PATypeHolder> *TypeList;
Reid Spencera132e042006-12-03 05:46:11 +0000317 llvm::PATypeHolder *TypeVal;
318 llvm::Value *ValueVal;
Reid Spencera132e042006-12-03 05:46:11 +0000319 std::vector<llvm::Value*> *ValueList;
Reid Spencer14310612006-12-31 05:40:51 +0000320 llvm::ArgListType *ArgList;
321 llvm::TypeWithAttrs TypeWithAttrs;
322 llvm::TypeWithAttrsList *TypeWithAttrsList;
323 llvm::ValueRefList *ValueRefList;
324
Reid Spencer68a24bd2005-08-27 18:50:39 +0000325 // Represent the RHS of PHI node
Reid Spencera132e042006-12-03 05:46:11 +0000326 std::list<std::pair<llvm::Value*,
327 llvm::BasicBlock*> > *PHIList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000328 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
Reid Spencera132e042006-12-03 05:46:11 +0000329 std::vector<llvm::Constant*> *ConstVector;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000330
331 llvm::GlobalValue::LinkageTypes Linkage;
Reid Spencer14310612006-12-31 05:40:51 +0000332 llvm::FunctionType::ParameterAttributes ParamAttrs;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000333 int64_t SInt64Val;
334 uint64_t UInt64Val;
335 int SIntVal;
336 unsigned UIntVal;
337 double FPVal;
338 bool BoolVal;
339
340 char *StrVal; // This memory is strdup'd!
Reid Spencer1628cec2006-10-26 06:15:43 +0000341 llvm::ValID ValIDVal; // strdup'd memory maybe!
Reid Spencer68a24bd2005-08-27 18:50:39 +0000342
Reid Spencera132e042006-12-03 05:46:11 +0000343 llvm::Instruction::BinaryOps BinaryOpVal;
344 llvm::Instruction::TermOps TermOpVal;
345 llvm::Instruction::MemoryOps MemOpVal;
346 llvm::Instruction::CastOps CastOpVal;
347 llvm::Instruction::OtherOps OtherOpVal;
Reid Spencer1628cec2006-10-26 06:15:43 +0000348 llvm::Module::Endianness Endianness;
Reid Spencera132e042006-12-03 05:46:11 +0000349 llvm::ICmpInst::Predicate IPredicate;
350 llvm::FCmpInst::Predicate FPredicate;
Andrew Lenharth6353e052006-12-08 18:07:09 +0000351} YYSTYPE;
Reid Spencere4d87aa2006-12-23 06:05:41 +0000352/* Line 1447 of yacc.c. */
Reid Spencer218ded22007-01-05 17:07:23 +0000353#line 354 "llvmAsmParser.tab.h"
Reid Spencer3822ff52006-11-08 06:47:33 +0000354# define yystype YYSTYPE /* obsolescent; will be withdrawn */
355# define YYSTYPE_IS_DECLARED 1
356# define YYSTYPE_IS_TRIVIAL 1
357#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000358
359extern YYSTYPE llvmAsmlval;
Reid Spencer3822ff52006-11-08 06:47:33 +0000360
Andrew Lenharth6353e052006-12-08 18:07:09 +0000361
362