[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y UpgradeParser.y.cvs
Jeff Cohen
jeffc at jolt-lang.org
Sun Jan 21 11:34:59 PST 2007
Is one of the major features of bison 2.x the elimination of error
checking???
Jeff Cohen wrote:
> Changes in directory llvm/tools/llvm-upgrade:
>
> UpgradeParser.cpp.cvs updated: 1.43 -> 1.44
> UpgradeParser.h.cvs updated: 1.30 -> 1.31
> UpgradeParser.y updated: 1.42 -> 1.43
> UpgradeParser.y.cvs updated: 1.42 -> 1.43
> ---
> Log message:
>
> Fix a bunch of missing semicolon parse errors from bison.
>
> ---
> Diffs of the changes: (+1340 -1558)
>
> UpgradeParser.cpp.cvs | 2853 +++++++++++++++++++++++---------------------------
> UpgradeParser.h.cvs | 29
> UpgradeParser.y | 8
> UpgradeParser.y.cvs | 8
> 4 files changed, 1340 insertions(+), 1558 deletions(-)
>
>
> Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs
> diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.43 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.44
> --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.43 Sun Jan 14 20:41:46 2007
> +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Sun Jan 21 13:30:52 2007
> @@ -1,7 +1,7 @@
> -/* A Bison parser, made by GNU Bison 2.1. */
> +/* A Bison parser, made from /usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y, by GNU bison 1.75. */
>
> /* Skeleton parser for Yacc-like parsing with Bison,
> - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
> + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
>
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> @@ -15,8 +15,8 @@
>
> You should have received a copy of the GNU General Public License
> along with this program; if not, write to the Free Software
> - Foundation, Inc., 51 Franklin Street, Fifth Floor,
> - Boston, MA 02110-1301, USA. */
> + Foundation, Inc., 59 Temple Place - Suite 330,
> + Boston, MA 02111-1307, USA. */
>
> /* As a special exception, when this file is copied by Bison into a
> Bison output file, you may use that output file without restriction.
> @@ -34,21 +34,16 @@
> USER NAME SPACE" below. */
>
> /* Identify Bison output. */
> -#define YYBISON 1
> -
> -/* Bison version. */
> -#define YYBISON_VERSION "2.1"
> -
> -/* Skeleton name. */
> -#define YYSKELETON_NAME "yacc.c"
> +#define YYBISON 1
>
> /* Pure parsers. */
> -#define YYPURE 0
> +#define YYPURE 0
>
> /* Using locations. */
> #define YYLSP_NEEDED 0
>
> -/* Substitute the variable and function names. */
> +/* If NAME_PREFIX is specified substitute the variables and functions
> + names. */
> #define yyparse Upgradeparse
> #define yylex Upgradelex
> #define yyerror Upgradeerror
> @@ -213,7 +208,6 @@
> BITCAST = 404
> };
> #endif
> -/* Tokens. */
> #define VOID 258
> #define BOOL 259
> #define SBYTE 260
> @@ -366,7 +360,7 @@
>
>
> /* Copy the first part of user declarations. */
> -#line 14 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 14 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
>
> #include "UpgradeInternals.h"
> #include <algorithm>
> @@ -1335,75 +1329,53 @@
> # define YYERROR_VERBOSE 0
> #endif
>
> -/* Enabling the token table. */
> -#ifndef YYTOKEN_TABLE
> -# define YYTOKEN_TABLE 0
> -#endif
> -
> -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
> -#line 971 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> -typedef union YYSTYPE {
> +#ifndef YYSTYPE
> +#line 971 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> +typedef union {
> std::string* String;
> const Type* Ty;
> Value* Val;
> Constant* Const;
> ValueList* ValList;
> TypeList* TypeVec;
> -} YYSTYPE;
> -/* Line 196 of yacc.c. */
> -#line 1355 "UpgradeParser.tab.c"
> -# define yystype YYSTYPE /* obsolescent; will be withdrawn */
> -# define YYSTYPE_IS_DECLARED 1
> +} yystype;
> +/* Line 188 of /usr/local/share/bison/yacc.c. */
> +#line 1344 "UpgradeParser.tab.c"
> +# define YYSTYPE yystype
> # define YYSTYPE_IS_TRIVIAL 1
> #endif
>
> -
> +#ifndef YYLTYPE
> +typedef struct yyltype
> +{
> + int first_line;
> + int first_column;
> + int last_line;
> + int last_column;
> +} yyltype;
> +# define YYLTYPE yyltype
> +# define YYLTYPE_IS_TRIVIAL 1
> +#endif
>
> /* Copy the second part of user declarations. */
>
>
> -/* Line 219 of yacc.c. */
> -#line 1367 "UpgradeParser.tab.c"
> -
> -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
> -# define YYSIZE_T __SIZE_TYPE__
> -#endif
> -#if ! defined (YYSIZE_T) && defined (size_t)
> -# define YYSIZE_T size_t
> -#endif
> -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
> -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
> -# define YYSIZE_T size_t
> -#endif
> -#if ! defined (YYSIZE_T)
> -# define YYSIZE_T unsigned int
> -#endif
> -
> -#ifndef YY_
> -# if YYENABLE_NLS
> -# if ENABLE_NLS
> -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
> -# define YY_(msgid) dgettext ("bison-runtime", msgid)
> -# endif
> -# endif
> -# ifndef YY_
> -# define YY_(msgid) msgid
> -# endif
> -#endif
> +/* Line 213 of /usr/local/share/bison/yacc.c. */
> +#line 1365 "UpgradeParser.tab.c"
>
> #if ! defined (yyoverflow) || YYERROR_VERBOSE
>
> /* The parser invokes alloca or malloc; define the necessary symbols. */
>
> -# ifdef YYSTACK_USE_ALLOCA
> -# if YYSTACK_USE_ALLOCA
> -# ifdef __GNUC__
> -# define YYSTACK_ALLOC __builtin_alloca
> -# else
> +# if YYSTACK_USE_ALLOCA
> +# define YYSTACK_ALLOC alloca
> +# else
> +# ifndef YYSTACK_USE_ALLOCA
> +# if defined (alloca) || defined (_ALLOCA_H)
> # define YYSTACK_ALLOC alloca
> -# if defined (__STDC__) || defined (__cplusplus)
> -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
> -# define YYINCLUDED_STDLIB_H
> +# else
> +# ifdef __GNUC__
> +# define YYSTACK_ALLOC __builtin_alloca
> # endif
> # endif
> # endif
> @@ -1412,76 +1384,50 @@
> # ifdef YYSTACK_ALLOC
> /* Pacify GCC's `empty if-body' warning. */
> # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
> -# ifndef YYSTACK_ALLOC_MAXIMUM
> - /* The OS might guarantee only one guard page at the bottom of the stack,
> - and a page size can be as small as 4096 bytes. So we cannot safely
> - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
> - to allow for a few compiler-allocated temporary stack slots. */
> -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
> -# endif
> # else
> -# define YYSTACK_ALLOC YYMALLOC
> -# define YYSTACK_FREE YYFREE
> -# ifndef YYSTACK_ALLOC_MAXIMUM
> -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
> -# endif
> -# ifdef __cplusplus
> -extern "C" {
> -# endif
> -# ifndef YYMALLOC
> -# define YYMALLOC malloc
> -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
> - && (defined (__STDC__) || defined (__cplusplus)))
> -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
> -# endif
> -# endif
> -# ifndef YYFREE
> -# define YYFREE free
> -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
> - && (defined (__STDC__) || defined (__cplusplus)))
> -void free (void *); /* INFRINGES ON USER NAME SPACE */
> -# endif
> -# endif
> -# ifdef __cplusplus
> -}
> +# if defined (__STDC__) || defined (__cplusplus)
> +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
> +# define YYSIZE_T size_t
> # endif
> +# define YYSTACK_ALLOC malloc
> +# define YYSTACK_FREE free
> # endif
> #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
>
>
> #if (! defined (yyoverflow) \
> && (! defined (__cplusplus) \
> - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
> + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
>
> /* A type that is properly aligned for any stack member. */
> union yyalloc
> {
> - short int yyss;
> + short yyss;
> YYSTYPE yyvs;
> };
>
> /* The size of the maximum gap between one aligned stack and the next. */
> -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
> +# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
>
> /* The size of an array large to enough to hold all stacks, each with
> N elements. */
> # define YYSTACK_BYTES(N) \
> - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
> - + YYSTACK_GAP_MAXIMUM)
> + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
> + + YYSTACK_GAP_MAX)
>
> /* Copy COUNT objects from FROM to TO. The source and destination do
> not overlap. */
> # ifndef YYCOPY
> -# if defined (__GNUC__) && 1 < __GNUC__
> +# if 1 < __GNUC__
> # define YYCOPY(To, From, Count) \
> __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
> # else
> # define YYCOPY(To, From, Count) \
> do \
> { \
> - YYSIZE_T yyi; \
> + register YYSIZE_T yyi; \
> for (yyi = 0; yyi < (Count); yyi++) \
> - (To)[yyi] = (From)[yyi]; \
> + (To)[yyi] = (From)[yyi]; \
> } \
> while (0)
> # endif
> @@ -1498,7 +1444,7 @@
> YYSIZE_T yynewbytes; \
> YYCOPY (&yyptr->Stack, Stack, yysize); \
> Stack = &yyptr->Stack; \
> - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
> + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
> yyptr += yynewbytes / sizeof (*yyptr); \
> } \
> while (0)
> @@ -1508,12 +1454,11 @@
> #if defined (__STDC__) || defined (__cplusplus)
> typedef signed char yysigned_char;
> #else
> - typedef short int yysigned_char;
> + typedef short yysigned_char;
> #endif
>
> /* YYFINAL -- State number of the termination state. */
> #define YYFINAL 4
> -/* YYLAST -- Last index in YYTABLE. */
> #define YYLAST 1473
>
> /* YYNTOKENS -- Number of terminals. */
> @@ -1529,8 +1474,8 @@
> #define YYUNDEFTOK 2
> #define YYMAXUTOK 404
>
> -#define YYTRANSLATE(YYX) \
> - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
> +#define YYTRANSLATE(X) \
> + ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)
>
> /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
> static const unsigned char yytranslate[] =
> @@ -1581,7 +1526,7 @@
> #if YYDEBUG
> /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
> YYRHS. */
> -static const unsigned short int yyprhs[] =
> +static const unsigned short yyprhs[] =
> {
> 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
> 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
> @@ -1617,7 +1562,7 @@
> };
>
> /* YYRHS -- A `-1'-separated list of the rules' RHS. */
> -static const short int yyrhs[] =
> +static const short yyrhs[] =
> {
> 198, 0, -1, 19, -1, 20, -1, 17, -1, 18,
> -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
> @@ -1716,7 +1661,7 @@
> };
>
> /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
> -static const unsigned short int yyrline[] =
> +static const unsigned short yyrline[] =
> {
> 0, 1036, 1036, 1036, 1037, 1037, 1041, 1041, 1041, 1041,
> 1041, 1041, 1041, 1042, 1042, 1042, 1042, 1043, 1043, 1043,
> @@ -1724,7 +1669,7 @@
> 1045, 1045, 1045, 1045, 1045, 1045, 1046, 1046, 1046, 1046,
> 1046, 1046, 1046, 1046, 1046, 1046, 1047, 1047, 1047, 1047,
> 1047, 1047, 1048, 1048, 1048, 1048, 1049, 1049, 1049, 1049,
> - 1049, 1049, 1049, 1050, 1050, 1050, 1050, 1050, 1050, 1055,
> + 1049, 1049, 1049, 1049, 1050, 1050, 1050, 1050, 1050, 1055,
> 1055, 1055, 1055, 1056, 1056, 1056, 1056, 1057, 1057, 1058,
> 1058, 1061, 1064, 1069, 1069, 1069, 1069, 1069, 1069, 1070,
> 1071, 1074, 1074, 1074, 1074, 1074, 1075, 1076, 1081, 1086,
> @@ -1736,73 +1681,74 @@
> 1280, 1286, 1293, 1300, 1308, 1315, 1322, 1329, 1336, 1343,
> 1350, 1358, 1372, 1384, 1389, 1395, 1400, 1406, 1411, 1416,
> 1424, 1429, 1434, 1444, 1449, 1454, 1454, 1464, 1469, 1472,
> - 1477, 1481, 1485, 1487, 1487, 1490, 1500, 1505, 1510, 1520,
> - 1530, 1540, 1550, 1555, 1560, 1565, 1567, 1567, 1570, 1575,
> - 1582, 1587, 1594, 1601, 1606, 1607, 1615, 1615, 1616, 1616,
> - 1618, 1627, 1631, 1635, 1638, 1643, 1646, 1649, 1672, 1673,
> - 1676, 1687, 1688, 1690, 1699, 1700, 1701, 1705, 1705, 1719,
> - 1720, 1723, 1723, 1723, 1723, 1723, 1723, 1723, 1724, 1725,
> - 1730, 1731, 1740, 1740, 1744, 1750, 1761, 1770, 1773, 1781,
> - 1785, 1790, 1793, 1799, 1799, 1801, 1806, 1811, 1816, 1824,
> - 1834, 1843, 1865, 1870, 1876, 1882, 1890, 1908, 1917, 1927,
> - 1931, 1938, 1939, 1943, 1948, 1951, 1962, 1972, 1983, 1993,
> - 2003, 2014, 2044, 2053, 2060, 2069, 2076, 2083, 2089, 2140,
> - 2145, 2146, 2150, 2151, 2154, 2163, 2173, 2182, 2193, 2200,
> - 2211, 2222
> + 1477, 1481, 1485, 1488, 1488, 1491, 1501, 1506, 1511, 1521,
> + 1531, 1541, 1551, 1556, 1561, 1566, 1568, 1568, 1571, 1576,
> + 1583, 1588, 1595, 1602, 1607, 1608, 1616, 1616, 1617, 1617,
> + 1619, 1628, 1632, 1636, 1639, 1644, 1647, 1650, 1673, 1674,
> + 1678, 1689, 1690, 1692, 1701, 1702, 1703, 1707, 1707, 1721,
> + 1722, 1725, 1725, 1725, 1725, 1725, 1725, 1725, 1726, 1727,
> + 1732, 1733, 1742, 1742, 1746, 1752, 1763, 1772, 1775, 1783,
> + 1787, 1792, 1795, 1801, 1801, 1803, 1808, 1813, 1818, 1826,
> + 1836, 1845, 1867, 1872, 1878, 1884, 1892, 1910, 1919, 1929,
> + 1933, 1940, 1941, 1945, 1950, 1953, 1964, 1974, 1985, 1995,
> + 2005, 2016, 2046, 2055, 2062, 2071, 2078, 2085, 2091, 2142,
> + 2147, 2148, 2152, 2153, 2156, 2165, 2175, 2184, 2195, 2202,
> + 2213, 2224
> };
> #endif
>
> -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
> -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
> +#if YYDEBUG || YYERROR_VERBOSE
> +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
> First, the terminals, then, starting at YYNTOKENS, nonterminals. */
> static const char *const yytname[] =
> {
> - "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE",
> - "SHORT", "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE",
> - "LABEL", "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL",
> - "FPVAL", "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK",
> - "TYPE", "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION",
> - "BEGINTOK", "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION",
> - "VOLATILE", "TO", "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK",
> - "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "EXTERNAL",
> - "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN",
> - "UNINITIALIZED", "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", "EXCEPT", "UNWIND", "UNREACHABLE",
> - "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM",
> - "SREM", "FREM", "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT",
> - "SETEQ", "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
> - "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE",
> - "ULT", "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
> - "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
> - "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
> - "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
> - "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
> - "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
> - "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
> - "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
> - "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
> - "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign", "SectionString",
> - "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "TypesV",
> - "UpRTypesV", "Types", "PrimType", "UpRTypes", "TypeListI",
> - "ArgTypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
> - "Module", "DefinitionList", "External", "ConstPool", "AsmBlock",
> - "BigOrLittle", "TargetDefinition", "LibrariesDefinition", "LibList",
> - "Name", "OptName", "ArgVal", "ArgListH", "ArgList", "FunctionHeaderH",
> - "BEGIN", "FunctionHeader", "END", "Function", "FnDeclareLinkage",
> - "FunctionProto", "@1", "OptSideEffect", "ConstValueRef",
> - "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList",
> - "BasicBlock", "InstructionList", "Unwind", "BBTerminatorInst",
> - "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE",
> - "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0
> + "$end", "error", "$undefined", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT",
> + "USHORT", "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "LABEL",
> + "OPAQUE", "ESINT64VAL", "EUINT64VAL", "SINTVAL", "UINTVAL", "FPVAL",
> + "NULL_TOK", "UNDEF", "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "TYPE",
> + "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", "BEGINTOK",
> + "ENDTOK", "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO",
> + "DOTDOTDOT", "CONST", "INTERNAL", "LINKONCE", "WEAK", "DLLIMPORT",
> + "DLLEXPORT", "EXTERN_WEAK", "APPENDING", "EXTERNAL", "TARGET", "TRIPLE",
> + "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN", "UNINITIALIZED",
> + "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", "EXCEPT", "UNWIND", "UNREACHABLE", "ADD", "SUB",
> + "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM", "SREM", "FREM",
> + "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ",
> + "SETNE", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "OEQ",
> + "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "ULT",
> + "UGT", "ULE", "UGE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
> + "GETELEMENTPTR", "PHI_TOK", "SELECT", "SHL", "SHR", "ASHR", "LSHR",
> + "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "CAST",
> + "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "FPTOUI", "FPTOSI",
> + "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", "BITCAST", "'='", "','",
> + "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
> + "'*'", "'c'", "$accept", "IntVal", "EInt64Val", "ArithmeticOps",
> + "LogicalOps", "SetCondOps", "IPredicates", "FPredicates", "ShiftOps",
> + "CastOps", "SIntType", "UIntType", "IntType", "FPType", "OptAssign",
> + "OptLinkage", "OptCallingConv", "OptAlign", "OptCAlign",
> + "SectionString", "OptSection", "GlobalVarAttributes",
> + "GlobalVarAttribute", "TypesV", "UpRTypesV", "Types", "PrimType",
> + "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", "ConstExpr",
> + "ConstVector", "GlobalType", "Module", "DefinitionList", "External",
> + "ConstPool", "AsmBlock", "BigOrLittle", "TargetDefinition",
> + "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal",
> + "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader",
> + "END", "Function", "FnDeclareLinkage", "FunctionProto", "@1",
> + "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef",
> + "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList",
> + "Unwind", "BBTerminatorInst", "JumpTable", "Inst", "PHIList",
> + "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal", "IndexList",
> + "OptVolatile", "MemoryInst", 0
> };
> #endif
>
> # ifdef YYPRINT
> /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
> token YYLEX-NUM. */
> -static const unsigned short int yytoknum[] =
> +static const unsigned short yytoknum[] =
> {
> 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
> 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
> @@ -1899,7 +1845,7 @@
> /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
> STATE-NUM when YYTABLE doesn't specify something else to do. Zero
> means the default is an error. */
> -static const unsigned short int yydefact[] =
> +static const unsigned short yydefact[] =
> {
> 194, 0, 90, 182, 1, 181, 227, 83, 84, 85,
> 87, 88, 89, 86, 0, 98, 251, 178, 179, 206,
> @@ -1963,7 +1909,7 @@
> };
>
> /* YYDEFGOTO[NTERM-NUM]. */
> -static const short int yydefgoto[] =
> +static const short yydefgoto[] =
> {
> -1, 83, 336, 266, 267, 268, 290, 307, 269, 270,
> 233, 234, 149, 235, 24, 15, 36, 507, 384, 406,
> @@ -1978,7 +1924,7 @@
> /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
> STATE-NUM. */
> #define YYPACT_NINF -537
> -static const short int yypact[] =
> +static const short yypact[] =
> {
> -537, 75, 61, 1145, -537, -537, -537, -537, -537, -537,
> -537, -537, -537, -537, 18, 180, 55, -537, -537, -537,
> @@ -2042,7 +1988,7 @@
> };
>
> /* YYPGOTO[NTERM-NUM]. */
> -static const short int yypgoto[] =
> +static const short yypgoto[] =
> {
> -537, -537, 226, 361, 362, 365, 209, 214, 368, 370,
> -99, -98, -507, -537, 420, 452, -134, -537, -303, 57,
> @@ -2057,9 +2003,9 @@
> /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
> positive, shift that token. If negative, reduce the rule which
> number is the opposite. If zero, do what YYDEFACT says.
> - If YYTABLE_NINF, syntax error. */
> + If YYTABLE_NINF, parse error. */
> #define YYTABLE_NINF -178
> -static const short int yytable[] =
> +static const short yytable[] =
> {
> 86, 147, 148, 129, 115, 331, 386, 25, 91, 237,
> 136, 442, 125, 86, 38, 552, 565, 444, 94, 279,
> @@ -2211,7 +2157,7 @@
> 199, 200, 201, 202
> };
>
> -static const short int yycheck[] =
> +static const short yycheck[] =
> {
> 36, 100, 100, 82, 49, 221, 309, 3, 32, 120,
> 98, 10, 18, 49, 29, 522, 552, 10, 33, 153,
> @@ -2428,15 +2374,30 @@
> 15, 228, 223, 15, 223
> };
>
> +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
> +# define YYSIZE_T __SIZE_TYPE__
> +#endif
> +#if ! defined (YYSIZE_T) && defined (size_t)
> +# define YYSIZE_T size_t
> +#endif
> +#if ! defined (YYSIZE_T)
> +# if defined (__STDC__) || defined (__cplusplus)
> +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
> +# define YYSIZE_T size_t
> +# endif
> +#endif
> +#if ! defined (YYSIZE_T)
> +# define YYSIZE_T unsigned int
> +#endif
> +
> #define yyerrok (yyerrstatus = 0)
> #define yyclearin (yychar = YYEMPTY)
> -#define YYEMPTY (-2)
> +#define YYEMPTY -2
> #define YYEOF 0
>
> #define YYACCEPT goto yyacceptlab
> #define YYABORT goto yyabortlab
> -#define YYERROR goto yyerrorlab
> -
> +#define YYERROR goto yyerrlab1
>
> /* Like YYERROR except do call yyerror. This remains here temporarily
> to ease the transition to the new meaning of YYERROR, for GCC.
> @@ -2452,71 +2413,34 @@
> { \
> yychar = (Token); \
> yylval = (Value); \
> - yytoken = YYTRANSLATE (yychar); \
> + yychar1 = YYTRANSLATE (yychar); \
> YYPOPSTACK; \
> goto yybackup; \
> } \
> else \
> - { \
> - yyerror (YY_("syntax error: cannot back up")); \
> + { \
> + yyerror ("syntax error: cannot back up"); \
> YYERROR; \
> } \
> while (0)
>
> -
> #define YYTERROR 1
> #define YYERRCODE 256
>
> +/* YYLLOC_DEFAULT -- Compute the default location (before the actions
> + are run). */
>
> -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
> - If N is 0, then set CURRENT to the empty location which ends
> - the previous symbol: RHS[0] (always defined). */
> -
> -#define YYRHSLOC(Rhs, K) ((Rhs)[K])
> #ifndef YYLLOC_DEFAULT
> -# define YYLLOC_DEFAULT(Current, Rhs, N) \
> - do \
> - if (N) \
> - { \
> - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
> - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
> - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
> - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
> - } \
> - else \
> - { \
> - (Current).first_line = (Current).last_line = \
> - YYRHSLOC (Rhs, 0).last_line; \
> - (Current).first_column = (Current).last_column = \
> - YYRHSLOC (Rhs, 0).last_column; \
> - } \
> - while (0)
> -#endif
> -
> -
> -/* YY_LOCATION_PRINT -- Print the location on the stream.
> - This macro was not mandated originally: define only if we know
> - we won't break user code: when these are the locations we know. */
> -
> -#ifndef YY_LOCATION_PRINT
> -# if YYLTYPE_IS_TRIVIAL
> -# define YY_LOCATION_PRINT(File, Loc) \
> - fprintf (File, "%d.%d-%d.%d", \
> - (Loc).first_line, (Loc).first_column, \
> - (Loc).last_line, (Loc).last_column)
> -# else
> -# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
> -# endif
> +# define YYLLOC_DEFAULT(Current, Rhs, N) \
> + Current.first_line = Rhs[1].first_line; \
> + Current.first_column = Rhs[1].first_column; \
> + Current.last_line = Rhs[N].last_line; \
> + Current.last_column = Rhs[N].last_column;
> #endif
>
> -
> /* YYLEX -- calling `yylex' with the right arguments. */
>
> -#ifdef YYLEX_PARAM
> -# define YYLEX yylex (YYLEX_PARAM)
> -#else
> -# define YYLEX yylex ()
> -#endif
> +#define YYLEX yylex ()
>
> /* Enable debugging if requested. */
> #if YYDEBUG
> @@ -2531,86 +2455,19 @@
> if (yydebug) \
> YYFPRINTF Args; \
> } while (0)
> -
> -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
> -do { \
> - if (yydebug) \
> - { \
> - YYFPRINTF (stderr, "%s ", Title); \
> - yysymprint (stderr, \
> - Type, Value); \
> - YYFPRINTF (stderr, "\n"); \
> - } \
> -} while (0)
> -
> -/*------------------------------------------------------------------.
> -| yy_stack_print -- Print the state stack from its BOTTOM up to its |
> -| TOP (included). |
> -`------------------------------------------------------------------*/
> -
> -#if defined (__STDC__) || defined (__cplusplus)
> -static void
> -yy_stack_print (short int *bottom, short int *top)
> -#else
> -static void
> -yy_stack_print (bottom, top)
> - short int *bottom;
> - short int *top;
> -#endif
> -{
> - YYFPRINTF (stderr, "Stack now");
> - for (/* Nothing. */; bottom <= top; ++bottom)
> - YYFPRINTF (stderr, " %d", *bottom);
> - YYFPRINTF (stderr, "\n");
> -}
> -
> -# define YY_STACK_PRINT(Bottom, Top) \
> -do { \
> - if (yydebug) \
> - yy_stack_print ((Bottom), (Top)); \
> -} while (0)
> -
> -
> -/*------------------------------------------------.
> -| Report that the YYRULE is going to be reduced. |
> -`------------------------------------------------*/
> -
> -#if defined (__STDC__) || defined (__cplusplus)
> -static void
> -yy_reduce_print (int yyrule)
> -#else
> -static void
> -yy_reduce_print (yyrule)
> - int yyrule;
> -#endif
> -{
> - int yyi;
> - unsigned long int yylno = yyrline[yyrule];
> - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
> - yyrule - 1, yylno);
> - /* Print the symbols being reduced, and their result. */
> - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
> - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
> - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
> -}
> -
> -# define YY_REDUCE_PRINT(Rule) \
> -do { \
> - if (yydebug) \
> - yy_reduce_print (Rule); \
> +# define YYDSYMPRINT(Args) \
> +do { \
> + if (yydebug) \
> + yysymprint Args; \
> } while (0)
> -
> /* Nonzero means print parse trace. It is left uninitialized so that
> multiple parsers can coexist. */
> int yydebug;
> #else /* !YYDEBUG */
> # define YYDPRINTF(Args)
> -# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
> -# define YY_STACK_PRINT(Bottom, Top)
> -# define YY_REDUCE_PRINT(Rule)
> +# define YYDSYMPRINT(Args)
> #endif /* !YYDEBUG */
>
> -
> /* YYINITDEPTH -- initial size of the parser's stacks. */
> #ifndef YYINITDEPTH
> # define YYINITDEPTH 200
> @@ -2620,9 +2477,13 @@
> if the built-in stack extension method is used).
>
> Do not make this value too large; the results are undefined if
> - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
> + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
> evaluated with infinite-precision integer arithmetic. */
>
> +#if YYMAXDEPTH == 0
> +# undef YYMAXDEPTH
> +#endif
> +
> #ifndef YYMAXDEPTH
> # define YYMAXDEPTH 10000
> #endif
> @@ -2644,7 +2505,7 @@
> const char *yystr;
> # endif
> {
> - const char *yys = yystr;
> + register const char *yys = yystr;
>
> while (*yys++ != '\0')
> continue;
> @@ -2669,8 +2530,8 @@
> const char *yysrc;
> # endif
> {
> - char *yyd = yydest;
> - const char *yys = yysrc;
> + register char *yyd = yydest;
> + register const char *yys = yysrc;
>
> while ((*yyd++ = *yys++) != '\0')
> continue;
> @@ -2680,186 +2541,124 @@
> # endif
> # endif
>
> -# ifndef yytnamerr
> -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
> - quotes and backslashes, so that it's suitable for yyerror. The
> - heuristic is that double-quoting is unnecessary unless the string
> - contains an apostrophe, a comma, or backslash (other than
> - backslash-backslash). YYSTR is taken from yytname. If YYRES is
> - null, do not copy; instead, return the length of what the result
> - would have been. */
> -static YYSIZE_T
> -yytnamerr (char *yyres, const char *yystr)
> -{
> - if (*yystr == '"')
> - {
> - size_t yyn = 0;
> - char const *yyp = yystr;
> -
> - for (;;)
> - switch (*++yyp)
> - {
> - case '\'':
> - case ',':
> - goto do_not_strip_quotes;
> -
> - case '\\':
> - if (*++yyp != '\\')
> - goto do_not_strip_quotes;
> - /* Fall through. */
> - default:
> - if (yyres)
> - yyres[yyn] = *yyp;
> - yyn++;
> - break;
> -
> - case '"':
> - if (yyres)
> - yyres[yyn] = '\0';
> - return yyn;
> - }
> - do_not_strip_quotes: ;
> - }
> -
> - if (! yyres)
> - return yystrlen (yystr);
> -
> - return yystpcpy (yyres, yystr) - yyres;
> -}
> -# endif
> -
> -#endif /* YYERROR_VERBOSE */
> +#endif /* !YYERROR_VERBOSE */
>
>
>
> #if YYDEBUG
> -/*--------------------------------.
> -| Print this symbol on YYOUTPUT. |
> -`--------------------------------*/
> +/*-----------------------------.
> +| Print this symbol on YYOUT. |
> +`-----------------------------*/
>
> -#if defined (__STDC__) || defined (__cplusplus)
> static void
> -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
> +#if defined (__STDC__) || defined (__cplusplus)
> +yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
> #else
> -static void
> -yysymprint (yyoutput, yytype, yyvaluep)
> - FILE *yyoutput;
> +yysymprint (yyout, yytype, yyvalue)
> + FILE* yyout;
> int yytype;
> - YYSTYPE *yyvaluep;
> + YYSTYPE yyvalue;
> #endif
> {
> /* Pacify ``unused variable'' warnings. */
> - (void) yyvaluep;
> + (void) yyvalue;
>
> if (yytype < YYNTOKENS)
> - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
> - else
> - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
> -
> -
> + {
> + YYFPRINTF (yyout, "token %s (", yytname[yytype]);
> # ifdef YYPRINT
> - if (yytype < YYNTOKENS)
> - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
> + YYPRINT (yyout, yytoknum[yytype], yyvalue);
> # endif
> + }
> + else
> + YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);
> +
> switch (yytype)
> {
> default:
> break;
> }
> - YYFPRINTF (yyoutput, ")");
> + YYFPRINTF (yyout, ")");
> }
> +#endif /* YYDEBUG. */
> +
>
> -#endif /* ! YYDEBUG */
> /*-----------------------------------------------.
> | Release the memory associated to this symbol. |
> `-----------------------------------------------*/
>
> -#if defined (__STDC__) || defined (__cplusplus)
> static void
> -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
> +#if defined (__STDC__) || defined (__cplusplus)
> +yydestruct (int yytype, YYSTYPE yyvalue)
> #else
> -static void
> -yydestruct (yymsg, yytype, yyvaluep)
> - const char *yymsg;
> +yydestruct (yytype, yyvalue)
> int yytype;
> - YYSTYPE *yyvaluep;
> + YYSTYPE yyvalue;
> #endif
> {
> /* Pacify ``unused variable'' warnings. */
> - (void) yyvaluep;
> -
> - if (!yymsg)
> - yymsg = "Deleting";
> - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
> + (void) yyvalue;
>
> switch (yytype)
> {
> -
> default:
> break;
> }
> }
> +
>
>
> -/* Prevent warnings from -Wmissing-prototypes. */
> +/* The user can define YYPARSE_PARAM as the name of an argument to be passed
> + into yyparse. The argument should have type void *.
> + It should actually point to an object.
> + Grammar actions can access the variable by casting it
> + to the proper pointer type. */
>
> #ifdef YYPARSE_PARAM
> # if defined (__STDC__) || defined (__cplusplus)
> -int yyparse (void *YYPARSE_PARAM);
> +# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
> +# define YYPARSE_PARAM_DECL
> # else
> -int yyparse ();
> +# define YYPARSE_PARAM_ARG YYPARSE_PARAM
> +# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
> # endif
> -#else /* ! YYPARSE_PARAM */
> -#if defined (__STDC__) || defined (__cplusplus)
> +#else /* !YYPARSE_PARAM */
> +# define YYPARSE_PARAM_ARG
> +# define YYPARSE_PARAM_DECL
> +#endif /* !YYPARSE_PARAM */
> +
> +/* Prevent warning if -Wstrict-prototypes. */
> +#ifdef __GNUC__
> +# ifdef YYPARSE_PARAM
> +int yyparse (void *);
> +# else
> int yyparse (void);
> -#else
> -int yyparse ();
> +# endif
> #endif
> -#endif /* ! YYPARSE_PARAM */
> -
>
>
> -/* The look-ahead symbol. */
> +/* The lookahead symbol. */
> int yychar;
>
> -/* The semantic value of the look-ahead symbol. */
> +/* The semantic value of the lookahead symbol. */
> YYSTYPE yylval;
>
> -/* Number of syntax errors so far. */
> +/* Number of parse errors so far. */
> int yynerrs;
>
>
> -
> -/*----------.
> -| yyparse. |
> -`----------*/
> -
> -#ifdef YYPARSE_PARAM
> -# if defined (__STDC__) || defined (__cplusplus)
> -int yyparse (void *YYPARSE_PARAM)
> -# else
> -int yyparse (YYPARSE_PARAM)
> - void *YYPARSE_PARAM;
> -# endif
> -#else /* ! YYPARSE_PARAM */
> -#if defined (__STDC__) || defined (__cplusplus)
> int
> -yyparse (void)
> -#else
> -int
> -yyparse ()
> -
> -#endif
> -#endif
> +yyparse (YYPARSE_PARAM_ARG)
> + YYPARSE_PARAM_DECL
> {
>
> - int yystate;
> - int yyn;
> + register int yystate;
> + register int yyn;
> int yyresult;
> /* Number of tokens to shift before error messages enabled. */
> int yyerrstatus;
> - /* Look-ahead token as an internal (translated) token number. */
> - int yytoken = 0;
> + /* Lookahead token as an internal (translated) token number. */
> + int yychar1 = 0;
>
> /* Three stacks and their tools:
> `yyss': related to states,
> @@ -2870,14 +2669,14 @@
> to reallocate them elsewhere. */
>
> /* The state stack. */
> - short int yyssa[YYINITDEPTH];
> - short int *yyss = yyssa;
> - short int *yyssp;
> + short yyssa[YYINITDEPTH];
> + short *yyss = yyssa;
> + register short *yyssp;
>
> /* The semantic value stack. */
> YYSTYPE yyvsa[YYINITDEPTH];
> YYSTYPE *yyvs = yyvsa;
> - YYSTYPE *yyvsp;
> + register YYSTYPE *yyvsp;
>
>
>
> @@ -2923,7 +2722,7 @@
> yysetstate:
> *yyssp = yystate;
>
> - if (yyss + yystacksize - 1 <= yyssp)
> + if (yyssp >= yyss + yystacksize - 1)
> {
> /* Get the current used size of the three stacks, in elements. */
> YYSIZE_T yysize = yyssp - yyss + 1;
> @@ -2934,14 +2733,14 @@
> these so that the &'s don't force the real ones into
> memory. */
> YYSTYPE *yyvs1 = yyvs;
> - short int *yyss1 = yyss;
> + short *yyss1 = yyss;
>
>
> /* Each stack pointer address is followed by the size of the
> data in use in that stack, in bytes. This used to be a
> conditional around just the two extra args, but that might
> be undefined if yyoverflow is a macro. */
> - yyoverflow (YY_("memory exhausted"),
> + yyoverflow ("parser stack overflow",
> &yyss1, yysize * sizeof (*yyssp),
> &yyvs1, yysize * sizeof (*yyvsp),
>
> @@ -2952,21 +2751,21 @@
> }
> #else /* no yyoverflow */
> # ifndef YYSTACK_RELOCATE
> - goto yyexhaustedlab;
> + goto yyoverflowlab;
> # else
> /* Extend the stack our own way. */
> - if (YYMAXDEPTH <= yystacksize)
> - goto yyexhaustedlab;
> + if (yystacksize >= YYMAXDEPTH)
> + goto yyoverflowlab;
> yystacksize *= 2;
> - if (YYMAXDEPTH < yystacksize)
> + if (yystacksize > YYMAXDEPTH)
> yystacksize = YYMAXDEPTH;
>
> {
> - short int *yyss1 = yyss;
> + short *yyss1 = yyss;
> union yyalloc *yyptr =
> (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
> if (! yyptr)
> - goto yyexhaustedlab;
> + goto yyoverflowlab;
> YYSTACK_RELOCATE (yyss);
> YYSTACK_RELOCATE (yyvs);
>
> @@ -2984,7 +2783,7 @@
> YYDPRINTF ((stderr, "Stack size increased to %lu\n",
> (unsigned long int) yystacksize));
>
> - if (yyss + yystacksize - 1 <= yyssp)
> + if (yyssp >= yyss + yystacksize - 1)
> YYABORT;
> }
>
> @@ -2998,39 +2797,50 @@
> yybackup:
>
> /* Do appropriate processing given the current state. */
> -/* Read a look-ahead token if we need one and don't already have one. */
> +/* Read a lookahead token if we need one and don't already have one. */
> /* yyresume: */
>
> - /* First try to decide what to do without reference to look-ahead token. */
> + /* First try to decide what to do without reference to lookahead token. */
>
> yyn = yypact[yystate];
> if (yyn == YYPACT_NINF)
> goto yydefault;
>
> - /* Not known => get a look-ahead token if don't already have one. */
> + /* Not known => get a lookahead token if don't already have one. */
> +
> + /* yychar is either YYEMPTY or YYEOF
> + or a valid token in external form. */
>
> - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
> if (yychar == YYEMPTY)
> {
> YYDPRINTF ((stderr, "Reading a token: "));
> yychar = YYLEX;
> }
>
> - if (yychar <= YYEOF)
> + /* Convert token to internal form (in yychar1) for indexing tables with. */
> +
> + if (yychar <= 0) /* This means end of input. */
> {
> - yychar = yytoken = YYEOF;
> + yychar1 = 0;
> + yychar = YYEOF; /* Don't call YYLEX any more. */
> +
> YYDPRINTF ((stderr, "Now at end of input.\n"));
> }
> else
> {
> - yytoken = YYTRANSLATE (yychar);
> - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
> + yychar1 = YYTRANSLATE (yychar);
> +
> + /* We have to keep this `#if YYDEBUG', since we use variables
> + which are defined only if `YYDEBUG' is set. */
> + YYDPRINTF ((stderr, "Next token is "));
> + YYDSYMPRINT ((stderr, yychar1, yylval));
> + YYDPRINTF ((stderr, "\n"));
> }
>
> - /* If the proper action on seeing token YYTOKEN is to reduce or to
> + /* If the proper action on seeing token YYCHAR1 is to reduce or to
> detect an error, take that action. */
> - yyn += yytoken;
> - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
> + yyn += yychar1;
> + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
> goto yydefault;
> yyn = yytable[yyn];
> if (yyn <= 0)
> @@ -3044,8 +2854,9 @@
> if (yyn == YYFINAL)
> YYACCEPT;
>
> - /* Shift the look-ahead token. */
> - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
> + /* Shift the lookahead token. */
> + YYDPRINTF ((stderr, "Shifting token %d (%s), ",
> + yychar, yytname[yychar1]));
>
> /* Discard the token being shifted unless it is eof. */
> if (yychar != YYEOF)
> @@ -3091,1637 +2902,1653 @@
> yyval = yyvsp[1-yylen];
>
>
> - YY_REDUCE_PRINT (yyn);
> +
> +#if YYDEBUG
> + /* We have to keep this `#if YYDEBUG', since we use variables which
> + are defined only if `YYDEBUG' is set. */
> + if (yydebug)
> + {
> + int yyi;
> +
> + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
> + yyn - 1, yyrline[yyn]);
> +
> + /* Print the symbols being reduced, and their result. */
> + for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
> + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
> + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
> + }
> +#endif
> switch (yyn)
> {
> case 81:
> -#line 1061 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1061 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 82:
> -#line 1064 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1064 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = new std::string("");
> - ;}
> + yyval.String = new std::string("");
> + }
> break;
>
> case 90:
> -#line 1071 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(""); ;}
> +#line 1071 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(""); }
> break;
>
> case 97:
> -#line 1076 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1076 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-1].String) += *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + *yyvsp[-1].String += *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 98:
> -#line 1081 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(""); ;}
> +#line 1081 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(""); }
> break;
>
> case 99:
> -#line 1086 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1086 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 100:
> -#line 1087 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { *(yyvsp[-1].String) += " " + *(yyvsp[0].String); delete (yyvsp[0].String); (yyval.String) = (yyvsp[-1].String); ;}
> +#line 1087 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { *yyvsp[-1].String += " " + *yyvsp[0].String; delete yyvsp[0].String; yyval.String = yyvsp[-1].String; }
> break;
>
> case 101:
> -#line 1090 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1090 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 102:
> -#line 1091 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1091 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyvsp[-1].String)->insert(0, ", ");
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + yyvsp[-1].String->insert(0, ", ");
> + *yyvsp[-1].String += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 103:
> -#line 1099 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1099 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + *yyvsp[-1].String += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 104:
> -#line 1105 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1105 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 106:
> -#line 1109 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1109 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 107:
> -#line 1110 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1110 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyvsp[-1].String)->insert(0, ", ");
> - if (!(yyvsp[0].String)->empty())
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + yyvsp[-1].String->insert(0, ", ");
> + if (!yyvsp[0].String->empty())
> + *yyvsp[-1].String += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 109:
> -#line 1120 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1120 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + *yyvsp[-1].String += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 127:
> -#line 1142 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1142 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Ty) = Type::get(*(yyvsp[0].String), OpaqueTy);
> - ;}
> + yyval.Ty = Type::get(*yyvsp[0].String, OpaqueTy);
> + }
> break;
>
> case 128:
> -#line 1145 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1145 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Ty) = Type::get(*(yyvsp[0].String), UnresolvedTy);
> - ;}
> + yyval.Ty = Type::get(*yyvsp[0].String, UnresolvedTy);
> + }
> break;
>
> case 129:
> -#line 1148 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1148 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Ty) = (yyvsp[0].Ty);
> - ;}
> + yyval.Ty = yyvsp[0].Ty;
> + }
> break;
>
> case 130:
> -#line 1151 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1151 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Type UpReference
> - (yyvsp[0].String)->insert(0, "\\");
> - (yyval.Ty) = Type::get(*(yyvsp[0].String), UpRefTy);
> - ;}
> + yyvsp[0].String->insert(0, "\\");
> + yyval.Ty = Type::get(*yyvsp[0].String, UpRefTy);
> + }
> break;
>
> case 131:
> -#line 1155 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1155 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Function derived type?
> - std::string newTy( (yyvsp[-3].Ty)->getNewTy() + "(");
> - for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
> + std::string newTy( yyvsp[-3].Ty->getNewTy() + "(");
> + for (unsigned i = 0; i < yyvsp[-1].TypeVec->size(); ++i) {
> if (i != 0)
> newTy += ", ";
> - if ((*(yyvsp[-1].TypeVec))[i]->isVoid())
> + if ((*yyvsp[-1].TypeVec)[i]->isVoid())
> newTy += "...";
> else
> - newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
> + newTy += (*yyvsp[-1].TypeVec)[i]->getNewTy();
> }
> newTy += ")";
> - (yyval.Ty) = Type::get(newTy, (yyvsp[-3].Ty), (yyvsp[-1].TypeVec));
> - ;}
> + yyval.Ty = Type::get(newTy, yyvsp[-3].Ty, yyvsp[-1].TypeVec);
> + }
> break;
>
> case 132:
> -#line 1168 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1168 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Sized array type?
> - uint64_t elems = atoi((yyvsp[-3].String)->c_str());
> - (yyvsp[-3].String)->insert(0,"[ ");
> - *(yyvsp[-3].String) += " x " + (yyvsp[-1].Ty)->getNewTy() + " ]";
> - (yyval.Ty) = Type::get(*(yyvsp[-3].String), ArrayTy, (yyvsp[-1].Ty), elems);
> - ;}
> + uint64_t elems = atoi(yyvsp[-3].String->c_str());
> + yyvsp[-3].String->insert(0,"[ ");
> + *yyvsp[-3].String += " x " + yyvsp[-1].Ty->getNewTy() + " ]";
> + yyval.Ty = Type::get(*yyvsp[-3].String, ArrayTy, yyvsp[-1].Ty, elems);
> + }
> break;
>
> case 133:
> -#line 1174 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1174 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Packed array type?
> - uint64_t elems = atoi((yyvsp[-3].String)->c_str());
> - (yyvsp[-3].String)->insert(0,"< ");
> - *(yyvsp[-3].String) += " x " + (yyvsp[-1].Ty)->getNewTy() + " >";
> - (yyval.Ty) = Type::get(*(yyvsp[-3].String), PackedTy, (yyvsp[-1].Ty), elems);
> - ;}
> + uint64_t elems = atoi(yyvsp[-3].String->c_str());
> + yyvsp[-3].String->insert(0,"< ");
> + *yyvsp[-3].String += " x " + yyvsp[-1].Ty->getNewTy() + " >";
> + yyval.Ty = Type::get(*yyvsp[-3].String, PackedTy, yyvsp[-1].Ty, elems);
> + }
> break;
>
> case 134:
> -#line 1180 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1180 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Structure type?
> std::string newTy("{");
> - for (unsigned i = 0; i < (yyvsp[-1].TypeVec)->size(); ++i) {
> + for (unsigned i = 0; i < yyvsp[-1].TypeVec->size(); ++i) {
> if (i != 0)
> newTy += ", ";
> - newTy += (*(yyvsp[-1].TypeVec))[i]->getNewTy();
> + newTy += (*yyvsp[-1].TypeVec)[i]->getNewTy();
> }
> newTy += "}";
> - (yyval.Ty) = Type::get(newTy, StructTy, (yyvsp[-1].TypeVec));
> - ;}
> + yyval.Ty = Type::get(newTy, StructTy, yyvsp[-1].TypeVec);
> + }
> break;
>
> case 135:
> -#line 1190 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1190 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Empty structure type?
> - (yyval.Ty) = Type::get("{}", StructTy, new TypeList());
> - ;}
> + yyval.Ty = Type::get("{}", StructTy, new TypeList());
> + }
> break;
>
> case 136:
> -#line 1193 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1193 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Packed Structure type?
> std::string newTy("<{");
> - for (unsigned i = 0; i < (yyvsp[-2].TypeVec)->size(); ++i) {
> + for (unsigned i = 0; i < yyvsp[-2].TypeVec->size(); ++i) {
> if (i != 0)
> newTy += ", ";
> - newTy += (*(yyvsp[-2].TypeVec))[i]->getNewTy();
> + newTy += (*yyvsp[-2].TypeVec)[i]->getNewTy();
> }
> newTy += "}>";
> - (yyval.Ty) = Type::get(newTy, PackedStructTy, (yyvsp[-2].TypeVec));
> - ;}
> + yyval.Ty = Type::get(newTy, PackedStructTy, yyvsp[-2].TypeVec);
> + }
> break;
>
> case 137:
> -#line 1203 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1203 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Empty packed structure type?
> - (yyval.Ty) = Type::get("<{}>", PackedStructTy, new TypeList());
> - ;}
> + yyval.Ty = Type::get("<{}>", PackedStructTy, new TypeList());
> + }
> break;
>
> case 138:
> -#line 1206 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1206 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Pointer type?
> - (yyval.Ty) = (yyvsp[-1].Ty)->getPointerType();
> - ;}
> + yyval.Ty = yyvsp[-1].Ty->getPointerType();
> + }
> break;
>
> case 139:
> -#line 1214 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1214 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.TypeVec) = new TypeList();
> - (yyval.TypeVec)->push_back((yyvsp[0].Ty));
> - ;}
> + yyval.TypeVec = new TypeList();
> + yyval.TypeVec->push_back(yyvsp[0].Ty);
> + }
> break;
>
> case 140:
> -#line 1218 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1218 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.TypeVec) = (yyvsp[-2].TypeVec);
> - (yyval.TypeVec)->push_back((yyvsp[0].Ty));
> - ;}
> + yyval.TypeVec = yyvsp[-2].TypeVec;
> + yyval.TypeVec->push_back(yyvsp[0].Ty);
> + }
> break;
>
> case 142:
> -#line 1226 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1226 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.TypeVec) = (yyvsp[-2].TypeVec);
> - (yyval.TypeVec)->push_back(Type::get("void",VoidTy));
> - delete (yyvsp[0].String);
> - ;}
> + yyval.TypeVec = yyvsp[-2].TypeVec;
> + yyval.TypeVec->push_back(Type::get("void",VoidTy));
> + delete yyvsp[0].String;
> + }
> break;
>
> case 143:
> -#line 1231 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1231 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.TypeVec) = new TypeList();
> - (yyval.TypeVec)->push_back(Type::get("void",VoidTy));
> - delete (yyvsp[0].String);
> - ;}
> + yyval.TypeVec = new TypeList();
> + yyval.TypeVec->push_back(Type::get("void",VoidTy));
> + delete yyvsp[0].String;
> + }
> break;
>
> case 144:
> -#line 1236 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1236 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.TypeVec) = new TypeList();
> - ;}
> + yyval.TypeVec = new TypeList();
> + }
> break;
>
> case 145:
> -#line 1246 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1246 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Nonempty unsized arr
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-3].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-3].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " [ " + *(yyvsp[-1].String) + " ]";
> - delete (yyvsp[-1].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-3].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-3].Ty->getNewTy());
> + *yyval.Const->cnst += " [ " + *yyvsp[-1].String + " ]";
> + delete yyvsp[-1].String;
> + }
> break;
>
> case 146:
> -#line 1253 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1253 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-2].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-2].Ty)->getNewTy());
> - *(yyval.Const)->cnst += "[ ]";
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-2].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-2].Ty->getNewTy());
> + *yyval.Const->cnst += "[ ]";
> + }
> break;
>
> case 147:
> -#line 1259 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1259 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-2].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-2].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " c" + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-2].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-2].Ty->getNewTy());
> + *yyval.Const->cnst += " c" + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 148:
> -#line 1266 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1266 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Nonempty unsized arr
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-3].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-3].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " < " + *(yyvsp[-1].String) + " >";
> - delete (yyvsp[-1].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-3].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-3].Ty->getNewTy());
> + *yyval.Const->cnst += " < " + *yyvsp[-1].String + " >";
> + delete yyvsp[-1].String;
> + }
> break;
>
> case 149:
> -#line 1273 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1273 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-3].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-3].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " { " + *(yyvsp[-1].String) + " }";
> - delete (yyvsp[-1].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-3].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-3].Ty->getNewTy());
> + *yyval.Const->cnst += " { " + *yyvsp[-1].String + " }";
> + delete yyvsp[-1].String;
> + }
> break;
>
> case 150:
> -#line 1280 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1280 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-2].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-2].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " {}";
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-2].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-2].Ty->getNewTy());
> + *yyval.Const->cnst += " {}";
> + }
> break;
>
> case 151:
> -#line 1286 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1286 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 152:
> -#line 1293 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1293 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 153:
> -#line 1300 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1300 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Ty)->resolve(), true);
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + Name;
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + std::string Name = getUniqueName(yyvsp[0].String, yyvsp[-1].Ty->resolve(), true);
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + Name;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 154:
> -#line 1308 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1308 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 155:
> -#line 1315 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1315 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 156:
> -#line 1322 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1322 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // integral constants
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 157:
> -#line 1329 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1329 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // integral constants
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 158:
> -#line 1336 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1336 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Boolean constants
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 159:
> -#line 1343 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1343 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Boolean constants
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 160:
> -#line 1350 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1350 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Float & Double constants
> - (yyval.Const) = new Constant;
> - (yyval.Const)->type = (yyvsp[-1].Ty);
> - (yyval.Const)->cnst = new std::string((yyvsp[-1].Ty)->getNewTy());
> - *(yyval.Const)->cnst += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + yyval.Const = new Constant;
> + yyval.Const->type = yyvsp[-1].Ty;
> + yyval.Const->cnst = new std::string(yyvsp[-1].Ty->getNewTy());
> + *yyval.Const->cnst += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 161:
> -#line 1358 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1358 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string source = *(yyvsp[-3].Const)->cnst;
> - const Type* SrcTy = (yyvsp[-3].Const)->type->resolve();
> - const Type* DstTy = (yyvsp[-1].Ty)->resolve();
> - if (*(yyvsp[-5].String) == "cast") {
> + std::string source = *yyvsp[-3].Const->cnst;
> + const Type* SrcTy = yyvsp[-3].Const->type->resolve();
> + const Type* DstTy = yyvsp[-1].Ty->resolve();
> + if (*yyvsp[-5].String == "cast") {
> // Call getCastUpgrade to upgrade the old cast
> - (yyval.String) = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
> + yyval.String = new std::string(getCastUpgrade(source, SrcTy, DstTy, true));
> } else {
> // Nothing to upgrade, just create the cast constant expr
> - (yyval.String) = new std::string(*(yyvsp[-5].String));
> - *(yyval.String) += "( " + source + " to " + (yyvsp[-1].Ty)->getNewTy() + ")";
> + yyval.String = new std::string(*yyvsp[-5].String);
> + *yyval.String += "( " + source + " to " + yyvsp[-1].Ty->getNewTy() + ")";
> }
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-2].String);
> - ;}
> + delete yyvsp[-5].String; delete yyvsp[-3].Const; delete yyvsp[-2].String;
> + }
> break;
>
> case 162:
> -#line 1372 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1372 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-4].String) += "(" + *(yyvsp[-2].Const)->cnst;
> - for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
> - Value* V = (*(yyvsp[-1].ValList))[i];
> - *(yyvsp[-4].String) += ", " + *V->val;
> + *yyvsp[-4].String += "(" + *yyvsp[-2].Const->cnst;
> + for (unsigned i = 0; i < yyvsp[-1].ValList->size(); ++i) {
> + Value* V = (*yyvsp[-1].ValList)[i];
> + *yyvsp[-4].String += ", " + *V->val;
> delete V;
> }
> - *(yyvsp[-4].String) += ")";
> - (yyval.String) = (yyvsp[-4].String);
> - delete (yyvsp[-2].Const);
> - delete (yyvsp[-1].ValList);
> - ;}
> + *yyvsp[-4].String += ")";
> + yyval.String = yyvsp[-4].String;
> + delete yyvsp[-2].Const;
> + delete yyvsp[-1].ValList;
> + }
> break;
>
> case 163:
> -#line 1384 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1384 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const)->cnst + "," + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].Const); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-7].String);
> - ;}
> + *yyvsp[-7].String += "(" + *yyvsp[-5].Const->cnst + "," + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].Const; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-7].String;
> + }
> break;
>
> case 164:
> -#line 1389 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1389 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - const char* op = getDivRemOpcode(*(yyvsp[-5].String), (yyvsp[-3].Const)->type);
> - (yyval.String) = new std::string(op);
> - *(yyval.String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - ;}
> + const char* op = getDivRemOpcode(*yyvsp[-5].String, yyvsp[-3].Const->type);
> + yyval.String = new std::string(op);
> + *yyval.String += "(" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].String; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + }
> break;
>
> case 165:
> -#line 1395 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1395 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-5].String);
> - ;}
> + *yyvsp[-5].String += "(" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-5].String;
> + }
> break;
>
> case 166:
> -#line 1400 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1400 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) = getCompareOp(*(yyvsp[-5].String), (yyvsp[-3].Const)->type);
> - *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-5].String);
> - ;}
> + *yyvsp[-5].String = getCompareOp(*yyvsp[-5].String, yyvsp[-3].Const->type);
> + *yyvsp[-5].String += "(" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-5].String;
> + }
> break;
>
> case 167:
> -#line 1406 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1406 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-6].String);
> - ;}
> + *yyvsp[-6].String += " " + *yyvsp[-5].String + " (" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].String; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-6].String;
> + }
> break;
>
> case 168:
> -#line 1411 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1411 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-6].String) += " " + *(yyvsp[-5].String) + " (" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-6].String);
> - ;}
> + *yyvsp[-6].String += " " + *yyvsp[-5].String + " (" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].String; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-6].String;
> + }
> break;
>
> case 169:
> -#line 1416 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1416 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - const char* shiftop = (yyvsp[-5].String)->c_str();
> - if (*(yyvsp[-5].String) == "shr")
> - shiftop = ((yyvsp[-3].Const)->type->isUnsigned()) ? "lshr" : "ashr";
> - (yyval.String) = new std::string(shiftop);
> - *(yyval.String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - ;}
> + const char* shiftop = yyvsp[-5].String->c_str();
> + if (*yyvsp[-5].String == "shr")
> + shiftop = (yyvsp[-3].Const->type->isUnsigned()) ? "lshr" : "ashr";
> + yyval.String = new std::string(shiftop);
> + *yyval.String += "(" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].String; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + }
> break;
>
> case 170:
> -#line 1424 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1424 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) += "(" + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-5].String);
> - ;}
> + *yyvsp[-5].String += "(" + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-5].String;
> + }
> break;
>
> case 171:
> -#line 1429 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1429 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const)->cnst + "," + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].Const); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-7].String);
> - ;}
> + *yyvsp[-7].String += "(" + *yyvsp[-5].Const->cnst + "," + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].Const; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-7].String;
> + }
> break;
>
> case 172:
> -#line 1434 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1434 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-7].String) += "(" + *(yyvsp[-5].Const)->cnst + "," + *(yyvsp[-3].Const)->cnst + "," + *(yyvsp[-1].Const)->cnst + ")";
> - delete (yyvsp[-5].Const); delete (yyvsp[-3].Const); delete (yyvsp[-1].Const);
> - (yyval.String) = (yyvsp[-7].String);
> - ;}
> + *yyvsp[-7].String += "(" + *yyvsp[-5].Const->cnst + "," + *yyvsp[-3].Const->cnst + "," + *yyvsp[-1].Const->cnst + ")";
> + delete yyvsp[-5].Const; delete yyvsp[-3].Const; delete yyvsp[-1].Const;
> + yyval.String = yyvsp[-7].String;
> + }
> break;
>
> case 173:
> -#line 1444 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1444 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += ", " + *(yyvsp[0].Const)->cnst;
> - delete (yyvsp[0].Const);
> - (yyval.String) = (yyvsp[-2].String);
> - ;}
> + *yyvsp[-2].String += ", " + *yyvsp[0].Const->cnst;
> + delete yyvsp[0].Const;
> + yyval.String = yyvsp[-2].String;
> + }
> break;
>
> case 174:
> -#line 1449 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(*(yyvsp[0].Const)->cnst); delete (yyvsp[0].Const); ;}
> +#line 1449 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(*yyvsp[0].Const->cnst); delete yyvsp[0].Const; }
> break;
>
> case 177:
> -#line 1464 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1464 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> -;}
> +}
> break;
>
> case 178:
> -#line 1469 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1469 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 179:
> -#line 1472 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1472 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[0].String << '\n';
> + delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 180:
> -#line 1477 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1477 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << "module asm " << ' ' << *(yyvsp[0].String) << '\n';
> - (yyval.String) = 0;
> - ;}
> + *O << "module asm " << ' ' << *yyvsp[0].String << '\n';
> + yyval.String = 0;
> + }
> break;
>
> case 181:
> -#line 1481 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1481 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> *O << "implementation\n";
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 182:
> -#line 1485 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = 0; ;}
> +#line 1485 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = 0; }
> break;
>
> case 184:
> -#line 1487 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "external"; ;}
> +#line 1488 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = yyvsp[0].String; *yyval.String = "external"; }
> break;
>
> case 185:
> -#line 1490 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1491 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - Type::EnumeratedTypes.push_back((yyvsp[0].Ty));
> - if (!(yyvsp[-2].String)->empty()) {
> - Type::NamedTypes[*(yyvsp[-2].String)] = (yyvsp[0].Ty);
> - *O << *(yyvsp[-2].String) << " = ";
> - }
> - *O << "type " << (yyvsp[0].Ty)->getNewTy() << '\n';
> - delete (yyvsp[-2].String); delete (yyvsp[-1].String);
> - (yyval.String) = 0;
> - ;}
> + Type::EnumeratedTypes.push_back(yyvsp[0].Ty);
> + if (!yyvsp[-2].String->empty()) {
> + Type::NamedTypes[*yyvsp[-2].String] = yyvsp[0].Ty;
> + *O << *yyvsp[-2].String << " = ";
> + }
> + *O << "type " << yyvsp[0].Ty->getNewTy() << '\n';
> + delete yyvsp[-2].String; delete yyvsp[-1].String;
> + yyval.String = 0;
> + }
> break;
>
> case 186:
> -#line 1500 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1501 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Function prototypes can be in const pool
> - *O << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[0].String << '\n';
> + delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 187:
> -#line 1505 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1506 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Asm blocks can be in the const pool
> - *O << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-2].String << ' ' << *yyvsp[-1].String << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-2].String; delete yyvsp[-1].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 188:
> -#line 1510 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1511 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-4].String)->empty()) {
> - std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String), (yyvsp[-1].Const)->type->getPointerType(),
> - *(yyvsp[-2].String) == "constant");
> + if (!yyvsp[-4].String->empty()) {
> + std::string Name = getGlobalName(yyvsp[-4].String,*yyvsp[-3].String, yyvsp[-1].Const->type->getPointerType(),
> + *yyvsp[-2].String == "constant");
> *O << Name << " = ";
> }
> - *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << *(yyvsp[-1].Const)->cnst << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << *yyvsp[-1].Const->cnst << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 189:
> -#line 1520 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1521 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-4].String)->empty()) {
> - std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Ty)->getPointerType(),
> - *(yyvsp[-2].String) == "constant");
> + if (!yyvsp[-4].String->empty()) {
> + std::string Name = getGlobalName(yyvsp[-4].String,*yyvsp[-3].String,yyvsp[-1].Ty->getPointerType(),
> + *yyvsp[-2].String == "constant");
> *O << Name << " = ";
> }
> - *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Ty)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << yyvsp[-1].Ty->getNewTy() << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 190:
> -#line 1530 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1531 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-4].String)->empty()) {
> - std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Ty)->getPointerType(),
> - *(yyvsp[-2].String) == "constant");
> + if (!yyvsp[-4].String->empty()) {
> + std::string Name = getGlobalName(yyvsp[-4].String,*yyvsp[-3].String,yyvsp[-1].Ty->getPointerType(),
> + *yyvsp[-2].String == "constant");
> *O << Name << " = ";
> }
> - *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Ty)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << yyvsp[-1].Ty->getNewTy() << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 191:
> -#line 1540 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1541 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-4].String)->empty()) {
> - std::string Name = getGlobalName((yyvsp[-4].String),*(yyvsp[-3].String),(yyvsp[-1].Ty)->getPointerType(),
> - *(yyvsp[-2].String) == "constant");
> + if (!yyvsp[-4].String->empty()) {
> + std::string Name = getGlobalName(yyvsp[-4].String,*yyvsp[-3].String,yyvsp[-1].Ty->getPointerType(),
> + *yyvsp[-2].String == "constant");
> *O << Name << " = ";
> }
> - *O << *(yyvsp[-3].String) << ' ' << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Ty)->getNewTy() << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-4].String); delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-3].String << ' ' << *yyvsp[-2].String << ' ' << yyvsp[-1].Ty->getNewTy() << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-4].String; delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 192:
> -#line 1550 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1551 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-1].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-1].String << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-1].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 193:
> -#line 1555 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1556 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << *(yyvsp[-2].String) << " = " << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-2].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-2].String << " = " << *yyvsp[0].String << '\n';
> + delete yyvsp[-2].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 194:
> -#line 1560 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1561 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 198:
> -#line 1570 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1571 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-2].String);
> - ;}
> + *yyvsp[-2].String += " = " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-2].String;
> + }
> break;
>
> case 199:
> -#line 1575 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1576 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
> - if (*(yyvsp[0].String) == "64")
> + *yyvsp[-2].String += " = " + *yyvsp[0].String;
> + if (*yyvsp[0].String == "64")
> SizeOfPointer = 64;
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-2].String);
> - ;}
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-2].String;
> + }
> break;
>
> case 200:
> -#line 1582 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1583 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-2].String);
> - ;}
> + *yyvsp[-2].String += " = " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-2].String;
> + }
> break;
>
> case 201:
> -#line 1587 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1588 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += " = " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-2].String);
> - ;}
> + *yyvsp[-2].String += " = " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-2].String;
> + }
> break;
>
> case 202:
> -#line 1594 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1595 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyvsp[-1].String)->insert(0, "[ ");
> - *(yyvsp[-1].String) += " ]";
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + yyvsp[-1].String->insert(0, "[ ");
> + *yyvsp[-1].String += " ]";
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 203:
> -#line 1601 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1602 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-2].String);
> - ;}
> + *yyvsp[-2].String += ", " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-2].String;
> + }
> break;
>
> case 205:
> -#line 1607 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1608 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = new std::string();
> - ;}
> + yyval.String = new std::string();
> + }
> break;
>
> case 209:
> -#line 1616 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1617 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 210:
> -#line 1618 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1619 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = new std::string((yyvsp[-1].Ty)->getNewTy());
> - if (!(yyvsp[0].String)->empty()) {
> - std::string Name = getUniqueName((yyvsp[0].String), (yyvsp[-1].Ty)->resolve());
> - *(yyval.String) += " " + Name;
> + yyval.String = new std::string(yyvsp[-1].Ty->getNewTy());
> + if (!yyvsp[0].String->empty()) {
> + std::string Name = getUniqueName(yyvsp[0].String, yyvsp[-1].Ty->resolve());
> + *yyval.String += " " + Name;
> }
> - delete (yyvsp[0].String);
> -;}
> + delete yyvsp[0].String;
> +}
> break;
>
> case 211:
> -#line 1627 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1628 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += ", " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - ;}
> + *yyvsp[-2].String += ", " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 212:
> -#line 1631 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1632 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = (yyvsp[0].String);
> - ;}
> + yyval.String = yyvsp[0].String;
> + }
> break;
>
> case 213:
> -#line 1635 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1636 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = (yyvsp[0].String);
> - ;}
> + yyval.String = yyvsp[0].String;
> + }
> break;
>
> case 214:
> -#line 1638 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1639 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += ", ...";
> - (yyval.String) = (yyvsp[-2].String);
> - delete (yyvsp[0].String);
> - ;}
> + *yyvsp[-2].String += ", ...";
> + yyval.String = yyvsp[-2].String;
> + delete yyvsp[0].String;
> + }
> break;
>
> case 215:
> -#line 1643 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1644 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = (yyvsp[0].String);
> - ;}
> + yyval.String = yyvsp[0].String;
> + }
> break;
>
> case 216:
> -#line 1646 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1647 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 217:
> -#line 1649 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1650 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (*(yyvsp[-5].String) == "%llvm.va_start" || *(yyvsp[-5].String) == "%llvm.va_end") {
> - *(yyvsp[-3].String) = "i8*";
> - } else if (*(yyvsp[-5].String) == "%llvm.va_copy") {
> - *(yyvsp[-3].String) = "i8*, i8*";
> - }
> - if (!(yyvsp[-7].String)->empty()) {
> - *(yyvsp[-7].String) += " ";
> - }
> - *(yyvsp[-7].String) += (yyvsp[-6].Ty)->getNewTy() + " " + *(yyvsp[-5].String) + "(" + *(yyvsp[-3].String) + ")";
> - if (!(yyvsp[-1].String)->empty()) {
> - *(yyvsp[-7].String) += " " + *(yyvsp[-1].String);
> - }
> - if (!(yyvsp[0].String)->empty()) {
> - *(yyvsp[-7].String) += " " + *(yyvsp[0].String);
> - }
> - delete (yyvsp[-5].String);
> - delete (yyvsp[-3].String);
> - delete (yyvsp[-1].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-7].String);
> - ;}
> + if (*yyvsp[-5].String == "%llvm.va_start" || *yyvsp[-5].String == "%llvm.va_end") {
> + *yyvsp[-3].String = "i8*";
> + } else if (*yyvsp[-5].String == "%llvm.va_copy") {
> + *yyvsp[-3].String = "i8*, i8*";
> + }
> + if (!yyvsp[-7].String->empty()) {
> + *yyvsp[-7].String += " ";
> + }
> + *yyvsp[-7].String += yyvsp[-6].Ty->getNewTy() + " " + *yyvsp[-5].String + "(" + *yyvsp[-3].String + ")";
> + if (!yyvsp[-1].String->empty()) {
> + *yyvsp[-7].String += " " + *yyvsp[-1].String;
> + }
> + if (!yyvsp[0].String->empty()) {
> + *yyvsp[-7].String += " " + *yyvsp[0].String;
> + }
> + delete yyvsp[-5].String;
> + delete yyvsp[-3].String;
> + delete yyvsp[-1].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-7].String;
> + }
> break;
>
> case 218:
> -#line 1672 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string("{"); delete (yyvsp[0].String); ;}
> +#line 1673 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string("{"); delete yyvsp[0].String; }
> break;
>
> case 219:
> -#line 1673 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string ("{"); ;}
> +#line 1674 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string ("{"); }
> break;
>
> case 220:
> -#line 1676 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1678 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> *O << "define ";
> - if (!(yyvsp[-2].String)->empty()) {
> - *O << *(yyvsp[-2].String) << ' ';
> + if (!yyvsp[-2].String->empty()) {
> + *O << *yyvsp[-2].String << ' ';
> }
> - *O << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[-1].String << ' ' << *yyvsp[0].String << '\n';
> + delete yyvsp[-2].String; delete yyvsp[-1].String; delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 221:
> -#line 1687 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string("}"); delete (yyvsp[0].String); ;}
> +#line 1689 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string("}"); delete yyvsp[0].String; }
> break;
>
> case 222:
> -#line 1688 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string("}"); ;}
> +#line 1690 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string("}"); }
> break;
>
> case 223:
> -#line 1690 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1692 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if ((yyvsp[-1].String))
> - *O << *(yyvsp[-1].String);
> - *O << *(yyvsp[0].String) << "\n\n";
> - delete (yyvsp[-2].String); delete (yyvsp[-1].String); delete (yyvsp[0].String);
> - (yyval.String) = 0;
> -;}
> + if (yyvsp[-1].String)
> + *O << *yyvsp[-1].String;
> + *O << *yyvsp[0].String << "\n\n";
> + delete yyvsp[-2].String; delete yyvsp[-1].String; delete yyvsp[0].String;
> + yyval.String = 0;
> +}
> break;
>
> case 224:
> -#line 1699 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1701 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 227:
> -#line 1705 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { isDeclare = true; ;}
> +#line 1707 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { isDeclare = true; }
> break;
>
> case 228:
> -#line 1705 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1707 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-1].String)->empty())
> - *(yyvsp[-3].String) += " " + *(yyvsp[-1].String);
> - *(yyvsp[-3].String) += " " + *(yyvsp[0].String);
> - delete (yyvsp[-1].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-3].String);
> + if (!yyvsp[-1].String->empty())
> + *yyvsp[-3].String += " " + *yyvsp[-1].String;
> + *yyvsp[-3].String += " " + *yyvsp[0].String;
> + delete yyvsp[-1].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-3].String;
> isDeclare = false;
> - ;}
> + }
> break;
>
> case 229:
> -#line 1719 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 1721 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 239:
> -#line 1725 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1727 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyvsp[-1].String)->insert(0, "<");
> - *(yyvsp[-1].String) += ">";
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + yyvsp[-1].String->insert(0, "<");
> + *yyvsp[-1].String += ">";
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 241:
> -#line 1731 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1733 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-3].String)->empty()) {
> - *(yyvsp[-4].String) += " " + *(yyvsp[-3].String);
> + if (!yyvsp[-3].String->empty()) {
> + *yyvsp[-4].String += " " + *yyvsp[-3].String;
> }
> - *(yyvsp[-4].String) += " " + *(yyvsp[-2].String) + ", " + *(yyvsp[0].String);
> - delete (yyvsp[-3].String); delete (yyvsp[-2].String); delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-4].String);
> - ;}
> + *yyvsp[-4].String += " " + *yyvsp[-2].String + ", " + *yyvsp[0].String;
> + delete yyvsp[-3].String; delete yyvsp[-2].String; delete yyvsp[0].String;
> + yyval.String = yyvsp[-4].String;
> + }
> break;
>
> case 244:
> -#line 1744 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1746 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = (yyvsp[0].String);
> - (yyval.Val)->constant = false;
> - (yyval.Val)->type = 0;
> - ;}
> + yyval.Val = new Value;
> + yyval.Val->val = yyvsp[0].String;
> + yyval.Val->constant = false;
> + yyval.Val->type = 0;
> + }
> break;
>
> case 245:
> -#line 1750 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1752 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = (yyvsp[0].String);
> - (yyval.Val)->constant = true;
> - (yyval.Val)->type = 0;
> - ;}
> + yyval.Val = new Value;
> + yyval.Val->val = yyvsp[0].String;
> + yyval.Val->constant = true;
> + yyval.Val->type = 0;
> + }
> break;
>
> case 246:
> -#line 1761 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1763 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyvsp[-1].Ty) = (yyvsp[-1].Ty)->resolve();
> - std::string Name = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-1].Ty));
> - (yyval.Val) = (yyvsp[0].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = new std::string((yyvsp[-1].Ty)->getNewTy() + " " + Name);
> - (yyval.Val)->type = (yyvsp[-1].Ty);
> - ;}
> + yyvsp[-1].Ty = yyvsp[-1].Ty->resolve();
> + std::string Name = getUniqueName(yyvsp[0].Val->val, yyvsp[-1].Ty);
> + yyval.Val = yyvsp[0].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = new std::string(yyvsp[-1].Ty->getNewTy() + " " + Name);
> + yyval.Val->type = yyvsp[-1].Ty;
> + }
> break;
>
> case 247:
> -#line 1770 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1772 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 248:
> -#line 1773 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1775 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Do not allow functions with 0 basic blocks
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 249:
> -#line 1781 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1783 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 250:
> -#line 1785 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1787 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << " " << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << " " << *yyvsp[0].String << '\n';
> + delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 251:
> -#line 1790 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1792 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.String) = 0;
> - ;}
> + yyval.String = 0;
> + }
> break;
>
> case 252:
> -#line 1793 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1795 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << *yyvsp[0].String << '\n';
> + delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 254:
> -#line 1799 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = (yyvsp[0].String); *(yyval.String) = "unwind"; ;}
> +#line 1801 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = yyvsp[0].String; *yyval.String = "unwind"; }
> break;
>
> case 255:
> -#line 1801 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1803 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Return with a result...
> - *O << " " << *(yyvsp[-1].String) << ' ' << *(yyvsp[0].Val)->val << '\n';
> - delete (yyvsp[-1].String); delete (yyvsp[0].Val);
> - (yyval.String) = 0;
> - ;}
> + *O << " " << *yyvsp[-1].String << ' ' << *yyvsp[0].Val->val << '\n';
> + delete yyvsp[-1].String; delete yyvsp[0].Val;
> + yyval.String = 0;
> + }
> break;
>
> case 256:
> -#line 1806 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1808 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Return with no result...
> - *O << " " << *(yyvsp[-1].String) << ' ' << (yyvsp[0].Ty)->getNewTy() << '\n';
> - delete (yyvsp[-1].String);
> - (yyval.String) = 0;
> - ;}
> + *O << " " << *yyvsp[-1].String << ' ' << yyvsp[0].Ty->getNewTy() << '\n';
> + delete yyvsp[-1].String;
> + yyval.String = 0;
> + }
> break;
>
> case 257:
> -#line 1811 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1813 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Unconditional Branch...
> - *O << " " << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Ty)->getNewTy() << ' ' << *(yyvsp[0].Val)->val << '\n';
> - delete (yyvsp[-2].String); delete (yyvsp[0].Val);
> - (yyval.String) = 0;
> - ;}
> + *O << " " << *yyvsp[-2].String << ' ' << yyvsp[-1].Ty->getNewTy() << ' ' << *yyvsp[0].Val->val << '\n';
> + delete yyvsp[-2].String; delete yyvsp[0].Val;
> + yyval.String = 0;
> + }
> break;
>
> case 258:
> -#line 1816 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1818 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-6].Val)->val, (yyvsp[-7].Ty));
> - *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Ty)->getNewTy() << ' ' << Name << ", "
> - << (yyvsp[-4].Ty)->getNewTy() << ' ' << *(yyvsp[-3].Val)->val << ", " << (yyvsp[-1].Ty)->getNewTy() << ' '
> - << *(yyvsp[0].Val)->val << '\n';
> - delete (yyvsp[-8].String); delete (yyvsp[-6].Val); delete (yyvsp[-3].Val); delete (yyvsp[0].Val);
> - (yyval.String) = 0;
> - ;}
> + std::string Name = getUniqueName(yyvsp[-6].Val->val, yyvsp[-7].Ty);
> + *O << " " << *yyvsp[-8].String << ' ' << yyvsp[-7].Ty->getNewTy() << ' ' << Name << ", "
> + << yyvsp[-4].Ty->getNewTy() << ' ' << *yyvsp[-3].Val->val << ", " << yyvsp[-1].Ty->getNewTy() << ' '
> + << *yyvsp[0].Val->val << '\n';
> + delete yyvsp[-8].String; delete yyvsp[-6].Val; delete yyvsp[-3].Val; delete yyvsp[0].Val;
> + yyval.String = 0;
> + }
> break;
>
> case 259:
> -#line 1824 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1826 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-6].Val)->val, (yyvsp[-7].Ty));
> - *O << " " << *(yyvsp[-8].String) << ' ' << (yyvsp[-7].Ty)->getNewTy() << ' ' << Name << ", "
> - << (yyvsp[-4].Ty)->getNewTy() << ' ' << *(yyvsp[-3].Val)->val << " [" << *(yyvsp[-1].String) << " ]\n";
> - delete (yyvsp[-8].String);
> - delete (yyvsp[-6].Val);
> - delete (yyvsp[-3].Val);
> - delete (yyvsp[-1].String);
> - (yyval.String) = 0;
> - ;}
> + std::string Name = getUniqueName(yyvsp[-6].Val->val, yyvsp[-7].Ty);
> + *O << " " << *yyvsp[-8].String << ' ' << yyvsp[-7].Ty->getNewTy() << ' ' << Name << ", "
> + << yyvsp[-4].Ty->getNewTy() << ' ' << *yyvsp[-3].Val->val << " [" << *yyvsp[-1].String << " ]\n";
> + delete yyvsp[-8].String;
> + delete yyvsp[-6].Val;
> + delete yyvsp[-3].Val;
> + delete yyvsp[-1].String;
> + yyval.String = 0;
> + }
> break;
>
> case 260:
> -#line 1834 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1836 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-5].Val)->val, (yyvsp[-6].Ty));
> - *O << " " << *(yyvsp[-7].String) << ' ' << (yyvsp[-6].Ty)->getNewTy() << ' ' << Name << ", "
> - << (yyvsp[-3].Ty)->getNewTy() << ' ' << *(yyvsp[-2].Val)->val << "[]\n";
> - delete (yyvsp[-7].String);
> - delete (yyvsp[-5].Val);
> - delete (yyvsp[-2].Val);
> - (yyval.String) = 0;
> - ;}
> + std::string Name = getUniqueName(yyvsp[-5].Val->val, yyvsp[-6].Ty);
> + *O << " " << *yyvsp[-7].String << ' ' << yyvsp[-6].Ty->getNewTy() << ' ' << Name << ", "
> + << yyvsp[-3].Ty->getNewTy() << ' ' << *yyvsp[-2].Val->val << "[]\n";
> + delete yyvsp[-7].String;
> + delete yyvsp[-5].Val;
> + delete yyvsp[-2].Val;
> + yyval.String = 0;
> + }
> break;
>
> case 261:
> -#line 1844 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1846 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - const Type* ResTy = getFunctionReturnType((yyvsp[-10].Ty));
> + const Type* ResTy = getFunctionReturnType(yyvsp[-10].Ty);
> *O << " ";
> - if (!(yyvsp[-13].String)->empty()) {
> - std::string Name = getUniqueName((yyvsp[-13].String), ResTy);
> + if (!yyvsp[-13].String->empty()) {
> + std::string Name = getUniqueName(yyvsp[-13].String, ResTy);
> *O << Name << " = ";
> }
> - *O << *(yyvsp[-12].String) << ' ' << *(yyvsp[-11].String) << ' ' << (yyvsp[-10].Ty)->getNewTy() << ' ' << *(yyvsp[-9].Val)->val << " (";
> - for (unsigned i = 0; i < (yyvsp[-7].ValList)->size(); ++i) {
> - Value* V = (*(yyvsp[-7].ValList))[i];
> + *O << *yyvsp[-12].String << ' ' << *yyvsp[-11].String << ' ' << yyvsp[-10].Ty->getNewTy() << ' ' << *yyvsp[-9].Val->val << " (";
> + for (unsigned i = 0; i < yyvsp[-7].ValList->size(); ++i) {
> + Value* V = (*yyvsp[-7].ValList)[i];
> *O << *V->val;
> - if (i+1 < (yyvsp[-7].ValList)->size())
> + if (i+1 < yyvsp[-7].ValList->size())
> *O << ", ";
> delete V;
> }
> - *O << ") " << *(yyvsp[-5].String) << ' ' << (yyvsp[-4].Ty)->getNewTy() << ' ' << *(yyvsp[-3].Val)->val << ' '
> - << *(yyvsp[-2].String) << ' ' << (yyvsp[-1].Ty)->getNewTy() << ' ' << *(yyvsp[0].Val)->val << '\n';
> - delete (yyvsp[-13].String); delete (yyvsp[-12].String); delete (yyvsp[-11].String); delete (yyvsp[-9].Val); delete (yyvsp[-7].ValList);
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Val); delete (yyvsp[-2].String); delete (yyvsp[0].Val);
> - (yyval.String) = 0;
> - ;}
> + *O << ") " << *yyvsp[-5].String << ' ' << yyvsp[-4].Ty->getNewTy() << ' ' << *yyvsp[-3].Val->val << ' '
> + << *yyvsp[-2].String << ' ' << yyvsp[-1].Ty->getNewTy() << ' ' << *yyvsp[0].Val->val << '\n';
> + delete yyvsp[-13].String; delete yyvsp[-12].String; delete yyvsp[-11].String; delete yyvsp[-9].Val; delete yyvsp[-7].ValList;
> + delete yyvsp[-5].String; delete yyvsp[-3].Val; delete yyvsp[-2].String; delete yyvsp[0].Val;
> + yyval.String = 0;
> + }
> break;
>
> case 262:
> -#line 1865 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1867 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << " " << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << " " << *yyvsp[0].String << '\n';
> + delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 263:
> -#line 1870 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1872 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *O << " " << *(yyvsp[0].String) << '\n';
> - delete (yyvsp[0].String);
> - (yyval.String) = 0;
> - ;}
> + *O << " " << *yyvsp[0].String << '\n';
> + delete yyvsp[0].String;
> + yyval.String = 0;
> + }
> break;
>
> case 264:
> -#line 1876 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1878 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) += " " + (yyvsp[-4].Ty)->getNewTy() + " " + *(yyvsp[-3].String) + ", " + (yyvsp[-1].Ty)->getNewTy() + " " +
> - *(yyvsp[0].Val)->val;
> - delete (yyvsp[-3].String); delete (yyvsp[0].Val);
> - (yyval.String) = (yyvsp[-5].String);
> - ;}
> + *yyvsp[-5].String += " " + yyvsp[-4].Ty->getNewTy() + " " + *yyvsp[-3].String + ", " + yyvsp[-1].Ty->getNewTy() + " " +
> + *yyvsp[0].Val->val;
> + delete yyvsp[-3].String; delete yyvsp[0].Val;
> + yyval.String = yyvsp[-5].String;
> + }
> break;
>
> case 265:
> -#line 1882 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1884 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyvsp[-3].String)->insert(0, (yyvsp[-4].Ty)->getNewTy() + " " );
> - *(yyvsp[-3].String) += ", " + (yyvsp[-1].Ty)->getNewTy() + " " + *(yyvsp[0].Val)->val;
> - delete (yyvsp[0].Val);
> - (yyval.String) = (yyvsp[-3].String);
> - ;}
> + yyvsp[-3].String->insert(0, yyvsp[-4].Ty->getNewTy() + " " );
> + *yyvsp[-3].String += ", " + yyvsp[-1].Ty->getNewTy() + " " + *yyvsp[0].Val->val;
> + delete yyvsp[0].Val;
> + yyval.String = yyvsp[-3].String;
> + }
> break;
>
> case 266:
> -#line 1890 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1892 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - if (!(yyvsp[-1].String)->empty()) {
> + if (!yyvsp[-1].String->empty()) {
> // Get a unique name for this value, based on its type.
> - std::string Name = getUniqueName((yyvsp[-1].String), (yyvsp[0].Val)->type);
> - *(yyvsp[-1].String) = Name + " = ";
> + std::string Name = getUniqueName(yyvsp[-1].String, yyvsp[0].Val->type);
> + *yyvsp[-1].String = Name + " = ";
> if (deleteUselessCastFlag && *deleteUselessCastName == Name) {
> // don't actually delete it, just comment it out
> - (yyvsp[-1].String)->insert(0, "; USELSS BITCAST: ");
> + yyvsp[-1].String->insert(0, "; USELSS BITCAST: ");
> delete deleteUselessCastName;
> }
> }
> - *(yyvsp[-1].String) += *(yyvsp[0].Val)->val;
> - delete (yyvsp[0].Val);
> + *yyvsp[-1].String += *yyvsp[0].Val->val;
> + delete yyvsp[0].Val;
> deleteUselessCastFlag = false;
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 267:
> -#line 1908 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1910 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> { // Used for PHI nodes
> - std::string Name = getUniqueName((yyvsp[-3].Val)->val, (yyvsp[-5].Ty));
> - Name.insert(0, (yyvsp[-5].Ty)->getNewTy() + "[");
> - Name += "," + *(yyvsp[-1].Val)->val + "]";
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = new std::string(Name);
> - (yyval.Val)->type = (yyvsp[-5].Ty);
> - delete (yyvsp[-3].Val); delete (yyvsp[-1].Val);
> - ;}
> + std::string Name = getUniqueName(yyvsp[-3].Val->val, yyvsp[-5].Ty);
> + Name.insert(0, yyvsp[-5].Ty->getNewTy() + "[");
> + Name += "," + *yyvsp[-1].Val->val + "]";
> + yyval.Val = new Value;
> + yyval.Val->val = new std::string(Name);
> + yyval.Val->type = yyvsp[-5].Ty;
> + delete yyvsp[-3].Val; delete yyvsp[-1].Val;
> + }
> break;
>
> case 268:
> -#line 1917 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1919 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-3].Val)->val, (yyvsp[-6].Val)->type);
> - *(yyvsp[-6].Val)->val += ", [" + Name + "," + *(yyvsp[-1].Val)->val + "]";
> - delete (yyvsp[-3].Val);
> - delete (yyvsp[-1].Val);
> - (yyval.Val) = (yyvsp[-6].Val);
> - ;}
> + std::string Name = getUniqueName(yyvsp[-3].Val->val, yyvsp[-6].Val->type);
> + *yyvsp[-6].Val->val += ", [" + Name + "," + *yyvsp[-1].Val->val + "]";
> + delete yyvsp[-3].Val;
> + delete yyvsp[-1].Val;
> + yyval.Val = yyvsp[-6].Val;
> + }
> break;
>
> case 269:
> -#line 1927 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1929 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.ValList) = new ValueList();
> - (yyval.ValList)->push_back((yyvsp[0].Val));
> - ;}
> + yyval.ValList = new ValueList();
> + yyval.ValList->push_back(yyvsp[0].Val);
> + }
> break;
>
> case 270:
> -#line 1931 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1933 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - (yyval.ValList) = (yyvsp[-2].ValList);
> - (yyval.ValList)->push_back((yyvsp[0].Val));
> - ;}
> + yyval.ValList = yyvsp[-2].ValList;
> + yyval.ValList->push_back(yyvsp[0].Val);
> + }
> break;
>
> case 271:
> -#line 1938 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.ValList) = (yyvsp[0].ValList); ;}
> +#line 1940 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.ValList = yyvsp[0].ValList; }
> break;
>
> case 272:
> -#line 1939 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.ValList) = new ValueList(); ;}
> +#line 1941 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.ValList = new ValueList(); }
> break;
>
> case 273:
> -#line 1943 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1945 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].String);
> - delete (yyvsp[0].String);
> - (yyval.String) = (yyvsp[-1].String);
> - ;}
> + *yyvsp[-1].String += " " + *yyvsp[0].String;
> + delete yyvsp[0].String;
> + yyval.String = yyvsp[-1].String;
> + }
> break;
>
> case 275:
> -#line 1951 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1953 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - const char* op = getDivRemOpcode(*(yyvsp[-4].String), (yyvsp[-3].Ty));
> - std::string Name1 = getUniqueName((yyvsp[-2].Val)->val, (yyvsp[-3].Ty));
> - std::string Name2 = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-3].Ty));
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = new std::string(op);
> - *(yyval.Val)->val += " " + (yyvsp[-3].Ty)->getNewTy() + " " + Name1 + ", " + Name2;
> - (yyval.Val)->type = (yyvsp[-3].Ty);
> - delete (yyvsp[-4].String); delete (yyvsp[0].Val);
> - ;}
> + const char* op = getDivRemOpcode(*yyvsp[-4].String, yyvsp[-3].Ty);
> + std::string Name1 = getUniqueName(yyvsp[-2].Val->val, yyvsp[-3].Ty);
> + std::string Name2 = getUniqueName(yyvsp[0].Val->val, yyvsp[-3].Ty);
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = new std::string(op);
> + *yyval.Val->val += " " + yyvsp[-3].Ty->getNewTy() + " " + Name1 + ", " + Name2;
> + yyval.Val->type = yyvsp[-3].Ty;
> + delete yyvsp[-4].String; delete yyvsp[0].Val;
> + }
> break;
>
> case 276:
> -#line 1962 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1964 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name1 = getUniqueName((yyvsp[-2].Val)->val, (yyvsp[-3].Ty));
> - std::string Name2 = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-3].Ty));
> - *(yyvsp[-4].String) += " " + (yyvsp[-3].Ty)->getNewTy() + " " + Name1 + ", " + Name2;
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-4].String);
> - (yyval.Val)->type = (yyvsp[-3].Ty);
> - delete (yyvsp[0].Val);
> - ;}
> + std::string Name1 = getUniqueName(yyvsp[-2].Val->val, yyvsp[-3].Ty);
> + std::string Name2 = getUniqueName(yyvsp[0].Val->val, yyvsp[-3].Ty);
> + *yyvsp[-4].String += " " + yyvsp[-3].Ty->getNewTy() + " " + Name1 + ", " + Name2;
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-4].String;
> + yyval.Val->type = yyvsp[-3].Ty;
> + delete yyvsp[0].Val;
> + }
> break;
>
> case 277:
> -#line 1972 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1974 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name1 = getUniqueName((yyvsp[-2].Val)->val, (yyvsp[-3].Ty));
> - std::string Name2 = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-3].Ty));
> - *(yyvsp[-4].String) = getCompareOp(*(yyvsp[-4].String), (yyvsp[-3].Ty));
> - *(yyvsp[-4].String) += " " + (yyvsp[-3].Ty)->getNewTy() + " " + Name1 + ", " + Name2;
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-4].String);
> - (yyval.Val)->type = Type::get("i1",BoolTy);
> - delete (yyvsp[0].Val);
> - ;}
> + std::string Name1 = getUniqueName(yyvsp[-2].Val->val, yyvsp[-3].Ty);
> + std::string Name2 = getUniqueName(yyvsp[0].Val->val, yyvsp[-3].Ty);
> + *yyvsp[-4].String = getCompareOp(*yyvsp[-4].String, yyvsp[-3].Ty);
> + *yyvsp[-4].String += " " + yyvsp[-3].Ty->getNewTy() + " " + Name1 + ", " + Name2;
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-4].String;
> + yyval.Val->type = Type::get("i1",BoolTy);
> + delete yyvsp[0].Val;
> + }
> break;
>
> case 278:
> -#line 1983 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1985 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name1 = getUniqueName((yyvsp[-2].Val)->val, (yyvsp[-3].Ty));
> - std::string Name2 = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-3].Ty));
> - *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Ty)->getNewTy() + " " + Name1 + "," + Name2;
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - (yyval.Val)->type = Type::get("i1",BoolTy);
> - delete (yyvsp[-4].String); delete (yyvsp[0].Val);
> - ;}
> + std::string Name1 = getUniqueName(yyvsp[-2].Val->val, yyvsp[-3].Ty);
> + std::string Name2 = getUniqueName(yyvsp[0].Val->val, yyvsp[-3].Ty);
> + *yyvsp[-5].String += " " + *yyvsp[-4].String + " " + yyvsp[-3].Ty->getNewTy() + " " + Name1 + "," + Name2;
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + yyval.Val->type = Type::get("i1",BoolTy);
> + delete yyvsp[-4].String; delete yyvsp[0].Val;
> + }
> break;
>
> case 279:
> -#line 1993 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 1995 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name1 = getUniqueName((yyvsp[-2].Val)->val, (yyvsp[-3].Ty));
> - std::string Name2 = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-3].Ty));
> - *(yyvsp[-5].String) += " " + *(yyvsp[-4].String) + " " + (yyvsp[-3].Ty)->getNewTy() + " " + Name1 + "," + Name2;
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - (yyval.Val)->type = Type::get("i1",BoolTy);
> - delete (yyvsp[-4].String); delete (yyvsp[0].Val);
> - ;}
> + std::string Name1 = getUniqueName(yyvsp[-2].Val->val, yyvsp[-3].Ty);
> + std::string Name2 = getUniqueName(yyvsp[0].Val->val, yyvsp[-3].Ty);
> + *yyvsp[-5].String += " " + *yyvsp[-4].String + " " + yyvsp[-3].Ty->getNewTy() + " " + Name1 + "," + Name2;
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + yyval.Val->type = Type::get("i1",BoolTy);
> + delete yyvsp[-4].String; delete yyvsp[0].Val;
> + }
> break;
>
> case 280:
> -#line 2003 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2005 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - const char* shiftop = (yyvsp[-3].String)->c_str();
> - if (*(yyvsp[-3].String) == "shr")
> - shiftop = ((yyvsp[-2].Val)->type->isUnsigned()) ? "lshr" : "ashr";
> + const char* shiftop = yyvsp[-3].String->c_str();
> + if (*yyvsp[-3].String == "shr")
> + shiftop = (yyvsp[-2].Val->type->isUnsigned()) ? "lshr" : "ashr";
> std::string *val = new std::string(shiftop);
> - *val += " " + *(yyvsp[-2].Val)->val + ", " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = val;
> - delete (yyvsp[-3].String); delete (yyvsp[0].Val);
> - ;}
> + *val += " " + *yyvsp[-2].Val->val + ", " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = val;
> + delete yyvsp[-3].String; delete yyvsp[0].Val;
> + }
> break;
>
> case 281:
> -#line 2014 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2016 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string source = *(yyvsp[-2].Val)->val;
> - const Type* SrcTy = (yyvsp[-2].Val)->type->resolve();
> - const Type* DstTy = (yyvsp[0].Ty)->resolve();
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = new std::string();
> - (yyval.Val)->type = DstTy;
> - if (*(yyvsp[-3].String) == "cast") {
> - *(yyval.Val)->val += getCastUpgrade(source, SrcTy, DstTy, false);
> + std::string source = *yyvsp[-2].Val->val;
> + const Type* SrcTy = yyvsp[-2].Val->type->resolve();
> + const Type* DstTy = yyvsp[0].Ty->resolve();
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = new std::string();
> + yyval.Val->type = DstTy;
> + if (*yyvsp[-3].String == "cast") {
> + *yyval.Val->val += getCastUpgrade(source, SrcTy, DstTy, false);
> } else {
> - *(yyval.Val)->val += *(yyvsp[-3].String) + " " + source + " to " + DstTy->getNewTy();
> + *yyval.Val->val += *yyvsp[-3].String + " " + source + " to " + DstTy->getNewTy();
> }
> // Check to see if this is a useless cast of a value to the same name
> // and the same type. Such casts will probably cause redefinition errors
> // when assembled and perform no code gen action so just remove them.
> - if (*(yyvsp[-3].String) == "cast" || *(yyvsp[-3].String) == "bitcast")
> + if (*yyvsp[-3].String == "cast" || *yyvsp[-3].String == "bitcast")
> if (SrcTy->isInteger() && DstTy->isInteger() &&
> SrcTy->getBitWidth() == DstTy->getBitWidth()) {
> deleteUselessCastFlag = true; // Flag the "Inst" rule
> - deleteUselessCastName = new std::string(*(yyvsp[-2].Val)->val); // save the name
> + deleteUselessCastName = new std::string(*yyvsp[-2].Val->val); // save the name
> size_t pos = deleteUselessCastName->find_first_of("%\"",0);
> if (pos != std::string::npos) {
> // remove the type portion before val
> deleteUselessCastName->erase(0, pos);
> }
> }
> - delete (yyvsp[-3].String);
> - delete (yyvsp[-1].String);
> - ;}
> + delete yyvsp[-3].String;
> + delete yyvsp[-1].String;
> + }
> break;
>
> case 282:
> -#line 2044 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2046 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) += " " + *(yyvsp[-4].Val)->val + ", " + *(yyvsp[-2].Val)->val + ", " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[-4].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - (yyval.Val)->type = (yyvsp[-2].Val)->type;
> - delete (yyvsp[-2].Val);
> - delete (yyvsp[0].Val);
> - ;}
> + *yyvsp[-5].String += " " + *yyvsp[-4].Val->val + ", " + *yyvsp[-2].Val->val + ", " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[-4].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + yyval.Val->type = yyvsp[-2].Val->type;
> + delete yyvsp[-2].Val;
> + delete yyvsp[0].Val;
> + }
> break;
>
> case 283:
> -#line 2053 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2055 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-3].String) += " " + *(yyvsp[-2].Val)->val + ", " + (yyvsp[0].Ty)->getNewTy();
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-3].String);
> - (yyval.Val)->type = (yyvsp[0].Ty);
> - ;}
> + *yyvsp[-3].String += " " + *yyvsp[-2].Val->val + ", " + yyvsp[0].Ty->getNewTy();
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-3].String;
> + yyval.Val->type = yyvsp[0].Ty;
> + }
> break;
>
> case 284:
> -#line 2060 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2062 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-3].String) += " " + *(yyvsp[-2].Val)->val + ", " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[-2].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-3].String);
> - (yyval.Val)->type = (yyval.Val)->type->resolve();
> - (yyval.Val)->type = (yyval.Val)->type->getElementType();
> - delete (yyvsp[0].Val);
> - ;}
> + *yyvsp[-3].String += " " + *yyvsp[-2].Val->val + ", " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[-2].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-3].String;
> + yyval.Val->type = yyval.Val->type->resolve();
> + yyval.Val->type = yyval.Val->type->getElementType();
> + delete yyvsp[0].Val;
> + }
> break;
>
> case 285:
> -#line 2069 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2071 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) += " " + *(yyvsp[-4].Val)->val + ", " + *(yyvsp[-2].Val)->val + ", " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[-4].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - delete (yyvsp[-2].Val); delete (yyvsp[0].Val);
> - ;}
> + *yyvsp[-5].String += " " + *yyvsp[-4].Val->val + ", " + *yyvsp[-2].Val->val + ", " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[-4].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + delete yyvsp[-2].Val; delete yyvsp[0].Val;
> + }
> break;
>
> case 286:
> -#line 2076 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2078 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-5].String) += " " + *(yyvsp[-4].Val)->val + ", " + *(yyvsp[-2].Val)->val + ", " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[-4].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - delete (yyvsp[-2].Val); delete (yyvsp[0].Val);
> - ;}
> + *yyvsp[-5].String += " " + *yyvsp[-4].Val->val + ", " + *yyvsp[-2].Val->val + ", " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[-4].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + delete yyvsp[-2].Val; delete yyvsp[0].Val;
> + }
> break;
>
> case 287:
> -#line 2083 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2085 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[0].Val);
> - delete (yyvsp[0].Val)->val;
> - (yyval.Val)->val = (yyvsp[-1].String);
> - ;}
> + *yyvsp[-1].String += " " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[0].Val;
> + delete yyvsp[0].Val->val;
> + yyval.Val->val = yyvsp[-1].String;
> + }
> break;
>
> case 288:
> -#line 2089 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2091 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> // map llvm.isunordered to "fcmp uno"
> - (yyval.Val) = new Value;
> - if (*(yyvsp[-3].Val)->val == "%llvm.isunordered.f32" ||
> - *(yyvsp[-3].Val)->val == "%llvm.isunordered.f64") {
> - (yyval.Val)->val = new std::string( "fcmp uno " + *(*(yyvsp[-1].ValList))[0]->val + ", ");
> - size_t pos = (*(yyvsp[-1].ValList))[1]->val->find(' ');
> + yyval.Val = new Value;
> + if (*yyvsp[-3].Val->val == "%llvm.isunordered.f32" ||
> + *yyvsp[-3].Val->val == "%llvm.isunordered.f64") {
> + yyval.Val->val = new std::string( "fcmp uno " + *(*yyvsp[-1].ValList)[0]->val + ", ");
> + size_t pos = (*yyvsp[-1].ValList)[1]->val->find(' ');
> assert(pos != std::string::npos && "no space?");
> - *(yyval.Val)->val += (*(yyvsp[-1].ValList))[1]->val->substr(pos+1);
> - (yyval.Val)->type = Type::get("i1", BoolTy);
> + *yyval.Val->val += (*yyvsp[-1].ValList)[1]->val->substr(pos+1);
> + yyval.Val->type = Type::get("i1", BoolTy);
> } else {
> static unsigned upgradeCount = 1;
> - if (*(yyvsp[-3].Val)->val == "%llvm.va_start" || *(yyvsp[-3].Val)->val == "%llvm.va_end") {
> - if (!(yyvsp[-1].ValList)->empty()) {
> + if (*yyvsp[-3].Val->val == "%llvm.va_start" || *yyvsp[-3].Val->val == "%llvm.va_end") {
> + if (!yyvsp[-1].ValList->empty()) {
> std::string name("%va_upgrade");
> name += llvm::utostr(upgradeCount++);
> - (yyvsp[-6].String)->insert(0, name + " = bitcast " + *(*(yyvsp[-1].ValList))[0]->val + " to i8*\n ");
> - *(*(yyvsp[-1].ValList))[0]->val = "i8* " + name;
> - (*(yyvsp[-1].ValList))[0]->type = Type::get("i8", UByteTy)->getPointerType();
> + yyvsp[-6].String->insert(0, name + " = bitcast " + *(*yyvsp[-1].ValList)[0]->val + " to i8*\n ");
> + *(*yyvsp[-1].ValList)[0]->val = "i8* " + name;
> + (*yyvsp[-1].ValList)[0]->type = Type::get("i8", UByteTy)->getPointerType();
> }
> - } else if (*(yyvsp[-3].Val)->val == "%llvm.va_copy") {
> + } else if (*yyvsp[-3].Val->val == "%llvm.va_copy") {
> std::string name0("%va_upgrade");
> name0 += llvm::utostr(upgradeCount++);
> std::string name1("%va_upgrade");
> name1 += llvm::utostr(upgradeCount++);
> - (yyvsp[-6].String)->insert(0, name0 + " = bitcast " + *(*(yyvsp[-1].ValList))[0]->val + " to i8*\n " +
> - name1 + " = bitcast " + *(*(yyvsp[-1].ValList))[1]->val + " to i8*\n ");
> - *(*(yyvsp[-1].ValList))[0]->val = "i8* " + name0;
> - (*(yyvsp[-1].ValList))[0]->type = Type::get("i8", UByteTy)->getPointerType();
> - *(*(yyvsp[-1].ValList))[1]->val = "i8* " + name1;
> - (*(yyvsp[-1].ValList))[0]->type = Type::get("i8", UByteTy)->getPointerType();
> + yyvsp[-6].String->insert(0, name0 + " = bitcast " + *(*yyvsp[-1].ValList)[0]->val + " to i8*\n " +
> + name1 + " = bitcast " + *(*yyvsp[-1].ValList)[1]->val + " to i8*\n ");
> + *(*yyvsp[-1].ValList)[0]->val = "i8* " + name0;
> + (*yyvsp[-1].ValList)[0]->type = Type::get("i8", UByteTy)->getPointerType();
> + *(*yyvsp[-1].ValList)[1]->val = "i8* " + name1;
> + (*yyvsp[-1].ValList)[0]->type = Type::get("i8", UByteTy)->getPointerType();
> }
> - if (!(yyvsp[-5].String)->empty())
> - *(yyvsp[-6].String) += " " + *(yyvsp[-5].String);
> - if (!(yyvsp[-6].String)->empty())
> - *(yyvsp[-6].String) += " ";
> - *(yyvsp[-6].String) += (yyvsp[-4].Ty)->getNewTy() + " " + *(yyvsp[-3].Val)->val + "(";
> - for (unsigned i = 0; i < (yyvsp[-1].ValList)->size(); ++i) {
> - Value* V = (*(yyvsp[-1].ValList))[i];
> - *(yyvsp[-6].String) += *V->val;
> - if (i+1 < (yyvsp[-1].ValList)->size())
> - *(yyvsp[-6].String) += ", ";
> + if (!yyvsp[-5].String->empty())
> + *yyvsp[-6].String += " " + *yyvsp[-5].String;
> + if (!yyvsp[-6].String->empty())
> + *yyvsp[-6].String += " ";
> + *yyvsp[-6].String += yyvsp[-4].Ty->getNewTy() + " " + *yyvsp[-3].Val->val + "(";
> + for (unsigned i = 0; i < yyvsp[-1].ValList->size(); ++i) {
> + Value* V = (*yyvsp[-1].ValList)[i];
> + *yyvsp[-6].String += *V->val;
> + if (i+1 < yyvsp[-1].ValList->size())
> + *yyvsp[-6].String += ", ";
> delete V;
> }
> - *(yyvsp[-6].String) += ")";
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = (yyvsp[-6].String);
> - (yyval.Val)->type = getFunctionReturnType((yyvsp[-4].Ty));
> + *yyvsp[-6].String += ")";
> + yyval.Val = new Value;
> + yyval.Val->val = yyvsp[-6].String;
> + yyval.Val->type = getFunctionReturnType(yyvsp[-4].Ty);
> }
> - delete (yyvsp[-5].String); delete (yyvsp[-3].Val); delete (yyvsp[-1].ValList);
> - ;}
> + delete yyvsp[-5].String; delete yyvsp[-3].Val; delete yyvsp[-1].ValList;
> + }
> break;
>
> case 290:
> -#line 2145 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.ValList) = (yyvsp[0].ValList); ;}
> +#line 2147 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.ValList = yyvsp[0].ValList; }
> break;
>
> case 291:
> -#line 2146 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.ValList) = new ValueList(); ;}
> +#line 2148 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.ValList = new ValueList(); }
> break;
>
> case 293:
> -#line 2151 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> - { (yyval.String) = new std::string(); ;}
> +#line 2153 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> + { yyval.String = new std::string(); }
> break;
>
> case 294:
> -#line 2154 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2156 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += " " + (yyvsp[-1].Ty)->getNewTy();
> - if (!(yyvsp[0].String)->empty())
> - *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = (yyvsp[-2].String);
> - (yyval.Val)->type = (yyvsp[-1].Ty)->getPointerType();
> - delete (yyvsp[0].String);
> - ;}
> + *yyvsp[-2].String += " " + yyvsp[-1].Ty->getNewTy();
> + if (!yyvsp[0].String->empty())
> + *yyvsp[-2].String += " " + *yyvsp[0].String;
> + yyval.Val = new Value;
> + yyval.Val->val = yyvsp[-2].String;
> + yyval.Val->type = yyvsp[-1].Ty->getPointerType();
> + delete yyvsp[0].String;
> + }
> break;
>
> case 295:
> -#line 2163 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2165 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-1].Val)->val, (yyvsp[-2].Ty));
> - *(yyvsp[-5].String) += " " + (yyvsp[-4].Ty)->getNewTy() + ", " + (yyvsp[-2].Ty)->getNewTy() + " " + Name;
> - if (!(yyvsp[0].String)->empty())
> - *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - (yyval.Val)->type = (yyvsp[-4].Ty)->getPointerType();
> - delete (yyvsp[-1].Val); delete (yyvsp[0].String);
> - ;}
> + std::string Name = getUniqueName(yyvsp[-1].Val->val, yyvsp[-2].Ty);
> + *yyvsp[-5].String += " " + yyvsp[-4].Ty->getNewTy() + ", " + yyvsp[-2].Ty->getNewTy() + " " + Name;
> + if (!yyvsp[0].String->empty())
> + *yyvsp[-5].String += " " + *yyvsp[0].String;
> + yyval.Val = new Value;
> + yyval.Val->val = yyvsp[-5].String;
> + yyval.Val->type = yyvsp[-4].Ty->getPointerType();
> + delete yyvsp[-1].Val; delete yyvsp[0].String;
> + }
> break;
>
> case 296:
> -#line 2173 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2175 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-2].String) += " " + (yyvsp[-1].Ty)->getNewTy();
> - if (!(yyvsp[0].String)->empty())
> - *(yyvsp[-2].String) += " " + *(yyvsp[0].String);
> - (yyval.Val) = new Value;
> - (yyval.Val)->val = (yyvsp[-2].String);
> - (yyval.Val)->type = (yyvsp[-1].Ty)->getPointerType();
> - delete (yyvsp[0].String);
> - ;}
> + *yyvsp[-2].String += " " + yyvsp[-1].Ty->getNewTy();
> + if (!yyvsp[0].String->empty())
> + *yyvsp[-2].String += " " + *yyvsp[0].String;
> + yyval.Val = new Value;
> + yyval.Val->val = yyvsp[-2].String;
> + yyval.Val->type = yyvsp[-1].Ty->getPointerType();
> + delete yyvsp[0].String;
> + }
> break;
>
> case 297:
> -#line 2182 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2184 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-1].Val)->val, (yyvsp[-2].Ty));
> - *(yyvsp[-5].String) += " " + (yyvsp[-4].Ty)->getNewTy() + ", " + (yyvsp[-2].Ty)->getNewTy() + " " + Name;
> - if (!(yyvsp[0].String)->empty())
> - *(yyvsp[-5].String) += " " + *(yyvsp[0].String);
> - (yyval.Val) = (yyvsp[-1].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - (yyval.Val)->type = (yyvsp[-4].Ty)->getPointerType();
> - delete (yyvsp[0].String);
> - ;}
> + std::string Name = getUniqueName(yyvsp[-1].Val->val, yyvsp[-2].Ty);
> + *yyvsp[-5].String += " " + yyvsp[-4].Ty->getNewTy() + ", " + yyvsp[-2].Ty->getNewTy() + " " + Name;
> + if (!yyvsp[0].String->empty())
> + *yyvsp[-5].String += " " + *yyvsp[0].String;
> + yyval.Val = yyvsp[-1].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + yyval.Val->type = yyvsp[-4].Ty->getPointerType();
> + delete yyvsp[0].String;
> + }
> break;
>
> case 298:
> -#line 2193 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2195 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - *(yyvsp[-1].String) += " " + *(yyvsp[0].Val)->val;
> - (yyval.Val) = (yyvsp[0].Val);
> - delete (yyvsp[0].Val)->val;
> - (yyval.Val)->val = (yyvsp[-1].String);
> - (yyval.Val)->type = Type::get("void", VoidTy);
> - ;}
> + *yyvsp[-1].String += " " + *yyvsp[0].Val->val;
> + yyval.Val = yyvsp[0].Val;
> + delete yyvsp[0].Val->val;
> + yyval.Val->val = yyvsp[-1].String;
> + yyval.Val->type = Type::get("void", VoidTy);
> + }
> break;
>
> case 299:
> -#line 2200 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2202 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-1].Ty));
> - if (!(yyvsp[-3].String)->empty())
> - *(yyvsp[-3].String) += " ";
> - *(yyvsp[-3].String) += *(yyvsp[-2].String) + " " + (yyvsp[-1].Ty)->getNewTy() + " " + Name;
> - (yyval.Val) = (yyvsp[0].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-3].String);
> - (yyval.Val)->type = (yyvsp[-1].Ty)->getElementType();
> - delete (yyvsp[-2].String);
> - ;}
> + std::string Name = getUniqueName(yyvsp[0].Val->val, yyvsp[-1].Ty);
> + if (!yyvsp[-3].String->empty())
> + *yyvsp[-3].String += " ";
> + *yyvsp[-3].String += *yyvsp[-2].String + " " + yyvsp[-1].Ty->getNewTy() + " " + Name;
> + yyval.Val = yyvsp[0].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-3].String;
> + yyval.Val->type = yyvsp[-1].Ty->getElementType();
> + delete yyvsp[-2].String;
> + }
> break;
>
> case 300:
> -#line 2211 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2213 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[0].Val)->val, (yyvsp[-1].Ty));
> - if (!(yyvsp[-5].String)->empty())
> - *(yyvsp[-5].String) += " ";
> - *(yyvsp[-5].String) += *(yyvsp[-4].String) + " " + *(yyvsp[-3].Val)->val + ", " + (yyvsp[-1].Ty)->getNewTy() + " " + Name;
> - (yyval.Val) = (yyvsp[-3].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-5].String);
> - (yyval.Val)->type = Type::get("void", VoidTy);
> - delete (yyvsp[-4].String); delete (yyvsp[0].Val);
> - ;}
> + std::string Name = getUniqueName(yyvsp[0].Val->val, yyvsp[-1].Ty);
> + if (!yyvsp[-5].String->empty())
> + *yyvsp[-5].String += " ";
> + *yyvsp[-5].String += *yyvsp[-4].String + " " + *yyvsp[-3].Val->val + ", " + yyvsp[-1].Ty->getNewTy() + " " + Name;
> + yyval.Val = yyvsp[-3].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-5].String;
> + yyval.Val->type = Type::get("void", VoidTy);
> + delete yyvsp[-4].String; delete yyvsp[0].Val;
> + }
> break;
>
> case 301:
> -#line 2222 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2224 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> {
> - std::string Name = getUniqueName((yyvsp[-1].Val)->val, (yyvsp[-2].Ty));
> + std::string Name = getUniqueName(yyvsp[-1].Val->val, yyvsp[-2].Ty);
> // Upgrade the indices
> - for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
> - Value* V = (*(yyvsp[0].ValList))[i];
> + for (unsigned i = 0; i < yyvsp[0].ValList->size(); ++i) {
> + Value* V = (*yyvsp[0].ValList)[i];
> if (V->type->isUnsigned() && !V->isConstant() &&
> V->type->getBitWidth() < 64) {
> *O << " %gep_upgrade" << UniqueNameCounter << " = zext " << *V->val
> @@ -4730,33 +4557,41 @@
> V->type = Type::get("i64",ULongTy);
> }
> }
> - *(yyvsp[-3].String) += " " + (yyvsp[-2].Ty)->getNewTy() + " " + Name;
> - for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i) {
> - Value* V = (*(yyvsp[0].ValList))[i];
> - *(yyvsp[-3].String) += ", " + *V->val;
> - }
> - (yyval.Val) = (yyvsp[-1].Val);
> - delete (yyval.Val)->val;
> - (yyval.Val)->val = (yyvsp[-3].String);
> - (yyval.Val)->type = getGEPIndexedType((yyvsp[-2].Ty),(yyvsp[0].ValList));
> - for (unsigned i = 0; i < (yyvsp[0].ValList)->size(); ++i)
> - delete (*(yyvsp[0].ValList))[i];
> - delete (yyvsp[0].ValList);
> - ;}
> + *yyvsp[-3].String += " " + yyvsp[-2].Ty->getNewTy() + " " + Name;
> + for (unsigned i = 0; i < yyvsp[0].ValList->size(); ++i) {
> + Value* V = (*yyvsp[0].ValList)[i];
> + *yyvsp[-3].String += ", " + *V->val;
> + }
> + yyval.Val = yyvsp[-1].Val;
> + delete yyval.Val->val;
> + yyval.Val->val = yyvsp[-3].String;
> + yyval.Val->type = getGEPIndexedType(yyvsp[-2].Ty,yyvsp[0].ValList);
> + for (unsigned i = 0; i < yyvsp[0].ValList->size(); ++i)
> + delete (*yyvsp[0].ValList)[i];
> + delete yyvsp[0].ValList;
> + }
> break;
>
>
> - default: break;
> }
>
> -/* Line 1126 of yacc.c. */
> -#line 4754 "UpgradeParser.tab.c"
> +/* Line 1016 of /usr/local/share/bison/yacc.c. */
> +#line 4580 "UpgradeParser.tab.c"
>
> yyvsp -= yylen;
> yyssp -= yylen;
>
>
> - YY_STACK_PRINT (yyss, yyssp);
> +#if YYDEBUG
> + if (yydebug)
> + {
> + short *yyssp1 = yyss - 1;
> + YYFPRINTF (stderr, "state stack now");
> + while (yyssp1 != yyssp)
> + YYFPRINTF (stderr, " %d", *++yyssp1);
> + YYFPRINTF (stderr, "\n");
> + }
> +#endif
>
> *++yyvsp = yyval;
>
> @@ -4789,153 +4624,90 @@
>
> if (YYPACT_NINF < yyn && yyn < YYLAST)
> {
> + YYSIZE_T yysize = 0;
> int yytype = YYTRANSLATE (yychar);
> - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
> - YYSIZE_T yysize = yysize0;
> - YYSIZE_T yysize1;
> - int yysize_overflow = 0;
> - char *yymsg = 0;
> -# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
> - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
> - int yyx;
> -
> -#if 0
> - /* This is so xgettext sees the translatable formats that are
> - constructed on the fly. */
> - YY_("syntax error, unexpected %s");
> - YY_("syntax error, unexpected %s, expecting %s");
> - YY_("syntax error, unexpected %s, expecting %s or %s");
> - YY_("syntax error, unexpected %s, expecting %s or %s or %s");
> - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
> -#endif
> - char *yyfmt;
> - char const *yyf;
> - static char const yyunexpected[] = "syntax error, unexpected %s";
> - static char const yyexpecting[] = ", expecting %s";
> - static char const yyor[] = " or %s";
> - char yyformat[sizeof yyunexpected
> - + sizeof yyexpecting - 1
> - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
> - * (sizeof yyor - 1))];
> - char const *yyprefix = yyexpecting;
> + char *yymsg;
> + int yyx, yycount;
>
> + yycount = 0;
> /* Start YYX at -YYN if negative to avoid negative indexes in
> YYCHECK. */
> - int yyxbegin = yyn < 0 ? -yyn : 0;
> -
> - /* Stay within bounds of both yycheck and yytname. */
> - int yychecklim = YYLAST - yyn;
> - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
> - int yycount = 1;
> -
> - yyarg[0] = yytname[yytype];
> - yyfmt = yystpcpy (yyformat, yyunexpected);
> -
> - for (yyx = yyxbegin; yyx < yyxend; ++yyx)
> + for (yyx = yyn < 0 ? -yyn : 0;
> + yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
> if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
> - {
> - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
> - {
> - yycount = 1;
> - yysize = yysize0;
> - yyformat[sizeof yyunexpected - 1] = '\0';
> - break;
> - }
> - yyarg[yycount++] = yytname[yyx];
> - yysize1 = yysize + yytnamerr (0, yytname[yyx]);
> - yysize_overflow |= yysize1 < yysize;
> - yysize = yysize1;
> - yyfmt = yystpcpy (yyfmt, yyprefix);
> - yyprefix = yyor;
> - }
> -
> - yyf = YY_(yyformat);
> - yysize1 = yysize + yystrlen (yyf);
> - yysize_overflow |= yysize1 < yysize;
> - yysize = yysize1;
> -
> - if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
> - yymsg = (char *) YYSTACK_ALLOC (yysize);
> - if (yymsg)
> + yysize += yystrlen (yytname[yyx]) + 15, yycount++;
> + yysize += yystrlen ("parse error, unexpected ") + 1;
> + yysize += yystrlen (yytname[yytype]);
> + yymsg = (char *) YYSTACK_ALLOC (yysize);
> + if (yymsg != 0)
> {
> - /* Avoid sprintf, as that infringes on the user's name space.
> - Don't have undefined behavior even if the translation
> - produced a string with the wrong number of "%s"s. */
> - char *yyp = yymsg;
> - int yyi = 0;
> - while ((*yyp = *yyf))
> + char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
> + yyp = yystpcpy (yyp, yytname[yytype]);
> +
> + if (yycount < 5)
> {
> - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
> - {
> - yyp += yytnamerr (yyp, yyarg[yyi++]);
> - yyf += 2;
> - }
> - else
> - {
> - yyp++;
> - yyf++;
> - }
> + yycount = 0;
> + for (yyx = yyn < 0 ? -yyn : 0;
> + yyx < (int) (sizeof (yytname) / sizeof (char *));
> + yyx++)
> + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
> + {
> + const char *yyq = ! yycount ? ", expecting " : " or ";
> + yyp = yystpcpy (yyp, yyq);
> + yyp = yystpcpy (yyp, yytname[yyx]);
> + yycount++;
> + }
> }
> yyerror (yymsg);
> YYSTACK_FREE (yymsg);
> }
> else
> - {
> - yyerror (YY_("syntax error"));
> - goto yyexhaustedlab;
> - }
> + yyerror ("parse error; also virtual memory exhausted");
> }
> else
> #endif /* YYERROR_VERBOSE */
> - yyerror (YY_("syntax error"));
> + yyerror ("parse error");
> }
> + goto yyerrlab1;
>
>
> -
> +/*----------------------------------------------------.
> +| yyerrlab1 -- error raised explicitly by an action. |
> +`----------------------------------------------------*/
> +yyerrlab1:
> if (yyerrstatus == 3)
> {
> - /* If just tried and failed to reuse look-ahead token after an
> + /* If just tried and failed to reuse lookahead token after an
> error, discard it. */
>
> - if (yychar <= YYEOF)
> + /* Return failure if at end of input. */
> + if (yychar == YYEOF)
> {
> - /* Return failure if at end of input. */
> - if (yychar == YYEOF)
> - YYABORT;
> + /* Pop the error token. */
> + YYPOPSTACK;
> + /* Pop the rest of the stack. */
> + while (yyssp > yyss)
> + {
> + YYDPRINTF ((stderr, "Error: popping "));
> + YYDSYMPRINT ((stderr,
> + yystos[*yyssp],
> + *yyvsp));
> + YYDPRINTF ((stderr, "\n"));
> + yydestruct (yystos[*yyssp], *yyvsp);
> + YYPOPSTACK;
> + }
> + YYABORT;
> }
> - else
> - {
> - yydestruct ("Error: discarding", yytoken, &yylval);
> - yychar = YYEMPTY;
> - }
> +
> + YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
> + yychar, yytname[yychar1]));
> + yydestruct (yychar1, yylval);
> + yychar = YYEMPTY;
> }
>
> - /* Else will try to reuse look-ahead token after shifting the error
> + /* Else will try to reuse lookahead token after shifting the error
> token. */
> - goto yyerrlab1;
> -
> -
> -/*---------------------------------------------------.
> -| yyerrorlab -- error raised explicitly by YYERROR. |
> -`---------------------------------------------------*/
> -yyerrorlab:
> -
> - /* Pacify compilers like GCC when the user code never invokes
> - YYERROR and the label yyerrorlab therefore never appears in user
> - code. */
> - if (0)
> - goto yyerrorlab;
> -
> -yyvsp -= yylen;
> - yyssp -= yylen;
> - yystate = *yyssp;
> - goto yyerrlab1;
>
> -
> -/*-------------------------------------------------------------.
> -| yyerrlab1 -- common code for both syntax error and YYERROR. |
> -`-------------------------------------------------------------*/
> -yyerrlab1:
> yyerrstatus = 3; /* Each real token shifted decrements this. */
>
> for (;;)
> @@ -4956,21 +4728,35 @@
> if (yyssp == yyss)
> YYABORT;
>
> + YYDPRINTF ((stderr, "Error: popping "));
> + YYDSYMPRINT ((stderr,
> + yystos[*yyssp], *yyvsp));
> + YYDPRINTF ((stderr, "\n"));
> +
> + yydestruct (yystos[yystate], *yyvsp);
> + yyvsp--;
> + yystate = *--yyssp;
> +
>
> - yydestruct ("Error: popping", yystos[yystate], yyvsp);
> - YYPOPSTACK;
> - yystate = *yyssp;
> - YY_STACK_PRINT (yyss, yyssp);
> +#if YYDEBUG
> + if (yydebug)
> + {
> + short *yyssp1 = yyss - 1;
> + YYFPRINTF (stderr, "Error: state stack now");
> + while (yyssp1 != yyssp)
> + YYFPRINTF (stderr, " %d", *++yyssp1);
> + YYFPRINTF (stderr, "\n");
> + }
> +#endif
> }
>
> if (yyn == YYFINAL)
> YYACCEPT;
>
> - *++yyvsp = yylval;
> + YYDPRINTF ((stderr, "Shifting error token, "));
>
> + *++yyvsp = yylval;
>
> - /* Shift the error token. */
> - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
>
> yystate = yyn;
> goto yynewstate;
> @@ -4991,25 +4777,16 @@
> goto yyreturn;
>
> #ifndef yyoverflow
> -/*-------------------------------------------------.
> -| yyexhaustedlab -- memory exhaustion comes here. |
> -`-------------------------------------------------*/
> -yyexhaustedlab:
> - yyerror (YY_("memory exhausted"));
> +/*----------------------------------------------.
> +| yyoverflowlab -- parser overflow comes here. |
> +`----------------------------------------------*/
> +yyoverflowlab:
> + yyerror ("parser stack overflow");
> yyresult = 2;
> /* Fall through. */
> #endif
>
> yyreturn:
> - if (yychar != YYEOF && yychar != YYEMPTY)
> - yydestruct ("Cleanup: discarding lookahead",
> - yytoken, &yylval);
> - while (yyssp != yyss)
> - {
> - yydestruct ("Cleanup: popping",
> - yystos[*yyssp], yyvsp);
> - YYPOPSTACK;
> - }
> #ifndef yyoverflow
> if (yyss != yyssa)
> YYSTACK_FREE (yyss);
> @@ -5018,7 +4795,7 @@
> }
>
>
> -#line 2249 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> +#line 2251 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
>
>
> int yyerror(const char *ErrorMsg) {
>
>
> Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs
> diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.30 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.31
> --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.30 Sun Jan 14 20:41:46 2007
> +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Sun Jan 21 13:30:52 2007
> @@ -1,7 +1,7 @@
> -/* A Bison parser, made by GNU Bison 2.1. */
> +/* A Bison parser, made from /usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y, by GNU bison 1.75. */
>
> /* Skeleton parser for Yacc-like parsing with Bison,
> - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
> + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
>
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> @@ -15,14 +15,17 @@
>
> You should have received a copy of the GNU General Public License
> along with this program; if not, write to the Free Software
> - Foundation, Inc., 51 Franklin Street, Fifth Floor,
> - Boston, MA 02110-1301, USA. */
> + Foundation, Inc., 59 Temple Place - Suite 330,
> + Boston, MA 02111-1307, USA. */
>
> /* As a special exception, when this file is copied by Bison into a
> Bison output file, you may use that output file without restriction.
> This special exception was added by the Free Software Foundation
> in version 1.24 of Bison. */
>
> +#ifndef BISON_UPGRADEPARSER_TAB_H
> +# define BISON_UPGRADEPARSER_TAB_H
> +
> /* Tokens. */
> #ifndef YYTOKENTYPE
> # define YYTOKENTYPE
> @@ -178,7 +181,6 @@
> BITCAST = 404
> };
> #endif
> -/* Tokens. */
> #define VOID 258
> #define BOOL 259
> #define SBYTE 260
> @@ -330,24 +332,23 @@
>
>
>
> -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
> -#line 971 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y"
> -typedef union YYSTYPE {
> +#ifndef YYSTYPE
> +#line 971 "/usr/home/jeffc/llvm/tools/llvm-upgrade/UpgradeParser.y"
> +typedef union {
> std::string* String;
> const Type* Ty;
> Value* Val;
> Constant* Const;
> ValueList* ValList;
> TypeList* TypeVec;
> -} YYSTYPE;
> -/* Line 1447 of yacc.c. */
> -#line 345 "UpgradeParser.tab.h"
> -# define yystype YYSTYPE /* obsolescent; will be withdrawn */
> -# define YYSTYPE_IS_DECLARED 1
> -# define YYSTYPE_IS_TRIVIAL 1
> +} yystype;
> +/* Line 1237 of /usr/local/share/bison/yacc.c. */
> +#line 347 "UpgradeParser.tab.h"
> +# define YYSTYPE yystype
> #endif
>
> extern YYSTYPE Upgradelval;
>
>
> +#endif /* not BISON_UPGRADEPARSER_TAB_H */
>
>
>
> Index: llvm/tools/llvm-upgrade/UpgradeParser.y
> diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.42 llvm/tools/llvm-upgrade/UpgradeParser.y:1.43
> --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.42 Sun Jan 14 20:40:33 2007
> +++ llvm/tools/llvm-upgrade/UpgradeParser.y Sun Jan 21 13:30:52 2007
> @@ -1483,8 +1483,9 @@
> $$ = 0;
> }
> | ConstPool { $$ = 0; }
> + ;
>
> -External : EXTERNAL | UNINITIALIZED { $$ = $1; *$$ = "external"; }
> +External : EXTERNAL | UNINITIALIZED { $$ = $1; *$$ = "external"; } ;
>
> // ConstPool - Constants with optional names assigned to them.
> ConstPool : ConstPool OptAssign TYPE TypesV {
> @@ -1564,7 +1565,7 @@
>
> AsmBlock : STRINGCONSTANT ;
>
> -BigOrLittle : BIG | LITTLE
> +BigOrLittle : BIG | LITTLE ;
>
> TargetDefinition
> : ENDIAN '=' BigOrLittle {
> @@ -1671,6 +1672,7 @@
>
> BEGIN : BEGINTOK { $$ = new std::string("{"); delete $1; }
> | '{' { $$ = new std::string ("{"); }
> + ;
>
> FunctionHeader
> : OptLinkage FunctionHeaderH BEGIN {
> @@ -1796,7 +1798,7 @@
> $$ = 0;
> };
>
> -Unwind : UNWIND | EXCEPT { $$ = $1; *$$ = "unwind"; }
> +Unwind : UNWIND | EXCEPT { $$ = $1; *$$ = "unwind"; } ;
>
> BBTerminatorInst : RET ResolvedVal { // Return with a result...
> *O << " " << *$1 << ' ' << *$2->val << '\n';
>
>
> Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
> diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.42 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.43
> --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.42 Sun Jan 14 20:41:46 2007
> +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Sun Jan 21 13:30:52 2007
> @@ -1483,8 +1483,9 @@
> $$ = 0;
> }
> | ConstPool { $$ = 0; }
> + ;
>
> -External : EXTERNAL | UNINITIALIZED { $$ = $1; *$$ = "external"; }
> +External : EXTERNAL | UNINITIALIZED { $$ = $1; *$$ = "external"; } ;
>
> // ConstPool - Constants with optional names assigned to them.
> ConstPool : ConstPool OptAssign TYPE TypesV {
> @@ -1564,7 +1565,7 @@
>
> AsmBlock : STRINGCONSTANT ;
>
> -BigOrLittle : BIG | LITTLE
> +BigOrLittle : BIG | LITTLE ;
>
> TargetDefinition
> : ENDIAN '=' BigOrLittle {
> @@ -1671,6 +1672,7 @@
>
> BEGIN : BEGINTOK { $$ = new std::string("{"); delete $1; }
> | '{' { $$ = new std::string ("{"); }
> + ;
>
> FunctionHeader
> : OptLinkage FunctionHeaderH BEGIN {
> @@ -1796,7 +1798,7 @@
> $$ = 0;
> };
>
> -Unwind : UNWIND | EXCEPT { $$ = $1; *$$ = "unwind"; }
> +Unwind : UNWIND | EXCEPT { $$ = $1; *$$ = "unwind"; } ;
>
> BBTerminatorInst : RET ResolvedVal { // Return with a result...
> *O << " " << *$1 << ' ' << *$2->val << '\n';
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
>
More information about the llvm-commits
mailing list