blob: e249522172a7ffc70772b0e21e07c3c87e714fe0 [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,
39 SBYTE = 265,
40 UBYTE = 266,
41 SHORT = 267,
42 USHORT = 268,
43 INT = 269,
44 UINT = 270,
45 LONG = 271,
46 ULONG = 272,
47 FLOAT = 273,
48 DOUBLE = 274,
Reid Spencer6fd36ab2006-12-29 20:35:03 +000049 LABEL = 275,
50 TYPE = 276,
Reid Spencer3822ff52006-11-08 06:47:33 +000051 VAR_ID = 277,
52 LABELSTR = 278,
53 STRINGCONSTANT = 279,
54 IMPLEMENTATION = 280,
55 ZEROINITIALIZER = 281,
56 TRUETOK = 282,
57 FALSETOK = 283,
58 BEGINTOK = 284,
59 ENDTOK = 285,
60 DECLARE = 286,
Reid Spencer6fd36ab2006-12-29 20:35:03 +000061 DEFINE = 287,
62 GLOBAL = 288,
63 CONSTANT = 289,
64 SECTION = 290,
65 VOLATILE = 291,
66 TO = 292,
67 DOTDOTDOT = 293,
68 NULL_TOK = 294,
69 UNDEF = 295,
70 CONST = 296,
71 INTERNAL = 297,
72 LINKONCE = 298,
73 WEAK = 299,
74 APPENDING = 300,
75 DLLIMPORT = 301,
76 DLLEXPORT = 302,
77 EXTERN_WEAK = 303,
78 OPAQUE = 304,
79 NOT = 305,
80 EXTERNAL = 306,
81 TARGET = 307,
82 TRIPLE = 308,
83 ENDIAN = 309,
84 POINTERSIZE = 310,
85 LITTLE = 311,
86 BIG = 312,
87 ALIGN = 313,
88 DEPLIBS = 314,
89 CALL = 315,
90 TAIL = 316,
91 ASM_TOK = 317,
92 MODULE = 318,
93 SIDEEFFECT = 319,
94 CC_TOK = 320,
95 CCC_TOK = 321,
96 CSRETCC_TOK = 322,
97 FASTCC_TOK = 323,
98 COLDCC_TOK = 324,
99 X86_STDCALLCC_TOK = 325,
100 X86_FASTCALLCC_TOK = 326,
101 DATALAYOUT = 327,
102 RET = 328,
103 BR = 329,
104 SWITCH = 330,
105 INVOKE = 331,
106 UNWIND = 332,
107 UNREACHABLE = 333,
108 ADD = 334,
109 SUB = 335,
110 MUL = 336,
111 UDIV = 337,
112 SDIV = 338,
113 FDIV = 339,
114 UREM = 340,
115 SREM = 341,
116 FREM = 342,
117 AND = 343,
118 OR = 344,
119 XOR = 345,
120 ICMP = 346,
121 FCMP = 347,
122 EQ = 348,
123 NE = 349,
124 SLT = 350,
125 SGT = 351,
126 SLE = 352,
127 SGE = 353,
128 ULT = 354,
129 UGT = 355,
130 ULE = 356,
131 UGE = 357,
132 OEQ = 358,
133 ONE = 359,
134 OLT = 360,
135 OGT = 361,
136 OLE = 362,
137 OGE = 363,
138 ORD = 364,
139 UNO = 365,
140 UEQ = 366,
141 UNE = 367,
142 MALLOC = 368,
143 ALLOCA = 369,
144 FREE = 370,
145 LOAD = 371,
146 STORE = 372,
147 GETELEMENTPTR = 373,
148 TRUNC = 374,
149 ZEXT = 375,
150 SEXT = 376,
151 FPTRUNC = 377,
152 FPEXT = 378,
153 BITCAST = 379,
154 UITOFP = 380,
155 SITOFP = 381,
156 FPTOUI = 382,
157 FPTOSI = 383,
158 INTTOPTR = 384,
159 PTRTOINT = 385,
160 PHI_TOK = 386,
161 SELECT = 387,
162 SHL = 388,
163 LSHR = 389,
164 ASHR = 390,
165 VAARG = 391,
166 EXTRACTELEMENT = 392,
167 INSERTELEMENT = 393,
168 SHUFFLEVECTOR = 394
Reid Spencer3822ff52006-11-08 06:47:33 +0000169 };
170#endif
Reid Spencere4d87aa2006-12-23 06:05:41 +0000171/* Tokens. */
Reid Spencer3822ff52006-11-08 06:47:33 +0000172#define ESINT64VAL 258
173#define EUINT64VAL 259
174#define SINTVAL 260
175#define UINTVAL 261
176#define FPVAL 262
177#define VOID 263
178#define BOOL 264
179#define SBYTE 265
180#define UBYTE 266
181#define SHORT 267
182#define USHORT 268
183#define INT 269
184#define UINT 270
185#define LONG 271
186#define ULONG 272
187#define FLOAT 273
188#define DOUBLE 274
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000189#define LABEL 275
190#define TYPE 276
Reid Spencer3822ff52006-11-08 06:47:33 +0000191#define VAR_ID 277
192#define LABELSTR 278
193#define STRINGCONSTANT 279
194#define IMPLEMENTATION 280
195#define ZEROINITIALIZER 281
196#define TRUETOK 282
197#define FALSETOK 283
198#define BEGINTOK 284
199#define ENDTOK 285
200#define DECLARE 286
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000201#define DEFINE 287
202#define GLOBAL 288
203#define CONSTANT 289
204#define SECTION 290
205#define VOLATILE 291
206#define TO 292
207#define DOTDOTDOT 293
208#define NULL_TOK 294
209#define UNDEF 295
210#define CONST 296
211#define INTERNAL 297
212#define LINKONCE 298
213#define WEAK 299
214#define APPENDING 300
215#define DLLIMPORT 301
216#define DLLEXPORT 302
217#define EXTERN_WEAK 303
218#define OPAQUE 304
219#define NOT 305
220#define EXTERNAL 306
221#define TARGET 307
222#define TRIPLE 308
223#define ENDIAN 309
224#define POINTERSIZE 310
225#define LITTLE 311
226#define BIG 312
227#define ALIGN 313
228#define DEPLIBS 314
229#define CALL 315
230#define TAIL 316
231#define ASM_TOK 317
232#define MODULE 318
233#define SIDEEFFECT 319
234#define CC_TOK 320
235#define CCC_TOK 321
236#define CSRETCC_TOK 322
237#define FASTCC_TOK 323
238#define COLDCC_TOK 324
239#define X86_STDCALLCC_TOK 325
240#define X86_FASTCALLCC_TOK 326
241#define DATALAYOUT 327
242#define RET 328
243#define BR 329
244#define SWITCH 330
245#define INVOKE 331
246#define UNWIND 332
247#define UNREACHABLE 333
248#define ADD 334
249#define SUB 335
250#define MUL 336
251#define UDIV 337
252#define SDIV 338
253#define FDIV 339
254#define UREM 340
255#define SREM 341
256#define FREM 342
257#define AND 343
258#define OR 344
259#define XOR 345
260#define ICMP 346
261#define FCMP 347
262#define EQ 348
263#define NE 349
264#define SLT 350
265#define SGT 351
266#define SLE 352
267#define SGE 353
268#define ULT 354
269#define UGT 355
270#define ULE 356
271#define UGE 357
272#define OEQ 358
273#define ONE 359
274#define OLT 360
275#define OGT 361
276#define OLE 362
277#define OGE 363
278#define ORD 364
279#define UNO 365
280#define UEQ 366
281#define UNE 367
282#define MALLOC 368
283#define ALLOCA 369
284#define FREE 370
285#define LOAD 371
286#define STORE 372
287#define GETELEMENTPTR 373
288#define TRUNC 374
289#define ZEXT 375
290#define SEXT 376
291#define FPTRUNC 377
292#define FPEXT 378
293#define BITCAST 379
294#define UITOFP 380
295#define SITOFP 381
296#define FPTOUI 382
297#define FPTOSI 383
298#define INTTOPTR 384
299#define PTRTOINT 385
300#define PHI_TOK 386
301#define SELECT 387
302#define SHL 388
303#define LSHR 389
304#define ASHR 390
305#define VAARG 391
306#define EXTRACTELEMENT 392
307#define INSERTELEMENT 393
308#define SHUFFLEVECTOR 394
Reid Spencer3822ff52006-11-08 06:47:33 +0000309
310
311
312
Andrew Lenharth6353e052006-12-08 18:07:09 +0000313#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000314#line 855 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
Andrew Lenharth6353e052006-12-08 18:07:09 +0000315typedef union YYSTYPE {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000316 llvm::Module *ModuleVal;
317 llvm::Function *FunctionVal;
Reid Spencera132e042006-12-03 05:46:11 +0000318 std::pair<llvm::PATypeHolder*, char*> *ArgVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000319 llvm::BasicBlock *BasicBlockVal;
320 llvm::TerminatorInst *TermInstVal;
321 llvm::Instruction *InstVal;
Reid Spencera132e042006-12-03 05:46:11 +0000322 llvm::Constant *ConstVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000323
Reid Spencera132e042006-12-03 05:46:11 +0000324 const llvm::Type *PrimType;
325 llvm::PATypeHolder *TypeVal;
326 llvm::Value *ValueVal;
327
328 std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList;
329 std::vector<llvm::Value*> *ValueList;
330 std::list<llvm::PATypeHolder> *TypeList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000331 // Represent the RHS of PHI node
Reid Spencera132e042006-12-03 05:46:11 +0000332 std::list<std::pair<llvm::Value*,
333 llvm::BasicBlock*> > *PHIList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000334 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
Reid Spencera132e042006-12-03 05:46:11 +0000335 std::vector<llvm::Constant*> *ConstVector;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000336
337 llvm::GlobalValue::LinkageTypes Linkage;
338 int64_t SInt64Val;
339 uint64_t UInt64Val;
340 int SIntVal;
341 unsigned UIntVal;
342 double FPVal;
343 bool BoolVal;
344
345 char *StrVal; // This memory is strdup'd!
Reid Spencer1628cec2006-10-26 06:15:43 +0000346 llvm::ValID ValIDVal; // strdup'd memory maybe!
Reid Spencer68a24bd2005-08-27 18:50:39 +0000347
Reid Spencera132e042006-12-03 05:46:11 +0000348 llvm::Instruction::BinaryOps BinaryOpVal;
349 llvm::Instruction::TermOps TermOpVal;
350 llvm::Instruction::MemoryOps MemOpVal;
351 llvm::Instruction::CastOps CastOpVal;
352 llvm::Instruction::OtherOps OtherOpVal;
Reid Spencer1628cec2006-10-26 06:15:43 +0000353 llvm::Module::Endianness Endianness;
Reid Spencera132e042006-12-03 05:46:11 +0000354 llvm::ICmpInst::Predicate IPredicate;
355 llvm::FCmpInst::Predicate FPredicate;
Andrew Lenharth6353e052006-12-08 18:07:09 +0000356} YYSTYPE;
Reid Spencere4d87aa2006-12-23 06:05:41 +0000357/* Line 1447 of yacc.c. */
Reid Spencer6fd36ab2006-12-29 20:35:03 +0000358#line 359 "llvmAsmParser.tab.h"
Reid Spencer3822ff52006-11-08 06:47:33 +0000359# define yystype YYSTYPE /* obsolescent; will be withdrawn */
360# define YYSTYPE_IS_DECLARED 1
361# define YYSTYPE_IS_TRIVIAL 1
362#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000363
364extern YYSTYPE llvmAsmlval;
Reid Spencer3822ff52006-11-08 06:47:33 +0000365
Andrew Lenharth6353e052006-12-08 18:07:09 +0000366
367