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