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