aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-upgrade/UpgradeParser.cpp.cvs
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-01 20:26:20 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-01 20:26:20 +0000
commite77e35e8b198213c5e6599be97e2545f3fe99160 (patch)
tree7f9ef22eed9fdef20148f19f6d4e87fc55500fae /tools/llvm-upgrade/UpgradeParser.cpp.cvs
parent102e2d3c82e3671cdabbfed9012792cd1bb3493a (diff)
First version of llvm-upgrade that can correctly upgrade a large test
case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-upgrade/UpgradeParser.cpp.cvs')
-rw-r--r--tools/llvm-upgrade/UpgradeParser.cpp.cvs2864
1 files changed, 1521 insertions, 1343 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
index 7dd14fde7f..920f38b846 100644
--- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
@@ -69,47 +69,47 @@
SINTVAL = 260,
UINTVAL = 261,
FPVAL = 262,
- VOID = 263,
- BOOL = 264,
- SBYTE = 265,
- UBYTE = 266,
- SHORT = 267,
- USHORT = 268,
- INT = 269,
- UINT = 270,
- LONG = 271,
- ULONG = 272,
- FLOAT = 273,
- DOUBLE = 274,
- TYPE = 275,
- LABEL = 276,
- VAR_ID = 277,
- LABELSTR = 278,
- STRINGCONSTANT = 279,
- IMPLEMENTATION = 280,
- ZEROINITIALIZER = 281,
- TRUETOK = 282,
- FALSETOK = 283,
- BEGINTOK = 284,
- ENDTOK = 285,
- DECLARE = 286,
- GLOBAL = 287,
- CONSTANT = 288,
- SECTION = 289,
- VOLATILE = 290,
- TO = 291,
- DOTDOTDOT = 292,
- NULL_TOK = 293,
- UNDEF = 294,
- CONST = 295,
- INTERNAL = 296,
- LINKONCE = 297,
- WEAK = 298,
- APPENDING = 299,
+ TRUETOK = 263,
+ FALSETOK = 264,
+ NULL_TOK = 265,
+ UNDEF = 266,
+ ZEROINITIALIZER = 267,
+ VOID = 268,
+ BOOL = 269,
+ SBYTE = 270,
+ UBYTE = 271,
+ SHORT = 272,
+ USHORT = 273,
+ INT = 274,
+ UINT = 275,
+ LONG = 276,
+ ULONG = 277,
+ FLOAT = 278,
+ DOUBLE = 279,
+ LABEL = 280,
+ OPAQUE = 281,
+ TYPE = 282,
+ VAR_ID = 283,
+ LABELSTR = 284,
+ STRINGCONSTANT = 285,
+ IMPLEMENTATION = 286,
+ BEGINTOK = 287,
+ ENDTOK = 288,
+ DECLARE = 289,
+ GLOBAL = 290,
+ CONSTANT = 291,
+ SECTION = 292,
+ VOLATILE = 293,
+ TO = 294,
+ DOTDOTDOT = 295,
+ CONST = 296,
+ INTERNAL = 297,
+ LINKONCE = 298,
+ WEAK = 299,
DLLIMPORT = 300,
DLLEXPORT = 301,
EXTERN_WEAK = 302,
- OPAQUE = 303,
+ APPENDING = 303,
NOT = 304,
EXTERNAL = 305,
TARGET = 306,
@@ -163,28 +163,16 @@
LOAD = 354,
STORE = 355,
GETELEMENTPTR = 356,
- TRUNC = 357,
- ZEXT = 358,
- SEXT = 359,
- FPTRUNC = 360,
- FPEXT = 361,
- BITCAST = 362,
- UITOFP = 363,
- SITOFP = 364,
- FPTOUI = 365,
- FPTOSI = 366,
- INTTOPTR = 367,
- PTRTOINT = 368,
- PHI_TOK = 369,
- SELECT = 370,
- SHL = 371,
- LSHR = 372,
- ASHR = 373,
- VAARG = 374,
- EXTRACTELEMENT = 375,
- INSERTELEMENT = 376,
- SHUFFLEVECTOR = 377,
- CAST = 378
+ PHI_TOK = 357,
+ SELECT = 358,
+ SHL = 359,
+ LSHR = 360,
+ ASHR = 361,
+ VAARG = 362,
+ EXTRACTELEMENT = 363,
+ INSERTELEMENT = 364,
+ SHUFFLEVECTOR = 365,
+ CAST = 366
};
#endif
/* Tokens. */
@@ -193,47 +181,47 @@
#define SINTVAL 260
#define UINTVAL 261
#define FPVAL 262
-#define VOID 263
-#define BOOL 264
-#define SBYTE 265
-#define UBYTE 266
-#define SHORT 267
-#define USHORT 268
-#define INT 269
-#define UINT 270
-#define LONG 271
-#define ULONG 272
-#define FLOAT 273
-#define DOUBLE 274
-#define TYPE 275
-#define LABEL 276
-#define VAR_ID 277
-#define LABELSTR 278
-#define STRINGCONSTANT 279
-#define IMPLEMENTATION 280
-#define ZEROINITIALIZER 281
-#define TRUETOK 282
-#define FALSETOK 283
-#define BEGINTOK 284
-#define ENDTOK 285
-#define DECLARE 286
-#define GLOBAL 287
-#define CONSTANT 288
-#define SECTION 289
-#define VOLATILE 290
-#define TO 291
-#define DOTDOTDOT 292
-#define NULL_TOK 293
-#define UNDEF 294
-#define CONST 295
-#define INTERNAL 296
-#define LINKONCE 297
-#define WEAK 298
-#define APPENDING 299
+#define TRUETOK 263
+#define FALSETOK 264
+#define NULL_TOK 265
+#define UNDEF 266
+#define ZEROINITIALIZER 267
+#define VOID 268
+#define BOOL 269
+#define SBYTE 270
+#define UBYTE 271
+#define SHORT 272
+#define USHORT 273
+#define INT 274
+#define UINT 275
+#define LONG 276
+#define ULONG 277
+#define FLOAT 278
+#define DOUBLE 279
+#define LABEL 280
+#define OPAQUE 281
+#define TYPE 282
+#define VAR_ID 283
+#define LABELSTR 284
+#define STRINGCONSTANT 285
+#define IMPLEMENTATION 286
+#define BEGINTOK 287
+#define ENDTOK 288
+#define DECLARE 289
+#define GLOBAL 290
+#define CONSTANT 291
+#define SECTION 292
+#define VOLATILE 293
+#define TO 294
+#define DOTDOTDOT 295
+#define CONST 296
+#define INTERNAL 297
+#define LINKONCE 298
+#define WEAK 299
#define DLLIMPORT 300
#define DLLEXPORT 301
#define EXTERN_WEAK 302
-#define OPAQUE 303
+#define APPENDING 303
#define NOT 304
#define EXTERNAL 305
#define TARGET 306
@@ -287,28 +275,16 @@
#define LOAD 354
#define STORE 355
#define GETELEMENTPTR 356
-#define TRUNC 357
-#define ZEXT 358
-#define SEXT 359
-#define FPTRUNC 360
-#define FPEXT 361
-#define BITCAST 362
-#define UITOFP 363
-#define SITOFP 364
-#define FPTOUI 365
-#define FPTOSI 366
-#define INTTOPTR 367
-#define PTRTOINT 368
-#define PHI_TOK 369
-#define SELECT 370
-#define SHL 371
-#define LSHR 372
-#define ASHR 373
-#define VAARG 374
-#define EXTRACTELEMENT 375
-#define INSERTELEMENT 376
-#define SHUFFLEVECTOR 377
-#define CAST 378
+#define PHI_TOK 357
+#define SELECT 358
+#define SHL 359
+#define LSHR 360
+#define ASHR 361
+#define VAARG 362
+#define EXTRACTELEMENT 363
+#define INSERTELEMENT 364
+#define SHUFFLEVECTOR 365
+#define CAST 366
@@ -316,9 +292,6 @@
/* Copy the first part of user declarations. */
#line 14 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
-#define YYERROR_VERBOSE 1
-#define YYSTYPE std::string*
-
#include "ParserInternals.h"
#include <llvm/ADT/StringExtras.h>
#include <algorithm>
@@ -326,23 +299,26 @@
#include <utility>
#include <iostream>
+#define YYERROR_VERBOSE 1
#define YYINCLUDED_STDLIB_H
+#define YYDEBUG 1
int yylex(); // declaration" of xxx warnings.
int yyparse();
+extern int yydebug;
static std::string CurFilename;
-
static std::ostream *O = 0;
-
std::istream* LexInput = 0;
+unsigned SizeOfPointer = 32;
void UpgradeAssembly(const std::string &infile, std::istream& in,
- std::ostream &out)
+ std::ostream &out, bool debug)
{
Upgradelineno = 1;
CurFilename = infile;
LexInput = &in;
+ yydebug = debug;
O = &out;
if (yyparse()) {
@@ -351,6 +327,82 @@ void UpgradeAssembly(const std::string &infile, std::istream& in,
}
}
+const char* getCastOpcode(TypeInfo& SrcTy, TypeInfo&DstTy) {
+ unsigned SrcBits = SrcTy.getBitWidth();
+ unsigned DstBits = DstTy.getBitWidth();
+ const char* opcode = "bitcast";
+ // Run through the possibilities ...
+ if (DstTy.isIntegral()) { // Casting to integral
+ if (SrcTy.isIntegral()) { // Casting from integral
+ if (DstBits < SrcBits)
+ opcode = "trunc";
+ else if (DstBits > SrcBits) { // its an extension
+ if (SrcTy.isSigned())
+ opcode ="sext"; // signed -> SEXT
+ else
+ opcode = "zext"; // unsigned -> ZEXT
+ } else {
+ opcode = "bitcast"; // Same size, No-op cast
+ }
+ } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
+ if (DstTy.isSigned())
+ opcode = "fptosi"; // FP -> sint
+ else
+ opcode = "fptoui"; // FP -> uint
+ } else if (SrcTy.isPacked()) {
+ assert(DstBits == SrcTy.getBitWidth() &&
+ "Casting packed to integer of different width");
+ opcode = "bitcast"; // same size, no-op cast
+ } else {
+ assert(SrcTy.isPointer() &&
+ "Casting from a value that is not first-class type");
+ opcode = "ptrtoint"; // ptr -> int
+ }
+ } else if (DstTy.isFloatingPoint()) { // Casting to floating pt
+ if (SrcTy.isIntegral()) { // Casting from integral
+ if (SrcTy.isSigned())
+ opcode = "sitofp"; // sint -> FP
+ else
+ opcode = "uitofp"; // uint -> FP
+ } else if (SrcTy.isFloatingPoint()) { // Casting from floating pt
+ if (DstBits < SrcBits) {
+ opcode = "fptrunc"; // FP -> smaller FP
+ } else if (DstBits > SrcBits) {
+ opcode = "fpext"; // FP -> larger FP
+ } else {
+ opcode ="bitcast"; // same size, no-op cast
+ }
+ } else if (SrcTy.isPacked()) {
+ assert(DstBits == SrcTy.getBitWidth() &&
+ "Casting packed to floating point of different width");
+ opcode = "bitcast"; // same size, no-op cast
+ } else {
+ assert(0 && "Casting pointer or non-first class to float");
+ }
+ } else if (DstTy.isPacked()) {
+ if (SrcTy.isPacked()) {
+ assert(DstTy.getBitWidth() == SrcTy.getBitWidth() &&
+ "Casting packed to packed of different widths");
+ opcode = "bitcast"; // packed -> packed
+ } else if (DstTy.getBitWidth() == SrcBits) {
+ opcode = "bitcast"; // float/int -> packed
+ } else {
+ assert(!"Illegal cast to packed (wrong type or size)");
+ }
+ } else if (DstTy.isPointer()) {
+ if (SrcTy.isPointer()) {
+ opcode = "bitcast"; // ptr -> ptr
+ } else if (SrcTy.isIntegral()) {
+ opcode = "inttoptr"; // int -> ptr
+ } else {
+ assert(!"Casting pointer to other than pointer or int");
+ }
+ } else {
+ assert(!"Casting to type that is not first-class");
+ }
+ return opcode;
+}
+
/* Enabling traces. */
@@ -372,7 +424,15 @@ void UpgradeAssembly(const std::string &infile, std::istream& in,
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-typedef int YYSTYPE;
+#line 130 "/proj/llvm/llvm-4/tools/llvm-upgrade/UpgradeParser.y"
+typedef union YYSTYPE {
+ std::string* String;
+ TypeInfo Type;
+ ValueInfo Value;
+ ConstInfo Const;
+} YYSTYPE;
+/* Line 196 of yacc.c. */
+#line 436 "UpgradeParser.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
@@ -384,7 +444,7 @@ typedef int YYSTYPE;
/* Line 219 of yacc.c. */
-#line 388 "UpgradeParser.tab.c"
+#line 448 "UpgradeParser.tab.c"
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
@@ -535,20 +595,20 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 4
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1246
+#define YYLAST 1193
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 138
+#define YYNTOKENS 126
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 71
+#define YYNNTS 70
/* YYNRULES -- Number of rules. */
-#define YYNRULES 251
+#define YYNRULES 249
/* YYNRULES -- Number of states. */
-#define YYNSTATES 510
+#define YYNSTATES 508
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 378
+#define YYMAXUTOK 366
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -560,15 +620,15 @@ static const unsigned char yytranslate[] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 127, 128, 136, 2, 125, 2, 2, 2, 2, 2,
+ 115, 116, 124, 2, 113, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 132, 124, 133, 2, 2, 2, 2, 2, 2, 2,
+ 120, 112, 121, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 129, 126, 131, 2, 2, 2, 2, 2, 137,
+ 2, 117, 114, 119, 2, 2, 2, 2, 2, 125,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 130, 2, 2, 134, 2, 135, 2, 2, 2, 2,
+ 118, 2, 2, 122, 2, 123, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -592,8 +652,7 @@ static const unsigned char yytranslate[] =
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
- 115, 116, 117, 118, 119, 120, 121, 122, 123
+ 105, 106, 107, 108, 109, 110, 111
};
#if YYDEBUG
@@ -605,146 +664,143 @@ static const unsigned short int yyprhs[] =
19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
- 79, 82, 83, 85, 87, 89, 91, 93, 95, 97,
- 98, 100, 102, 104, 106, 108, 110, 113, 114, 115,
- 118, 119, 123, 126, 127, 129, 130, 134, 136, 139,
+ 80, 81, 83, 85, 87, 89, 91, 93, 95, 96,
+ 98, 100, 102, 104, 106, 108, 111, 112, 113, 116,
+ 117, 121, 124, 125, 127, 128, 132, 134, 137, 139,
141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
- 161, 163, 165, 167, 169, 171, 173, 175, 177, 179,
- 181, 184, 189, 195, 201, 205, 208, 211, 213, 217,
- 219, 223, 225, 226, 231, 235, 239, 244, 249, 253,
- 256, 259, 262, 265, 268, 271, 274, 277, 280, 283,
- 290, 296, 305, 312, 319, 326, 333, 340, 349, 358,
- 362, 364, 366, 368, 370, 373, 376, 381, 384, 386,
- 391, 394, 399, 406, 413, 420, 427, 431, 436, 437,
- 439, 441, 443, 447, 451, 455, 459, 463, 467, 469,
- 470, 472, 474, 476, 477, 480, 484, 486, 488, 492,
- 494, 495, 504, 506, 508, 512, 514, 516, 520, 521,
- 523, 525, 529, 530, 532, 534, 536, 538, 540, 542,
- 544, 546, 548, 552, 554, 560, 562, 564, 566, 568,
- 571, 574, 576, 580, 583, 584, 586, 589, 592, 596,
- 606, 616, 625, 639, 641, 643, 650, 656, 659, 666,
- 674, 676, 680, 682, 683, 686, 688, 694, 700, 706,
- 709, 714, 719, 726, 731, 736, 743, 750, 753, 761,
- 763, 766, 767, 769, 770, 774, 781, 785, 792, 795,
- 800, 807
+ 161, 163, 165, 167, 169, 171, 173, 175, 177, 180,
+ 185, 191, 197, 201, 204, 207, 209, 213, 215, 219,
+ 221, 222, 227, 231, 235, 240, 245, 249, 252, 255,
+ 258, 261, 264, 267, 270, 273, 276, 279, 286, 292,
+ 301, 308, 315, 322, 329, 336, 345, 354, 358, 360,
+ 362, 364, 366, 369, 372, 377, 380, 382, 387, 390,
+ 395, 402, 409, 416, 423, 427, 432, 433, 435, 437,
+ 439, 443, 447, 451, 455, 459, 463, 465, 466, 468,
+ 470, 472, 473, 476, 480, 482, 484, 488, 490, 491,
+ 500, 502, 504, 508, 510, 512, 516, 517, 519, 521,
+ 525, 526, 528, 530, 532, 534, 536, 538, 540, 542,
+ 544, 548, 550, 556, 558, 560, 562, 564, 567, 570,
+ 572, 576, 579, 580, 582, 585, 588, 592, 602, 612,
+ 621, 635, 637, 639, 646, 652, 655, 662, 670, 672,
+ 676, 678, 679, 682, 684, 690, 696, 702, 705, 710,
+ 715, 722, 727, 732, 739, 746, 749, 757, 759, 762,
+ 763, 765, 766, 770, 777, 781, 788, 791, 796, 803
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short int yyrhs[] =
{
- 170, 0, -1, 5, -1, 6, -1, 3, -1, 4,
+ 157, 0, -1, 5, -1, 6, -1, 3, -1, 4,
-1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
-1, 83, -1, 84, -1, 85, -1, 86, -1, 87,
-1, 88, -1, 89, -1, 90, -1, 91, -1, 92,
- -1, 93, -1, 94, -1, 95, -1, 123, -1, 116,
- -1, 117, -1, 118, -1, 16, -1, 14, -1, 12,
- -1, 10, -1, 17, -1, 15, -1, 13, -1, 11,
- -1, 146, -1, 147, -1, 18, -1, 19, -1, 178,
- 124, -1, -1, 41, -1, 42, -1, 43, -1, 44,
- -1, 45, -1, 46, -1, 47, -1, -1, 65, -1,
- 66, -1, 67, -1, 68, -1, 69, -1, 70, -1,
- 64, 4, -1, -1, -1, 57, 4, -1, -1, 125,
- 57, 4, -1, 34, 24, -1, -1, 155, -1, -1,
- 125, 158, 157, -1, 155, -1, 57, 4, -1, 161,
- -1, 8, -1, 163, -1, 8, -1, 163, -1, 9,
- -1, 10, -1, 11, -1, 12, -1, 13, -1, 14,
- -1, 15, -1, 16, -1, 17, -1, 18, -1, 19,
- -1, 20, -1, 21, -1, 48, -1, 162, -1, 192,
- -1, 126, 4, -1, 160, 127, 165, 128, -1, 129,
- 4, 130, 163, 131, -1, 132, 4, 130, 163, 133,
- -1, 134, 164, 135, -1, 134, 135, -1, 163, 136,
- -1, 163, -1, 164, 125, 163, -1, 164, -1, 164,
- 125, 37, -1, 37, -1, -1, 161, 129, 168, 131,
- -1, 161, 129, 131, -1, 161, 137, 24, -1, 161,
- 132, 168, 133, -1, 161, 134, 168, 135, -1, 161,
- 134, 135, -1, 161, 38, -1, 161, 39, -1, 161,
- 192, -1, 161, 167, -1, 161, 26, -1, 146, 140,
- -1, 147, 4, -1, 9, 27, -1, 9, 28, -1,
- 149, 7, -1, 144, 127, 166, 36, 161, 128, -1,
- 101, 127, 166, 206, 128, -1, 115, 127, 166, 125,
- 166, 125, 166, 128, -1, 141, 127, 166, 125, 166,
- 128, -1, 142, 127, 166, 125, 166, 128, -1, 143,
- 127, 166, 125, 166, 128, -1, 145, 127, 166, 125,
- 166, 128, -1, 120, 127, 166, 125, 166, 128, -1,
- 121, 127, 166, 125, 166, 125, 166, 128, -1, 122,
- 127, 166, 125, 166, 125, 166, 128, -1, 168, 125,
- 166, -1, 166, -1, 32, -1, 33, -1, 171, -1,
- 171, 187, -1, 171, 189, -1, 171, 62, 61, 173,
- -1, 171, 25, -1, 172, -1, 172, 150, 20, 159,
- -1, 172, 189, -1, 172, 62, 61, 173, -1, 172,
- 150, 151, 169, 166, 157, -1, 172, 150, 50, 169,
- 161, 157, -1, 172, 150, 45, 169, 161, 157, -1,
- 172, 150, 47, 169, 161, 157, -1, 172, 51, 175,
- -1, 172, 58, 124, 176, -1, -1, 24, -1, 56,
- -1, 55, -1, 53, 124, 174, -1, 54, 124, 4,
- -1, 52, 124, 24, -1, 71, 124, 24, -1, 129,
- 177, 131, -1, 177, 125, 24, -1, 24, -1, -1,
- 22, -1, 24, -1, 178, -1, -1, 161, 179, -1,
- 181, 125, 180, -1, 180, -1, 181, -1, 181, 125,
- 37, -1, 37, -1, -1, 152, 159, 178, 127, 182,
- 128, 156, 153, -1, 29, -1, 134, -1, 151, 183,
- 184, -1, 30, -1, 135, -1, 185, 195, 186, -1,
- -1, 45, -1, 47, -1, 31, 188, 183, -1, -1,
- 63, -1, 3, -1, 4, -1, 7, -1, 27, -1,
- 28, -1, 38, -1, 39, -1, 26, -1, 132, 168,
- 133, -1, 167, -1, 61, 190, 24, 125, 24, -1,
- 139, -1, 178, -1, 192, -1, 191, -1, 161, 193,
- -1, 195, 196, -1, 196, -1, 197, 150, 198, -1,
- 197, 200, -1, -1, 23, -1, 72, 194, -1, 72,
- 8, -1, 73, 21, 193, -1, 73, 9, 193, 125,
- 21, 193, 125, 21, 193, -1, 74, 148, 193, 125,
- 21, 193, 129, 199, 131, -1, 74, 148, 193, 125,
- 21, 193, 129, 131, -1, 75, 152, 159, 193, 127,
- 203, 128, 36, 21, 193, 76, 21, 193, -1, 76,
- -1, 77, -1, 199, 148, 191, 125, 21, 193, -1,
- 148, 191, 125, 21, 193, -1, 150, 205, -1, 161,
- 129, 193, 125, 193, 131, -1, 201, 125, 129, 193,
- 125, 193, 131, -1, 194, -1, 202, 125, 194, -1,
- 202, -1, -1, 60, 59, -1, 59, -1, 141, 161,
- 193, 125, 193, -1, 142, 161, 193, 125, 193, -1,
- 143, 161, 193, 125, 193, -1, 49, 194, -1, 145,
- 194, 125, 194, -1, 144, 194, 36, 161, -1, 115,
- 194, 125, 194, 125, 194, -1, 119, 194, 125, 161,
- -1, 120, 194, 125, 194, -1, 121, 194, 125, 194,
- 125, 194, -1, 122, 194, 125, 194, 125, 194, -1,
- 114, 201, -1, 204, 152, 159, 193, 127, 203, 128,
- -1, 208, -1, 125, 202, -1, -1, 35, -1, -1,
- 96, 161, 154, -1, 96, 161, 125, 15, 193, 154,
- -1, 97, 161, 154, -1, 97, 161, 125, 15, 193,
- 154, -1, 98, 194, -1, 207, 99, 161, 193, -1,
- 207, 100, 194, 125, 161, 193, -1, 101, 161, 193,
- 206, -1
+ -1, 93, -1, 94, -1, 95, -1, 104, -1, 105,
+ -1, 106, -1, 21, -1, 19, -1, 17, -1, 15,
+ -1, 22, -1, 20, -1, 18, -1, 16, -1, 133,
+ -1, 134, -1, 23, -1, 24, -1, 165, 112, -1,
+ -1, 42, -1, 43, -1, 44, -1, 48, -1, 45,
+ -1, 46, -1, 47, -1, -1, 65, -1, 66, -1,
+ 67, -1, 68, -1, 69, -1, 70, -1, 64, 4,
+ -1, -1, -1, 57, 4, -1, -1, 113, 57, 4,
+ -1, 37, 30, -1, -1, 142, -1, -1, 113, 145,
+ 144, -1, 142, -1, 57, 4, -1, 148, -1, 13,
+ -1, 150, -1, 13, -1, 150, -1, 14, -1, 15,
+ -1, 16, -1, 17, -1, 18, -1, 19, -1, 20,
+ -1, 21, -1, 22, -1, 23, -1, 24, -1, 25,
+ -1, 26, -1, 149, -1, 179, -1, 114, 4, -1,
+ 147, 115, 152, 116, -1, 117, 4, 118, 150, 119,
+ -1, 120, 4, 118, 150, 121, -1, 122, 151, 123,
+ -1, 122, 123, -1, 150, 124, -1, 150, -1, 151,
+ 113, 150, -1, 151, -1, 151, 113, 40, -1, 40,
+ -1, -1, 148, 117, 155, 119, -1, 148, 117, 119,
+ -1, 148, 125, 30, -1, 148, 120, 155, 121, -1,
+ 148, 122, 155, 123, -1, 148, 122, 123, -1, 148,
+ 10, -1, 148, 11, -1, 148, 179, -1, 148, 154,
+ -1, 148, 12, -1, 133, 128, -1, 134, 4, -1,
+ 14, 8, -1, 14, 9, -1, 136, 7, -1, 111,
+ 115, 153, 39, 148, 116, -1, 101, 115, 153, 193,
+ 116, -1, 103, 115, 153, 113, 153, 113, 153, 116,
+ -1, 129, 115, 153, 113, 153, 116, -1, 130, 115,
+ 153, 113, 153, 116, -1, 131, 115, 153, 113, 153,
+ 116, -1, 132, 115, 153, 113, 153, 116, -1, 108,
+ 115, 153, 113, 153, 116, -1, 109, 115, 153, 113,
+ 153, 113, 153, 116, -1, 110, 115, 153, 113, 153,
+ 113, 153, 116, -1, 155, 113, 153, -1, 153, -1,
+ 35, -1, 36, -1, 158, -1, 158, 174, -1, 158,
+ 176, -1, 158, 62, 61, 160, -1, 158, 31, -1,
+ 159, -1, 159, 137, 27, 146, -1, 159, 176, -1,
+ 159, 62, 61, 160, -1, 159, 137, 138, 156, 153,
+ 144, -1, 159, 137, 50, 156, 148, 144, -1, 159,
+ 137, 45, 156, 148, 144, -1, 159, 137, 47, 156,
+ 148, 144, -1, 159, 51, 162, -1, 159, 58, 112,
+ 163, -1, -1, 30, -1, 56, -1, 55, -1, 53,
+ 112, 161, -1, 54, 112, 4, -1, 52, 112, 30,
+ -1, 71, 112, 30, -1, 117, 164, 119, -1, 164,
+ 113, 30, -1, 30, -1, -1, 28, -1, 30, -1,
+ 165, -1, -1, 148, 166, -1, 168, 113, 167, -1,
+ 167, -1, 168, -1, 168, 113, 40, -1, 40, -1,
+ -1, 139, 146, 165, 115, 169, 116, 143, 140, -1,
+ 32, -1, 122, -1, 138, 170, 171, -1, 33, -1,
+ 123, -1, 172, 182, 173, -1, -1, 45, -1, 47,
+ -1, 34, 175, 170, -1, -1, 63, -1, 3, -1,
+ 4, -1, 7, -1, 8, -1, 9, -1, 10, -1,
+ 11, -1, 12, -1, 120, 155, 121, -1, 154, -1,
+ 61, 177, 30, 113, 30, -1, 127, -1, 165, -1,
+ 179, -1, 178, -1, 148, 180, -1, 182, 183, -1,
+ 183, -1, 184, 137, 185, -1, 184, 187, -1, -1,
+ 29, -1, 72, 181, -1, 72, 13, -1, 73, 25,
+ 180, -1, 73, 14, 180, 113, 25, 180, 113, 25,
+ 180, -1, 74, 135, 180, 113, 25, 180, 117, 186,
+ 119, -1, 74, 135, 180, 113, 25, 180, 117, 119,
+ -1, 75, 139, 146, 180, 115, 190, 116, 39, 25,
+ 180, 76, 25, 180, -1, 76, -1, 77, -1, 186,
+ 135, 178, 113, 25, 180, -1, 135, 178, 113, 25,
+ 180, -1, 137, 192, -1, 148, 117, 180, 113, 180,
+ 119, -1, 188, 113, 117, 180, 113, 180, 119, -1,
+ 181, -1, 189, 113, 181, -1, 189, -1, -1, 60,
+ 59, -1, 59, -1, 129, 148, 180, 113, 180, -1,
+ 130, 148, 180, 113, 180, -1, 131, 148, 180, 113,
+ 180, -1, 49, 181, -1, 132, 181, 113, 181, -1,
+ 111, 181, 39, 148, -1, 103, 181, 113, 181, 113,
+ 181, -1, 107, 181, 113, 148, -1, 108, 181, 113,
+ 181, -1, 109, 181, 113, 181, 113, 181, -1, 110,
+ 181, 113, 181, 113, 181, -1, 102, 188, -1, 191,
+ 139, 146, 180, 115, 190, 116, -1, 195, -1, 113,
+ 189, -1, -1, 38, -1, -1, 96, 148, 141, -1,
+ 96, 148, 113, 20, 180, 141, -1, 97, 148, 141,
+ -1, 97, 148, 113, 20, 180, 141, -1, 98, 181,
+ -1, 194, 99, 148, 180, -1, 194, 100, 181, 113,
+ 148, 180, -1, 101, 148, 180, 193, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short int yyrline[] =
{
- 0, 84, 84, 84, 85, 85, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 90, 90, 90, 91, 91,
- 91, 91, 91, 91, 92, 93, 93, 93, 97, 97,
- 97, 97, 98, 98, 98, 98, 99, 99, 100, 100,
- 103, 107, 112, 112, 112, 112, 112, 112, 113, 114,
- 117, 117, 117, 117, 117, 118, 118, 119, 124, 125,
- 128, 129, 137, 143, 144, 147, 148, 157, 158, 171,
- 171, 172, 172, 173, 177, 177, 177, 177, 177, 177,
- 177, 178, 178, 178, 178, 178, 178, 179, 179, 179,
- 183, 187, 192, 198, 204, 209, 212, 220, 220, 227,
- 228, 233, 236, 246, 251, 254, 259, 264, 269, 272,
- 277, 282, 287, 292, 298, 303, 308, 313, 318, 325,
- 330, 332, 334, 336, 338, 340, 342, 344, 346, 351,
- 353, 358, 358, 368, 373, 376, 381, 384, 387, 391,
- 396, 401, 406, 411, 416, 421, 426, 431, 436, 441,
- 443, 443, 446, 451, 456, 461, 468, 475, 480, 481,
- 489, 489, 490, 490, 492, 498, 501, 505, 508, 512,
- 515, 519, 534, 537, 541, 550, 551, 553, 559, 560,
- 561, 565, 575, 577, 580, 580, 580, 580, 580, 581,
- 581, 581, 582, 587, 588, 597, 597, 600, 600, 606,
- 612, 614, 621, 625, 630, 633, 639, 644, 649, 654,
- 660, 666, 672, 681, 686, 692, 697, 704, 711, 716,
- 724, 725, 733, 734, 738, 743, 746, 751, 756, 761,
- 766, 771, 776, 781, 786, 791, 796, 801, 806, 815,
- 820, 824, 828, 829, 832, 839, 846, 853, 860, 865,
- 872, 879
+ 0, 189, 189, 189, 190, 190, 194, 194, 194, 194,
+ 194, 194, 194, 194, 194, 195, 195, 195, 196, 196,
+ 196, 196, 196, 196, 197, 197, 197, 201, 201, 201,
+ 201, 202, 202, 202, 202, 203, 203, 204, 204, 207,
+ 211, 216, 216, 216, 216, 216, 216, 217, 218, 221,
+ 221, 221, 221, 221, 222, 222, 223, 228, 229, 232,
+ 233, 241, 247, 248, 251, 252, 261, 262, 275, 275,
+ 276, 276, 277, 281, 281, 281, 281, 281, 281, 281,
+ 282, 282, 282, 282, 282, 283, 283, 283, 288, 293,
+ 299, 306, 313, 319, 323, 333, 336, 344, 345, 350,
+ 353, 363, 369, 374, 380, 386, 392, 397, 403, 409,
+ 415, 421, 427, 433, 439, 445, 451, 459, 466, 472,
+ 477, 482, 487, 492, 497, 502, 507, 517, 522, 527,
+ 527, 537, 542, 545, 550, 553, 556, 560, 565, 570,
+ 575, 581, 587, 593, 599, 604, 609, 614, 616, 616,
+ 619, 624, 631, 636, 643, 650, 655, 656, 664, 664,
+ 665, 665, 667, 674, 678, 682, 685, 690, 693, 697,
+ 717, 720, 724, 733, 734, 736, 744, 745, 746, 750,
+ 763, 765, 769, 770, 771, 772, 773, 774, 775, 776,
+ 777, 782, 783, 792, 792, 795, 795, 801, 808, 810,
+ 817, 821, 826, 829, 835, 840, 845, 850, 857, 863,
+ 869, 878, 883, 889, 894, 902, 909, 915, 923, 924,
+ 932, 933, 937, 942, 945, 950, 955, 960, 965, 970,
+ 977, 982, 987, 992, 997, 1002, 1007, 1016, 1021, 1025,
+ 1029, 1030, 1033, 1040, 1047, 1054, 1061, 1066, 1073, 1080
};
#endif
@@ -754,28 +810,26 @@ static const unsigned short int yyrline[] =
static const char *const yytname[] =
{
"$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL",
- "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT",
- "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL",
- "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
- "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK",
- "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO",
- "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE",
- "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
- "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE",
- "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE",
- "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK",
- "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT",
- "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB",
- "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR",
- "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC",
- "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT",
- "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI",
- "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "SHL", "LSHR",
+ "UINTVAL", "FPVAL", "TRUETOK", "FALSETOK", "NULL_TOK", "UNDEF",
+ "ZEROINITIALIZER", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT",
+ "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "LABEL", "OPAQUE",
+ "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
+ "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
+ "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
+ "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "NOT", "EXTERNAL",
+ "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
+ "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK",
+ "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK", "COLDCC_TOK",
+ "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", "RET", "BR",
+ "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV",
+ "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", "XOR", "SETLE",
+ "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "MALLOC", "ALLOCA", "FREE",
+ "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "LSHR",
"ASHR", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
"CAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'",
- "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL",
- "ArithmeticOps", "LogicalOps", "SetCondOps", "CastOps", "ShiftOps",
- "SIntType", "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage",
+ "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "IntVal", "EInt64Val",
+ "ArithmeticOps", "LogicalOps", "SetCondOps", "ShiftOps", "SIntType",
+ "UIntType", "IntType", "FPType", "OptAssign", "OptLinkage",
"OptCallingConv", "OptAlign", "OptCAlign", "SectionString", "OptSection",
"GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV",
"Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal",
@@ -807,41 +861,39 @@ static const unsigned short int yytoknum[] =
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
- 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
- 375, 376, 377, 378, 61, 44, 92, 40, 41, 91,
- 120, 93, 60, 62, 123, 125, 42, 99
+ 365, 366, 61, 44, 92, 40, 41, 91, 120, 93,
+ 60, 62, 123, 125, 42, 99
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
- 0, 138, 139, 139, 140, 140, 141, 141, 141, 141,
- 141, 141, 141, 141, 141, 142, 142, 142, 143, 143,
- 143, 143, 143, 143, 144, 145, 145, 145, 146, 146,
- 146, 146, 147, 147, 147, 147, 148, 148, 149, 149,
- 150, 150, 151, 151, 151, 151, 151, 151, 151, 151,
- 152, 152, 152, 152, 152, 152, 152, 152, 153, 153,
- 154, 154, 155, 156, 156, 157, 157, 158, 158, 159,
- 159, 160, 160, 161, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 162, 162, 162, 162, 163, 163, 163,
- 163, 163, 163, 163, 163, 163, 163, 164, 164, 165,
- 165, 165, 165, 166, 166, 166, 166, 166, 166, 166,
- 166, 166, 166, 166, 166, 166, 166, 166, 166, 167,
- 167, 167, 167, 167, 167, 167, 167, 167, 167, 168,
- 168, 169, 169, 170, 171, 171, 171, 171, 171, 172,
- 172, 172, 172, 172, 172, 172, 172, 172, 172, 173,
- 174, 174, 175, 175, 175, 175, 176, 177, 177, 177,
- 178, 178, 179, 179, 180, 181, 181, 182, 182, 182,
- 182, 183, 184, 184, 185, 186, 186, 187, 188, 188,
- 188, 189, 190, 190, 191, 191, 191, 191, 191, 191,
- 191, 191, 191, 191, 191, 192, 192, 193, 193, 194,
- 195, 195, 196, 197, 197, 197, 198, 198, 198, 198,
- 198, 198, 198, 198, 198, 199, 199, 200, 201, 201,
- 202, 202, 203, 203, 204, 204, 205, 205, 205, 205,
- 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
- 206, 206, 207, 207, 208, 208, 208, 208, 208, 208,
- 208, 208
+ 0, 126, 127, 127, 128, 128, 129, 129, 129, 129,
+ 129, 129, 129, 129, 129, 130, 130, 130, 131, 131,
+ 131, 131, 131, 131, 132, 132, 132, 133, 133, 133,
+ 133, 134, 134, 134, 134, 135, 135, 136, 136, 137,
+ 137, 138, 138, 138, 138, 138, 138, 138, 138, 139,
+ 139, 139, 139, 139, 139, 139, 139, 140, 140, 141,
+ 141, 142, 143, 143, 144, 144, 145, 145, 146, 146,
+ 147, 147, 148, 149, 149, 149, 149, 149, 149, 149,
+ 149, 149, 149, 149, 149, 150, 150, 150, 150, 150,
+ 150, 150, 150, 150, 150, 151, 151, 152, 152, 152,
+ 152, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 154, 154, 154,
+ 154, 154, 154, 154, 154, 154, 154, 155, 155, 156,
+ 156, 157, 158, 158, 158, 158, 158, 159, 159, 159,
+ 159, 159, 159, 159, 159, 159, 159, 160, 161, 161,
+ 162, 162, 162, 162, 163, 164,