blob: 1346dec4adbc8a28f10a5224800a717caa490037 [file] [log] [blame]
Reid Spencer9c9b63a2007-04-28 16:07:31 +00001/* A Bison parser, made by GNU Bison 2.1. */
Anton Korobeynikov38e09802007-04-28 13:48:45 +00002
Reid Spencer9c9b63a2007-04-28 16:07:31 +00003/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Anton Korobeynikov38e09802007-04-28 13:48:45 +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
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
20
Reid Spencer9c9b63a2007-04-28 16:07:31 +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. */
Anton Korobeynikov38e09802007-04-28 13:48:45 +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 ESAPINTVAL = 260,
35 EUAPINTVAL = 261,
36 LOCALVAL_ID = 262,
37 GLOBALVAL_ID = 263,
38 FPVAL = 264,
39 VOID = 265,
40 INTTYPE = 266,
41 FLOAT = 267,
42 DOUBLE = 268,
43 LABEL = 269,
44 TYPE = 270,
45 LOCALVAR = 271,
46 GLOBALVAR = 272,
47 LABELSTR = 273,
48 STRINGCONSTANT = 274,
49 ATSTRINGCONSTANT = 275,
50 ZEROINITIALIZER = 276,
51 TRUETOK = 277,
52 FALSETOK = 278,
53 BEGINTOK = 279,
54 ENDTOK = 280,
55 DECLARE = 281,
56 DEFINE = 282,
57 GLOBAL = 283,
58 CONSTANT = 284,
59 SECTION = 285,
60 ALIAS = 286,
61 VOLATILE = 287,
62 THREAD_LOCAL = 288,
63 TO = 289,
64 DOTDOTDOT = 290,
65 NULL_TOK = 291,
66 UNDEF = 292,
67 INTERNAL = 293,
68 LINKONCE = 294,
69 WEAK = 295,
70 APPENDING = 296,
71 DLLIMPORT = 297,
72 DLLEXPORT = 298,
73 EXTERN_WEAK = 299,
74 OPAQUE = 300,
75 EXTERNAL = 301,
76 TARGET = 302,
77 TRIPLE = 303,
78 ALIGN = 304,
79 DEPLIBS = 305,
80 CALL = 306,
81 TAIL = 307,
82 ASM_TOK = 308,
83 MODULE = 309,
84 SIDEEFFECT = 310,
85 CC_TOK = 311,
86 CCC_TOK = 312,
87 FASTCC_TOK = 313,
88 COLDCC_TOK = 314,
89 X86_STDCALLCC_TOK = 315,
90 X86_FASTCALLCC_TOK = 316,
91 DATALAYOUT = 317,
92 RET = 318,
93 BR = 319,
94 SWITCH = 320,
95 INVOKE = 321,
96 UNWIND = 322,
97 UNREACHABLE = 323,
98 ADD = 324,
99 SUB = 325,
100 MUL = 326,
101 UDIV = 327,
102 SDIV = 328,
103 FDIV = 329,
104 UREM = 330,
105 SREM = 331,
106 FREM = 332,
107 AND = 333,
108 OR = 334,
109 XOR = 335,
110 SHL = 336,
111 LSHR = 337,
112 ASHR = 338,
113 ICMP = 339,
114 FCMP = 340,
115 EQ = 341,
116 NE = 342,
117 SLT = 343,
118 SGT = 344,
119 SLE = 345,
120 SGE = 346,
121 ULT = 347,
122 UGT = 348,
123 ULE = 349,
124 UGE = 350,
125 OEQ = 351,
126 ONE = 352,
127 OLT = 353,
128 OGT = 354,
129 OLE = 355,
130 OGE = 356,
131 ORD = 357,
132 UNO = 358,
133 UEQ = 359,
134 UNE = 360,
135 MALLOC = 361,
136 ALLOCA = 362,
137 FREE = 363,
138 LOAD = 364,
139 STORE = 365,
140 GETELEMENTPTR = 366,
141 TRUNC = 367,
142 ZEXT = 368,
143 SEXT = 369,
144 FPTRUNC = 370,
145 FPEXT = 371,
146 BITCAST = 372,
147 UITOFP = 373,
148 SITOFP = 374,
149 FPTOUI = 375,
150 FPTOSI = 376,
151 INTTOPTR = 377,
152 PTRTOINT = 378,
153 PHI_TOK = 379,
154 SELECT = 380,
155 VAARG = 381,
156 EXTRACTELEMENT = 382,
157 INSERTELEMENT = 383,
158 SHUFFLEVECTOR = 384,
159 NORETURN = 385,
160 INREG = 386,
161 SRET = 387,
162 NOUNWIND = 388,
163 DEFAULT = 389,
164 HIDDEN = 390
165 };
166#endif
167/* Tokens. */
168#define ESINT64VAL 258
169#define EUINT64VAL 259
170#define ESAPINTVAL 260
171#define EUAPINTVAL 261
172#define LOCALVAL_ID 262
173#define GLOBALVAL_ID 263
174#define FPVAL 264
175#define VOID 265
176#define INTTYPE 266
177#define FLOAT 267
178#define DOUBLE 268
179#define LABEL 269
180#define TYPE 270
181#define LOCALVAR 271
182#define GLOBALVAR 272
183#define LABELSTR 273
184#define STRINGCONSTANT 274
185#define ATSTRINGCONSTANT 275
186#define ZEROINITIALIZER 276
187#define TRUETOK 277
188#define FALSETOK 278
189#define BEGINTOK 279
190#define ENDTOK 280
191#define DECLARE 281
192#define DEFINE 282
193#define GLOBAL 283
194#define CONSTANT 284
195#define SECTION 285
196#define ALIAS 286
197#define VOLATILE 287
198#define THREAD_LOCAL 288
199#define TO 289
200#define DOTDOTDOT 290
201#define NULL_TOK 291
202#define UNDEF 292
203#define INTERNAL 293
204#define LINKONCE 294
205#define WEAK 295
206#define APPENDING 296
207#define DLLIMPORT 297
208#define DLLEXPORT 298
209#define EXTERN_WEAK 299
210#define OPAQUE 300
211#define EXTERNAL 301
212#define TARGET 302
213#define TRIPLE 303
214#define ALIGN 304
215#define DEPLIBS 305
216#define CALL 306
217#define TAIL 307
218#define ASM_TOK 308
219#define MODULE 309
220#define SIDEEFFECT 310
221#define CC_TOK 311
222#define CCC_TOK 312
223#define FASTCC_TOK 313
224#define COLDCC_TOK 314
225#define X86_STDCALLCC_TOK 315
226#define X86_FASTCALLCC_TOK 316
227#define DATALAYOUT 317
228#define RET 318
229#define BR 319
230#define SWITCH 320
231#define INVOKE 321
232#define UNWIND 322
233#define UNREACHABLE 323
234#define ADD 324
235#define SUB 325
236#define MUL 326
237#define UDIV 327
238#define SDIV 328
239#define FDIV 329
240#define UREM 330
241#define SREM 331
242#define FREM 332
243#define AND 333
244#define OR 334
245#define XOR 335
246#define SHL 336
247#define LSHR 337
248#define ASHR 338
249#define ICMP 339
250#define FCMP 340
251#define EQ 341
252#define NE 342
253#define SLT 343
254#define SGT 344
255#define SLE 345
256#define SGE 346
257#define ULT 347
258#define UGT 348
259#define ULE 349
260#define UGE 350
261#define OEQ 351
262#define ONE 352
263#define OLT 353
264#define OGT 354
265#define OLE 355
266#define OGE 356
267#define ORD 357
268#define UNO 358
269#define UEQ 359
270#define UNE 360
271#define MALLOC 361
272#define ALLOCA 362
273#define FREE 363
274#define LOAD 364
275#define STORE 365
276#define GETELEMENTPTR 366
277#define TRUNC 367
278#define ZEXT 368
279#define SEXT 369
280#define FPTRUNC 370
281#define FPEXT 371
282#define BITCAST 372
283#define UITOFP 373
284#define SITOFP 374
285#define FPTOUI 375
286#define FPTOSI 376
287#define INTTOPTR 377
288#define PTRTOINT 378
289#define PHI_TOK 379
290#define SELECT 380
291#define VAARG 381
292#define EXTRACTELEMENT 382
293#define INSERTELEMENT 383
294#define SHUFFLEVECTOR 384
295#define NORETURN 385
296#define INREG 386
297#define SRET 387
298#define NOUNWIND 388
299#define DEFAULT 389
300#define HIDDEN 390
301
302
303
304
Reid Spencer9c9b63a2007-04-28 16:07:31 +0000305#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
306#line 955 "/proj/llvm/llvm-2/lib/AsmParser/llvmAsmParser.y"
307typedef 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;
Anton Korobeynikov178a3522007-01-12 19:22:51 +0000332 llvm::GlobalValue::VisibilityTypes Visibility;
Reid Spencer7b5d4662007-04-09 06:16:21 +0000333 uint16_t ParamAttrs;
Reid Spencer38c91a92007-02-28 02:24:54 +0000334 llvm::APInt *APIntVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000335 int64_t SInt64Val;
336 uint64_t UInt64Val;
337 int SIntVal;
338 unsigned UIntVal;
339 double FPVal;
340 bool BoolVal;
341
342 char *StrVal; // This memory is strdup'd!
Reid Spencer1628cec2006-10-26 06:15:43 +0000343 llvm::ValID ValIDVal; // strdup'd memory maybe!
Reid Spencer68a24bd2005-08-27 18:50:39 +0000344
Reid Spencera132e042006-12-03 05:46:11 +0000345 llvm::Instruction::BinaryOps BinaryOpVal;
346 llvm::Instruction::TermOps TermOpVal;
347 llvm::Instruction::MemoryOps MemOpVal;
348 llvm::Instruction::CastOps CastOpVal;
349 llvm::Instruction::OtherOps OtherOpVal;
Reid Spencera132e042006-12-03 05:46:11 +0000350 llvm::ICmpInst::Predicate IPredicate;
351 llvm::FCmpInst::Predicate FPredicate;
Reid Spencer9c9b63a2007-04-28 16:07:31 +0000352} YYSTYPE;
353/* Line 1447 of yacc.c. */
354#line 355 "llvmAsmParser.tab.h"
Anton Korobeynikov38e09802007-04-28 13:48:45 +0000355# define yystype YYSTYPE /* obsolescent; will be withdrawn */
356# define YYSTYPE_IS_DECLARED 1
357# define YYSTYPE_IS_TRIVIAL 1
358#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000359
360extern YYSTYPE llvmAsmlval;
Anton Korobeynikov38e09802007-04-28 13:48:45 +0000361
Reid Spencer9c9b63a2007-04-28 16:07:31 +0000362
363