blob: 46cdcc5153201354f868b35c0d7f57950c251a64 [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,
163 SHUFFLEVECTOR = 389
Reid Spencer3822ff52006-11-08 06:47:33 +0000164 };
165#endif
Reid Spencere4d87aa2006-12-23 06:05:41 +0000166/* Tokens. */
Reid Spencer3822ff52006-11-08 06:47:33 +0000167#define ESINT64VAL 258
168#define EUINT64VAL 259
169#define SINTVAL 260
170#define UINTVAL 261
171#define FPVAL 262
172#define VOID 263
173#define BOOL 264
Reid Spencer14310612006-12-31 05:40:51 +0000174#define INT8 265
175#define INT16 266
176#define INT32 267
177#define INT64 268
178#define FLOAT 269
179#define DOUBLE 270
180#define LABEL 271
181#define TYPE 272
182#define VAR_ID 273
183#define LABELSTR 274
184#define STRINGCONSTANT 275
185#define IMPLEMENTATION 276
186#define ZEROINITIALIZER 277
187#define TRUETOK 278
188#define FALSETOK 279
189#define BEGINTOK 280
190#define ENDTOK 281
191#define DECLARE 282
192#define DEFINE 283
193#define GLOBAL 284
194#define CONSTANT 285
195#define SECTION 286
196#define VOLATILE 287
197#define TO 288
198#define DOTDOTDOT 289
199#define NULL_TOK 290
200#define UNDEF 291
201#define INTERNAL 292
202#define LINKONCE 293
203#define WEAK 294
204#define APPENDING 295
205#define DLLIMPORT 296
206#define DLLEXPORT 297
207#define EXTERN_WEAK 298
208#define OPAQUE 299
209#define NOT 300
210#define EXTERNAL 301
211#define TARGET 302
212#define TRIPLE 303
213#define ENDIAN 304
214#define POINTERSIZE 305
215#define LITTLE 306
216#define BIG 307
217#define ALIGN 308
218#define DEPLIBS 309
219#define CALL 310
220#define TAIL 311
221#define ASM_TOK 312
222#define MODULE 313
223#define SIDEEFFECT 314
224#define CC_TOK 315
225#define CCC_TOK 316
226#define CSRETCC_TOK 317
227#define FASTCC_TOK 318
228#define COLDCC_TOK 319
229#define X86_STDCALLCC_TOK 320
230#define X86_FASTCALLCC_TOK 321
231#define DATALAYOUT 322
232#define RET 323
233#define BR 324
234#define SWITCH 325
235#define INVOKE 326
236#define UNWIND 327
237#define UNREACHABLE 328
238#define ADD 329
239#define SUB 330
240#define MUL 331
241#define UDIV 332
242#define SDIV 333
243#define FDIV 334
244#define UREM 335
245#define SREM 336
246#define FREM 337
247#define AND 338
248#define OR 339
249#define XOR 340
250#define ICMP 341
251#define FCMP 342
252#define EQ 343
253#define NE 344
254#define SLT 345
255#define SGT 346
256#define SLE 347
257#define SGE 348
258#define ULT 349
259#define UGT 350
260#define ULE 351
261#define UGE 352
262#define OEQ 353
263#define ONE 354
264#define OLT 355
265#define OGT 356
266#define OLE 357
267#define OGE 358
268#define ORD 359
269#define UNO 360
270#define UEQ 361
271#define UNE 362
272#define MALLOC 363
273#define ALLOCA 364
274#define FREE 365
275#define LOAD 366
276#define STORE 367
277#define GETELEMENTPTR 368
278#define TRUNC 369
279#define ZEXT 370
280#define SEXT 371
281#define FPTRUNC 372
282#define FPEXT 373
283#define BITCAST 374
284#define UITOFP 375
285#define SITOFP 376
286#define FPTOUI 377
287#define FPTOSI 378
288#define INTTOPTR 379
289#define PTRTOINT 380
290#define PHI_TOK 381
291#define SELECT 382
292#define SHL 383
293#define LSHR 384
294#define ASHR 385
295#define VAARG 386
296#define EXTRACTELEMENT 387
297#define INSERTELEMENT 388
298#define SHUFFLEVECTOR 389
Reid Spencer3822ff52006-11-08 06:47:33 +0000299
300
301
302
Andrew Lenharth6353e052006-12-08 18:07:09 +0000303#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencer14310612006-12-31 05:40:51 +0000304#line 843 "/proj/llvm/llvm-3/lib/AsmParser/llvmAsmParser.y"
Andrew Lenharth6353e052006-12-08 18:07:09 +0000305typedef union YYSTYPE {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000306 llvm::Module *ModuleVal;
307 llvm::Function *FunctionVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000308 llvm::BasicBlock *BasicBlockVal;
309 llvm::TerminatorInst *TermInstVal;
310 llvm::Instruction *InstVal;
Reid Spencera132e042006-12-03 05:46:11 +0000311 llvm::Constant *ConstVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000312
Reid Spencera132e042006-12-03 05:46:11 +0000313 const llvm::Type *PrimType;
Reid Spencer14310612006-12-31 05:40:51 +0000314 std::list<llvm::PATypeHolder> *TypeList;
Reid Spencera132e042006-12-03 05:46:11 +0000315 llvm::PATypeHolder *TypeVal;
316 llvm::Value *ValueVal;
Reid Spencera132e042006-12-03 05:46:11 +0000317 std::vector<llvm::Value*> *ValueList;
Reid Spencer14310612006-12-31 05:40:51 +0000318 llvm::ArgListType *ArgList;
319 llvm::TypeWithAttrs TypeWithAttrs;
320 llvm::TypeWithAttrsList *TypeWithAttrsList;
321 llvm::ValueRefList *ValueRefList;
322
Reid Spencer68a24bd2005-08-27 18:50:39 +0000323 // Represent the RHS of PHI node
Reid Spencera132e042006-12-03 05:46:11 +0000324 std::list<std::pair<llvm::Value*,
325 llvm::BasicBlock*> > *PHIList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000326 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
Reid Spencera132e042006-12-03 05:46:11 +0000327 std::vector<llvm::Constant*> *ConstVector;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000328
329 llvm::GlobalValue::LinkageTypes Linkage;
Reid Spencer14310612006-12-31 05:40:51 +0000330 llvm::FunctionType::ParameterAttributes ParamAttrs;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000331 int64_t SInt64Val;
332 uint64_t UInt64Val;
333 int SIntVal;
334 unsigned UIntVal;
335 double FPVal;
336 bool BoolVal;
337
338 char *StrVal; // This memory is strdup'd!
Reid Spencer1628cec2006-10-26 06:15:43 +0000339 llvm::ValID ValIDVal; // strdup'd memory maybe!
Reid Spencer68a24bd2005-08-27 18:50:39 +0000340
Reid Spencera132e042006-12-03 05:46:11 +0000341 llvm::Instruction::BinaryOps BinaryOpVal;
342 llvm::Instruction::TermOps TermOpVal;
343 llvm::Instruction::MemoryOps MemOpVal;
344 llvm::Instruction::CastOps CastOpVal;
345 llvm::Instruction::OtherOps OtherOpVal;
Reid Spencer1628cec2006-10-26 06:15:43 +0000346 llvm::Module::Endianness Endianness;
Reid Spencera132e042006-12-03 05:46:11 +0000347 llvm::ICmpInst::Predicate IPredicate;
348 llvm::FCmpInst::Predicate FPredicate;
Andrew Lenharth6353e052006-12-08 18:07:09 +0000349} YYSTYPE;
Reid Spencere4d87aa2006-12-23 06:05:41 +0000350/* Line 1447 of yacc.c. */
Reid Spencer14310612006-12-31 05:40:51 +0000351#line 352 "llvmAsmParser.tab.h"
Reid Spencer3822ff52006-11-08 06:47:33 +0000352# define yystype YYSTYPE /* obsolescent; will be withdrawn */
353# define YYSTYPE_IS_DECLARED 1
354# define YYSTYPE_IS_TRIVIAL 1
355#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000356
357extern YYSTYPE llvmAsmlval;
Reid Spencer3822ff52006-11-08 06:47:33 +0000358
Andrew Lenharth6353e052006-12-08 18:07:09 +0000359
360