blob: 3d7cef32d3f32c6013bb175759518f72143a1b27 [file] [log] [blame]
Reid Spencer5b7e7532006-09-28 19:28:24 +00001/* A Bison parser, made by GNU Bison 2.1. */
Anton Korobeynikov43e3aad2006-09-14 18:25:26 +00002
Reid Spencer5b7e7532006-09-28 19:28:24 +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 Korobeynikov43e3aad2006-09-14 18:25:26 +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 Spencer5b7e7532006-09-28 19:28:24 +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 Korobeynikov43e3aad2006-09-14 18:25:26 +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,
Anton Korobeynikovbcb97702006-09-17 20:25:45 +000098 X86_STDCALLCC_TOK = 324,
99 X86_FASTCALLCC_TOK = 325,
100 RET = 326,
101 BR = 327,
102 SWITCH = 328,
103 INVOKE = 329,
104 UNWIND = 330,
105 UNREACHABLE = 331,
106 ADD = 332,
107 SUB = 333,
108 MUL = 334,
109 DIV = 335,
110 REM = 336,
111 AND = 337,
112 OR = 338,
113 XOR = 339,
114 SETLE = 340,
115 SETGE = 341,
116 SETLT = 342,
117 SETGT = 343,
118 SETEQ = 344,
119 SETNE = 345,
120 MALLOC = 346,
121 ALLOCA = 347,
122 FREE = 348,
123 LOAD = 349,
124 STORE = 350,
125 GETELEMENTPTR = 351,
126 PHI_TOK = 352,
127 CAST = 353,
128 SELECT = 354,
129 SHL = 355,
130 SHR = 356,
131 VAARG = 357,
132 EXTRACTELEMENT = 358,
133 INSERTELEMENT = 359,
134 SHUFFLEVECTOR = 360,
135 VAARG_old = 361,
136 VANEXT_old = 362
Anton Korobeynikov43e3aad2006-09-14 18:25:26 +0000137 };
138#endif
139/* Tokens. */
140#define ESINT64VAL 258
141#define EUINT64VAL 259
142#define SINTVAL 260
143#define UINTVAL 261
144#define FPVAL 262
145#define VOID 263
146#define BOOL 264
147#define SBYTE 265
148#define UBYTE 266
149#define SHORT 267
150#define USHORT 268
151#define INT 269
152#define UINT 270
153#define LONG 271
154#define ULONG 272
155#define FLOAT 273
156#define DOUBLE 274
157#define TYPE 275
158#define LABEL 276
159#define VAR_ID 277
160#define LABELSTR 278
161#define STRINGCONSTANT 279
162#define IMPLEMENTATION 280
163#define ZEROINITIALIZER 281
164#define TRUETOK 282
165#define FALSETOK 283
166#define BEGINTOK 284
167#define ENDTOK 285
168#define DECLARE 286
169#define GLOBAL 287
170#define CONSTANT 288
171#define SECTION 289
172#define VOLATILE 290
173#define TO 291
174#define DOTDOTDOT 292
175#define NULL_TOK 293
176#define UNDEF 294
177#define CONST 295
178#define INTERNAL 296
179#define LINKONCE 297
180#define WEAK 298
181#define APPENDING 299
182#define DLLIMPORT 300
183#define DLLEXPORT 301
184#define EXTERN_WEAK 302
185#define OPAQUE 303
186#define NOT 304
187#define EXTERNAL 305
188#define TARGET 306
189#define TRIPLE 307
190#define ENDIAN 308
191#define POINTERSIZE 309
192#define LITTLE 310
193#define BIG 311
194#define ALIGN 312
195#define DEPLIBS 313
196#define CALL 314
197#define TAIL 315
198#define ASM_TOK 316
199#define MODULE 317
200#define SIDEEFFECT 318
201#define CC_TOK 319
202#define CCC_TOK 320
203#define CSRETCC_TOK 321
204#define FASTCC_TOK 322
205#define COLDCC_TOK 323
Anton Korobeynikovbcb97702006-09-17 20:25:45 +0000206#define X86_STDCALLCC_TOK 324
207#define X86_FASTCALLCC_TOK 325
208#define RET 326
209#define BR 327
210#define SWITCH 328
211#define INVOKE 329
212#define UNWIND 330
213#define UNREACHABLE 331
214#define ADD 332
215#define SUB 333
216#define MUL 334
217#define DIV 335
218#define REM 336
219#define AND 337
220#define OR 338
221#define XOR 339
222#define SETLE 340
223#define SETGE 341
224#define SETLT 342
225#define SETGT 343
226#define SETEQ 344
227#define SETNE 345
228#define MALLOC 346
229#define ALLOCA 347
230#define FREE 348
231#define LOAD 349
232#define STORE 350
233#define GETELEMENTPTR 351
234#define PHI_TOK 352
235#define CAST 353
236#define SELECT 354
237#define SHL 355
238#define SHR 356
239#define VAARG 357
240#define EXTRACTELEMENT 358
241#define INSERTELEMENT 359
242#define SHUFFLEVECTOR 360
243#define VAARG_old 361
244#define VANEXT_old 362
Anton Korobeynikov43e3aad2006-09-14 18:25:26 +0000245
246
247
248
Reid Spencer5b7e7532006-09-28 19:28:24 +0000249#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
250#line 966 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y"
251typedef union YYSTYPE {
Reid Spencer68a24bd2005-08-27 18:50:39 +0000252 llvm::Module *ModuleVal;
253 llvm::Function *FunctionVal;
254 std::pair<llvm::PATypeHolder*, char*> *ArgVal;
255 llvm::BasicBlock *BasicBlockVal;
256 llvm::TerminatorInst *TermInstVal;
257 llvm::Instruction *InstVal;
258 llvm::Constant *ConstVal;
259
260 const llvm::Type *PrimType;
261 llvm::PATypeHolder *TypeVal;
262 llvm::Value *ValueVal;
263
264 std::vector<std::pair<llvm::PATypeHolder*,char*> > *ArgList;
265 std::vector<llvm::Value*> *ValueList;
266 std::list<llvm::PATypeHolder> *TypeList;
267 // Represent the RHS of PHI node
268 std::list<std::pair<llvm::Value*,
269 llvm::BasicBlock*> > *PHIList;
270 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
271 std::vector<llvm::Constant*> *ConstVector;
272
273 llvm::GlobalValue::LinkageTypes Linkage;
274 int64_t SInt64Val;
275 uint64_t UInt64Val;
276 int SIntVal;
277 unsigned UIntVal;
278 double FPVal;
279 bool BoolVal;
280
281 char *StrVal; // This memory is strdup'd!
282 llvm::ValID ValIDVal; // strdup'd memory maybe!
283
284 llvm::Instruction::BinaryOps BinaryOpVal;
285 llvm::Instruction::TermOps TermOpVal;
286 llvm::Instruction::MemoryOps MemOpVal;
287 llvm::Instruction::OtherOps OtherOpVal;
288 llvm::Module::Endianness Endianness;
Reid Spencer5b7e7532006-09-28 19:28:24 +0000289} YYSTYPE;
290/* Line 1447 of yacc.c. */
291#line 292 "llvmAsmParser.tab.h"
Anton Korobeynikov43e3aad2006-09-14 18:25:26 +0000292# define yystype YYSTYPE /* obsolescent; will be withdrawn */
293# define YYSTYPE_IS_DECLARED 1
294# define YYSTYPE_IS_TRIVIAL 1
295#endif
Reid Spencer68a24bd2005-08-27 18:50:39 +0000296
297extern YYSTYPE llvmAsmlval;
Anton Korobeynikov43e3aad2006-09-14 18:25:26 +0000298
Reid Spencer5b7e7532006-09-28 19:28:24 +0000299
300