blob: d3d7ca55681d20b82ec5908f80b9a86c3b1b0574 [file] [log] [blame]
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +00001/* A Bison parser, made by GNU Bison 2.3. */
Reid Spencerb0fcf8f2007-01-17 02:48:45 +00002
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +00003/* Skeleton interface for Bison's Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
Reid Spencerb0fcf8f2007-01-17 02:48:45 +00007
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
Reid Spencer41dff5e2007-01-26 08:05:27 +000020 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
Reid Spencerb0fcf8f2007-01-17 02:48:45 +000022
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +000023/* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
32
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
Reid Spencerb0fcf8f2007-01-17 02:48:45 +000035
36/* Tokens. */
37#ifndef YYTOKENTYPE
38# define YYTOKENTYPE
39 /* Put the tokens into the symbol table, so that GDB and other debuggers
40 know about them. */
41 enum yytokentype {
42 ESINT64VAL = 258,
43 EUINT64VAL = 259,
Reid Spencer41dff5e2007-01-26 08:05:27 +000044 LOCALVAL_ID = 260,
45 GLOBALVAL_ID = 261,
Reid Spencerb0fcf8f2007-01-17 02:48:45 +000046 FPVAL = 262,
47 VOID = 263,
48 INTTYPE = 264,
49 FLOAT = 265,
50 DOUBLE = 266,
51 LABEL = 267,
52 TYPE = 268,
Reid Spencer41dff5e2007-01-26 08:05:27 +000053 LOCALVAR = 269,
54 GLOBALVAR = 270,
55 LABELSTR = 271,
56 STRINGCONSTANT = 272,
57 ATSTRINGCONSTANT = 273,
58 IMPLEMENTATION = 274,
59 ZEROINITIALIZER = 275,
60 TRUETOK = 276,
61 FALSETOK = 277,
62 BEGINTOK = 278,
63 ENDTOK = 279,
64 DECLARE = 280,
65 DEFINE = 281,
66 GLOBAL = 282,
67 CONSTANT = 283,
68 SECTION = 284,
69 VOLATILE = 285,
70 TO = 286,
71 DOTDOTDOT = 287,
72 NULL_TOK = 288,
73 UNDEF = 289,
74 INTERNAL = 290,
75 LINKONCE = 291,
76 WEAK = 292,
77 APPENDING = 293,
78 DLLIMPORT = 294,
79 DLLEXPORT = 295,
80 EXTERN_WEAK = 296,
81 OPAQUE = 297,
82 EXTERNAL = 298,
83 TARGET = 299,
84 TRIPLE = 300,
85 ALIGN = 301,
86 DEPLIBS = 302,
87 CALL = 303,
88 TAIL = 304,
89 ASM_TOK = 305,
90 MODULE = 306,
91 SIDEEFFECT = 307,
92 CC_TOK = 308,
93 CCC_TOK = 309,
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +000094 FASTCC_TOK = 310,
95 COLDCC_TOK = 311,
96 X86_STDCALLCC_TOK = 312,
97 X86_FASTCALLCC_TOK = 313,
98 DATALAYOUT = 314,
99 RET = 315,
100 BR = 316,
101 SWITCH = 317,
102 INVOKE = 318,
103 UNWIND = 319,
104 UNREACHABLE = 320,
105 ADD = 321,
106 SUB = 322,
107 MUL = 323,
108 UDIV = 324,
109 SDIV = 325,
110 FDIV = 326,
111 UREM = 327,
112 SREM = 328,
113 FREM = 329,
114 AND = 330,
115 OR = 331,
116 XOR = 332,
117 ICMP = 333,
118 FCMP = 334,
119 EQ = 335,
120 NE = 336,
121 SLT = 337,
122 SGT = 338,
123 SLE = 339,
124 SGE = 340,
125 ULT = 341,
126 UGT = 342,
127 ULE = 343,
128 UGE = 344,
129 OEQ = 345,
130 ONE = 346,
131 OLT = 347,
132 OGT = 348,
133 OLE = 349,
134 OGE = 350,
135 ORD = 351,
136 UNO = 352,
137 UEQ = 353,
138 UNE = 354,
139 MALLOC = 355,
140 ALLOCA = 356,
141 FREE = 357,
142 LOAD = 358,
143 STORE = 359,
144 GETELEMENTPTR = 360,
145 TRUNC = 361,
146 ZEXT = 362,
147 SEXT = 363,
148 FPTRUNC = 364,
149 FPEXT = 365,
150 BITCAST = 366,
151 UITOFP = 367,
152 SITOFP = 368,
153 FPTOUI = 369,
154 FPTOSI = 370,
155 INTTOPTR = 371,
156 PTRTOINT = 372,
157 PHI_TOK = 373,
158 SELECT = 374,
159 SHL = 375,
160 LSHR = 376,
161 ASHR = 377,
162 VAARG = 378,
163 EXTRACTELEMENT = 379,
164 INSERTELEMENT = 380,
165 SHUFFLEVECTOR = 381,
166 NORETURN = 382,
167 INREG = 383,
168 SRET = 384,
169 DEFAULT = 385,
170 HIDDEN = 386
Reid Spencerb0fcf8f2007-01-17 02:48:45 +0000171 };
172#endif
Reid Spencer41dff5e2007-01-26 08:05:27 +0000173/* Tokens. */
Reid Spencerb0fcf8f2007-01-17 02:48:45 +0000174#define ESINT64VAL 258
175#define EUINT64VAL 259
Reid Spencer41dff5e2007-01-26 08:05:27 +0000176#define LOCALVAL_ID 260
177#define GLOBALVAL_ID 261
Reid Spencerb0fcf8f2007-01-17 02:48:45 +0000178#define FPVAL 262
179#define VOID 263
180#define INTTYPE 264
181#define FLOAT 265
182#define DOUBLE 266
183#define LABEL 267
184#define TYPE 268
Reid Spencer41dff5e2007-01-26 08:05:27 +0000185#define LOCALVAR 269
186#define GLOBALVAR 270
187#define LABELSTR 271
188#define STRINGCONSTANT 272
189#define ATSTRINGCONSTANT 273
190#define IMPLEMENTATION 274
191#define ZEROINITIALIZER 275
192#define TRUETOK 276
193#define FALSETOK 277
194#define BEGINTOK 278
195#define ENDTOK 279
196#define DECLARE 280
197#define DEFINE 281
198#define GLOBAL 282
199#define CONSTANT 283
200#define SECTION 284
201#define VOLATILE 285
202#define TO 286
203#define DOTDOTDOT 287
204#define NULL_TOK 288
205#define UNDEF 289
206#define INTERNAL 290
207#define LINKONCE 291
208#define WEAK 292
209#define APPENDING 293
210#define DLLIMPORT 294
211#define DLLEXPORT 295
212#define EXTERN_WEAK 296
213#define OPAQUE 297
214#define EXTERNAL 298
215#define TARGET 299
216#define TRIPLE 300
217#define ALIGN 301
218#define DEPLIBS 302
219#define CALL 303
220#define TAIL 304
221#define ASM_TOK 305
222#define MODULE 306
223#define SIDEEFFECT 307
224#define CC_TOK 308
225#define CCC_TOK 309
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +0000226#define FASTCC_TOK 310
227#define COLDCC_TOK 311
228#define X86_STDCALLCC_TOK 312
229#define X86_FASTCALLCC_TOK 313
230#define DATALAYOUT 314
231#define RET 315
232#define BR 316
233#define SWITCH 317
234#define INVOKE 318
235#define UNWIND 319
236#define UNREACHABLE 320
237#define ADD 321
238#define SUB 322
239#define MUL 323
240#define UDIV 324
241#define SDIV 325
242#define FDIV 326
243#define UREM 327
244#define SREM 328
245#define FREM 329
246#define AND 330
247#define OR 331
248#define XOR 332
249#define ICMP 333
250#define FCMP 334
251#define EQ 335
252#define NE 336
253#define SLT 337
254#define SGT 338
255#define SLE 339
256#define SGE 340
257#define ULT 341
258#define UGT 342
259#define ULE 343
260#define UGE 344
261#define OEQ 345
262#define ONE 346
263#define OLT 347
264#define OGT 348
265#define OLE 349
266#define OGE 350
267#define ORD 351
268#define UNO 352
269#define UEQ 353
270#define UNE 354
271#define MALLOC 355
272#define ALLOCA 356
273#define FREE 357
274#define LOAD 358
275#define STORE 359
276#define GETELEMENTPTR 360
277#define TRUNC 361
278#define ZEXT 362
279#define SEXT 363
280#define FPTRUNC 364
281#define FPEXT 365
282#define BITCAST 366
283#define UITOFP 367
284#define SITOFP 368
285#define FPTOUI 369
286#define FPTOSI 370
287#define INTTOPTR 371
288#define PTRTOINT 372
289#define PHI_TOK 373
290#define SELECT 374
291#define SHL 375
292#define LSHR 376
293#define ASHR 377
294#define VAARG 378
295#define EXTRACTELEMENT 379
296#define INSERTELEMENT 380
297#define SHUFFLEVECTOR 381
298#define NORETURN 382
299#define INREG 383
300#define SRET 384
301#define DEFAULT 385
302#define HIDDEN 386
Reid Spencerb0fcf8f2007-01-17 02:48:45 +0000303
304
305
306
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +0000307#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
308typedef union YYSTYPE
309#line 885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
310{
Reid Spencer68a24bd2005-08-27 18:50:39 +0000311 llvm::Module *ModuleVal;
312 llvm::Function *FunctionVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000313 llvm::BasicBlock *BasicBlockVal;
314 llvm::TerminatorInst *TermInstVal;
315 llvm::Instruction *InstVal;
Reid Spencera132e042006-12-03 05:46:11 +0000316 llvm::Constant *ConstVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000317
Reid Spencera132e042006-12-03 05:46:11 +0000318 const llvm::Type *PrimType;
Reid Spencer14310612006-12-31 05:40:51 +0000319 std::list<llvm::PATypeHolder> *TypeList;
Reid Spencera132e042006-12-03 05:46:11 +0000320 llvm::PATypeHolder *TypeVal;
321 llvm::Value *ValueVal;
Reid Spencera132e042006-12-03 05:46:11 +0000322 std::vector<llvm::Value*> *ValueList;
Reid Spencer14310612006-12-31 05:40:51 +0000323 llvm::ArgListType *ArgList;
324 llvm::TypeWithAttrs TypeWithAttrs;
325 llvm::TypeWithAttrsList *TypeWithAttrsList;
326 llvm::ValueRefList *ValueRefList;
327
Reid Spencer68a24bd2005-08-27 18:50:39 +0000328 // Represent the RHS of PHI node
Reid Spencera132e042006-12-03 05:46:11 +0000329 std::list<std::pair<llvm::Value*,
330 llvm::BasicBlock*> > *PHIList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000331 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
Reid Spencera132e042006-12-03 05:46:11 +0000332 std::vector<llvm::Constant*> *ConstVector;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000333
334 llvm::GlobalValue::LinkageTypes Linkage;
Anton Korobeynikov178a3522007-01-12 19:22:51 +0000335 llvm::GlobalValue::VisibilityTypes Visibility;
Reid Spencer14310612006-12-31 05:40:51 +0000336 llvm::FunctionType::ParameterAttributes ParamAttrs;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000337 int64_t SInt64Val;
338 uint64_t UInt64Val;
339 int SIntVal;
340 unsigned UIntVal;
341 double FPVal;
342 bool BoolVal;
343
344 char *StrVal; // This memory is strdup'd!
Reid Spencer1628cec2006-10-26 06:15:43 +0000345 llvm::ValID ValIDVal; // strdup'd memory maybe!
Reid Spencer68a24bd2005-08-27 18:50:39 +0000346
Reid Spencera132e042006-12-03 05:46:11 +0000347 llvm::Instruction::BinaryOps BinaryOpVal;
348 llvm::Instruction::TermOps TermOpVal;
349 llvm::Instruction::MemoryOps MemOpVal;
350 llvm::Instruction::CastOps CastOpVal;
351 llvm::Instruction::OtherOps OtherOpVal;
Reid Spencera132e042006-12-03 05:46:11 +0000352 llvm::ICmpInst::Predicate IPredicate;
353 llvm::FCmpInst::Predicate FPredicate;
Anton Korobeynikov9adeaa22007-01-28 13:37:39 +0000354}
355/* Line 1489 of yacc.c. */
356#line 357 "llvmAsmParser.tab.h"
357 YYSTYPE;
Reid Spencer41dff5e2007-01-26 08:05:27 +0000358# define yystype YYSTYPE /* obsolescent; will be withdrawn */
359# define YYSTYPE_IS_DECLARED 1
360# define YYSTYPE_IS_TRIVIAL 1
Reid Spencerb0fcf8f2007-01-17 02:48:45 +0000361#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000362
363extern YYSTYPE llvmAsmlval;
Reid Spencerb0fcf8f2007-01-17 02:48:45 +0000364