blob: 4abbca579376c07b858b1c7a83f0f9e9e8b72236 [file] [log] [blame]
Reid Spencer38c91a92007-02-28 02:24:54 +00001/* A Bison parser, made by GNU Bison 2.1. */
2
3/* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5
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
21/* 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. */
25
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,
Reid Spencer3d6b71e2007-04-09 01:56:05 +000050 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 VOLATILE = 286,
61 TO = 287,
62 DOTDOTDOT = 288,
63 NULL_TOK = 289,
64 UNDEF = 290,
65 INTERNAL = 291,
66 LINKONCE = 292,
67 WEAK = 293,
68 APPENDING = 294,
69 DLLIMPORT = 295,
70 DLLEXPORT = 296,
71 EXTERN_WEAK = 297,
72 OPAQUE = 298,
73 EXTERNAL = 299,
74 TARGET = 300,
75 TRIPLE = 301,
76 ALIGN = 302,
77 DEPLIBS = 303,
78 CALL = 304,
79 TAIL = 305,
80 ASM_TOK = 306,
81 MODULE = 307,
82 SIDEEFFECT = 308,
83 CC_TOK = 309,
84 CCC_TOK = 310,
85 FASTCC_TOK = 311,
86 COLDCC_TOK = 312,
87 X86_STDCALLCC_TOK = 313,
88 X86_FASTCALLCC_TOK = 314,
89 DATALAYOUT = 315,
90 RET = 316,
91 BR = 317,
92 SWITCH = 318,
93 INVOKE = 319,
94 UNWIND = 320,
95 UNREACHABLE = 321,
96 ADD = 322,
97 SUB = 323,
98 MUL = 324,
99 UDIV = 325,
100 SDIV = 326,
101 FDIV = 327,
102 UREM = 328,
103 SREM = 329,
104 FREM = 330,
105 AND = 331,
106 OR = 332,
107 XOR = 333,
108 SHL = 334,
109 LSHR = 335,
110 ASHR = 336,
111 ICMP = 337,
112 FCMP = 338,
113 EQ = 339,
114 NE = 340,
115 SLT = 341,
116 SGT = 342,
117 SLE = 343,
118 SGE = 344,
119 ULT = 345,
120 UGT = 346,
121 ULE = 347,
122 UGE = 348,
123 OEQ = 349,
124 ONE = 350,
125 OLT = 351,
126 OGT = 352,
127 OLE = 353,
128 OGE = 354,
129 ORD = 355,
130 UNO = 356,
131 UEQ = 357,
132 UNE = 358,
133 MALLOC = 359,
134 ALLOCA = 360,
135 FREE = 361,
136 LOAD = 362,
137 STORE = 363,
138 GETELEMENTPTR = 364,
139 TRUNC = 365,
140 ZEXT = 366,
141 SEXT = 367,
142 FPTRUNC = 368,
143 FPEXT = 369,
144 BITCAST = 370,
145 UITOFP = 371,
146 SITOFP = 372,
147 FPTOUI = 373,
148 FPTOSI = 374,
149 INTTOPTR = 375,
150 PTRTOINT = 376,
151 PHI_TOK = 377,
152 SELECT = 378,
153 VAARG = 379,
154 EXTRACTELEMENT = 380,
155 INSERTELEMENT = 381,
156 SHUFFLEVECTOR = 382,
157 NORETURN = 383,
158 INREG = 384,
159 SRET = 385,
160 NOUNWIND = 386,
161 DEFAULT = 387,
162 HIDDEN = 388
Reid Spencer38c91a92007-02-28 02:24:54 +0000163 };
164#endif
165/* Tokens. */
166#define ESINT64VAL 258
167#define EUINT64VAL 259
168#define ESAPINTVAL 260
169#define EUAPINTVAL 261
170#define LOCALVAL_ID 262
171#define GLOBALVAL_ID 263
172#define FPVAL 264
173#define VOID 265
174#define INTTYPE 266
175#define FLOAT 267
176#define DOUBLE 268
177#define LABEL 269
178#define TYPE 270
179#define LOCALVAR 271
180#define GLOBALVAR 272
181#define LABELSTR 273
182#define STRINGCONSTANT 274
183#define ATSTRINGCONSTANT 275
Reid Spencer3d6b71e2007-04-09 01:56:05 +0000184#define ZEROINITIALIZER 276
185#define TRUETOK 277
186#define FALSETOK 278
187#define BEGINTOK 279
188#define ENDTOK 280
189#define DECLARE 281
190#define DEFINE 282
191#define GLOBAL 283
192#define CONSTANT 284
193#define SECTION 285
194#define VOLATILE 286
195#define TO 287
196#define DOTDOTDOT 288
197#define NULL_TOK 289
198#define UNDEF 290
199#define INTERNAL 291
200#define LINKONCE 292
201#define WEAK 293
202#define APPENDING 294
203#define DLLIMPORT 295
204#define DLLEXPORT 296
205#define EXTERN_WEAK 297
206#define OPAQUE 298
207#define EXTERNAL 299
208#define TARGET 300
209#define TRIPLE 301
210#define ALIGN 302
211#define DEPLIBS 303
212#define CALL 304
213#define TAIL 305
214#define ASM_TOK 306
215#define MODULE 307
216#define SIDEEFFECT 308
217#define CC_TOK 309
218#define CCC_TOK 310
219#define FASTCC_TOK 311
220#define COLDCC_TOK 312
221#define X86_STDCALLCC_TOK 313
222#define X86_FASTCALLCC_TOK 314
223#define DATALAYOUT 315
224#define RET 316
225#define BR 317
226#define SWITCH 318
227#define INVOKE 319
228#define UNWIND 320
229#define UNREACHABLE 321
230#define ADD 322
231#define SUB 323
232#define MUL 324
233#define UDIV 325
234#define SDIV 326
235#define FDIV 327
236#define UREM 328
237#define SREM 329
238#define FREM 330
239#define AND 331
240#define OR 332
241#define XOR 333
242#define SHL 334
243#define LSHR 335
244#define ASHR 336
245#define ICMP 337
246#define FCMP 338
247#define EQ 339
248#define NE 340
249#define SLT 341
250#define SGT 342
251#define SLE 343
252#define SGE 344
253#define ULT 345
254#define UGT 346
255#define ULE 347
256#define UGE 348
257#define OEQ 349
258#define ONE 350
259#define OLT 351
260#define OGT 352
261#define OLE 353
262#define OGE 354
263#define ORD 355
264#define UNO 356
265#define UEQ 357
266#define UNE 358
267#define MALLOC 359
268#define ALLOCA 360
269#define FREE 361
270#define LOAD 362
271#define STORE 363
272#define GETELEMENTPTR 364
273#define TRUNC 365
274#define ZEXT 366
275#define SEXT 367
276#define FPTRUNC 368
277#define FPEXT 369
278#define BITCAST 370
279#define UITOFP 371
280#define SITOFP 372
281#define FPTOUI 373
282#define FPTOSI 374
283#define INTTOPTR 375
284#define PTRTOINT 376
285#define PHI_TOK 377
286#define SELECT 378
287#define VAARG 379
288#define EXTRACTELEMENT 380
289#define INSERTELEMENT 381
290#define SHUFFLEVECTOR 382
291#define NORETURN 383
292#define INREG 384
293#define SRET 385
294#define NOUNWIND 386
295#define DEFAULT 387
296#define HIDDEN 388
Reid Spencer38c91a92007-02-28 02:24:54 +0000297
298
299
300
301#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
Reid Spencer7b5d4662007-04-09 06:16:21 +0000302#line 937 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
Reid Spencer38c91a92007-02-28 02:24:54 +0000303typedef union YYSTYPE {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000304 llvm::Module *ModuleVal;
305 llvm::Function *FunctionVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000306 llvm::BasicBlock *BasicBlockVal;
307 llvm::TerminatorInst *TermInstVal;
308 llvm::Instruction *InstVal;
Reid Spencera132e042006-12-03 05:46:11 +0000309 llvm::Constant *ConstVal;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000310
Reid Spencera132e042006-12-03 05:46:11 +0000311 const llvm::Type *PrimType;
Reid Spencer14310612006-12-31 05:40:51 +0000312 std::list<llvm::PATypeHolder> *TypeList;
Reid Spencera132e042006-12-03 05:46:11 +0000313 llvm::PATypeHolder *TypeVal;
314 llvm::Value *ValueVal;
Reid Spencera132e042006-12-03 05:46:11 +0000315 std::vector<llvm::Value*> *ValueList;
Reid Spencer14310612006-12-31 05:40:51 +0000316 llvm::ArgListType *ArgList;
317 llvm::TypeWithAttrs TypeWithAttrs;
318 llvm::TypeWithAttrsList *TypeWithAttrsList;
319 llvm::ValueRefList *ValueRefList;
320
Reid Spencer68a24bd2005-08-27 18:50:39 +0000321 // Represent the RHS of PHI node
Reid Spencera132e042006-12-03 05:46:11 +0000322 std::list<std::pair<llvm::Value*,
323 llvm::BasicBlock*> > *PHIList;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000324 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
Reid Spencera132e042006-12-03 05:46:11 +0000325 std::vector<llvm::Constant*> *ConstVector;
Reid Spencer68a24bd2005-08-27 18:50:39 +0000326
327 llvm::GlobalValue::LinkageTypes Linkage;
Anton Korobeynikov178a3522007-01-12 19:22:51 +0000328 llvm::GlobalValue::VisibilityTypes Visibility;
Reid Spencer7b5d4662007-04-09 06:16:21 +0000329 uint16_t ParamAttrs;
Reid Spencer38c91a92007-02-28 02:24:54 +0000330 llvm::APInt *APIntVal;
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 Spencera132e042006-12-03 05:46:11 +0000346 llvm::ICmpInst::Predicate IPredicate;
347 llvm::FCmpInst::Predicate FPredicate;
Chris Lattner9d2fda62007-02-13 05:53:56 +0000348} YYSTYPE;
Reid Spencer38c91a92007-02-28 02:24:54 +0000349/* Line 1447 of yacc.c. */
Reid Spencer3d6b71e2007-04-09 01:56:05 +0000350#line 351 "llvmAsmParser.tab.h"
Reid Spencer38c91a92007-02-28 02:24:54 +0000351# define yystype YYSTYPE /* obsolescent; will be withdrawn */
352# define YYSTYPE_IS_DECLARED 1
353# define YYSTYPE_IS_TRIVIAL 1
354#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000355
356extern YYSTYPE llvmAsmlval;
Reid Spencer38c91a92007-02-28 02:24:54 +0000357
358
359