From e59f4931f49a245dd10b41e57965dc8d815a0c8d Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 16 Apr 2007 03:05:01 +0000 Subject: [PATCH] Regenerate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36106 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-upgrade/UpgradeParser.cpp.cvs | 558 ++++++++++++----------- tools/llvm-upgrade/UpgradeParser.h.cvs | 2 +- tools/llvm-upgrade/UpgradeParser.y.cvs | 12 +- 3 files changed, 292 insertions(+), 280 deletions(-) diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs index 03ccc39cd91..29a733a2520 100644 --- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs +++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs @@ -1294,8 +1294,9 @@ ParseGlobalVariable(char *NameStr,GlobalValue::LinkageTypes Linkage, // of this global in the module and emit warnings if there are conflicts. if (!Name.empty()) { // The global has a name. See if there's an existing one of the same name. - if (CurModule.CurrentModule->getNamedGlobal(Name)) { - // We found an existing global ov the same name. This isn't allowed + if (CurModule.CurrentModule->getNamedGlobal(Name) || + CurModule.CurrentModule->getFunction(Name)) { + // We found an existing global of the same name. This isn't allowed // in LLVM 2.0. Consequently, we must alter the name of the global so it // can at least compile. This can happen because of type planes // There is alread a global of the same name which means there is a @@ -2146,7 +2147,7 @@ using namespace llvm; #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1770 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1771 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -2189,7 +2190,7 @@ typedef union YYSTYPE { llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 2193 "UpgradeParser.tab.c" +#line 2194 "UpgradeParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -2201,7 +2202,7 @@ typedef union YYSTYPE { /* Line 219 of yacc.c. */ -#line 2205 "UpgradeParser.tab.c" +#line 2206 "UpgradeParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -2561,38 +2562,38 @@ static const short int yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1910, 1910, 1911, 1919, 1920, 1930, 1930, 1930, 1930, - 1930, 1930, 1930, 1930, 1930, 1930, 1930, 1934, 1934, 1934, - 1938, 1938, 1938, 1938, 1938, 1938, 1942, 1942, 1943, 1943, - 1944, 1944, 1945, 1945, 1946, 1946, 1950, 1950, 1951, 1951, - 1952, 1952, 1953, 1953, 1954, 1954, 1955, 1955, 1956, 1956, - 1957, 1958, 1961, 1961, 1961, 1961, 1965, 1965, 1965, 1965, - 1965, 1965, 1965, 1966, 1966, 1966, 1966, 1966, 1966, 1972, - 1972, 1972, 1972, 1976, 1976, 1976, 1976, 1980, 1980, 1984, - 1984, 1989, 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2025, - 2026, 2034, 2035, 2043, 2052, 2053, 2060, 2061, 2065, 2069, - 2085, 2086, 2093, 2094, 2101, 2109, 2109, 2109, 2109, 2109, - 2109, 2109, 2110, 2110, 2110, 2110, 2110, 2115, 2119, 2123, - 2128, 2137, 2155, 2161, 2174, 2185, 2189, 2202, 2206, 2220, - 2224, 2231, 2232, 2238, 2245, 2257, 2287, 2300, 2323, 2351, - 2373, 2384, 2406, 2417, 2426, 2431, 2490, 2497, 2505, 2512, - 2519, 2523, 2527, 2536, 2551, 2563, 2572, 2600, 2613, 2622, - 2628, 2634, 2645, 2651, 2657, 2668, 2669, 2678, 2679, 2691, - 2700, 2701, 2702, 2703, 2704, 2720, 2740, 2742, 2744, 2744, - 2751, 2751, 2759, 2759, 2767, 2767, 2776, 2778, 2780, 2785, - 2799, 2800, 2804, 2807, 2815, 2819, 2826, 2830, 2834, 2838, - 2846, 2846, 2850, 2851, 2855, 2863, 2868, 2876, 2877, 2884, - 2891, 2895, 3077, 3077, 3081, 3081, 3091, 3091, 3095, 3100, - 3101, 3102, 3106, 3107, 3106, 3119, 3120, 3125, 3126, 3127, - 3128, 3132, 3136, 3137, 3138, 3139, 3160, 3164, 3178, 3179, - 3184, 3184, 3192, 3202, 3205, 3214, 3225, 3230, 3239, 3250, - 3250, 3253, 3257, 3261, 3266, 3276, 3294, 3303, 3373, 3377, - 3384, 3396, 3411, 3441, 3451, 3461, 3465, 3472, 3473, 3477, - 3480, 3486, 3505, 3523, 3539, 3553, 3567, 3578, 3596, 3605, - 3614, 3621, 3642, 3666, 3672, 3678, 3684, 3700, 3790, 3798, - 3799, 3803, 3804, 3808, 3814, 3821, 3827, 3834, 3841, 3854, - 3880 + 0, 1911, 1911, 1912, 1920, 1921, 1931, 1931, 1931, 1931, + 1931, 1931, 1931, 1931, 1931, 1931, 1931, 1935, 1935, 1935, + 1939, 1939, 1939, 1939, 1939, 1939, 1943, 1943, 1944, 1944, + 1945, 1945, 1946, 1946, 1947, 1947, 1951, 1951, 1952, 1952, + 1953, 1953, 1954, 1954, 1955, 1955, 1956, 1956, 1957, 1957, + 1958, 1959, 1962, 1962, 1962, 1962, 1966, 1966, 1966, 1966, + 1966, 1966, 1966, 1967, 1967, 1967, 1967, 1967, 1967, 1973, + 1973, 1973, 1973, 1977, 1977, 1977, 1977, 1981, 1981, 1985, + 1985, 1990, 1993, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2026, + 2027, 2035, 2036, 2044, 2053, 2054, 2061, 2062, 2066, 2070, + 2086, 2087, 2094, 2095, 2102, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2111, 2111, 2111, 2111, 2111, 2116, 2120, 2124, + 2129, 2138, 2156, 2162, 2175, 2186, 2190, 2203, 2207, 2221, + 2225, 2232, 2233, 2239, 2246, 2258, 2288, 2301, 2324, 2352, + 2374, 2385, 2407, 2418, 2427, 2432, 2491, 2498, 2506, 2513, + 2520, 2524, 2528, 2537, 2552, 2564, 2573, 2601, 2614, 2623, + 2629, 2635, 2646, 2652, 2658, 2669, 2670, 2679, 2680, 2692, + 2701, 2702, 2703, 2704, 2705, 2721, 2741, 2743, 2745, 2745, + 2752, 2752, 2760, 2760, 2768, 2768, 2777, 2779, 2781, 2786, + 2800, 2801, 2805, 2808, 2816, 2820, 2827, 2831, 2835, 2839, + 2847, 2847, 2851, 2852, 2856, 2864, 2869, 2877, 2878, 2885, + 2892, 2896, 3083, 3083, 3087, 3087, 3097, 3097, 3101, 3106, + 3107, 3108, 3112, 3113, 3112, 3125, 3126, 3131, 3132, 3133, + 3134, 3138, 3142, 3143, 3144, 3145, 3166, 3170, 3184, 3185, + 3190, 3190, 3198, 3208, 3211, 3220, 3231, 3236, 3245, 3256, + 3256, 3259, 3263, 3267, 3272, 3282, 3300, 3309, 3379, 3383, + 3390, 3402, 3417, 3447, 3457, 3467, 3471, 3478, 3479, 3483, + 3486, 3492, 3511, 3529, 3545, 3559, 3573, 3584, 3602, 3611, + 3620, 3627, 3648, 3672, 3678, 3684, 3690, 3706, 3796, 3804, + 3805, 3809, 3810, 3814, 3820, 3827, 3833, 3840, 3847, 3860, + 3886 }; #endif @@ -3982,7 +3983,7 @@ yyreduce: switch (yyn) { case 3: -#line 1911 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1912 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! error("Value too large for type"); @@ -3991,7 +3992,7 @@ yyreduce: break; case 5: -#line 1920 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1921 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! error("Value too large for type"); @@ -4000,226 +4001,226 @@ yyreduce: break; case 26: -#line 1942 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1943 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} break; case 27: -#line 1942 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1943 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_NE; ;} break; case 28: -#line 1943 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1944 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} break; case 29: -#line 1943 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1944 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} break; case 30: -#line 1944 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1945 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} break; case 31: -#line 1944 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1945 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} break; case 32: -#line 1945 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1946 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} break; case 33: -#line 1945 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1946 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} break; case 34: -#line 1946 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1947 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} break; case 35: -#line 1946 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1947 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} break; case 36: -#line 1950 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1951 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} break; case 37: -#line 1950 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1951 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} break; case 38: -#line 1951 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1952 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} break; case 39: -#line 1951 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1952 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} break; case 40: -#line 1952 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1953 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} break; case 41: -#line 1952 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1953 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} break; case 42: -#line 1953 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1954 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} break; case 43: -#line 1953 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1954 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} break; case 44: -#line 1954 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1955 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} break; case 45: -#line 1954 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1955 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} break; case 46: -#line 1955 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1956 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} break; case 47: -#line 1955 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1956 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} break; case 48: -#line 1956 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1957 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} break; case 49: -#line 1956 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1957 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} break; case 50: -#line 1957 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1958 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} break; case 51: -#line 1958 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1959 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} break; case 81: -#line 1989 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1990 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); ;} break; case 82: -#line 1992 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1993 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 83: -#line 1997 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1998 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 84: -#line 1998 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1999 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 85: -#line 1999 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2000 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 86: -#line 2000 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2001 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 87: -#line 2001 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2002 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 88: -#line 2002 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2003 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 89: -#line 2003 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2004 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 90: -#line 2004 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2005 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 91: -#line 2008 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::C; ;} - break; - - case 92: #line 2009 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::C; ;} break; - case 93: + case 92: #line 2010 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::C; ;} + break; + + case 93: +#line 2011 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::CSRet; ;} break; case 94: -#line 2011 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2012 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::Fast; ;} break; case 95: -#line 2012 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2013 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::Cold; ;} break; case 96: -#line 2013 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2014 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} break; case 97: -#line 2014 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2015 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} break; case 98: -#line 2015 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2016 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) error("Calling conv too large"); @@ -4228,12 +4229,12 @@ yyreduce: break; case 99: -#line 2025 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2026 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 100: -#line 2026 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2027 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4242,12 +4243,12 @@ yyreduce: break; case 101: -#line 2034 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2035 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = 0; ;} break; case 102: -#line 2035 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2036 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4256,7 +4257,7 @@ yyreduce: break; case 103: -#line 2043 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2044 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -4266,27 +4267,27 @@ yyreduce: break; case 104: -#line 2052 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2053 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 105: -#line 2053 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2054 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 106: -#line 2060 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" - {;} - break; - - case 107: #line 2061 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" {;} break; + case 107: +#line 2062 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" + {;} + break; + case 108: -#line 2065 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2066 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -4294,7 +4295,7 @@ yyreduce: break; case 109: -#line 2069 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2070 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) error("Alignment must be a power of two"); @@ -4304,7 +4305,7 @@ yyreduce: break; case 111: -#line 2086 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2087 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.makeSignless(); @@ -4312,7 +4313,7 @@ yyreduce: break; case 113: -#line 2094 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2095 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.makeSignless(); @@ -4320,7 +4321,7 @@ yyreduce: break; case 114: -#line 2101 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2102 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!UpRefs.empty()) error("Invalid upreference in type: " + (*(yyvsp[0].TypeVal).PAT)->getDescription()); @@ -4329,7 +4330,7 @@ yyreduce: break; case 127: -#line 2115 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2116 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[0].PrimType).T); (yyval.TypeVal).S.copy((yyvsp[0].PrimType).S); @@ -4337,7 +4338,7 @@ yyreduce: break; case 128: -#line 2119 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2120 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get()); (yyval.TypeVal).S.makeSignless(); @@ -4345,7 +4346,7 @@ yyreduce: break; case 129: -#line 2123 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2124 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Named types are also simple types... (yyval.TypeVal).S.copy(getTypeSign((yyvsp[0].ValIDVal))); const Type* tmp = getType((yyvsp[0].ValIDVal)); @@ -4354,7 +4355,7 @@ yyreduce: break; case 130: -#line 2128 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2129 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Type UpReference if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) error("Value out of range"); @@ -4367,7 +4368,7 @@ yyreduce: break; case 131: -#line 2137 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2138 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Function derived type? (yyval.TypeVal).S.makeComposite((yyvsp[-3].TypeVal).S); std::vector Params; @@ -4389,7 +4390,7 @@ yyreduce: break; case 132: -#line 2155 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2156 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Sized array type? (yyval.TypeVal).S.makeComposite((yyvsp[-1].TypeVal).S); (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[-1].TypeVal).PAT->get(), @@ -4399,7 +4400,7 @@ yyreduce: break; case 133: -#line 2161 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2162 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal).PAT->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -4416,7 +4417,7 @@ yyreduce: break; case 134: -#line 2174 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2175 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Structure type? std::vector Elements; (yyval.TypeVal).S.makeComposite(); @@ -4431,7 +4432,7 @@ yyreduce: break; case 135: -#line 2185 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2186 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Empty structure type? (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector())); (yyval.TypeVal).S.makeComposite(); @@ -4439,7 +4440,7 @@ yyreduce: break; case 136: -#line 2189 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2190 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Packed Structure type? (yyval.TypeVal).S.makeComposite(); std::vector Elements; @@ -4456,7 +4457,7 @@ yyreduce: break; case 137: -#line 2202 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2203 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Empty packed structure type? (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector(),true)); (yyval.TypeVal).S.makeComposite(); @@ -4464,7 +4465,7 @@ yyreduce: break; case 138: -#line 2206 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2207 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Pointer type? if ((yyvsp[-1].TypeVal).PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); @@ -4476,7 +4477,7 @@ yyreduce: break; case 139: -#line 2220 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2221 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back((yyvsp[0].TypeVal)); @@ -4484,14 +4485,14 @@ yyreduce: break; case 140: -#line 2224 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2225 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back((yyvsp[0].TypeVal)); ;} break; case 142: -#line 2232 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2233 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); @@ -4501,7 +4502,7 @@ yyreduce: break; case 143: -#line 2238 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2239 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); PATypeInfo VoidTI; @@ -4512,14 +4513,14 @@ yyreduce: break; case 144: -#line 2245 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2246 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TypeList) = new std::list(); ;} break; case 145: -#line 2257 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2258 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (ATy == 0) @@ -4553,7 +4554,7 @@ yyreduce: break; case 146: -#line 2287 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2288 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) @@ -4570,7 +4571,7 @@ yyreduce: break; case 147: -#line 2300 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2301 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (ATy == 0) @@ -4597,7 +4598,7 @@ yyreduce: break; case 148: -#line 2323 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2324 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized arr const VectorType *PTy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (PTy == 0) @@ -4629,7 +4630,7 @@ yyreduce: break; case 149: -#line 2351 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2352 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal).PAT->get()); if (STy == 0) @@ -4655,7 +4656,7 @@ yyreduce: break; case 150: -#line 2373 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2374 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal).PAT->get()); if (STy == 0) @@ -4670,7 +4671,7 @@ yyreduce: break; case 151: -#line 2384 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2385 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-5].TypeVal).PAT->get()); if (STy == 0) @@ -4696,7 +4697,7 @@ yyreduce: break; case 152: -#line 2406 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2407 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const StructType *STy = dyn_cast((yyvsp[-4].TypeVal).PAT->get()); if (STy == 0) @@ -4711,7 +4712,7 @@ yyreduce: break; case 153: -#line 2417 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2418 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); if (PTy == 0) @@ -4724,7 +4725,7 @@ yyreduce: break; case 154: -#line 2426 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2427 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVal).C = UndefValue::get((yyvsp[-1].TypeVal).PAT->get()); (yyval.ConstVal).S.copy((yyvsp[-1].TypeVal).S); @@ -4733,7 +4734,7 @@ yyreduce: break; case 155: -#line 2431 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2432 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); if (Ty == 0) @@ -4796,7 +4797,7 @@ yyreduce: break; case 156: -#line 2490 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2491 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).PAT->get() != (yyvsp[0].ConstVal).C->getType()) error("Mismatched types for constant expression"); @@ -4807,7 +4808,7 @@ yyreduce: break; case 157: -#line 2497 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2498 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -4819,7 +4820,7 @@ yyreduce: break; case 158: -#line 2505 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2506 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].SInt64Val))) @@ -4830,7 +4831,7 @@ yyreduce: break; case 159: -#line 2512 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2513 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // integral constants const Type *Ty = (yyvsp[-1].PrimType).T; if (!ConstantInt::isValueValidForType(Ty, (yyvsp[0].UInt64Val))) @@ -4841,7 +4842,7 @@ yyreduce: break; case 160: -#line 2519 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2520 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); (yyval.ConstVal).S.makeUnsigned(); @@ -4849,7 +4850,7 @@ yyreduce: break; case 161: -#line 2523 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2524 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Boolean constants (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); (yyval.ConstVal).S.makeUnsigned(); @@ -4857,7 +4858,7 @@ yyreduce: break; case 162: -#line 2527 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2528 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType).T, (yyvsp[0].FPVal))) error("Floating point constant invalid for type"); @@ -4867,7 +4868,7 @@ yyreduce: break; case 163: -#line 2536 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2537 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* SrcTy = (yyvsp[-3].ConstVal).C->getType(); const Type* DstTy = (yyvsp[-1].TypeVal).PAT->get(); @@ -4886,7 +4887,7 @@ yyreduce: break; case 164: -#line 2551 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2552 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-2].ConstVal).C->getType(); if (!isa(Ty)) @@ -4902,7 +4903,7 @@ yyreduce: break; case 165: -#line 2563 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2564 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-5].ConstVal).C->getType()->isInteger() || cast((yyvsp[-5].ConstVal).C->getType())->getBitWidth() != 1) @@ -4915,7 +4916,7 @@ yyreduce: break; case 166: -#line 2572 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2573 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4947,7 +4948,7 @@ yyreduce: break; case 167: -#line 2600 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2601 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4964,7 +4965,7 @@ yyreduce: break; case 168: -#line 2613 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2614 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-3].ConstVal).C->getType(); if (Ty != (yyvsp[-1].ConstVal).C->getType()) @@ -4977,7 +4978,7 @@ yyreduce: break; case 169: -#line 2622 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2623 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("icmp operand types must match"); @@ -4987,7 +4988,7 @@ yyreduce: break; case 170: -#line 2628 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2629 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-3].ConstVal).C->getType() != (yyvsp[-1].ConstVal).C->getType()) error("fcmp operand types must match"); @@ -4997,7 +4998,7 @@ yyreduce: break; case 171: -#line 2634 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2635 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-1].ConstVal).C->getType()->isInteger() || cast((yyvsp[-1].ConstVal).C->getType())->getBitWidth() != 8) @@ -5012,7 +5013,7 @@ yyreduce: break; case 172: -#line 2645 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2646 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid extractelement operands"); @@ -5022,7 +5023,7 @@ yyreduce: break; case 173: -#line 2651 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2652 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid insertelement operands"); @@ -5032,7 +5033,7 @@ yyreduce: break; case 174: -#line 2657 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2658 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal).C, (yyvsp[-3].ConstVal).C, (yyvsp[-1].ConstVal).C)) error("Invalid shufflevector operands"); @@ -5042,12 +5043,12 @@ yyreduce: break; case 175: -#line 2668 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2669 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); ;} break; case 176: -#line 2669 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2670 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -5055,17 +5056,17 @@ yyreduce: break; case 177: -#line 2678 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2679 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 178: -#line 2679 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2680 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 179: -#line 2691 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2692 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -5073,27 +5074,27 @@ yyreduce: break; case 180: -#line 2700 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2701 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); ;} break; case 181: -#line 2701 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2702 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 182: -#line 2702 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2703 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); ;} break; case 183: -#line 2703 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2704 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); ;} break; case 184: -#line 2704 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2705 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -5109,7 +5110,7 @@ yyreduce: break; case 185: -#line 2720 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2721 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -5133,19 +5134,19 @@ yyreduce: break; case 186: -#line 2740 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2741 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Function prototypes can be in const pool ;} break; case 187: -#line 2742 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2743 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Asm blocks can be in the const pool ;} break; case 188: -#line 2744 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2745 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].ConstVal).C == 0) error("Global value initializer is not a constant"); @@ -5154,14 +5155,14 @@ yyreduce: break; case 189: -#line 2748 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2749 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 190: -#line 2751 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2752 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), Ty, 0, @@ -5171,14 +5172,14 @@ yyreduce: break; case 191: -#line 2756 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2757 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 192: -#line 2759 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2760 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[-1].BoolVal), Ty, 0, @@ -5188,14 +5189,14 @@ yyreduce: break; case 193: -#line 2764 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2765 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 194: -#line 2767 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2768 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); CurGV = @@ -5206,32 +5207,32 @@ yyreduce: break; case 195: -#line 2773 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2774 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurGV = 0; ;} break; case 196: -#line 2776 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2777 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 197: -#line 2778 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2779 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 198: -#line 2780 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2781 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 199: -#line 2785 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2786 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -5246,24 +5247,24 @@ yyreduce: break; case 200: -#line 2799 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2800 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 201: -#line 2800 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2801 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 202: -#line 2804 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2805 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.setEndianness((yyvsp[0].Endianness)); ;} break; case 203: -#line 2807 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2808 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); @@ -5275,7 +5276,7 @@ yyreduce: break; case 204: -#line 2815 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2816 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5283,7 +5284,7 @@ yyreduce: break; case 205: -#line 2819 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2820 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5291,7 +5292,7 @@ yyreduce: break; case 207: -#line 2830 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2831 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5299,7 +5300,7 @@ yyreduce: break; case 208: -#line 2834 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2835 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -5307,17 +5308,17 @@ yyreduce: break; case 209: -#line 2838 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2839 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ;} break; case 213: -#line 2851 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2852 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.StrVal) = 0; ;} break; case 214: -#line 2855 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2856 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[-1].TypeVal).PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); @@ -5326,7 +5327,7 @@ yyreduce: break; case 215: -#line 2863 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2864 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5335,7 +5336,7 @@ yyreduce: break; case 216: -#line 2868 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2869 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -5344,12 +5345,12 @@ yyreduce: break; case 217: -#line 2876 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2877 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); ;} break; case 218: -#line 2877 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2878 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); PATypeInfo VoidTI; @@ -5360,7 +5361,7 @@ yyreduce: break; case 219: -#line 2884 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2885 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = new std::vector >(); PATypeInfo VoidTI; @@ -5371,12 +5372,12 @@ yyreduce: break; case 220: -#line 2891 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2892 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ArgList) = 0; ;} break; case 221: -#line 2895 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 2896 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -5484,7 +5485,7 @@ yyreduce: AI->setName(""); } } else if (Conflict) { - // We have two globals with the same name and different types. + // We have two globals with the same name and different types. // Previously, this was permitted because the symbol table had // "type planes" and names only needed to be distinct within a // type plane. After PR411 was fixed, this is no loner the case. @@ -5518,8 +5519,13 @@ yyreduce: Fn = new Function(FT, CurFun.Linkage, FunctionName, M); InsertValue(Fn, CurModule.Values); } + } else { + // There's no conflict, just define the function + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); } + CurFun.FunctionStart(Fn); if (CurFun.isDeclare) { @@ -5559,12 +5565,12 @@ yyreduce: break; case 224: -#line 3081 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3087 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = (yyvsp[0].Linkage); ;} break; case 225: -#line 3081 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3087 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5575,39 +5581,39 @@ yyreduce: break; case 228: -#line 3095 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3101 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 229: -#line 3100 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3106 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 230: -#line 3101 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3107 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 231: -#line 3102 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3108 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 232: -#line 3106 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3112 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurFun.isDeclare = true; ;} break; case 233: -#line 3107 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3113 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { CurFun.Linkage = (yyvsp[0].Linkage); ;} break; case 234: -#line 3107 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3113 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -5616,32 +5622,32 @@ yyreduce: break; case 235: -#line 3119 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3125 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 236: -#line 3120 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3126 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 237: -#line 3125 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3131 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); ;} break; case 238: -#line 3126 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3132 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); ;} break; case 239: -#line 3127 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3133 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); ;} break; case 240: -#line 3128 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3134 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); (yyval.ValIDVal).S.makeUnsigned(); @@ -5649,7 +5655,7 @@ yyreduce: break; case 241: -#line 3132 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3138 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); (yyval.ValIDVal).S.makeUnsigned(); @@ -5657,22 +5663,22 @@ yyreduce: break; case 242: -#line 3136 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3142 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createNull(); ;} break; case 243: -#line 3137 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3143 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createUndef(); ;} break; case 244: -#line 3138 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3144 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::createZeroInit(); ;} break; case 245: -#line 3139 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3145 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0].C->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -5697,7 +5703,7 @@ yyreduce: break; case 246: -#line 3160 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3166 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal).C); (yyval.ValIDVal).S.copy((yyvsp[0].ConstVal).S); @@ -5705,7 +5711,7 @@ yyreduce: break; case 247: -#line 3164 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3170 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -5718,17 +5724,17 @@ yyreduce: break; case 248: -#line 3178 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3184 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); (yyval.ValIDVal).S.makeSignless(); ;} break; case 249: -#line 3179 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3185 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); (yyval.ValIDVal).S.makeSignless(); ;} break; case 252: -#line 3192 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3198 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); @@ -5739,21 +5745,21 @@ yyreduce: break; case 253: -#line 3202 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3208 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 254: -#line 3205 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3211 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); ;} break; case 255: -#line 3214 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3220 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { ValueInfo VI; VI.V = (yyvsp[0].TermInstVal).TI; VI.S.copy((yyvsp[0].TermInstVal).S); setValueName(VI, (yyvsp[-1].StrVal)); @@ -5765,7 +5771,7 @@ yyreduce: break; case 256: -#line 3225 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3231 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if ((yyvsp[0].InstVal).I) (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal).I); @@ -5774,7 +5780,7 @@ yyreduce: break; case 257: -#line 3230 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3236 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++),true); // Make sure to move the basic block to the correct location in the @@ -5787,7 +5793,7 @@ yyreduce: break; case 258: -#line 3239 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3245 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the @@ -5800,7 +5806,7 @@ yyreduce: break; case 261: -#line 3253 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3259 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Return with a result... (yyval.TermInstVal).TI = new ReturnInst((yyvsp[0].ValueVal).V); (yyval.TermInstVal).S.makeSignless(); @@ -5808,7 +5814,7 @@ yyreduce: break; case 262: -#line 3257 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3263 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Return with no result... (yyval.TermInstVal).TI = new ReturnInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5816,7 +5822,7 @@ yyreduce: break; case 263: -#line 3261 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3267 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[0].ValIDVal)); (yyval.TermInstVal).TI = new BranchInst(tmpBB); @@ -5825,7 +5831,7 @@ yyreduce: break; case 264: -#line 3266 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3272 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-3].ValIDVal).S.makeSignless(); (yyvsp[0].ValIDVal).S.makeSignless(); @@ -5839,7 +5845,7 @@ yyreduce: break; case 265: -#line 3276 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3282 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-6].ValIDVal).S.copy((yyvsp[-7].PrimType).S); Value* tmpVal = getVal((yyvsp[-7].PrimType).T, (yyvsp[-6].ValIDVal)); @@ -5861,7 +5867,7 @@ yyreduce: break; case 266: -#line 3294 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3300 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-5].ValIDVal).S.copy((yyvsp[-6].PrimType).S); Value* tmpVal = getVal((yyvsp[-6].PrimType).T, (yyvsp[-5].ValIDVal)); @@ -5874,7 +5880,7 @@ yyreduce: break; case 267: -#line 3304 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3310 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -5947,7 +5953,7 @@ yyreduce: break; case 268: -#line 3373 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3379 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal).TI = new UnwindInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5955,7 +5961,7 @@ yyreduce: break; case 269: -#line 3377 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3383 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.TermInstVal).TI = new UnreachableInst(); (yyval.TermInstVal).S.makeSignless(); @@ -5963,7 +5969,7 @@ yyreduce: break; case 270: -#line 3384 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3390 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S); @@ -5979,7 +5985,7 @@ yyreduce: break; case 271: -#line 3396 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3402 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.JumpTable) = new std::vector >(); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S); @@ -5995,7 +6001,7 @@ yyreduce: break; case 272: -#line 3411 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3417 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { bool omit = false; if ((yyvsp[-1].StrVal)) @@ -6028,7 +6034,7 @@ yyreduce: break; case 273: -#line 3441 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3447 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Used for PHI nodes (yyval.PHIList).P = new std::list >(); (yyval.PHIList).S.copy((yyvsp[-5].TypeVal).S); @@ -6042,7 +6048,7 @@ yyreduce: break; case 274: -#line 3451 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3457 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); (yyvsp[-3].ValIDVal).S.copy((yyvsp[-6].PHIList).S); @@ -6054,7 +6060,7 @@ yyreduce: break; case 275: -#line 3461 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3467 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -6062,7 +6068,7 @@ yyreduce: break; case 276: -#line 3465 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3471 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -6070,26 +6076,26 @@ yyreduce: break; case 278: -#line 3473 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3479 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = 0; ;} break; case 279: -#line 3477 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3483 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 280: -#line 3480 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3486 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 281: -#line 3486 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3492 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6112,7 +6118,7 @@ yyreduce: break; case 282: -#line 3505 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3511 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6134,7 +6140,7 @@ yyreduce: break; case 283: -#line 3523 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3529 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6154,7 +6160,7 @@ yyreduce: break; case 284: -#line 3539 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3545 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6172,7 +6178,7 @@ yyreduce: break; case 285: -#line 3553 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3559 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); (yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S); @@ -6190,7 +6196,7 @@ yyreduce: break; case 286: -#line 3567 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3573 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); const Type *Ty = (yyvsp[0].ValueVal).V->getType(); @@ -6205,7 +6211,7 @@ yyreduce: break; case 287: -#line 3578 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3584 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[0].ValueVal).V->getType()->isInteger() || cast((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8) @@ -6227,7 +6233,7 @@ yyreduce: break; case 288: -#line 3596 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3602 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *DstTy = (yyvsp[0].TypeVal).PAT->get(); if (!DstTy->isFirstClassType()) @@ -6240,7 +6246,7 @@ yyreduce: break; case 289: -#line 3605 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3611 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() || cast((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1) @@ -6253,7 +6259,7 @@ yyreduce: break; case 290: -#line 3614 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3620 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].TypeVal).PAT->get(); NewVarArgs = true; @@ -6264,7 +6270,7 @@ yyreduce: break; case 291: -#line 3621 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3627 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); @@ -6289,7 +6295,7 @@ yyreduce: break; case 292: -#line 3642 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3648 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType(); const Type* DstTy = (yyvsp[0].TypeVal).PAT->get(); @@ -6317,7 +6323,7 @@ yyreduce: break; case 293: -#line 3666 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3672 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid extractelement operands"); @@ -6327,7 +6333,7 @@ yyreduce: break; case 294: -#line 3672 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3678 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid insertelement operands"); @@ -6337,7 +6343,7 @@ yyreduce: break; case 295: -#line 3678 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3684 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V)) error("Invalid shufflevector operands"); @@ -6347,7 +6353,7 @@ yyreduce: break; case 296: -#line 3684 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3690 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6367,7 +6373,7 @@ yyreduce: break; case 297: -#line 3700 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3706 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { // Handle the short call syntax const PointerType *PFTy; @@ -6461,34 +6467,34 @@ yyreduce: break; case 298: -#line 3790 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3796 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); ;} break; case 299: -#line 3798 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3804 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); ;} break; case 300: -#line 3799 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3805 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 301: -#line 3803 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3809 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = true; ;} break; case 302: -#line 3804 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3810 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyval.BoolVal) = false; ;} break; case 303: -#line 3808 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3814 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S); @@ -6498,7 +6504,7 @@ yyreduce: break; case 304: -#line 3814 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3820 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyvsp[-1].ValIDVal).S.makeUnsigned(); @@ -6509,7 +6515,7 @@ yyreduce: break; case 305: -#line 3821 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3827 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S); @@ -6519,7 +6525,7 @@ yyreduce: break; case 306: -#line 3827 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3833 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *Ty = (yyvsp[-4].TypeVal).PAT->get(); (yyvsp[-1].ValIDVal).S.makeUnsigned(); @@ -6530,7 +6536,7 @@ yyreduce: break; case 307: -#line 3834 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3840 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type *PTy = (yyvsp[0].ValueVal).V->getType(); if (!isa(PTy)) @@ -6541,7 +6547,7 @@ yyreduce: break; case 308: -#line 3841 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3847 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { const Type* Ty = (yyvsp[-1].TypeVal).PAT->get(); (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); @@ -6558,7 +6564,7 @@ yyreduce: break; case 309: -#line 3854 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3860 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S); const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal).PAT->get()); @@ -6588,7 +6594,7 @@ yyreduce: break; case 310: -#line 3880 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3886 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" { (yyvsp[-1].ValIDVal).S.copy((yyvsp[-2].TypeVal).S); const Type* Ty = (yyvsp[-2].TypeVal).PAT->get(); @@ -6612,7 +6618,7 @@ yyreduce: } /* Line 1126 of yacc.c. */ -#line 6616 "UpgradeParser.tab.c" +#line 6622 "UpgradeParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -6880,7 +6886,7 @@ yyreturn: } -#line 3898 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 3904 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { diff --git a/tools/llvm-upgrade/UpgradeParser.h.cvs b/tools/llvm-upgrade/UpgradeParser.h.cvs index c7683dfe3ae..a96144201c7 100644 --- a/tools/llvm-upgrade/UpgradeParser.h.cvs +++ b/tools/llvm-upgrade/UpgradeParser.h.cvs @@ -335,7 +335,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 1770 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" +#line 1771 "/proj/llvm/llvm-2/tools/llvm-upgrade/UpgradeParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; diff --git a/tools/llvm-upgrade/UpgradeParser.y.cvs b/tools/llvm-upgrade/UpgradeParser.y.cvs index 697c7af2f88..02f4cae685e 100644 --- a/tools/llvm-upgrade/UpgradeParser.y.cvs +++ b/tools/llvm-upgrade/UpgradeParser.y.cvs @@ -934,8 +934,9 @@ ParseGlobalVariable(char *NameStr,GlobalValue::LinkageTypes Linkage, // of this global in the module and emit warnings if there are conflicts. if (!Name.empty()) { // The global has a name. See if there's an existing one of the same name. - if (CurModule.CurrentModule->getNamedGlobal(Name)) { - // We found an existing global ov the same name. This isn't allowed + if (CurModule.CurrentModule->getNamedGlobal(Name) || + CurModule.CurrentModule->getFunction(Name)) { + // We found an existing global of the same name. This isn't allowed // in LLVM 2.0. Consequently, we must alter the name of the global so it // can at least compile. This can happen because of type planes // There is alread a global of the same name which means there is a @@ -2999,7 +3000,7 @@ FunctionHeaderH AI->setName(""); } } else if (Conflict) { - // We have two globals with the same name and different types. + // We have two globals with the same name and different types. // Previously, this was permitted because the symbol table had // "type planes" and names only needed to be distinct within a // type plane. After PR411 was fixed, this is no loner the case. @@ -3033,8 +3034,13 @@ FunctionHeaderH Fn = new Function(FT, CurFun.Linkage, FunctionName, M); InsertValue(Fn, CurModule.Values); } + } else { + // There's no conflict, just define the function + Fn = new Function(FT, CurFun.Linkage, FunctionName, M); + InsertValue(Fn, CurModule.Values); } + CurFun.FunctionStart(Fn); if (CurFun.isDeclare) {