llvm.org GIT mirror llvm / 66c5fd6
When a function takes a variable number of pointer arguments, with a zero pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23888 91177308-0d34-0410-b5e6-96231b3b80d8 Jeff Cohen 13 years ago
27 changed file(s) with 291 addition(s) and 263 deletion(s). Raw diff Collapse all Expand all
220220 endif
221221 endif
222222
223 CXX.Flags += $(CXXFLAGS)
223 CXX.Flags += $(CXXFLAGS) -Wformat
224224 C.Flags += $(CFLAGS)
225225 CPP.Flags += $(CPPFLAGS)
226226 LD.Flags += $(LDFLAGS)
3636 static Function *CreateFibFunction(Module *M) {
3737 // Create the fib function and insert it into module M. This function is said
3838 // to return an int and take an int parameter.
39 Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, 0);
39 Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy,
40 (Type *)0);
4041
4142 // Add a basic block to the function.
4243 BasicBlock *BB = new BasicBlock("EntryBlock", FibF);
5050 // Create the add1 function entry and insert this entry into module M. The
5151 // function will have a return type of "int" and take an argument of "int".
5252 // The '0' terminates the list of argument types.
53 Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 0);
53 Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy,
54 (Type *)0);
5455
5556 // Add a basic block to the function. As before, it automatically inserts
5657 // because of the last argument.
7576
7677 // Now we going to create function `foo', which returns an int and takes no
7778 // arguments.
78 Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, 0);
79 Function *FooF = M->getOrInsertFunction("foo", Type::IntTy, (Type *)0);
7980
8081 // Add a basic block to the FooF function.
8182 BB = new BasicBlock("EntryBlock", FooF);
3232 // Create the add1 function entry and insert this entry into module M. The
3333 // function will have a return type of "int" and take an argument of "int".
3434 // The '0' terminates the list of argument types.
35 Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy, 0);
35 Function *Add1F = M->getOrInsertFunction("add1", Type::IntTy, Type::IntTy,
36 (Type *)0);
3637
3738 // Add a basic block to the function. As before, it automatically inserts
3839 // because of the last argument.
6061 {
6162 // Create the fib function and insert it into module M. This function is said
6263 // to return an int and take an int parameter.
63 Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy, 0);
64 Function *FibF = M->getOrInsertFunction("fib", Type::IntTy, Type::IntTy,
65 (Type *)0);
6466
6567 // Add a basic block to the function.
6668 BasicBlock *BB = new BasicBlock("EntryBlock", FibF);
2121 #include "llvm/Function.h"
2222 #include "llvm/GlobalVariable.h"
2323 #include "llvm/ADT/SetVector.h"
24 #include "llvm/Support/DataTypes.h"
2425
2526 namespace llvm {
2627
110111 /// table. If it does not exist, add a prototype for the function and return
111112 /// it. This version of the method takes a null terminated list of function
112113 /// arguments, which makes it easier for clients to use.
113 Function *getOrInsertFunction(const std::string &Name, const Type *RetTy,...);
114 Function *getOrInsertFunction(const std::string &Name, const Type *RetTy,...)
115 END_WITH_NULL;
114116
115117 /// getFunction - Look up the specified function in the module symbol table.
116118 /// If it does not exist, return null.
2020 #define LLVM_SUPPORT_COMMANDLINE_H
2121
2222 #include "llvm/Support/type_traits.h"
23 #include "llvm/Support/DataTypes.h"
2324 #include
2425 #include
2526 #include
334335
335336 template
336337 ValuesClass values(const char *Arg, DataType Val, const char *Desc,
337 ...) {
338 ...) END_WITH_NULL {
338339 va_list ValueArgs;
339340 va_start(ValueArgs, Desc);
340341 ValuesClass Vals(Arg, Val, Desc, ValueArgs);
9797 # define UINT64_MAX 0xffffffffffffffffULL
9898 #endif
9999
100 #if __GNUC__ > 3
101 #define END_WITH_NULL __attribute__((sentinel))
102 #else
103 #define END_WITH_NULL
104 #endif
105
100106 #endif /* SUPPORT_DATATYPES_H */
None /* A Bison parser, made by GNU Bison 1.875c. */
0 /* A Bison parser, made by GNU Bison 1.875d. */
11
22 /* Skeleton parser for Yacc-like parsing with Bison,
3 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
250250
251251
252252 /* Copy the first part of user declarations. */
253 #line 14 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
253 #line 14 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
254254
255255 #include "ParserInternals.h"
256256 #include "llvm/CallingConv.h"
10061006 const Type* ArgTy = F->getFunctionType()->getReturnType();
10071007 const Type* ArgTyPtr = PointerType::get(ArgTy);
10081008 Function* NF = Result->getOrInsertFunction("llvm.va_start",
1009 RetTy, ArgTyPtr, 0);
1009 RetTy, ArgTyPtr, (Type *)0);
10101010
10111011 while (!F->use_empty()) {
10121012 CallInst* CI = cast(F->use_back());
10311031 const Type* ArgTy = F->getFunctionType()->getParamType(0);
10321032 const Type* ArgTyPtr = PointerType::get(ArgTy);
10331033 Function* NF = Result->getOrInsertFunction("llvm.va_end",
1034 RetTy, ArgTyPtr, 0);
1034 RetTy, ArgTyPtr, (Type *)0);
10351035
10361036 while (!F->use_empty()) {
10371037 CallInst* CI = cast(F->use_back());
10581058 const Type* ArgTy = F->getFunctionType()->getReturnType();
10591059 const Type* ArgTyPtr = PointerType::get(ArgTy);
10601060 Function* NF = Result->getOrInsertFunction("llvm.va_copy",
1061 RetTy, ArgTyPtr, ArgTyPtr, 0);
1061 RetTy, ArgTyPtr, ArgTyPtr,
1062 (Type *)0);
10621063
10631064 while (!F->use_empty()) {
10641065 CallInst* CI = cast(F->use_back());
11161117 #endif
11171118
11181119 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1119 #line 865 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
1120 #line 866 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
11201121 typedef union YYSTYPE {
11211122 llvm::Module *ModuleVal;
11221123 llvm::Function *FunctionVal;
11571158 llvm::Module::Endianness Endianness;
11581159 } YYSTYPE;
11591160 /* Line 191 of yacc.c. */
1160 #line 1162 "llvmAsmParser.tab.c"
1161 #line 1163 "llvmAsmParser.tab.c"
11611162 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
11621163 # define YYSTYPE_IS_DECLARED 1
11631164 # define YYSTYPE_IS_TRIVIAL 1
11691170
11701171
11711172 /* Line 214 of yacc.c. */
1172 #line 1174 "llvmAsmParser.tab.c"
1173 #line 1175 "llvmAsmParser.tab.c"
11731174
11741175 #if ! defined (yyoverflow) || YYERROR_VERBOSE
11751176
12171218 /* A type that is properly aligned for any stack member. */
12181219 union yyalloc
12191220 {
1220 short yyss;
1221 short int yyss;
12211222 YYSTYPE yyvs;
12221223 };
12231224
12271228 /* The size of an array large to enough to hold all stacks, each with
12281229 N elements. */
12291230 # define YYSTACK_BYTES(N) \
1230 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
1231 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
12311232 + YYSTACK_GAP_MAXIMUM)
12321233
12331234 /* Copy COUNT objects from FROM to TO. The source and destination do
12691270 #if defined (__STDC__) || defined (__cplusplus)
12701271 typedef signed char yysigned_char;
12711272 #else
1272 typedef short yysigned_char;
1273 typedef short int yysigned_char;
12731274 #endif
12741275
12751276 /* YYFINAL -- State number of the termination state. */
13361337 #if YYDEBUG
13371338 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
13381339 YYRHS. */
1339 static const unsigned short yyprhs[] =
1340 static const unsigned short int yyprhs[] =
13401341 {
13411342 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
13421343 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
13631364 };
13641365
13651366 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1366 static const short yyrhs[] =
1367 static const short int yyrhs[] =
13671368 {
13681369 133, 0, -1, 5, -1, 6, -1, 3, -1, 4,
13691370 -1, 66, -1, 67, -1, 68, -1, 69, -1, 70,
14361437 };
14371438
14381439 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1439 static const unsigned short yyrline[] =
1440 static const unsigned short int yyrline[] =
14401441 {
1441 0, 982, 982, 983, 990, 991, 1000, 1000, 1000, 1000,
1442 1000, 1001, 1001, 1001, 1002, 1002, 1002, 1002, 1002, 1002,
1443 1004, 1004, 1008, 1008, 1008, 1008, 1009, 1009, 1009, 1009,
1444 1010, 1010, 1011, 1011, 1014, 1017, 1021, 1022, 1023, 1024,
1445 1025, 1027, 1028, 1029, 1030, 1031, 1044, 1044, 1045, 1045,
1446 1047, 1056, 1056, 1056, 1056, 1056, 1056, 1056, 1057, 1057,
1447 1057, 1057, 1057, 1057, 1058, 1061, 1064, 1070, 1077, 1089,
1448 1093, 1104, 1113, 1116, 1124, 1128, 1133, 1134, 1137, 1140,
1449 1150, 1175, 1188, 1216, 1241, 1261, 1273, 1282, 1286, 1345,
1450 1351, 1359, 1364, 1369, 1372, 1375, 1382, 1392, 1423, 1430,
1451 1451, 1458, 1463, 1473, 1476, 1483, 1483, 1493, 1500, 1504,
1452 1507, 1510, 1523, 1543, 1545, 1549, 1553, 1555, 1557, 1562,
1453 1563, 1565, 1568, 1576, 1581, 1583, 1587, 1591, 1599, 1599,
1454 1600, 1600, 1602, 1608, 1613, 1619, 1622, 1627, 1631, 1635,
1455 1715, 1715, 1717, 1725, 1725, 1727, 1731, 1731, 1740, 1743,
1456 1746, 1749, 1752, 1755, 1758, 1761, 1785, 1792, 1795, 1800,
1457 1800, 1806, 1810, 1813, 1821, 1830, 1834, 1844, 1855, 1858,
1458 1861, 1864, 1867, 1881, 1885, 1938, 1941, 1947, 1955, 1965,
1459 1972, 1977, 1984, 1988, 1994, 1994, 1996, 1999, 2005, 2017,
1460 2025, 2035, 2047, 2054, 2061, 2068, 2073, 2092, 2114, 2128,
1461 2185, 2191, 2193, 2197, 2200, 2206, 2210, 2214, 2218, 2222,
1462 2229, 2239, 2252
1442 0, 983, 983, 984, 991, 992, 1001, 1001, 1001, 1001,
1443 1001, 1002, 1002, 1002, 1003, 1003, 1003, 1003, 1003, 1003,
1444 1005, 1005, 1009, 1009, 1009, 1009, 1010, 1010, 1010, 1010,
1445 1011, 1011, 1012, 1012, 1015, 1018, 1022, 1023, 1024, 1025,
1446 1026, 1028, 1029, 1030, 1031, 1032, 1045, 1045, 1046, 1046,
1447 1048, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1058, 1058,
1448 1058, 1058, 1058, 1058, 1059, 1062, 1065, 1071, 1078, 1090,
1449 1094, 1105, 1114, 1117, 1125, 1129, 1134, 1135, 1138, 1141,
1450 1151, 1176, 1189, 1217, 1242, 1262, 1274, 1283, 1287, 1346,
1451 1352, 1360, 1365, 1370, 1373, 1376, 1383, 1393, 1424, 1431,
1452 1452, 1459, 1464, 1474, 1477, 1484, 1484, 1494, 1501, 1505,
1453 1508, 1511, 1524, 1544, 1546, 1550, 1554, 1556, 1558, 1563,
1454 1564, 1566, 1569, 1577, 1582, 1584, 1588, 1592, 1600, 1600,
1455 1601, 1601, 1603, 1609, 1614, 1620, 1623, 1628, 1632, 1636,
1456 1716, 1716, 1718, 1726, 1726, 1728, 1732, 1732, 1741, 1744,
1457 1747, 1750, 1753, 1756, 1759, 1762, 1786, 1793, 1796, 1801,
1458 1801, 1807, 1811, 1814, 1822, 1831, 1835, 1845, 1856, 1859,
1459 1862, 1865, 1868, 1882, 1886, 1939, 1942, 1948, 1956, 1966,
1460 1973, 1978, 1985, 1989, 1995, 1995, 1997, 2000, 2006, 2018,
1461 2026, 2036, 2048, 2055, 2062, 2069, 2074, 2093, 2115, 2129,
1462 2186, 2192, 2194, 2198, 2201, 2207, 2211, 2215, 2219, 2223,
1463 2230, 2240, 2253
14631464 };
14641465 #endif
14651466
15021503 # ifdef YYPRINT
15031504 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
15041505 token YYLEX-NUM. */
1505 static const unsigned short yytoknum[] =
1506 static const unsigned short int yytoknum[] =
15061507 {
15071508 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
15081509 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
16221623 };
16231624
16241625 /* YYDEFGOTO[NTERM-NUM]. */
1625 static const short yydefgoto[] =
1626 static const short int yydefgoto[] =
16261627 {
16271628 -1, 69, 222, 235, 236, 237, 238, 166, 167, 196,
16281629 168, 20, 11, 28, 70, 71, 169, 73, 74, 98,
16361637 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
16371638 STATE-NUM. */
16381639 #define YYPACT_NINF -383
1639 static const short yypact[] =
1640 static const short int yypact[] =
16401641 {
16411642 -383, 48, 136, 517, -383, -383, -383, -383, -383, -383,
16421643 -383, 27, 36, -383, -383, -17, -383, -383, 46, -21,
16831684 };
16841685
16851686 /* YYPGOTO[NTERM-NUM]. */
1686 static const short yypgoto[] =
1687 static const short int yypgoto[] =
16871688 {
16881689 -383, -383, -383, 254, 262, 264, 272, -106, -105, -372,
16891690 -383, 313, 333, -101, -38, -383, -28, -383, -56, 255,
16991700 number is the opposite. If zero, do what YYDEFACT says.
17001701 If YYTABLE_NINF, syntax error. */
17011702 #define YYTABLE_NINF -108
1702 static const short yytable[] =
1703 static const short int yytable[] =
17031704 {
17041705 72, 170, 194, 195, 87, 77, 30, 21, 197, 291,
17051706 293, 397, 97, 33, 72, 403, 299, 42, 216, 88,
18141815 67, 0, 68
18151816 };
18161817
1817 static const short yycheck[] =
1818 static const short int yycheck[] =
18181819 {
18191820 28, 91, 108, 108, 42, 29, 23, 3, 109, 232,
18201821 233, 383, 68, 30, 42, 397, 100, 20, 100, 32,
20882089
20892090 #if defined (__STDC__) || defined (__cplusplus)
20902091 static void
2091 yy_stack_print (short *bottom, short *top)
2092 yy_stack_print (short int *bottom, short int *top)
20922093 #else
20932094 static void
20942095 yy_stack_print (bottom, top)
2095 short *bottom;
2096 short *top;
2096 short int *bottom;
2097 short int *top;
20972098 #endif
20982099 {
20992100 YYFPRINTF (stderr, "Stack now");
23602361 to reallocate them elsewhere. */
23612362
23622363 /* The state stack. */
2363 short yyssa[YYINITDEPTH];
2364 short *yyss = yyssa;
2365 register short *yyssp;
2364 short int yyssa[YYINITDEPTH];
2365 short int *yyss = yyssa;
2366 register short int *yyssp;
23662367
23672368 /* The semantic value stack. */
23682369 YYSTYPE yyvsa[YYINITDEPTH];
23982399
23992400 yyssp = yyss;
24002401 yyvsp = yyvs;
2402
24012403
24022404 goto yysetstate;
24032405
24242426 these so that the &'s don't force the real ones into
24252427 memory. */
24262428 YYSTYPE *yyvs1 = yyvs;
2427 short *yyss1 = yyss;
2429 short int *yyss1 = yyss;
24282430
24292431
24302432 /* Each stack pointer address is followed by the size of the
24522454 yystacksize = YYMAXDEPTH;
24532455
24542456 {
2455 short *yyss1 = yyss;
2457 short int *yyss1 = yyss;
24562458 union yyalloc *yyptr =
24572459 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
24582460 if (! yyptr)
25852587 switch (yyn)
25862588 {
25872589 case 3:
2588 #line 983 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2590 #line 984 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
25892591 {
25902592 if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range!
25912593 ThrowException("Value too large for type!");
25942596 break;
25952597
25962598 case 5:
2597 #line 991 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2599 #line 992 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
25982600 {
25992601 if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range!
26002602 ThrowException("Value too large for type!");
26032605 break;
26042606
26052607 case 34:
2606 #line 1014 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2608 #line 1015 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26072609 {
26082610 yyval.StrVal = yyvsp[-1].StrVal;
26092611 ;}
26102612 break;
26112613
26122614 case 35:
2613 #line 1017 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2615 #line 1018 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26142616 {
26152617 yyval.StrVal = 0;
26162618 ;}
26172619 break;
26182620
26192621 case 36:
2620 #line 1021 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2622 #line 1022 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26212623 { yyval.Linkage = GlobalValue::InternalLinkage; ;}
26222624 break;
26232625
26242626 case 37:
2625 #line 1022 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2627 #line 1023 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26262628 { yyval.Linkage = GlobalValue::LinkOnceLinkage; ;}
26272629 break;
26282630
26292631 case 38:
2630 #line 1023 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2632 #line 1024 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26312633 { yyval.Linkage = GlobalValue::WeakLinkage; ;}
26322634 break;
26332635
26342636 case 39:
2635 #line 1024 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2637 #line 1025 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26362638 { yyval.Linkage = GlobalValue::AppendingLinkage; ;}
26372639 break;
26382640
26392641 case 40:
2640 #line 1025 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2642 #line 1026 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26412643 { yyval.Linkage = GlobalValue::ExternalLinkage; ;}
26422644 break;
26432645
26442646 case 41:
2645 #line 1027 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2647 #line 1028 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26462648 { yyval.UIntVal = CallingConv::C; ;}
26472649 break;
26482650
26492651 case 42:
2650 #line 1028 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2652 #line 1029 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26512653 { yyval.UIntVal = CallingConv::C; ;}
26522654 break;
26532655
26542656 case 43:
2655 #line 1029 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2657 #line 1030 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26562658 { yyval.UIntVal = CallingConv::Fast; ;}
26572659 break;
26582660
26592661 case 44:
2660 #line 1030 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2662 #line 1031 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26612663 { yyval.UIntVal = CallingConv::Cold; ;}
26622664 break;
26632665
26642666 case 45:
2665 #line 1031 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2667 #line 1032 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26662668 {
26672669 if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val)
26682670 ThrowException("Calling conv too large!");
26712673 break;
26722674
26732675 case 47:
2674 #line 1044 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2676 #line 1045 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26752677 { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;}
26762678 break;
26772679
26782680 case 49:
2679 #line 1045 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2681 #line 1046 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26802682 { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ;}
26812683 break;
26822684
26832685 case 50:
2684 #line 1047 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2686 #line 1048 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26852687 {
26862688 if (!UpRefs.empty())
26872689 ThrowException("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription());
26902692 break;
26912693
26922694 case 64:
2693 #line 1058 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2695 #line 1059 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
26942696 {
26952697 yyval.TypeVal = new PATypeHolder(OpaqueType::get());
26962698 ;}
26972699 break;
26982700
26992701 case 65:
2700 #line 1061 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2702 #line 1062 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27012703 {
27022704 yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType);
27032705 ;}
27042706 break;
27052707
27062708 case 66:
2707 #line 1064 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2709 #line 1065 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27082710 { // Named types are also simple types...
27092711 yyval.TypeVal = new PATypeHolder(getTypeVal(yyvsp[0].ValIDVal));
27102712 ;}
27112713 break;
27122714
27132715 case 67:
2714 #line 1070 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2716 #line 1071 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27152717 { // Type UpReference
27162718 if (yyvsp[0].UInt64Val > (uint64_t)~0U) ThrowException("Value out of range!");
27172719 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
27222724 break;
27232725
27242726 case 68:
2725 #line 1077 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2727 #line 1078 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27262728 { // Function derived type?
27272729 std::vector Params;
27282730 for (std::list::iterator I = yyvsp[-1].TypeList->begin(),
27382740 break;
27392741
27402742 case 69:
2741 #line 1089 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2743 #line 1090 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27422744 { // Sized array type?
27432745 yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val)));
27442746 delete yyvsp[-1].TypeVal;
27462748 break;
27472749
27482750 case 70:
2749 #line 1093 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2751 #line 1094 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27502752 { // Packed array type?
27512753 const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get();
27522754 if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) {
27612763 break;
27622764
27632765 case 71:
2764 #line 1104 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2766 #line 1105 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27652767 { // Structure type?
27662768 std::vector Elements;
27672769 for (std::list::iterator I = yyvsp[-1].TypeList->begin(),
27742776 break;
27752777
27762778 case 72:
2777 #line 1113 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2779 #line 1114 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27782780 { // Empty structure type?
27792781 yyval.TypeVal = new PATypeHolder(StructType::get(std::vector()));
27802782 ;}
27812783 break;
27822784
27832785 case 73:
2784 #line 1116 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2786 #line 1117 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27852787 { // Pointer type?
27862788 yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal)));
27872789 delete yyvsp[-1].TypeVal;
27892791 break;
27902792
27912793 case 74:
2792 #line 1124 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2794 #line 1125 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
27932795 {
27942796 yyval.TypeList = new std::list();
27952797 yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal;
27972799 break;
27982800
27992801 case 75:
2800 #line 1128 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2802 #line 1129 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28012803 {
28022804 (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal;
28032805 ;}
28042806 break;
28052807
28062808 case 77:
2807 #line 1134 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2809 #line 1135 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28082810 {
28092811 (yyval.TypeList=yyvsp[-2].TypeList)->push_back(Type::VoidTy);
28102812 ;}
28112813 break;
28122814
28132815 case 78:
2814 #line 1137 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2816 #line 1138 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28152817 {
28162818 (yyval.TypeList = new std::list())->push_back(Type::VoidTy);
28172819 ;}
28182820 break;
28192821
28202822 case 79:
2821 #line 1140 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2823 #line 1141 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28222824 {
28232825 yyval.TypeList = new std::list();
28242826 ;}
28252827 break;
28262828
28272829 case 80:
2828 #line 1150 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2830 #line 1151 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28292831 { // Nonempty unsized arr
28302832 const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get());
28312833 if (ATy == 0)
28542856 break;
28552857
28562858 case 81:
2857 #line 1175 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2859 #line 1176 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28582860 {
28592861 const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get());
28602862 if (ATy == 0)
28712873 break;
28722874
28732875 case 82:
2874 #line 1188 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2876 #line 1189 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
28752877 {
28762878 const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get());
28772879 if (ATy == 0)
29032905 break;
29042906
29052907 case 83:
2906 #line 1216 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2908 #line 1217 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
29072909 { // Nonempty unsized arr
29082910 const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get());
29092911 if (PTy == 0)
29322934 break;
29332935
29342936 case 84:
2935 #line 1241 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2937 #line 1242 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
29362938 {
29372939 const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get());
29382940 if (STy == 0)
29562958 break;
29572959
29582960 case 85:
2959 #line 1261 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2961 #line 1262 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
29602962 {
29612963 const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get());
29622964 if (STy == 0)
29722974 break;
29732975
29742976 case 86:
2975 #line 1273 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2977 #line 1274 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
29762978 {
29772979 const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get());
29782980 if (PTy == 0)
29852987 break;
29862988
29872989 case 87:
2988 #line 1282 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2990 #line 1283 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
29892991 {
29902992 yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get());
29912993 delete yyvsp[-1].TypeVal;
29932995 break;
29942996
29952997 case 88:
2996 #line 1286 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
2998 #line 1287 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
29972999 {
29983000 const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get());
29993001 if (Ty == 0)
30563058 break;
30573059
30583060 case 89:
3059 #line 1345 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3061 #line 1346 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
30603062 {
30613063 if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType())
30623064 ThrowException("Mismatched types for constant expression!");
30663068 break;
30673069
30683070 case 90:
3069 #line 1351 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3071 #line 1352 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
30703072 {
30713073 const Type *Ty = yyvsp[-1].TypeVal->get();
30723074 if (isa(Ty) || Ty == Type::LabelTy || isa(Ty))
30773079 break;
30783080
30793081 case 91:
3080 #line 1359 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3082 #line 1360 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
30813083 { // integral constants
30823084 if (!ConstantSInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val))
30833085 ThrowException("Constant value doesn't fit in type!");
30863088 break;
30873089
30883090 case 92:
3089 #line 1364 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3091 #line 1365 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
30903092 { // integral constants
30913093 if (!ConstantUInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val))
30923094 ThrowException("Constant value doesn't fit in type!");
30953097 break;
30963098
30973099 case 93:
3098 #line 1369 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3100 #line 1370 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
30993101 { // Boolean constants
31003102 yyval.ConstVal = ConstantBool::True;
31013103 ;}
31023104 break;
31033105
31043106 case 94:
3105 #line 1372 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3107 #line 1373 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
31063108 { // Boolean constants
31073109 yyval.ConstVal = ConstantBool::False;
31083110 ;}
31093111 break;
31103112
31113113 case 95:
3112 #line 1375 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3114 #line 1376 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
31133115 { // Float & Double constants
31143116 if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal))
31153117 ThrowException("Floating point constant invalid for type!!");
31183120 break;
31193121
31203122 case 96:
3121 #line 1382 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3123 #line 1383 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
31223124 {
31233125 if (!yyvsp[-3].ConstVal->getType()->isFirstClassType())
31243126 ThrowException("cast constant expression from a non-primitive type: '" +
31323134 break;
31333135
31343136 case 97:
3135 #line 1392 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3137 #line 1393 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
31363138 {
31373139 if (!isa(yyvsp[-2].ConstVal->getType()))
31383140 ThrowException("GetElementPtr requires a pointer operand!");
31673169 break;
31683170
31693171 case 98:
3170 #line 1423 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3172 #line 1424 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
31713173 {
31723174 if (yyvsp[-5].ConstVal->getType() != Type::BoolTy)
31733175 ThrowException("Select condition must be of boolean type!");
31783180 break;
31793181
31803182 case 99:
3181 #line 1430 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3183 #line 1431 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
31823184 {
31833185 if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
31843186 ThrowException("Binary operator types must match!");
32033205 break;
32043206
32053207 case 100:
3206 #line 1451 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3208 #line 1452 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32073209 {
32083210 if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
32093211 ThrowException("Logical operator types must match!");
32143216 break;
32153217
32163218 case 101:
3217 #line 1458 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3219 #line 1459 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32183220 {
32193221 if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType())
32203222 ThrowException("setcc operand types must match!");
32233225 break;
32243226
32253227 case 102:
3226 #line 1463 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3228 #line 1464 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32273229 {
32283230 if (yyvsp[-1].ConstVal->getType() != Type::UByteTy)
32293231 ThrowException("Shift count for shift constant must be unsigned byte!");
32343236 break;
32353237
32363238 case 103:
3237 #line 1473 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3239 #line 1474 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32383240 {
32393241 (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal);
32403242 ;}
32413243 break;
32423244
32433245 case 104:
3244 #line 1476 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3246 #line 1477 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32453247 {
32463248 yyval.ConstVector = new std::vector();
32473249 yyval.ConstVector->push_back(yyvsp[0].ConstVal);
32493251 break;
32503252
32513253 case 105:
3252 #line 1483 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3254 #line 1484 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32533255 { yyval.BoolVal = false; ;}
32543256 break;
32553257
32563258 case 106:
3257 #line 1483 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3259 #line 1484 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32583260 { yyval.BoolVal = true; ;}
32593261 break;
32603262
32613263 case 107:
3262 #line 1493 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3264 #line 1494 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32633265 {
32643266 yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal;
32653267 CurModule.ModuleDone();
32673269 break;
32683270
32693271 case 108:
3270 #line 1500 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3272 #line 1501 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32713273 {
32723274 yyval.ModuleVal = yyvsp[-1].ModuleVal;
32733275 CurFun.FunctionDone();
32753277 break;
32763278
32773279 case 109:
3278 #line 1504 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3280 #line 1505 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32793281 {
32803282 yyval.ModuleVal = yyvsp[-1].ModuleVal;
32813283 ;}
32823284 break;
32833285
32843286 case 110:
3285 #line 1507 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3287 #line 1508 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32863288 {
32873289 yyval.ModuleVal = yyvsp[-1].ModuleVal;
32883290 ;}
32893291 break;
32903292
32913293 case 111:
3292 #line 1510 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3294 #line 1511 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
32933295 {
32943296 yyval.ModuleVal = CurModule.CurrentModule;
32953297 // Emit an error if there are any unresolved types left.
33043306 break;
33053307
33063308 case 112:
3307 #line 1523 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3309 #line 1524 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33083310 {
33093311 // Eagerly resolve types. This is not an optimization, this is a
33103312 // requirement that is due to the fact that we could have this:
33283330 break;
33293331
33303332 case 113:
3331 #line 1543 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3333 #line 1544 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33323334 { // Function prototypes can be in const pool
33333335 ;}
33343336 break;
33353337
33363338 case 114:
3337 #line 1545 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3339 #line 1546 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33383340 {
33393341 if (yyvsp[0].ConstVal == 0) ThrowException("Global value initializer is not a constant!");
33403342 ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal);
33423344 break;
33433345
33443346 case 115:
3345 #line 1549 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3347 #line 1550 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33463348 {
33473349 ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0);
33483350 delete yyvsp[0].TypeVal;
33503352 break;
33513353
33523354 case 116:
3353 #line 1553 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3355 #line 1554 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33543356 {
33553357 ;}
33563358 break;
33573359
33583360 case 117:
3359 #line 1555 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3361 #line 1556 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33603362 {
33613363 ;}
33623364 break;
33633365
33643366 case 118:
3365 #line 1557 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3367 #line 1558 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33663368 {
33673369 ;}
33683370 break;
33693371
33703372 case 119:
3371 #line 1562 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3373 #line 1563 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33723374 { yyval.Endianness = Module::BigEndian; ;}
33733375 break;
33743376
33753377 case 120:
3376 #line 1563 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3378 #line 1564 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33773379 { yyval.Endianness = Module::LittleEndian; ;}
33783380 break;
33793381
33803382 case 121:
3381 #line 1565 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3383 #line 1566 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33823384 {
33833385 CurModule.CurrentModule->setEndianness(yyvsp[0].Endianness);
33843386 ;}
33853387 break;
33863388
33873389 case 122:
3388 #line 1568 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3390 #line 1569 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
33893391 {
33903392 if (yyvsp[0].UInt64Val == 32)
33913393 CurModule.CurrentModule->setPointerSize(Module::Pointer32);
33973399 break;
33983400
33993401 case 123:
3400 #line 1576 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3402 #line 1577 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34013403 {
34023404 CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal);
34033405 free(yyvsp[0].StrVal);
34053407 break;
34063408
34073409 case 125:
3408 #line 1583 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3410 #line 1584 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34093411 {
34103412 CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal);
34113413 free(yyvsp[0].StrVal);
34133415 break;
34143416
34153417 case 126:
3416 #line 1587 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3418 #line 1588 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34173419 {
34183420 CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal);
34193421 free(yyvsp[0].StrVal);
34213423 break;
34223424
34233425 case 127:
3424 #line 1591 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3426 #line 1592 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34253427 {
34263428 ;}
34273429 break;
34283430
34293431 case 131:
3430 #line 1600 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3432 #line 1601 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34313433 { yyval.StrVal = 0; ;}
34323434 break;
34333435
34343436 case 132:
3435 #line 1602 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3437 #line 1603 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34363438 {
34373439 if (*yyvsp[-1].TypeVal == Type::VoidTy)
34383440 ThrowException("void typed arguments are invalid!");
34413443 break;
34423444
34433445 case 133:
3444 #line 1608 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3446 #line 1609 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34453447 {
34463448 yyval.ArgList = yyvsp[-2].ArgList;
34473449 yyvsp[-2].ArgList->push_back(*yyvsp[0].ArgVal);
34503452 break;
34513453
34523454 case 134:
3453 #line 1613 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3455 #line 1614 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34543456 {
34553457 yyval.ArgList = new std::vector >();
34563458 yyval.ArgList->push_back(*yyvsp[0].ArgVal);
34593461 break;
34603462
34613463 case 135:
3462 #line 1619 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3464 #line 1620 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34633465 {
34643466 yyval.ArgList = yyvsp[0].ArgList;
34653467 ;}
34663468 break;
34673469
34683470 case 136:
3469 #line 1622 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3471 #line 1623 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34703472 {
34713473 yyval.ArgList = yyvsp[-2].ArgList;
34723474 yyval.ArgList->push_back(std::pair
34753477 break;
34763478
34773479 case 137:
3478 #line 1627 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3480 #line 1628 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34793481 {
34803482 yyval.ArgList = new std::vector >();
34813483 yyval.ArgList->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0));
34833485 break;
34843486
34853487 case 138:
3486 #line 1631 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3488 #line 1632 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34873489 {
34883490 yyval.ArgList = 0;
34893491 ;}
34903492 break;
34913493
34923494 case 139:
3493 #line 1635 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3495 #line 1636 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
34943496 {
34953497 UnEscapeLexed(yyvsp[-3].StrVal);
34963498 std::string FunctionName(yyvsp[-3].StrVal);
35733575 break;
35743576
35753577 case 142:
3576 #line 1717 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3578 #line 1718 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
35773579 {
35783580 yyval.FunctionVal = CurFun.CurrentFunction;
35793581
35843586 break;
35853587
35863588 case 145:
3587 #line 1727 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3589 #line 1728 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
35883590 {
35893591 yyval.FunctionVal = yyvsp[-1].FunctionVal;
35903592 ;}
35913593 break;
35923594
35933595 case 146:
3594 #line 1731 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3596 #line 1732 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
35953597 { CurFun.isDeclare = true; ;}
35963598 break;
35973599
35983600 case 147:
3599 #line 1731 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3601 #line 1732 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36003602 {
36013603 yyval.FunctionVal = CurFun.CurrentFunction;
36023604 CurFun.FunctionDone();
36043606 break;
36053607
36063608 case 148:
3607 #line 1740 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3609 #line 1741 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36083610 { // A reference to a direct constant
36093611 yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val);
36103612 ;}
36113613 break;
36123614
36133615 case 149:
3614 #line 1743 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3616 #line 1744 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36153617 {
36163618 yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val);
36173619 ;}
36183620 break;
36193621
36203622 case 150:
3621 #line 1746 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3623 #line 1747 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36223624 { // Perhaps it's an FP constant?
36233625 yyval.ValIDVal = ValID::create(yyvsp[0].FPVal);
36243626 ;}
36253627 break;
36263628
36273629 case 151:
3628 #line 1749 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3630 #line 1750 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36293631 {
36303632 yyval.ValIDVal = ValID::create(ConstantBool::True);
36313633 ;}
36323634 break;
36333635
36343636 case 152:
3635 #line 1752 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3637 #line 1753 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36363638 {
36373639 yyval.ValIDVal = ValID::create(ConstantBool::False);
36383640 ;}
36393641 break;
36403642
36413643 case 153:
3642 #line 1755 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3644 #line 1756 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36433645 {
36443646 yyval.ValIDVal = ValID::createNull();
36453647 ;}
36463648 break;
36473649
36483650 case 154:
3649 #line 1758 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3651 #line 1759 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36503652 {
36513653 yyval.ValIDVal = ValID::createUndef();
36523654 ;}
36533655 break;
36543656
36553657 case 155:
3656 #line 1761 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3658 #line 1762 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36573659 { // Nonempty unsized packed vector
36583660 const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType();
36593661 int NumElements = yyvsp[-1].ConstVector->size();
36813683 break;
36823684
36833685 case 156:
3684 #line 1785 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3686 #line 1786 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36853687 {
36863688 yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal);
36873689 ;}
36883690 break;
36893691
36903692 case 157:
3691 #line 1792 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3693 #line 1793 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36923694 { // Is it an integer reference...?
36933695 yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal);
36943696 ;}
36953697 break;
36963698
36973699 case 158:
3698 #line 1795 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3700 #line 1796 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
36993701 { // Is it a named reference...?
37003702 yyval.ValIDVal = ValID::create(yyvsp[0].StrVal);
37013703 ;}
37023704 break;
37033705
37043706 case 161:
3705 #line 1806 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3707 #line 1807 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37063708 {
37073709 yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); delete yyvsp[-1].TypeVal;
37083710 ;}
37093711 break;
37103712
37113713 case 162:
3712 #line 1810 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3714 #line 1811 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37133715 {
37143716 yyval.FunctionVal = yyvsp[-1].FunctionVal;
37153717 ;}
37163718 break;
37173719
37183720 case 163:
3719 #line 1813 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3721 #line 1814 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37203722 { // Do not allow functions with 0 basic blocks
37213723 yyval.FunctionVal = yyvsp[-1].FunctionVal;
37223724 ;}
37233725 break;
37243726
37253727 case 164:
3726 #line 1821 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3728 #line 1822 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37273729 {
37283730 setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal);
37293731 InsertValue(yyvsp[0].TermInstVal);
37353737 break;
37363738
37373739 case 165:
3738 #line 1830 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3740 #line 1831 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37393741 {
37403742 yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal);
37413743 yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal;
37433745 break;
37443746
37453747 case 166:
3746 #line 1834 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3748 #line 1835 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37473749 {
37483750 yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true);
37493751
37573759 break;
37583760
37593761 case 167:
3760 #line 1844 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3762 #line 1845 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37613763 {
37623764 yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true);
37633765
37713773 break;
37723774
37733775 case 168:
3774 #line 1855 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3776 #line 1856 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37753777 { // Return with a result...
37763778 yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal);
37773779 ;}
37783780 break;
37793781
37803782 case 169:
3781 #line 1858 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3783 #line 1859 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37823784 { // Return with no result...
37833785 yyval.TermInstVal = new ReturnInst();
37843786 ;}
37853787 break;
37863788
37873789 case 170:
3788 #line 1861 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3790 #line 1862 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37893791 { // Unconditional Branch...
37903792 yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[0].ValIDVal));
37913793 ;}
37923794 break;
37933795
37943796 case 171:
3795 #line 1864 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3797 #line 1865 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
37963798 {
37973799 yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[-3].ValIDVal), getBBVal(yyvsp[0].ValIDVal), getVal(Type::BoolTy, yyvsp[-6].ValIDVal));
37983800 ;}
37993801 break;
38003802
38013803 case 172:
3802 #line 1867 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3804 #line 1868 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
38033805 {
38043806 SwitchInst *S = new SwitchInst(getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal), getBBVal(yyvsp[-3].ValIDVal), yyvsp[-1].JumpTable->size());
38053807 yyval.TermInstVal = S;
38173819 break;
38183820
38193821 case 173:
3820 #line 1881 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3822 #line 1882 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
38213823 {
38223824 SwitchInst *S = new SwitchInst(getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal), getBBVal(yyvsp[-2].ValIDVal), 0);
38233825 yyval.TermInstVal = S;
38253827 break;
38263828
38273829 case 174:
3828 #line 1886 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3830 #line 1887 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
38293831 {
38303832 const PointerType *PFTy;
38313833 const FunctionType *Ty;
38813883 break;
38823884
38833885 case 175:
3884 #line 1938 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3886 #line 1939 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
38853887 {
38863888 yyval.TermInstVal = new UnwindInst();
38873889 ;}
38883890 break;
38893891
38903892 case 176:
3891 #line 1941 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3893 #line 1942 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
38923894 {
38933895 yyval.TermInstVal = new UnreachableInst();
38943896 ;}
38953897 break;
38963898
38973899 case 177:
3898 #line 1947 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3900 #line 1948 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
38993901 {
39003902 yyval.JumpTable = yyvsp[-5].JumpTable;
39013903 Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
39073909 break;
39083910
39093911 case 178:
3910 #line 1955 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3912 #line 1956 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39113913 {
39123914 yyval.JumpTable = new std::vector >();
39133915 Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal));
39203922 break;
39213923
39223924 case 179:
3923 #line 1965 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3925 #line 1966 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39243926 {
39253927 // Is this definition named?? if so, assign the name...
39263928 setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal);
39303932 break;
39313933
39323934 case 180:
3933 #line 1972 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3935 #line 1973 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39343936 { // Used for PHI nodes
39353937 yyval.PHIList = new std::list >();
39363938 yyval.PHIList->push_back(std::make_pair(getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal), getBBVal(yyvsp[-1].ValIDVal)));
39393941 break;
39403942
39413943 case 181:
3942 #line 1977 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3944 #line 1978 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39433945 {
39443946 yyval.PHIList = yyvsp[-6].PHIList;
39453947 yyvsp[-6].PHIList->push_back(std::make_pair(getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal),
39483950 break;
39493951
39503952 case 182:
3951 #line 1984 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3953 #line 1985 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39523954 { // Used for call statements, and memory insts...
39533955 yyval.ValueList = new std::vector();
39543956 yyval.ValueList->push_back(yyvsp[0].ValueVal);
39563958 break;
39573959
39583960 case 183:
3959 #line 1988 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3961 #line 1989 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39603962 {
39613963 yyval.ValueList = yyvsp[-2].ValueList;
39623964 yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal);
39643966 break;
39653967
39663968 case 185:
3967 #line 1994 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3969 #line 1995 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39683970 { yyval.ValueList = 0; ;}
39693971 break;
39703972
39713973 case 186:
3972 #line 1996 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3974 #line 1997 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39733975 {
39743976 yyval.BoolVal = true;
39753977 ;}
39763978 break;
39773979
39783980 case 187:
3979 #line 1999 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3981 #line 2000 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39803982 {
39813983 yyval.BoolVal = false;
39823984 ;}
39833985 break;
39843986
39853987 case 188:
3986 #line 2005 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
3988 #line 2006 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
39873989 {
39883990 if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() &&
39893991 !isa((*yyvsp[-3].TypeVal).get()))
39994001 break;
40004002
40014003 case 189:
4002 #line 2017 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4004 #line 2018 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40034005 {
40044006 if (!(*yyvsp[-3].TypeVal)->isIntegral())
40054007 ThrowException("Logical operator requires integral operands!");
40114013 break;
40124014
40134015 case 190:
4014 #line 2025 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4016 #line 2026 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40154017 {
40164018 if(isa((*yyvsp[-3].TypeVal).get())) {
40174019 ThrowException(
40254027 break;
40264028
40274029 case 191:
4028 #line 2035 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4030 #line 2036 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40294031 {
40304032 std::cerr << "WARNING: Use of eliminated 'not' instruction:"
40314033 << " Replacing with 'xor'.\n";
40414043 break;
40424044
40434045 case 192:
4044 #line 2047 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4046 #line 2048 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40454047 {
40464048 if (yyvsp[0].ValueVal->getType() != Type::UByteTy)
40474049 ThrowException("Shift amount must be ubyte!");
40524054 break;
40534055
40544056 case 193:
4055 #line 2054 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4057 #line 2055 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40564058 {
40574059 if (!yyvsp[0].TypeVal->get()->isFirstClassType())
40584060 ThrowException("cast instruction to a non-primitive type: '" +
40634065 break;
40644066
40654067 case 194:
4066 #line 2061 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4068 #line 2062 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40674069 {
40684070 if (yyvsp[-4].ValueVal->getType() != Type::BoolTy)
40694071 ThrowException("select condition must be boolean!");
40744076 break;
40754077
40764078 case 195:
4077 #line 2068 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4079 #line 2069 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40784080 {
40794081 NewVarArgs = true;
40804082 yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal);
40834085 break;
40844086
40854087 case 196:
4086 #line 2073 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4088 #line 2074 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
40874089 {
40884090 ObsoleteVarArgs = true;
40894091 const Type* ArgTy = yyvsp[-2].ValueVal->getType();
40904092 Function* NF = CurModule.CurrentModule->
4091 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0);
4093 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0);
40924094
40934095 //b = vaarg a, t ->
40944096 //foo = alloca 1 of t
41064108 break;
41074109
41084110 case 197:
4109 #line 2092 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4111 #line 2093 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
41104112 {
41114113 ObsoleteVarArgs = true;
41124114 const Type* ArgTy = yyvsp[-2].ValueVal->getType();
41134115 Function* NF = CurModule.CurrentModule->
4114 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0);
4116 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0);
41154117
41164118 //b = vanext a, t ->
41174119 //foo = alloca 1 of t
41324134 break;
41334135
41344136 case 198:
4135 #line 2114 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4137 #line 2115 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
41364138 {
41374139 const Type *Ty = yyvsp[0].PHIList->front().first->getType();
41384140 if (!Ty->isFirstClassType())
41504152 break;
41514153
41524154 case 199:
4153 #line 2128 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4155 #line 2129 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
41544156 {
41554157 const PointerType *PFTy;
41564158 const FunctionType *Ty;
42114213 break;
42124214
42134215 case 200:
4214 #line 2185 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4216 #line 2186 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42154217 {
42164218 yyval.InstVal = yyvsp[0].InstVal;
42174219 ;}
42184220 break;
42194221
42204222 case 201:
4221 #line 2191 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4223 #line 2192 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42224224 {
42234225 yyval.ValueList = yyvsp[0].ValueList;
42244226 ;}
42254227 break;
42264228
42274229 case 202:
4228 #line 2193 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4230 #line 2194 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42294231 {
42304232 yyval.ValueList = new std::vector();
42314233 ;}
42324234 break;
42334235
42344236 case 203:
4235 #line 2197 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4237 #line 2198 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42364238 {
42374239 yyval.BoolVal = true;
42384240 ;}
42394241 break;
42404242
42414243 case 204:
4242 #line 2200 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4244 #line 2201 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42434245 {
42444246 yyval.BoolVal = false;
42454247 ;}
42464248 break;
42474249
42484250 case 205:
4249 #line 2206 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4251 #line 2207 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42504252 {
42514253 yyval.InstVal = new MallocInst(*yyvsp[0].TypeVal);
42524254 delete yyvsp[0].TypeVal;
42544256 break;
42554257
42564258 case 206:
4257 #line 2210 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4259 #line 2211 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42584260 {
42594261 yyval.InstVal = new MallocInst(*yyvsp[-3].TypeVal, getVal(yyvsp[-1].PrimType, yyvsp[0].ValIDVal));
42604262 delete yyvsp[-3].TypeVal;
42624264 break;
42634265
42644266 case 207:
4265 #line 2214 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4267 #line 2215 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42664268 {
42674269 yyval.InstVal = new AllocaInst(*yyvsp[0].TypeVal);
42684270 delete yyvsp[0].TypeVal;
42704272 break;
42714273
42724274 case 208:
4273 #line 2218 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4275 #line 2219 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42744276 {
42754277 yyval.InstVal = new AllocaInst(*yyvsp[-3].TypeVal, getVal(yyvsp[-1].PrimType, yyvsp[0].ValIDVal));
42764278 delete yyvsp[-3].TypeVal;
42784280 break;
42794281
42804282 case 209:
4281 #line 2222 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4283 #line 2223 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42824284 {
42834285 if (!isa(yyvsp[0].ValueVal->getType()))
42844286 ThrowException("Trying to free nonpointer type " +
42884290 break;
42894291
42904292 case 210:
4291 #line 2229 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4293 #line 2230 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
42924294 {
42934295 if (!isa(yyvsp[-1].TypeVal->get()))
42944296 ThrowException("Can't load from nonpointer type: " +
43024304 break;
43034305
43044306 case 211:
4305 #line 2239 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4307 #line 2240 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
43064308 {
43074309 const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get());
43084310 if (!PT)
43194321 break;
43204322
43214323 case 212:
4322 #line 2252 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4324 #line 2253 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
43234325 {
43244326 if (!isa(yyvsp[-2].TypeVal->get()))
43254327 ThrowException("getelementptr insn requires pointer operand!");
43464348
43474349 }
43484350
4349 /* Line 1000 of yacc.c. */
4350 #line 4352 "llvmAsmParser.tab.c"
4351 /* Line 1010 of yacc.c. */
4352 #line 4354 "llvmAsmParser.tab.c"
43514353
43524354 yyvsp -= yylen;
43534355 yyssp -= yylen;
45724574 }
45734575
45744576
4575 #line 2275 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
4577 #line 2276 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
45764578
45774579 int yyerror(const char *ErrorMsg) {
45784580 std::string where
None /* A Bison parser, made by GNU Bison 1.875c. */
0 /* A Bison parser, made by GNU Bison 1.875d. */
11
22 /* Skeleton parser for Yacc-like parsing with Bison,
3 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
44
55 This program is free software; you can redistribute it and/or modify
66 it under the terms of the GNU General Public License as published by
217217
218218
219219 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
220 #line 865 "/proj/llvm/build/../llvm/lib/AsmParser/llvmAsmParser.y"
220 #line 866 "/usr/home/llvm/obj/../lib/AsmParser/llvmAsmParser.y"
221221 typedef union YYSTYPE {
222222 llvm::Module *ModuleVal;
223223 llvm::Function *FunctionVal;
257257 llvm::Instruction::OtherOps OtherOpVal;
258258 llvm::Module::Endianness Endianness;
259259 } YYSTYPE;
260 /* Line 1275 of yacc.c. */
260 /* Line 1285 of yacc.c. */
261261 #line 263 "llvmAsmParser.tab.h"
262262 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
263263 # define YYSTYPE_IS_DECLARED 1
765765 const Type* ArgTy = F->getFunctionType()->getReturnType();
766766 const Type* ArgTyPtr = PointerType::get(ArgTy);
767767 Function* NF = Result->getOrInsertFunction("llvm.va_start",
768 RetTy, ArgTyPtr, 0);
768 RetTy, ArgTyPtr, (Type *)0);
769769
770770 while (!F->use_empty()) {
771771 CallInst* CI = cast(F->use_back());
790790 const Type* ArgTy = F->getFunctionType()->getParamType(0);
791791 const Type* ArgTyPtr = PointerType::get(ArgTy);
792792 Function* NF = Result->getOrInsertFunction("llvm.va_end",
793 RetTy, ArgTyPtr, 0);
793 RetTy, ArgTyPtr, (Type *)0);
794794
795795 while (!F->use_empty()) {
796796 CallInst* CI = cast(F->use_back());
817817 const Type* ArgTy = F->getFunctionType()->getReturnType();
818818 const Type* ArgTyPtr = PointerType::get(ArgTy);
819819 Function* NF = Result->getOrInsertFunction("llvm.va_copy",
820 RetTy, ArgTyPtr, ArgTyPtr, 0);
820 RetTy, ArgTyPtr, ArgTyPtr,
821 (Type *)0);
821822
822823 while (!F->use_empty()) {
823824 CallInst* CI = cast(F->use_back());
20732074 ObsoleteVarArgs = true;
20742075 const Type* ArgTy = $2->getType();
20752076 Function* NF = CurModule.CurrentModule->
2076 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0);
2077 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0);
20772078
20782079 //b = vaarg a, t ->
20792080 //foo = alloca 1 of t
20922093 ObsoleteVarArgs = true;
20932094 const Type* ArgTy = $2->getType();
20942095 Function* NF = CurModule.CurrentModule->
2095 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0);
2096 getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0);
20962097
20972098 //b = vanext a, t ->
20982099 //foo = alloca 1 of t
679679 break;
680680 case 32: { //VANext_old
681681 const Type* ArgTy = getValue(iType, Oprnds[0])->getType();
682 Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0);
682 Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy,
683 (Type *)0);
683684
684685 //b = vanext a, t ->
685686 //foo = alloca 1 of t
699700 }
700701 case 33: { //VAArg_old
701702 const Type* ArgTy = getValue(iType, Oprnds[0])->getType();
702 Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, 0);
703 Function* NF = TheModule->getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy,
704 (Type *)0);
703705
704706 //b = vaarg a, t ->
705707 //foo = alloca 1 of t
180180 const Type* ArgTy = F->getFunctionType()->getReturnType();
181181 const Type* ArgTyPtr = PointerType::get(ArgTy);
182182 Function* NF = M->getOrInsertFunction("llvm.va_start",
183 RetTy, ArgTyPtr, 0);
183 RetTy, ArgTyPtr, (Type *)0);
184184
185185 for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
186186 if (CallInst* CI = dyn_cast(*I++)) {
203203 const Type* ArgTy = F->getFunctionType()->getParamType(0);
204204 const Type* ArgTyPtr = PointerType::get(ArgTy);
205205 Function* NF = M->getOrInsertFunction("llvm.va_end",
206 RetTy, ArgTyPtr, 0);
206 RetTy, ArgTyPtr, (Type *)0);
207207
208208 for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
209209 if (CallInst* CI = dyn_cast(*I++)) {
229229 const Type* ArgTy = F->getFunctionType()->getReturnType();
230230 const Type* ArgTyPtr = PointerType::get(ArgTy);
231231 Function* NF = M->getOrInsertFunction("llvm.va_copy",
232 RetTy, ArgTyPtr, ArgTyPtr, 0);
232 RetTy, ArgTyPtr, ArgTyPtr, (Type *)0);
233233
234234 for(Value::use_iterator I = F->use_begin(), E = F->use_end(); I != E;)
235235 if (CallInst* CI = dyn_cast(*I++)) {
109109 case Intrinsic::memset:
110110 M.getOrInsertFunction("memset", PointerType::get(Type::SByteTy),
111111 PointerType::get(Type::SByteTy),
112 Type::IntTy, (--(--I->arg_end()))->getType(), 0);
112 Type::IntTy, (--(--I->arg_end()))->getType(),
113 (Type *)0);
113114 break;
114115 case Intrinsic::isunordered:
115116 EnsureFunctionExists(M, "isunordered", I->arg_begin(), I->arg_end(),
923923
924924 // If the program didn't explicitly call exit, call exit now, for the program.
925925 // This ensures that any atexit handlers get called correctly.
926 Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy, 0);
926 Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy,
927 (Type *)0);
927928
928929 std::vector Args;
929930 GenericValue ResultGV;
203203
204204 // void __llvm_sjljeh_init_setjmpmap(void**)
205205 InitSJMap = M.getOrInsertFunction("__llvm_sjljeh_init_setjmpmap",
206 Type::VoidTy, SBPPTy, NULL);
206 Type::VoidTy, SBPPTy, (Type *)0);
207207 // void __llvm_sjljeh_destroy_setjmpmap(void**)
208208 DestroySJMap = M.getOrInsertFunction("__llvm_sjljeh_destroy_setjmpmap",
209 Type::VoidTy, SBPPTy, NULL);
209 Type::VoidTy, SBPPTy, (Type *)0);
210210
211211 // void __llvm_sjljeh_add_setjmp_to_map(void**, void*, unsigned)
212212 AddSJToMap = M.getOrInsertFunction("__llvm_sjljeh_add_setjmp_to_map",
213213 Type::VoidTy, SBPPTy, SBPTy,
214 Type::UIntTy, NULL);
214 Type::UIntTy, (Type *)0);
215215
216216 // void __llvm_sjljeh_throw_longjmp(int*, int)
217217 ThrowLongJmp = M.getOrInsertFunction("__llvm_sjljeh_throw_longjmp",
218 Type::VoidTy, SBPTy, Type::IntTy, NULL);
218 Type::VoidTy, SBPTy, Type::IntTy,
219 (Type *)0);
219220
220221 // unsigned __llvm_sjljeh_try_catching_longjmp_exception(void **)
221222 TryCatchLJ =
222223 M.getOrInsertFunction("__llvm_sjljeh_try_catching_longjmp_exception",
223 Type::UIntTy, SBPPTy, NULL);
224 Type::UIntTy, SBPPTy, (Type *)0);
224225
225226 // bool __llvm_sjljeh_is_longjmp_exception()
226227 IsLJException = M.getOrInsertFunction("__llvm_sjljeh_is_longjmp_exception",
227 Type::BoolTy, NULL);
228 Type::BoolTy, (Type *)0);
228229
229230 // int __llvm_sjljeh_get_longjmp_value()
230231 GetLJValue = M.getOrInsertFunction("__llvm_sjljeh_get_longjmp_value",
231 Type::IntTy, NULL);
232 Type::IntTy, (Type *)0);
232233 return true;
233234 }
234235
310310 if (!memcpy_func) {
311311 const Type *SBP = PointerType::get(Type::SByteTy);
312312 memcpy_func = M->getOrInsertFunction("llvm.memcpy", Type::VoidTy,SBP, SBP,
313 Type::UIntTy, Type::UIntTy, 0);
313 Type::UIntTy, Type::UIntTy,
314 (Type *)0);
314315 }
315316 return memcpy_func;
316317 }
318319 Function* get_floorf() {
319320 if (!floorf_func)
320321 floorf_func = M->getOrInsertFunction("floorf", Type::FloatTy,
321 Type::FloatTy, 0);
322 Type::FloatTy, (Type *)0);
322323 return floorf_func;
323324 }
324325
3939 const Type *PIntTy = PointerType::get(Type::IntTy);
4040 Function *trigMeth = M->getOrInsertFunction("trigger", Type::VoidTy,
4141 Type::IntTy, Type::IntTy,
42 PIntTy, PIntTy, 0);
42 PIntTy, PIntTy, (Type *)0);
4343 assert(trigMeth && "trigger method could not be inserted!");
4444
4545 vector trargs;
155155 }
156156
157157 bool InstLoops::doInitialization (Module &M) {
158 inCountMth = M.getOrInsertFunction("llvm_first_trigger", Type::VoidTy, 0);
158 inCountMth = M.getOrInsertFunction("llvm_first_trigger", Type::VoidTy,
159 (Type *)0);
159160 return true; // Module was modified.
160161 }
161162
188188 // IN THEIR INITIALIZE METHOD!!
189189 Function *initialize =
190190 F.getParent()->getOrInsertFunction("reoptimizerInitialize", Type::VoidTy,
191 PointerType::get(Type::IntTy), 0);
191 PointerType::get(Type::IntTy),
192 (Type *)0);
192193
193194 std::vector trargs;
194195 trargs.push_back(threshold);
2525 const PointerType *UIntPtr = PointerType::get(Type::UIntTy);
2626 Module &M = *MainFn->getParent();
2727 Function *InitFn = M.getOrInsertFunction(FnName, Type::IntTy, Type::IntTy,
28 ArgVTy, UIntPtr, Type::UIntTy, 0);
28 ArgVTy, UIntPtr, Type::UIntTy,
29 (Type *)0);
2930
3031 // This could force argc and argv into programs that wouldn't otherwise have
3132 // them, but instead we just pass null values in.
4545 << "\", \"" << FnName << "\", " << BBNumber << ")\n");
4646 Module &M = *BB->getParent ()->getParent ();
4747 Function *InstrFn = M.getOrInsertFunction (FnName, Type::VoidTy,
48 Type::UIntTy, 0);
48 Type::UIntTy, (Type *)0);
4949 std::vector Args (1);
5050 Args[0] = ConstantUInt::get (Type::UIntTy, BBNumber);
5151
129129
130130 // uint (sbyte*)
131131 HashPtrFunc = M.getOrInsertFunction("HashPointerToSeqNum", Type::UIntTy, SBP,
132 0);
132 (Type *)0);
133133
134134 // void (sbyte*)
135135 ReleasePtrFunc = M.getOrInsertFunction("ReleasePointerSeqNum",
136 Type::VoidTy, SBP, 0);
136 Type::VoidTy, SBP, (Type *)0);
137137 RecordPtrFunc = M.getOrInsertFunction("RecordPointer",
138 Type::VoidTy, SBP, 0);
139
140 PushOnEntryFunc = M.getOrInsertFunction("PushPointerSet", Type::VoidTy, 0);
138 Type::VoidTy, SBP, (Type *)0);
139
140 PushOnEntryFunc = M.getOrInsertFunction("PushPointerSet", Type::VoidTy,
141 (Type *)0);
141142 ReleaseOnReturnFunc = M.getOrInsertFunction("ReleasePointersPopSet",
142 Type::VoidTy, 0);
143 Type::VoidTy, (Type *)0);
143144 }
144145
145146
108108 // If the program is using read/write barriers, find the implementations of
109109 // them from the GC runtime library.
110110 if (GCReadInt) // Make: sbyte* %llvm_gc_read(sbyte**)
111 GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, VoidPtrPtr, 0);
111 GCRead = M.getOrInsertFunction("llvm_gc_read", VoidPtr, VoidPtr, VoidPtrPtr,
112 (Type *)0);
112113 if (GCWriteInt) // Make: void %llvm_gc_write(sbyte*, sbyte**)
113114 GCWrite = M.getOrInsertFunction("llvm_gc_write", Type::VoidTy,
114 VoidPtr, VoidPtr, VoidPtrPtr, 0);
115 VoidPtr, VoidPtr, VoidPtrPtr, (Type *)0);
115116
116117 // If the program has GC roots, get or create the global root list.
117118 if (GCRootInt) {
8282 MallocFunc = M.getOrInsertFunction("malloc", FT);
8383 }
8484 if (FreeFunc == 0)
85 FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0);
85 FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, (Type *)0);
8686
8787 return true;
8888 }
123123 Constant::getNullValue(PtrJBList),
124124 "llvm.sjljeh.jblist", &M);
125125 SetJmpFn = M.getOrInsertFunction("llvm.setjmp", Type::IntTy,
126 PointerType::get(JmpBufTy), NULL);
126 PointerType::get(JmpBufTy), (Type *)0);
127127 LongJmpFn = M.getOrInsertFunction("llvm.longjmp", Type::VoidTy,
128128 PointerType::get(JmpBufTy),
129 Type::IntTy, NULL);
129 Type::IntTy, (Type *)0);
130130 }
131131
132132 // We need the 'write' and 'abort' functions for both models.
133 AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, NULL);
133 AbortFn = M.getOrInsertFunction("abort", Type::VoidTy, (Type *)0);
134134
135135 // Unfortunately, 'write' can end up being prototyped in several different
136136 // ways. If the user defines a three (or more) operand function named 'write'
147147 WriteFn = 0;
148148 } else {
149149 WriteFn = M.getOrInsertFunction("write", Type::VoidTy, Type::IntTy,
150 VoidPtrTy, Type::IntTy, NULL);
150 VoidPtrTy, Type::IntTy, (Type *)0);
151151 }
152152 return true;
153153 }
665665 Function *resolverFunc =
666666 Safe->getOrInsertFunction("getPointerToNamedFunction",
667667 PointerType::get(Type::SByteTy),
668 PointerType::get(Type::SByteTy), 0);
668 PointerType::get(Type::SByteTy), (Type *)0);
669669
670670 // Use the function we just added to get addresses of functions we need.
671671 for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) {
9595 // If the program didn't explicitly call exit, call exit now, for the program.
9696 // This ensures that any atexit handlers get called correctly.
9797 Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy,
98 Type::IntTy, 0);
98 Type::IntTy,
99 (Type *)0);
99100
100101 std::vector Args;
101102 GenericValue ResultGV;