llvm.org GIT mirror llvm / 5cbf985
For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid confusion with external linkage types. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
72 changed file(s) with 1298 addition(s) and 1473 deletion(s). Raw diff Collapse all Expand all
8888 /// arguments.
8989 bool isVarArg() const;
9090
91 /// isExternal - Is the body of this function unknown? (The basic block list
92 /// is empty if so.) This is true for external functions, defined as forward
93 /// "declare"ations
94 ///
95 virtual bool isExternal() const { return BasicBlocks.empty(); }
91 /// isDeclaration - Is the body of this function unknown? (The basic block
92 /// list is empty if so.) This is true for function declarations, but not
93 /// true for function definitions.
94 ///
95 virtual bool isDeclaration() const { return BasicBlocks.empty(); }
9696
9797 /// getIntrinsicID - This method returns the ID number of the specified
9898 /// function, or Intrinsic::not_intrinsic if the function is not an
112112 /// Override from Constant class.
113113 virtual void destroyConstant();
114114
115 /// isExternal - Return true if the primary definition of this global value is
116 /// outside of the current translation unit...
117 virtual bool isExternal() const = 0;
115 /// isDeclaration - Return true if the primary definition of this global
116 /// value is outside of the current translation unit...
117 virtual bool isDeclaration() const = 0;
118118
119119 /// getParent - Get the module that this global value is contained inside
120120 /// of...
5757 Constant *Initializer, const std::string &Name,
5858 GlobalVariable *InsertBefore);
5959
60 /// isExternal - Is this global variable lacking an initializer? If so, the
61 /// global variable is defined in some other translation unit, and is thus
62 /// externally defined here.
63 ///
64 virtual bool isExternal() const { return getNumOperands() == 0; }
60 /// isDeclaration - Is this global variable lacking an initializer? If so,
61 /// the global variable is defined in some other translation unit, and is thus
62 /// only a declaration here.
63 virtual bool isDeclaration() const { return getNumOperands() == 0; }
6564
6665 /// hasInitializer - Unless a global variable isExternal(), it has an
6766 /// initializer. The initializer for the global variable/constant is held by
6867 /// Initializer if an initializer is specified.
6968 ///
70 inline bool hasInitializer() const { return !isExternal(); }
69 inline bool hasInitializer() const { return !isDeclaration(); }
7170
7271 /// getInitializer - Return the initializer for this global variable. It is
7372 /// illegal to call this method if the global is external, because we cannot
4747 for(Module::iterator I = M.begin(),
4848 E = M.end(); I != E; ++I){
4949 Vals.insert(&*I);
50 if(!I->isExternal()) {
50 if(!I->isDeclaration()) {
5151 for (Function::arg_iterator AI = I->arg_begin(), AE = I->arg_end();
5252 AI != AE; ++AI)
5353 Vals.insert(&*AI);
822822 AliasAnalysis::ModRefBehavior
823823 BasicAliasAnalysis::getModRefBehavior(Function *F, CallSite CS,
824824 std::vector *Info) {
825 if (!F->isExternal()) return UnknownModRefBehavior;
825 if (!F->isDeclaration()) return UnknownModRefBehavior;
826826
827827 static bool Initialized = false;
828828 if (!Initialized) {
366366 // program and modify stuff. We ignore this technical niggle for now. This
367367 // is, after all, a "research quality" implementation of Andersen's analysis.
368368 if (Function *F = CS.getCalledFunction())
369 if (F->isExternal()) {
369 if (F->isDeclaration()) {
370370 Node *N1 = getNode(P);
371371
372372 if (N1->begin() == N1->end())
598598 /// constraints and return true. If this is a call to an unknown function,
599599 /// return false.
600600 bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) {
601 assert(F->isExternal() && "Not an external function!");
601 assert(F->isDeclaration() && "Not an external function!");
602602
603603 // These functions don't induce any points-to constraints.
604604 if (F->getName() == "atoi" || F->getName() == "atof" ||
723723 if (!F->hasInternalLinkage())
724724 AddConstraintsForNonInternalLinkage(F);
725725
726 if (!F->isExternal()) {
726 if (!F->isDeclaration()) {
727727 // Scan the function body, creating a memory object for each heap/stack
728728 // allocation in the body of the function and a node to represent all
729729 // pointer values defined by instructions and used as operands.
882882 void Andersens::AddConstraintsForCall(CallSite CS, Function *F) {
883883 // If this is a call to an external function, handle it directly to get some
884884 // taste of context sensitivity.
885 if (F->isExternal() && AddConstraintsForExternalCall(CS, F))
885 if (F->isDeclaration() && AddConstraintsForExternalCall(CS, F))
886886 return;
887887
888888 if (isa(CS.getType())) {
132132
133133 // If this function is not defined in this translation unit, it could call
134134 // anything.
135 if (F->isExternal() && !F->getIntrinsicID())
135 if (F->isDeclaration() && !F->getIntrinsicID())
136136 Node->addCalledFunction(CallSite(), CallsExternalNode);
137137
138138 // Loop over all of the users of the function... looking for callers...
299299 // Okay, easy case.
300300 } else if (CallInst *CI = dyn_cast(Ptr)) {
301301 Function *F = CI->getCalledFunction();
302 if (!F || !F->isExternal()) return false; // Too hard to analyze.
302 if (!F || !F->isDeclaration()) return false; // Too hard to analyze.
303303 if (F->getName() != "calloc") return false; // Not calloc.
304304 } else {
305305 return false; // Too hard to analyze.
340340 if ((*I).size() != 1) {
341341 AnalyzeSCC(*I);
342342 } else if (Function *F = (*I)[0]->getFunction()) {
343 if (!F->isExternal()) {
343 if (!F->isDeclaration()) {
344344 // Nonexternal function.
345345 AnalyzeSCC(*I);
346346 } else {
163163 unsigned Counter = 0;
164164 for (Module::iterator I = M.begin(), E = M.end();
165165 I != E && Counter != FunctionCounts.size(); ++I)
166 if (!I->isExternal())
166 if (!I->isDeclaration())
167167 Counts.push_back(std::make_pair(I, FunctionCounts[Counter++]));
168168 }
169169
None /* A Bison parser, made by GNU Bison 2.3. */
1
2 /* Skeleton implementation for Bison's Yacc-like parsers in C
3
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5 Free Software Foundation, Inc.
0 /* A Bison parser, made by GNU Bison 2.1. */
1
2 /* Skeleton parser for Yacc-like parsing with Bison,
3 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
64
75 This program is free software; you can redistribute it and/or modify
86 it under the terms of the GNU General Public License as published by
1917 Foundation, Inc., 51 Franklin Street, Fifth Floor,
2018 Boston, MA 02110-1301, USA. */
2119
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
20 /* As a special exception, when this file is copied by Bison into a
21 Bison output file, you may use that output file without restriction.
22 This special exception was added by the Free Software Foundation
23 in version 1.24 of Bison. */
24
25 /* Written by Richard Stallman by simplifying the original so called
26 ``semantic'' parser. */
3727
3828 /* All symbols defined below should begin with yy or YY, to avoid
3929 infringing on user name space. This should be done even for local
4636 #define YYBISON 1
4737
4838 /* Bison version. */
49 #define YYBISON_VERSION "2.3"
39 #define YYBISON_VERSION "2.1"
5040
5141 /* Skeleton name. */
5242 #define YYSKELETON_NAME "yacc.c"
339329
340330
341331 /* Copy the first part of user declarations. */
342 #line 14 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
332 #line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
343333
344334 #include "ParserInternals.h"
345335 #include "llvm/CallingConv.h"
12291219 # define YYTOKEN_TABLE 0
12301220 #endif
12311221
1232 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1233 typedef union YYSTYPE
1234 #line 885 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
1235 {
1222 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1223 #line 885 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
1224 typedef union YYSTYPE {
12361225 llvm::Module *ModuleVal;
12371226 llvm::Function *FunctionVal;
12381227 llvm::BasicBlock *BasicBlockVal;
12761265 llvm::Instruction::OtherOps OtherOpVal;
12771266 llvm::ICmpInst::Predicate IPredicate;
12781267 llvm::FCmpInst::Predicate FPredicate;
1279 }
1280 /* Line 187 of yacc.c. */
1281 #line 1283 "llvmAsmParser.tab.c"
1282 YYSTYPE;
1268 } YYSTYPE;
1269 /* Line 196 of yacc.c. */
1270 #line 1272 "llvmAsmParser.tab.c"
12831271 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
12841272 # define YYSTYPE_IS_DECLARED 1
12851273 # define YYSTYPE_IS_TRIVIAL 1
12901278 /* Copy the second part of user declarations. */
12911279
12921280
1293 /* Line 216 of yacc.c. */
1294 #line 1296 "llvmAsmParser.tab.c"
1295
1296 #ifdef short
1297 # undef short
1281 /* Line 219 of yacc.c. */
1282 #line 1284 "llvmAsmParser.tab.c"
1283
1284 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1285 # define YYSIZE_T __SIZE_TYPE__
12981286 #endif
1299
1300 #ifdef YYTYPE_UINT8
1301 typedef YYTYPE_UINT8 yytype_uint8;
1302 #else
1303 typedef unsigned char yytype_uint8;
1287 #if ! defined (YYSIZE_T) && defined (size_t)
1288 # define YYSIZE_T size_t
13041289 #endif
1305
1306 #ifdef YYTYPE_INT8
1307 typedef YYTYPE_INT8 yytype_int8;
1308 #elif (defined __STDC__ || defined __C99__FUNC__ \
1309 || defined __cplusplus || defined _MSC_VER)
1310 typedef signed char yytype_int8;
1311 #else
1312 typedef short int yytype_int8;
1290 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1291 # include /* INFRINGES ON USER NAME SPACE */
1292 # define YYSIZE_T size_t
13131293 #endif
1314
1315 #ifdef YYTYPE_UINT16
1316 typedef YYTYPE_UINT16 yytype_uint16;
1317 #else
1318 typedef unsigned short int yytype_uint16;
1294 #if ! defined (YYSIZE_T)
1295 # define YYSIZE_T unsigned int
13191296 #endif
1320
1321 #ifdef YYTYPE_INT16
1322 typedef YYTYPE_INT16 yytype_int16;
1323 #else
1324 typedef short int yytype_int16;
1325 #endif
1326
1327 #ifndef YYSIZE_T
1328 # ifdef __SIZE_TYPE__
1329 # define YYSIZE_T __SIZE_TYPE__
1330 # elif defined size_t
1331 # define YYSIZE_T size_t
1332 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1333 || defined __cplusplus || defined _MSC_VER)
1334 # include /* INFRINGES ON USER NAME SPACE */
1335 # define YYSIZE_T size_t
1336 # else
1337 # define YYSIZE_T unsigned int
1338 # endif
1339 #endif
1340
1341 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
13421297
13431298 #ifndef YY_
13441299 # if YYENABLE_NLS
13521307 # endif
13531308 #endif
13541309
1355 /* Suppress unused-variable warnings by "using" E. */
1356 #if ! defined lint || defined __GNUC__
1357 # define YYUSE(e) ((void) (e))
1358 #else
1359 # define YYUSE(e) /* empty */
1360 #endif
1361
1362 /* Identity function, used to suppress warnings about constant conditions. */
1363 #ifndef lint
1364 # define YYID(n) (n)
1365 #else
1366 #if (defined __STDC__ || defined __C99__FUNC__ \
1367 || defined __cplusplus || defined _MSC_VER)
1368 static int
1369 YYID (int i)
1370 #else
1371 static int
1372 YYID (i)
1373 int i;
1374 #endif
1375 {
1376 return i;
1377 }
1378 #endif
1379
1380 #if ! defined yyoverflow || YYERROR_VERBOSE
1310 #if ! defined (yyoverflow) || YYERROR_VERBOSE
13811311
13821312 /* The parser invokes alloca or malloc; define the necessary symbols. */
13831313
13851315 # if YYSTACK_USE_ALLOCA
13861316 # ifdef __GNUC__
13871317 # define YYSTACK_ALLOC __builtin_alloca
1388 # elif defined __BUILTIN_VA_ARG_INCR
1389 # include /* INFRINGES ON USER NAME SPACE */
1390 # elif defined _AIX
1391 # define YYSTACK_ALLOC __alloca
1392 # elif defined _MSC_VER
1393 # include /* INFRINGES ON USER NAME SPACE */
1394 # define alloca _alloca
13951318 # else
13961319 # define YYSTACK_ALLOC alloca
1397 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1398 || defined __cplusplus || defined _MSC_VER)
1320 # if defined (__STDC__) || defined (__cplusplus)
13991321 # include /* INFRINGES ON USER NAME SPACE */
1400 # ifndef _STDLIB_H
1401 # define _STDLIB_H 1
1402 # endif
1322 # define YYINCLUDED_STDLIB_H
14031323 # endif
14041324 # endif
14051325 # endif
14061326 # endif
14071327
14081328 # ifdef YYSTACK_ALLOC
1409 /* Pacify GCC's `empty if-body' warning. */
1410 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1329 /* Pacify GCC's `empty if-body' warning. */
1330 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
14111331 # ifndef YYSTACK_ALLOC_MAXIMUM
14121332 /* The OS might guarantee only one guard page at the bottom of the stack,
14131333 and a page size can be as small as 4096 bytes. So we cannot safely
14141334 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
14151335 to allow for a few compiler-allocated temporary stack slots. */
1416 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1336 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
14171337 # endif
14181338 # else
14191339 # define YYSTACK_ALLOC YYMALLOC
14201340 # define YYSTACK_FREE YYFREE
14211341 # ifndef YYSTACK_ALLOC_MAXIMUM
1422 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1342 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
14231343 # endif
1424 # if (defined __cplusplus && ! defined _STDLIB_H \
1425 && ! ((defined YYMALLOC || defined malloc) \
1426 && (defined YYFREE || defined free)))
1427 # include /* INFRINGES ON USER NAME SPACE */
1428 # ifndef _STDLIB_H
1429 # define _STDLIB_H 1
1430 # endif
1344 # ifdef __cplusplus
1345 extern "C" {
14311346 # endif
14321347 # ifndef YYMALLOC
14331348 # define YYMALLOC malloc
1434 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1435 || defined __cplusplus || defined _MSC_VER)
1349 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1350 && (defined (__STDC__) || defined (__cplusplus)))
14361351 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
14371352 # endif
14381353 # endif
14391354 # ifndef YYFREE
14401355 # define YYFREE free
1441 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1442 || defined __cplusplus || defined _MSC_VER)
1356 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1357 && (defined (__STDC__) || defined (__cplusplus)))
14431358 void free (void *); /* INFRINGES ON USER NAME SPACE */
14441359 # endif
14451360 # endif
1361 # ifdef __cplusplus
1362 }
1363 # endif
14461364 # endif
1447 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1448
1449
1450 #if (! defined yyoverflow \
1451 && (! defined __cplusplus \
1452 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1365 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1366
1367
1368 #if (! defined (yyoverflow) \
1369 && (! defined (__cplusplus) \
1370 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
14531371
14541372 /* A type that is properly aligned for any stack member. */
14551373 union yyalloc
14561374 {
1457 yytype_int16 yyss;
1375 short int yyss;
14581376 YYSTYPE yyvs;
14591377 };
14601378
14641382 /* The size of an array large to enough to hold all stacks, each with
14651383 N elements. */
14661384 # define YYSTACK_BYTES(N) \
1467 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1385 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
14681386 + YYSTACK_GAP_MAXIMUM)
14691387
14701388 /* Copy COUNT objects from FROM to TO. The source and destination do
14711389 not overlap. */
14721390 # ifndef YYCOPY
1473 # if defined __GNUC__ && 1 < __GNUC__
1391 # if defined (__GNUC__) && 1 < __GNUC__
14741392 # define YYCOPY(To, From, Count) \
14751393 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
14761394 # else
14811399 for (yyi = 0; yyi < (Count); yyi++) \
14821400 (To)[yyi] = (From)[yyi]; \
14831401 } \
1484 while (YYID (0))
1402 while (0)
14851403 # endif
14861404 # endif
14871405
14991417 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
15001418 yyptr += yynewbytes / sizeof (*yyptr); \
15011419 } \
1502 while (YYID (0))
1420 while (0)
15031421
15041422 #endif
15051423
1506 /* YYFINAL -- State number of the termination state. */
1424 #if defined (__STDC__) || defined (__cplusplus)
1425 typedef signed char yysigned_char;
1426 #else
1427 typedef short int yysigned_char;
1428 #endif
1429
1430 /* YYFINAL -- State number of the termination state. */
15071431 #define YYFINAL 40
15081432 /* YYLAST -- Last index in YYTABLE. */
15091433 #define YYLAST 1466
15101434
1511 /* YYNTOKENS -- Number of terminals. */
1435 /* YYNTOKENS -- Number of terminals. */
15121436 #define YYNTOKENS 146
1513 /* YYNNTS -- Number of nonterminals. */
1437 /* YYNNTS -- Number of nonterminals. */
15141438 #define YYNNTS 79
1515 /* YYNRULES -- Number of rules. */
1439 /* YYNRULES -- Number of rules. */
15161440 #define YYNRULES 286
1517 /* YYNRULES -- Number of states. */
1441 /* YYNRULES -- Number of states. */
15181442 #define YYNSTATES 567
15191443
15201444 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
15251449 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
15261450
15271451 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1528 static const yytype_uint8 yytranslate[] =
1452 static const unsigned char yytranslate[] =
15291453 {
15301454 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
15311455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
15711495 #if YYDEBUG
15721496 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
15731497 YYRHS. */
1574 static const yytype_uint16 yyprhs[] =
1498 static const unsigned short int yyprhs[] =
15751499 {
15761500 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
15771501 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
16041528 875, 882, 886, 893, 896, 901, 908
16051529 };
16061530
1607 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1608 static const yytype_int16 yyrhs[] =
1531 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1532 static const short int yyrhs[] =
16091533 {
16101534 187, 0, -1, 66, -1, 67, -1, 68, -1, 69,
16111535 -1, 70, -1, 71, -1, 72, -1, 73, -1, 74,
17021626 };
17031627
17041628 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1705 static const yytype_uint16 yyrline[] =
1629 static const unsigned short int yyrline[] =
17061630 {
17071631 0, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031,
17081632 1031, 1032, 1032, 1032, 1033, 1033, 1033, 1033, 1033, 1033,
17381662
17391663 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
17401664 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1741 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1665 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
17421666 static const char *const yytname[] =
17431667 {
17441668 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL",
17861710 # ifdef YYPRINT
17871711 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
17881712 token YYLEX-NUM. */
1789 static const yytype_uint16 yytoknum[] =
1713 static const unsigned short int yytoknum[] =
17901714 {
17911715 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
17921716 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
18071731 # endif
18081732
18091733 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1810 static const yytype_uint8 yyr1[] =
1734 static const unsigned char yyr1[] =
18111735 {
18121736 0, 146, 147, 147, 147, 147, 147, 147, 147, 147,
18131737 147, 148, 148, 148, 149, 149, 149, 149, 149, 149,
18411765 };
18421766
18431767 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1844 static const yytype_uint8 yyr2[] =
1768 static const unsigned char yyr2[] =
18451769 {
18461770 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
18471771 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18771801 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
18781802 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
18791803 means the default is an error. */
1880 static const yytype_uint16 yydefact[] =
1804 static const unsigned short int yydefact[] =
18811805 {
18821806 67, 58, 64, 59, 65, 184, 181, 179, 0, 0,
18831807 0, 0, 0, 0, 76, 0, 67, 177, 78, 81,
19381862 0, 252, 0, 0, 251, 0, 248
19391863 };
19401864
1941 /* YYDEFGOTO[NTERM-NUM]. */
1942 static const yytype_int16 yydefgoto[] =
1865 /* YYDEFGOTO[NTERM-NUM]. */
1866 static const short int yydefgoto[] =
19431867 {
19441868 -1, 188, 189, 190, 191, 254, 271, 111, 112, 72,
19451869 494, 12, 73, 14, 37, 38, 39, 44, 50, 121,
19541878 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
19551879 STATE-NUM. */
19561880 #define YYPACT_NINF -386
1957 static const yytype_int16 yypact[] =
1881 static const short int yypact[] =
19581882 {
19591883 357, -386, -386, -386, -386, -386, -386, -386, 28, -112,
19601884 61, -51, 136, 27, 288, 172, 594, -386, 209, 93,
20161940 };
20171941
20181942 /* YYPGOTO[NTERM-NUM]. */
2019 static const yytype_int16 yypgoto[] =
1943 static const short int yypgoto[] =
20201944 {
20211945 -386, 398, 401, 407, 410, 327, 330, -204, -386, 0,
20221946 17, 453, 10, -386, -386, -386, 54, -386, -386, -175,
20331957 number is the opposite. If zero, do what YYDEFACT says.
20341958 If YYTABLE_NINF, syntax error. */
20351959 #define YYTABLE_NINF -177
2036 static const yytype_int16 yytable[] =
1960 static const short int yytable[] =
20371961 {
20381962 11, 75, 332, 299, 192, 281, 283, 381, 98, 398,
20391963 13, 114, 429, 398, 431, 298, 11, 375, 60, 61,
21842108 178, 179, 180, 219, 220, 221, 222
21852109 };
21862110
2187 static const yytype_int16 yycheck[] =
2111 static const short int yycheck[] =
21882112 {
21892113 0, 26, 241, 207, 113, 185, 186, 304, 4, 328,
21902114 0, 81, 9, 332, 9, 9, 16, 300, 5, 6,
23372261
23382262 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
23392263 symbol of state STATE-NUM. */
2340 static const yytype_uint8 yystos[] =
2264 static const unsigned char yystos[] =
23412265 {
23422266 0, 14, 15, 17, 18, 19, 25, 26, 44, 47,
23432267 51, 155, 157, 158, 159, 187, 188, 189, 191, 190,
24232347 yychar = (Token); \
24242348 yylval = (Value); \
24252349 yytoken = YYTRANSLATE (yychar); \
2426 YYPOPSTACK (1); \
2350 YYPOPSTACK; \
24272351 goto yybackup; \
24282352 } \
24292353 else \
24312355 yyerror (YY_("syntax error: cannot back up")); \
24322356 YYERROR; \
24332357 } \
2434 while (YYID (0))
2358 while (0)
24352359
24362360
24372361 #define YYTERROR 1
24462370 #ifndef YYLLOC_DEFAULT
24472371 # define YYLLOC_DEFAULT(Current, Rhs, N) \
24482372 do \
2449 if (YYID (N)) \
2373 if (N) \
24502374 { \
24512375 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
24522376 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
24602384 (Current).first_column = (Current).last_column = \
24612385 YYRHSLOC (Rhs, 0).last_column; \
24622386 } \
2463 while (YYID (0))
2387 while (0)
24642388 #endif
24652389
24662390
24722396 # if YYLTYPE_IS_TRIVIAL
24732397 # define YY_LOCATION_PRINT(File, Loc) \
24742398 fprintf (File, "%d.%d-%d.%d", \
2475 (Loc).first_line, (Loc).first_column, \
2476 (Loc).last_line, (Loc).last_column)
2399 (Loc).first_line, (Loc).first_column, \
2400 (Loc).last_line, (Loc).last_column)
24772401 # else
24782402 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
24792403 # endif
25002424 do { \
25012425 if (yydebug) \
25022426 YYFPRINTF Args; \
2503 } while (YYID (0))
2504
2505 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2506 do { \
2507 if (yydebug) \
2508 { \
2509 YYFPRINTF (stderr, "%s ", Title); \
2510 yy_symbol_print (stderr, \
2511 Type, Value); \
2512 YYFPRINTF (stderr, "\n"); \
2513 } \
2514 } while (YYID (0))
2515
2516
2517 /*--------------------------------.
2518 | Print this symbol on YYOUTPUT. |
2519 `--------------------------------*/
2520
2521 /*ARGSUSED*/
2522 #if (defined __STDC__ || defined __C99__FUNC__ \
2523 || defined __cplusplus || defined _MSC_VER)
2524 static void
2525 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2526 #else
2527 static void
2528 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2529 FILE *yyoutput;
2530 int yytype;
2531 YYSTYPE const * const yyvaluep;
2532 #endif
2533 {
2534 if (!yyvaluep)
2535 return;
2536 # ifdef YYPRINT
2537 if (yytype < YYNTOKENS)
2538 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2539 # else
2540 YYUSE (yyoutput);
2541 # endif
2542 switch (yytype)
2543 {
2544 default:
2545 break;
2546 }
2547 }
2548
2549
2550 /*--------------------------------.
2551 | Print this symbol on YYOUTPUT. |
2552 `--------------------------------*/
2553
2554 #if (defined __STDC__ || defined __C99__FUNC__ \
2555 || defined __cplusplus || defined _MSC_VER)
2556 static void
2557 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2558 #else
2559 static void
2560 yy_symbol_print (yyoutput, yytype, yyvaluep)
2561 FILE *yyoutput;
2562 int yytype;
2563 YYSTYPE const * const yyvaluep;
2564 #endif
2565 {
2566 if (yytype < YYNTOKENS)
2567 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2568 else
2569 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2570
2571 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2572 YYFPRINTF (yyoutput, ")");
2573 }
2427 } while (0)
2428
2429 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2430 do { \
2431 if (yydebug) \
2432 { \
2433 YYFPRINTF (stderr, "%s ", Title); \
2434 yysymprint (stderr, \
2435 Type, Value); \
2436 YYFPRINTF (stderr, "\n"); \
2437 } \
2438 } while (0)
25742439
25752440 /*------------------------------------------------------------------.
25762441 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
25772442 | TOP (included). |
25782443 `------------------------------------------------------------------*/
25792444
2580 #if (defined __STDC__ || defined __C99__FUNC__ \
2581 || defined __cplusplus || defined _MSC_VER)
2445 #if defined (__STDC__) || defined (__cplusplus)
25822446 static void
2583 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2447 yy_stack_print (short int *bottom, short int *top)
25842448 #else
25852449 static void
25862450 yy_stack_print (bottom, top)
2587 yytype_int16 *bottom;
2588 yytype_int16 *top;
2451 short int *bottom;
2452 short int *top;
25892453 #endif
25902454 {
25912455 YYFPRINTF (stderr, "Stack now");
2592 for (; bottom <= top; ++bottom)
2456 for (/* Nothing. */; bottom <= top; ++bottom)
25932457 YYFPRINTF (stderr, " %d", *bottom);
25942458 YYFPRINTF (stderr, "\n");
25952459 }
25982462 do { \
25992463 if (yydebug) \
26002464 yy_stack_print ((Bottom), (Top)); \
2601 } while (YYID (0))
2465 } while (0)
26022466
26032467
26042468 /*------------------------------------------------.
26052469 | Report that the YYRULE is going to be reduced. |
26062470 `------------------------------------------------*/
26072471
2608 #if (defined __STDC__ || defined __C99__FUNC__ \
2609 || defined __cplusplus || defined _MSC_VER)
2472 #if defined (__STDC__) || defined (__cplusplus)
26102473 static void
2611 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
2474 yy_reduce_print (int yyrule)
26122475 #else
26132476 static void
2614 yy_reduce_print (yyvsp, yyrule)
2615 YYSTYPE *yyvsp;
2477 yy_reduce_print (yyrule)
26162478 int yyrule;
26172479 #endif
26182480 {
2619 int yynrhs = yyr2[yyrule];
26202481 int yyi;
26212482 unsigned long int yylno = yyrline[yyrule];
2622 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2623 yyrule - 1, yylno);
2624 /* The symbols being reduced. */
2625 for (yyi = 0; yyi < yynrhs; yyi++)
2626 {
2627 fprintf (stderr, " $%d = ", yyi + 1);
2628 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2629 &(yyvsp[(yyi + 1) - (yynrhs)])
2630 );
2631 fprintf (stderr, "\n");
2632 }
2483 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2484 yyrule - 1, yylno);
2485 /* Print the symbols being reduced, and their result. */
2486 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2487 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2488 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
26332489 }
26342490
26352491 # define YY_REDUCE_PRINT(Rule) \
26362492 do { \
26372493 if (yydebug) \
2638 yy_reduce_print (yyvsp, Rule); \
2639 } while (YYID (0))
2494 yy_reduce_print (Rule); \
2495 } while (0)
26402496
26412497 /* Nonzero means print parse trace. It is left uninitialized so that
26422498 multiple parsers can coexist. */
26702526 #if YYERROR_VERBOSE
26712527
26722528 # ifndef yystrlen
2673 # if defined __GLIBC__ && defined _STRING_H
2529 # if defined (__GLIBC__) && defined (_STRING_H)
26742530 # define yystrlen strlen
26752531 # else
26762532 /* Return the length of YYSTR. */
2677 #if (defined __STDC__ || defined __C99__FUNC__ \
2678 || defined __cplusplus || defined _MSC_VER)
26792533 static YYSIZE_T
2534 # if defined (__STDC__) || defined (__cplusplus)
26802535 yystrlen (const char *yystr)
2681 #else
2682 static YYSIZE_T
2536 # else
26832537 yystrlen (yystr)
2684 const char *yystr;
2685 #endif
2538 const char *yystr;
2539 # endif
26862540 {
2687 YYSIZE_T yylen;
2688 for (yylen = 0; yystr[yylen]; yylen++)
2541 const char *yys = yystr;
2542
2543 while (*yys++ != '\0')
26892544 continue;
2690 return yylen;
2545
2546 return yys - yystr - 1;
26912547 }
26922548 # endif
26932549 # endif
26942550
26952551 # ifndef yystpcpy
2696 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2552 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
26972553 # define yystpcpy stpcpy
26982554 # else
26992555 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
27002556 YYDEST. */
2701 #if (defined __STDC__ || defined __C99__FUNC__ \
2702 || defined __cplusplus || defined _MSC_VER)
27032557 static char *
2558 # if defined (__STDC__) || defined (__cplusplus)
27042559 yystpcpy (char *yydest, const char *yysrc)
2705 #else
2706 static char *
2560 # else
27072561 yystpcpy (yydest, yysrc)
2708 char *yydest;
2709 const char *yysrc;
2710 #endif
2562 char *yydest;
2563 const char *yysrc;
2564 # endif
27112565 {
27122566 char *yyd = yydest;
27132567 const char *yys = yysrc;
27332587 {
27342588 if (*yystr == '"')
27352589 {
2736 YYSIZE_T yyn = 0;
2590 size_t yyn = 0;
27372591 char const *yyp = yystr;
27382592
27392593 for (;;)
27682622 }
27692623 # endif
27702624
2771 /* Copy into YYRESULT an error message about the unexpected token
2772 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2773 including the terminating null byte. If YYRESULT is null, do not
2774 copy anything; just return the number of bytes that would be
2775 copied. As a special case, return 0 if an ordinary "syntax error"
2776 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2777 size calculation. */
2778 static YYSIZE_T
2779 yysyntax_error (char *yyresult, int yystate, int yychar)
2625 #endif /* YYERROR_VERBOSE */
2626
2627
2628
2629 #if YYDEBUG
2630 /*--------------------------------.
2631 | Print this symbol on YYOUTPUT. |
2632 `--------------------------------*/
2633
2634 #if defined (__STDC__) || defined (__cplusplus)
2635 static void
2636 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2637 #else
2638 static void
2639 yysymprint (yyoutput, yytype, yyvaluep)
2640 FILE *yyoutput;
2641 int yytype;
2642 YYSTYPE *yyvaluep;
2643 #endif
27802644 {
2781 int yyn = yypact[yystate];
2782
2783 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
2784 return 0;
2645 /* Pacify ``unused variable'' warnings. */
2646 (void) yyvaluep;
2647
2648 if (yytype < YYNTOKENS)
2649 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
27852650 else
2786 {
2787 int yytype = YYTRANSLATE (yychar);
2788 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2789 YYSIZE_T yysize = yysize0;
2790 YYSIZE_T yysize1;
2791 int yysize_overflow = 0;
2792 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2793 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2794 int yyx;
2795
2796 # if 0
2797 /* This is so xgettext sees the translatable formats that are
2798 constructed on the fly. */
2799 YY_("syntax error, unexpected %s");
2800 YY_("syntax error, unexpected %s, expecting %s");
2801 YY_("syntax error, unexpected %s, expecting %s or %s");
2802 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2803 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2651 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2652
2653
2654 # ifdef YYPRINT
2655 if (yytype < YYNTOKENS)
2656 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
28042657 # endif
2805 char *yyfmt;
2806 char const *yyf;
2807 static char const yyunexpected[] = "syntax error, unexpected %s";
2808 static char const yyexpecting[] = ", expecting %s";
2809 static char const yyor[] = " or %s";
2810 char yyformat[sizeof yyunexpected
2811 + sizeof yyexpecting - 1
2812 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2813 * (sizeof yyor - 1))];
2814 char const *yyprefix = yyexpecting;
2815
2816 /* Start YYX at -YYN if negative to avoid negative indexes in
2817 YYCHECK. */
2818 int yyxbegin = yyn < 0 ? -yyn : 0;
2819
2820 /* Stay within bounds of both yycheck and yytname. */
2821 int yychecklim = YYLAST - yyn + 1;
2822 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2823 int yycount = 1;
2824
2825 yyarg[0] = yytname[yytype];
2826 yyfmt = yystpcpy (yyformat, yyunexpected);
2827
2828 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2829 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2830 {
2831 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2832 {
2833 yycount = 1;
2834 yysize = yysize0;
2835 yyformat[sizeof yyunexpected - 1] = '\0';
2836 break;
2837 }
2838 yyarg[yycount++] = yytname[yyx];
2839 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2840 yysize_overflow |= (yysize1 < yysize);
2841 yysize = yysize1;
2842 yyfmt = yystpcpy (yyfmt, yyprefix);
2843 yyprefix = yyor;
2844 }
2845
2846 yyf = YY_(yyformat);
2847 yysize1 = yysize + yystrlen (yyf);
2848 yysize_overflow |= (yysize1 < yysize);
2849 yysize = yysize1;
2850
2851 if (yysize_overflow)
2852 return YYSIZE_MAXIMUM;
2853
2854 if (yyresult)
2855 {
2856 /* Avoid sprintf, as that infringes on the user's name space.
2857 Don't have undefined behavior even if the translation
2858 produced a string with the wrong number of "%s"s. */
2859 char *yyp = yyresult;
2860 int yyi = 0;
2861 while ((*yyp = *yyf) != '\0')
2862 {
2863 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2864 {
2865 yyp += yytnamerr (yyp, yyarg[yyi++]);
2866 yyf += 2;
2867 }
2868 else
2869 {
2870 yyp++;
2871 yyf++;
2872 }
2873 }
2874 }
2875 return yysize;
2658 switch (yytype)
2659 {
2660 default:
2661 break;
28762662 }
2663 YYFPRINTF (yyoutput, ")");
28772664 }
2878 #endif /* YYERROR_VERBOSE */
2879
2880
2665
2666 #endif /* ! YYDEBUG */
28812667 /*-----------------------------------------------.
28822668 | Release the memory associated to this symbol. |
28832669 `-----------------------------------------------*/
28842670
2885 /*ARGSUSED*/
2886 #if (defined __STDC__ || defined __C99__FUNC__ \
2887 || defined __cplusplus || defined _MSC_VER)
2671 #if defined (__STDC__) || defined (__cplusplus)
28882672 static void
28892673 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
28902674 #else
28952679 YYSTYPE *yyvaluep;
28962680 #endif
28972681 {
2898 YYUSE (yyvaluep);
2682 /* Pacify ``unused variable'' warnings. */
2683 (void) yyvaluep;
28992684
29002685 if (!yymsg)
29012686 yymsg = "Deleting";
29052690 {
29062691
29072692 default:
2908 break;
2693 break;
29092694 }
29102695 }
29112696
29132698 /* Prevent warnings from -Wmissing-prototypes. */
29142699
29152700 #ifdef YYPARSE_PARAM
2916 #if defined __STDC__ || defined __cplusplus
2701 # if defined (__STDC__) || defined (__cplusplus)
29172702 int yyparse (void *YYPARSE_PARAM);
2918 #else
2703 # else
29192704 int yyparse ();
2920 #endif
2705 # endif
29212706 #else /* ! YYPARSE_PARAM */
2922 #if defined __STDC__ || defined __cplusplus
2707 #if defined (__STDC__) || defined (__cplusplus)
29232708 int yyparse (void);
29242709 #else
29252710 int yyparse ();
29442729 `----------*/
29452730
29462731 #ifdef YYPARSE_PARAM
2947 #if (defined __STDC__ || defined __C99__FUNC__ \
2948 || defined __cplusplus || defined _MSC_VER)
2949 int
2950 yyparse (void *YYPARSE_PARAM)
2951 #else
2952 int
2953 yyparse (YYPARSE_PARAM)
2954 void *YYPARSE_PARAM;
2955 #endif
2732 # if defined (__STDC__) || defined (__cplusplus)
2733 int yyparse (void *YYPARSE_PARAM)
2734 # else
2735 int yyparse (YYPARSE_PARAM)
2736 void *YYPARSE_PARAM;
2737 # endif
29562738 #else /* ! YYPARSE_PARAM */
2957 #if (defined __STDC__ || defined __C99__FUNC__ \
2958 || defined __cplusplus || defined _MSC_VER)
2739 #if defined (__STDC__) || defined (__cplusplus)
29592740 int
29602741 yyparse (void)
29612742 #else
29732754 int yyerrstatus;
29742755 /* Look-ahead token as an internal (translated) token number. */
29752756 int yytoken = 0;
2976 #if YYERROR_VERBOSE
2977 /* Buffer for error messages, and its allocated size. */
2978 char yymsgbuf[128];
2979 char *yymsg = yymsgbuf;
2980 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2981 #endif
29822757
29832758 /* Three stacks and their tools:
29842759 `yyss': related to states,
29892764 to reallocate them elsewhere. */
29902765
29912766 /* The state stack. */
2992 yytype_int16 yyssa[YYINITDEPTH];
2993 yytype_int16 *yyss = yyssa;
2994 yytype_int16 *yyssp;
2767 short int yyssa[YYINITDEPTH];
2768 short int *yyss = yyssa;
2769 short int *yyssp;
29952770
29962771 /* The semantic value stack. */
29972772 YYSTYPE yyvsa[YYINITDEPTH];
30002775
30012776
30022777
3003 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2778 #define YYPOPSTACK (yyvsp--, yyssp--)
30042779
30052780 YYSIZE_T yystacksize = YYINITDEPTH;
30062781
30092784 YYSTYPE yyval;
30102785
30112786
3012 /* The number of symbols on the RHS of the reduced rule.
3013 Keep to zero when no symbol should be popped. */
3014 int yylen = 0;
2787 /* When reducing, the number of symbols on the RHS of the reduced
2788 rule. */
2789 int yylen;
30152790
30162791 YYDPRINTF ((stderr, "Starting parse\n"));
30172792
30352810 `------------------------------------------------------------*/
30362811 yynewstate:
30372812 /* In all cases, when you get here, the value and location stacks
3038 have just been pushed. So pushing a state here evens the stacks. */
2813 have just been pushed. so pushing a state here evens the stacks.
2814 */
30392815 yyssp++;
30402816
30412817 yysetstate:
30482824
30492825 #ifdef yyoverflow
30502826 {
3051 /* Give user a chance to reallocate the stack. Use copies of
2827 /* Give user a chance to reallocate the stack. Use copies of
30522828 these so that the &'s don't force the real ones into
30532829 memory. */
30542830 YYSTYPE *yyvs1 = yyvs;
3055 yytype_int16 *yyss1 = yyss;
2831 short int *yyss1 = yyss;
30562832
30572833
30582834 /* Each stack pointer address is followed by the size of the
30802856 yystacksize = YYMAXDEPTH;
30812857
30822858 {
3083 yytype_int16 *yyss1 = yyss;
2859 short int *yyss1 = yyss;
30842860 union yyalloc *yyptr =
30852861 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
30862862 if (! yyptr)
31152891 `-----------*/
31162892 yybackup:
31172893
3118 /* Do appropriate processing given the current state. Read a
3119 look-ahead token if we need one and don't already have one. */
2894 /* Do appropriate processing given the current state. */
2895 /* Read a look-ahead token if we need one and don't already have one. */
2896 /* yyresume: */
31202897
31212898 /* First try to decide what to do without reference to look-ahead token. */
2899
31222900 yyn = yypact[yystate];
31232901 if (yyn == YYPACT_NINF)
31242902 goto yydefault;
31602938 if (yyn == YYFINAL)
31612939 YYACCEPT;
31622940
2941 /* Shift the look-ahead token. */
2942 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2943
2944 /* Discard the token being shifted unless it is eof. */
2945 if (yychar != YYEOF)
2946 yychar = YYEMPTY;
2947
2948 *++yyvsp = yylval;
2949
2950
31632951 /* Count tokens shifted since error; after three, turn off error
31642952 status. */
31652953 if (yyerrstatus)
31662954 yyerrstatus--;
31672955
3168 /* Shift the look-ahead token. */
3169 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3170
3171 /* Discard the shifted token unless it is eof. */
3172 if (yychar != YYEOF)
3173 yychar = YYEMPTY;
3174
31752956 yystate = yyn;
3176 *++yyvsp = yylval;
3177
31782957 goto yynewstate;
31792958
31802959
32102989 switch (yyn)
32112990 {
32122991 case 29:
3213 #line 1037 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
2992 #line 1037 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32142993 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
32152994 break;
32162995
32172996 case 30:
3218 #line 1037 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
2997 #line 1037 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32192998 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
32202999 break;
32213000
32223001 case 31:
3223 #line 1038 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3002 #line 1038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32243003 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
32253004 break;
32263005
32273006 case 32:
3228 #line 1038 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3007 #line 1038 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32293008 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
32303009 break;
32313010
32323011 case 33:
3233 #line 1039 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3012 #line 1039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32343013 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
32353014 break;
32363015
32373016 case 34:
3238 #line 1039 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3017 #line 1039 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32393018 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
32403019 break;
32413020
32423021 case 35:
3243 #line 1040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3022 #line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32443023 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
32453024 break;
32463025
32473026 case 36:
3248 #line 1040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3027 #line 1040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32493028 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
32503029 break;
32513030
32523031 case 37:
3253 #line 1041 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3032 #line 1041 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32543033 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
32553034 break;
32563035
32573036 case 38:
3258 #line 1041 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3037 #line 1041 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32593038 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
32603039 break;
32613040
32623041 case 39:
3263 #line 1045 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3042 #line 1045 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32643043 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
32653044 break;
32663045
32673046 case 40:
3268 #line 1045 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3047 #line 1045 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32693048 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
32703049 break;
32713050
32723051 case 41:
3273 #line 1046 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3052 #line 1046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32743053 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
32753054 break;
32763055
32773056 case 42:
3278 #line 1046 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3057 #line 1046 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32793058 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
32803059 break;
32813060
32823061 case 43:
3283 #line 1047 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3062 #line 1047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32843063 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
32853064 break;
32863065
32873066 case 44:
3288 #line 1047 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3067 #line 1047 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32893068 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
32903069 break;
32913070
32923071 case 45:
3293 #line 1048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3072 #line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32943073 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
32953074 break;
32963075
32973076 case 46:
3298 #line 1048 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3077 #line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
32993078 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
33003079 break;
33013080
33023081 case 47:
3303 #line 1049 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3082 #line 1049 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33043083 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
33053084 break;
33063085
33073086 case 48:
3308 #line 1049 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3087 #line 1049 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33093088 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
33103089 break;
33113090
33123091 case 49:
3313 #line 1050 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3092 #line 1050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33143093 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
33153094 break;
33163095
33173096 case 50:
3318 #line 1050 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3097 #line 1050 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33193098 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
33203099 break;
33213100
33223101 case 51:
3323 #line 1051 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3102 #line 1051 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33243103 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
33253104 break;
33263105
33273106 case 52:
3328 #line 1051 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3107 #line 1051 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33293108 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
33303109 break;
33313110
33323111 case 53:
3333 #line 1052 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3112 #line 1052 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33343113 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
33353114 break;
33363115
33373116 case 54:
3338 #line 1053 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3117 #line 1053 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33393118 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
33403119 break;
33413120
33423121 case 61:
3343 #line 1062 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3122 #line 1062 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33443123 { (yyval.StrVal) = 0; ;}
33453124 break;
33463125
33473126 case 62:
3348 #line 1066 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3349 {
3350 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3127 #line 1066 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3128 {
3129 (yyval.StrVal) = (yyvsp[-1].StrVal);
33513130 CHECK_FOR_ERROR
33523131 ;}
33533132 break;
33543133
33553134 case 63:
3356 #line 1070 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3135 #line 1070 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33573136 {
33583137 (yyval.StrVal) = 0;
33593138 CHECK_FOR_ERROR
33613140 break;
33623141
33633142 case 66:
3364 #line 1077 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3365 {
3366 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3143 #line 1077 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3144 {
3145 (yyval.StrVal) = (yyvsp[-1].StrVal);
33673146 CHECK_FOR_ERROR
33683147 ;}
33693148 break;
33703149
33713150 case 67:
3372 #line 1081 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3151 #line 1081 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33733152 {
33743153 (yyval.StrVal) = 0;
33753154 CHECK_FOR_ERROR
33773156 break;
33783157
33793158 case 68:
3380 #line 1087 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3159 #line 1087 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33813160 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
33823161 break;
33833162
33843163 case 69:
3385 #line 1088 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3164 #line 1088 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33863165 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
33873166 break;
33883167
33893168 case 70:
3390 #line 1089 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3169 #line 1089 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33913170 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
33923171 break;
33933172
33943173 case 71:
3395 #line 1090 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3174 #line 1090 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
33963175 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
33973176 break;
33983177
33993178 case 72:
3400 #line 1091 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3179 #line 1091 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34013180 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
34023181 break;
34033182
34043183 case 73:
3405 #line 1095 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3184 #line 1095 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34063185 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
34073186 break;
34083187
34093188 case 74:
3410 #line 1096 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3189 #line 1096 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34113190 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
34123191 break;
34133192
34143193 case 75:
3415 #line 1097 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3194 #line 1097 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34163195 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
34173196 break;
34183197
34193198 case 76:
3420 #line 1101 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3199 #line 1101 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34213200 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
34223201 break;
34233202
34243203 case 77:
3425 #line 1102 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3204 #line 1102 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34263205 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
34273206 break;
34283207
34293208 case 78:
3430 #line 1106 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3209 #line 1106 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34313210 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
34323211 break;
34333212
34343213 case 79:
3435 #line 1107 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3214 #line 1107 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34363215 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
34373216 break;
34383217
34393218 case 80:
3440 #line 1108 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3219 #line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34413220 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
34423221 break;
34433222
34443223 case 81:
3445 #line 1112 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3224 #line 1112 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34463225 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
34473226 break;
34483227
34493228 case 82:
3450 #line 1113 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3229 #line 1113 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34513230 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
34523231 break;
34533232
34543233 case 83:
3455 #line 1114 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3234 #line 1114 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34563235 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
34573236 break;
34583237
34593238 case 84:
3460 #line 1115 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3239 #line 1115 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34613240 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
34623241 break;
34633242
34643243 case 85:
3465 #line 1116 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3244 #line 1116 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34663245 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
34673246 break;
34683247
34693248 case 86:
3470 #line 1119 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3249 #line 1119 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34713250 { (yyval.UIntVal) = CallingConv::C; ;}
34723251 break;
34733252
34743253 case 87:
3475 #line 1120 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3254 #line 1120 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34763255 { (yyval.UIntVal) = CallingConv::C; ;}
34773256 break;
34783257
34793258 case 88:
3480 #line 1121 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3259 #line 1121 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34813260 { (yyval.UIntVal) = CallingConv::Fast; ;}
34823261 break;
34833262
34843263 case 89:
3485 #line 1122 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3264 #line 1122 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34863265 { (yyval.UIntVal) = CallingConv::Cold; ;}
34873266 break;
34883267
34893268 case 90:
3490 #line 1123 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3269 #line 1123 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34913270 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
34923271 break;
34933272
34943273 case 91:
3495 #line 1124 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3274 #line 1124 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
34963275 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
34973276 break;
34983277
34993278 case 92:
3500 #line 1125 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3501 {
3502 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3279 #line 1125 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3280 {
3281 if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val))
35033282 GEN_ERROR("Calling conv too large!");
3504 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3283 (yyval.UIntVal) = (yyvsp[0].UInt64Val);
35053284 CHECK_FOR_ERROR
35063285 ;}
35073286 break;
35083287
35093288 case 93:
3510 #line 1132 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3289 #line 1132 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35113290 { (yyval.ParamAttrs) = FunctionType::ZExtAttribute; ;}
35123291 break;
35133292
35143293 case 94:
3515 #line 1133 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3294 #line 1133 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35163295 { (yyval.ParamAttrs) = FunctionType::SExtAttribute; ;}
35173296 break;
35183297
35193298 case 95:
3520 #line 1134 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3299 #line 1134 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35213300 { (yyval.ParamAttrs) = FunctionType::InRegAttribute; ;}
35223301 break;
35233302
35243303 case 96:
3525 #line 1135 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3304 #line 1135 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35263305 { (yyval.ParamAttrs) = FunctionType::StructRetAttribute; ;}
35273306 break;
35283307
35293308 case 97:
3530 #line 1138 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3309 #line 1138 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35313310 { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;}
35323311 break;
35333312
35343313 case 98:
3535 #line 1139 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3536 {
3537 (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs));
3314 #line 1139 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3315 {
3316 (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs));
35383317 ;}
35393318 break;
35403319
35413320 case 99:
3542 #line 1144 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3321 #line 1144 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35433322 { (yyval.ParamAttrs) = FunctionType::NoReturnAttribute; ;}
35443323 break;
35453324
35463325 case 101:
3547 #line 1148 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3326 #line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35483327 { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;}
35493328 break;
35503329
35513330 case 102:
3552 #line 1149 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3553 {
3554 (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs));
3331 #line 1149 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3332 {
3333 (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[-1].ParamAttrs) | (yyvsp[0].ParamAttrs));
35553334 ;}
35563335 break;
35573336
35583337 case 103:
3559 #line 1156 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3338 #line 1156 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35603339 { (yyval.UIntVal) = 0; ;}
35613340 break;
35623341
35633342 case 104:
3564 #line 1157 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3565 {
3566 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3343 #line 1157 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3344 {
3345 (yyval.UIntVal) = (yyvsp[0].UInt64Val);
35673346 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
35683347 GEN_ERROR("Alignment must be a power of two!");
35693348 CHECK_FOR_ERROR
35713350 break;
35723351
35733352 case 105:
3574 #line 1163 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3353 #line 1163 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
35753354 { (yyval.UIntVal) = 0; ;}
35763355 break;
35773356
35783357 case 106:
3579 #line 1164 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3580 {
3581 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
3358 #line 1164 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3359 {
3360 (yyval.UIntVal) = (yyvsp[0].UInt64Val);
35823361 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
35833362 GEN_ERROR("Alignment must be a power of two!");
35843363 CHECK_FOR_ERROR
35863365 break;
35873366
35883367 case 107:
3589 #line 1172 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3590 {
3591 for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i)
3592 if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\')
3368 #line 1172 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3369 {
3370 for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i)
3371 if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\')
35933372 GEN_ERROR("Invalid character in section name!");
3594 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3373 (yyval.StrVal) = (yyvsp[0].StrVal);
35953374 CHECK_FOR_ERROR
35963375 ;}
35973376 break;
35983377
35993378 case 108:
3600 #line 1180 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3379 #line 1180 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36013380 { (yyval.StrVal) = 0; ;}
36023381 break;
36033382
36043383 case 109:
3605 #line 1181 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3606 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
3384 #line 1181 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3385 { (yyval.StrVal) = (yyvsp[0].StrVal); ;}
36073386 break;
36083387
36093388 case 110:
3610 #line 1186 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3389 #line 1186 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36113390 {;}
36123391 break;
36133392
36143393 case 111:
3615 #line 1187 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3394 #line 1187 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36163395 {;}
36173396 break;
36183397
36193398 case 112:
3620 #line 1188 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3621 {
3622 CurGV->setSection((yyvsp[(1) - (1)].StrVal));
3623 free((yyvsp[(1) - (1)].StrVal));
3399 #line 1188 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3400 {
3401 CurGV->setSection((yyvsp[0].StrVal));
3402 free((yyvsp[0].StrVal));
36243403 CHECK_FOR_ERROR
36253404 ;}
36263405 break;
36273406
36283407 case 113:
3629 #line 1193 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3630 {
3631 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
3408 #line 1193 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3409 {
3410 if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val)))
36323411 GEN_ERROR("Alignment must be a power of two!");
3633 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
3412 CurGV->setAlignment((yyvsp[0].UInt64Val));
36343413 CHECK_FOR_ERROR
36353414 ;}
36363415 break;
36373416
36383417 case 118:
3639 #line 1209 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3418 #line 1209 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36403419 {
36413420 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
36423421 CHECK_FOR_ERROR
36443423 break;
36453424
36463425 case 119:
3647 #line 1213 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3648 {
3649 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
3426 #line 1213 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3427 {
3428 (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType));
36503429 CHECK_FOR_ERROR
36513430 ;}
36523431 break;
36533432
36543433 case 120:
3655 #line 1217 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3434 #line 1217 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36563435 { // Pointer type?
3657 if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy)
3436 if (*(yyvsp[-1].TypeVal) == Type::LabelTy)
36583437 GEN_ERROR("Cannot form a pointer to a basic block");
3659 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal))));
3660 delete (yyvsp[(1) - (2)].TypeVal);
3438 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal))));
3439 delete (yyvsp[-1].TypeVal);
36613440 CHECK_FOR_ERROR
36623441 ;}
36633442 break;
36643443
36653444 case 121:
3666 #line 1224 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3445 #line 1224 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36673446 { // Named types are also simple types...
3668 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
3447 const Type* tmp = getTypeVal((yyvsp[0].ValIDVal));
36693448 CHECK_FOR_ERROR
36703449 (yyval.TypeVal) = new PATypeHolder(tmp);
36713450 ;}
36723451 break;
36733452
36743453 case 122:
3675 #line 1229 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3454 #line 1229 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36763455 { // Type UpReference
3677 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!");
3456 if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!");
36783457 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
3679 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
3458 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector...
36803459 (yyval.TypeVal) = new PATypeHolder(OT);
36813460 UR_OUT("New Upreference!\n");
36823461 CHECK_FOR_ERROR
36843463 break;
36853464
36863465 case 123:
3687 #line 1237 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3466 #line 1237 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
36883467 {
36893468 std::vector Params;
36903469 std::vector Attrs;
3691 Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs));
3692 for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) {
3470 Attrs.push_back((yyvsp[0].ParamAttrs));
3471 for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) {
36933472 Params.push_back(I->Ty->get());
36943473 if (I->Ty->get() != Type::VoidTy)
36953474 Attrs.push_back(I->Attrs);
36973476 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
36983477 if (isVarArg) Params.pop_back();
36993478
3700 FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, Attrs);
3701 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
3702 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
3479 FunctionType *FT = FunctionType::get(*(yyvsp[-4].TypeVal), Params, isVarArg, Attrs);
3480 delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list
3481 delete (yyvsp[-4].TypeVal); // Delete the return type handle
37033482 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
37043483 CHECK_FOR_ERROR
37053484 ;}
37063485 break;
37073486
37083487 case 124:
3709 #line 1255 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3488 #line 1255 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37103489 {
37113490 std::vector Params;
37123491 std::vector Attrs;
3713 Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs));
3714 for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) {
3492 Attrs.push_back((yyvsp[0].ParamAttrs));
3493 for (TypeWithAttrsList::iterator I=(yyvsp[-2].TypeWithAttrsList)->begin(), E=(yyvsp[-2].TypeWithAttrsList)->end(); I != E; ++I) {
37153494 Params.push_back(I->Ty->get());
37163495 if (I->Ty->get() != Type::VoidTy)
37173496 Attrs.push_back(I->Attrs);
37193498 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
37203499 if (isVarArg) Params.pop_back();
37213500
3722 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, Attrs);
3723 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
3501 FunctionType *FT = FunctionType::get((yyvsp[-4].PrimType), Params, isVarArg, Attrs);
3502 delete (yyvsp[-2].TypeWithAttrsList); // Delete the argument list
37243503 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
37253504 CHECK_FOR_ERROR
37263505 ;}
37273506 break;
37283507
37293508 case 125:
3730 #line 1273 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3509 #line 1273 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37313510 { // Sized array type?
3732 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
3733 delete (yyvsp[(4) - (5)].TypeVal);
3511 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val))));
3512 delete (yyvsp[-1].TypeVal);
37343513 CHECK_FOR_ERROR
37353514 ;}
37363515 break;
37373516
37383517 case 126:
3739 #line 1278 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3518 #line 1278 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37403519 { // Packed array type?
3741 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
3742 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
3520 const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get();
3521 if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val))
37433522 GEN_ERROR("Unsigned result not equal to signed result");
37443523 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
37453524 GEN_ERROR("Element type of a PackedType must be primitive");
3746 if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val)))
3525 if (!isPowerOf2_32((yyvsp[-3].UInt64Val)))
37473526 GEN_ERROR("Vector length should be a power of 2!");
3748 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
3749 delete (yyvsp[(4) - (5)].TypeVal);
3527 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val))));
3528 delete (yyvsp[-1].TypeVal);
37503529 CHECK_FOR_ERROR
37513530 ;}
37523531 break;
37533532
37543533 case 127:
3755 #line 1290 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3534 #line 1290 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37563535 { // Structure type?
37573536 std::vector Elements;
3758 for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
3759 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
3537 for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(),
3538 E = (yyvsp[-1].TypeList)->end(); I != E; ++I)
37603539 Elements.push_back(*I);
37613540
37623541 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
3763 delete (yyvsp[(2) - (3)].TypeList);
3542 delete (yyvsp[-1].TypeList);
37643543 CHECK_FOR_ERROR
37653544 ;}
37663545 break;
37673546
37683547 case 128:
3769 #line 1300 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3548 #line 1300 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37703549 { // Empty structure type?
37713550 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector()));
37723551 CHECK_FOR_ERROR
37743553 break;
37753554
37763555 case 129:
3777 #line 1304 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3556 #line 1304 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37783557 {
37793558 std::vector Elements;
3780 for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
3781 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
3559 for (std::list::iterator I = (yyvsp[-2].TypeList)->begin(),
3560 E = (yyvsp[-2].TypeList)->end(); I != E; ++I)
37823561 Elements.push_back(*I);
37833562
37843563 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
3785 delete (yyvsp[(3) - (5)].TypeList);
3564 delete (yyvsp[-2].TypeList);
37863565 CHECK_FOR_ERROR
37873566 ;}
37883567 break;
37893568
37903569 case 130:
3791 #line 1314 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3570 #line 1314 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
37923571 { // Empty structure type?
37933572 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true));
37943573 CHECK_FOR_ERROR
37963575 break;
37973576
37983577 case 131:
3799 #line 1321 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3578 #line 1321 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38003579 {
3801 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
3802 (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs);
3580 (yyval.TypeWithAttrs).Ty = (yyvsp[-1].TypeVal);
3581 (yyval.TypeWithAttrs).Attrs = (yyvsp[0].ParamAttrs);
38033582 ;}
38043583 break;
38053584
38063585 case 132:
3807 #line 1328 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3586 #line 1328 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38083587 {
38093588 if (!UpRefs.empty())
3810 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
3811 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType())
3589 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription());
3590 if (!(*(yyvsp[0].TypeVal))->isFirstClassType())
38123591 GEN_ERROR("LLVM functions cannot return aggregate types!");
3813 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
3592 (yyval.TypeVal) = (yyvsp[0].TypeVal);
38143593 ;}
38153594 break;
38163595
38173596 case 133:
3818 #line 1335 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3597 #line 1335 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38193598 {
38203599 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
38213600 ;}
38223601 break;
38233602
38243603 case 134:
3825 #line 1340 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3604 #line 1340 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38263605 {
38273606 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
3828 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
3607 (yyval.TypeWithAttrsList)->push_back((yyvsp[0].TypeWithAttrs));
38293608 CHECK_FOR_ERROR
38303609 ;}
38313610 break;
38323611
38333612 case 135:
3834 #line 1345 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3835 {
3836 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
3613 #line 1345 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3614 {
3615 ((yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList))->push_back((yyvsp[0].TypeWithAttrs));
38373616 CHECK_FOR_ERROR
38383617 ;}
38393618 break;
38403619
38413620 case 137:
3842 #line 1353 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3843 {
3844 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
3621 #line 1353 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3622 {
3623 (yyval.TypeWithAttrsList)=(yyvsp[-2].TypeWithAttrsList);
38453624 TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet;
38463625 TWA.Ty = new PATypeHolder(Type::VoidTy);
38473626 (yyval.TypeWithAttrsList)->push_back(TWA);
38503629 break;
38513630
38523631 case 138:
3853 #line 1360 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3632 #line 1360 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38543633 {
38553634 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
38563635 TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet;
38613640 break;
38623641
38633642 case 139:
3864 #line 1367 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3643 #line 1367 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38653644 {
38663645 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
38673646 CHECK_FOR_ERROR
38693648 break;
38703649
38713650 case 140:
3872 #line 1375 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3651 #line 1375 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38733652 {
38743653 (yyval.TypeList) = new std::list();
3875 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); delete (yyvsp[(1) - (1)].TypeVal);
3654 (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal);
38763655 CHECK_FOR_ERROR
38773656 ;}
38783657 break;
38793658
38803659 case 141:
3881 #line 1380 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3882 {
3883 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal);
3660 #line 1380 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3661 {
3662 ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal);
38843663 CHECK_FOR_ERROR
38853664 ;}
38863665 break;
38873666
38883667 case 142:
3889 #line 1391 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3668 #line 1391 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
38903669 { // Nonempty unsized arr
38913670 if (!UpRefs.empty())
3892 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
3893 const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
3671 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription());
3672 const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get());
38943673 if (ATy == 0)
38953674 GEN_ERROR("Cannot make array constant with type: '" +
3896 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'!");
3675 (*(yyvsp[-3].TypeVal))->getDescription() + "'!");
38973676 const Type *ETy = ATy->getElementType();
38983677 int NumElements = ATy->getNumElements();
38993678
39003679 // Verify that we have the correct size...
3901 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
3680 if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size())
39023681 GEN_ERROR("Type mismatch: constant sized array initialized with " +
3903 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
3682 utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " +
39043683 itostr(NumElements) + "!");
39053684
39063685 // Verify all elements are correct type!
3907 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
3908 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
3686 for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) {
3687 if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType())
39093688 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
39103689 ETy->getDescription() +"' as required!\nIt is of type '"+
3911 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
3690 (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'.");
39123691 }
39133692
3914 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
3915 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
3693 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector));
3694 delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector);
39163695 CHECK_FOR_ERROR
39173696 ;}
39183697 break;
39193698
39203699 case 143:
3921 #line 1419 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3700 #line 1419 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
39223701 {
39233702 if (!UpRefs.empty())
3924 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
3925 const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get());
3703 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription());
3704 const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get());
39263705 if (ATy == 0)
39273706 GEN_ERROR("Cannot make array constant with type: '" +
3928 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'!");
3707 (*(yyvsp[-2].TypeVal))->getDescription() + "'!");
39293708
39303709 int NumElements = ATy->getNumElements();
39313710 if (NumElements != -1 && NumElements != 0)
39323711 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
39333712 " arguments, but has size of " + itostr(NumElements) +"!");
39343713 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector());
3935 delete (yyvsp[(1) - (3)].TypeVal);
3714 delete (yyvsp[-2].TypeVal);
39363715 CHECK_FOR_ERROR
39373716 ;}
39383717 break;
39393718
39403719 case 144:
3941 #line 1435 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3720 #line 1435 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
39423721 {
39433722 if (!UpRefs.empty())
3944 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
3945 const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get());
3723 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription());
3724 const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get());
39463725 if (ATy == 0)
39473726 GEN_ERROR("Cannot make array constant with type: '" +
3948 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'!");
3727 (*(yyvsp[-2].TypeVal))->getDescription() + "'!");
39493728
39503729 int NumElements = ATy->getNumElements();
39513730 const Type *ETy = ATy->getElementType();
3952 char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true);
3953 if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal)))
3731 char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true);
3732 if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal)))
39543733 GEN_ERROR("Can't build string constant of size " +
3955 itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) +
3734 itostr((int)(EndStr-(yyvsp[0].StrVal))) +
39563735 " when array has size " + itostr(NumElements) + "!");
39573736 std::vector Vals;
39583737 if (ETy == Type::Int8Ty) {
3959 for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal);
3738 for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal);
39603739 C != (unsigned char*)EndStr; ++C)
39613740 Vals.push_back(ConstantInt::get(ETy, *C));
39623741 } else {
3963 free((yyvsp[(3) - (3)].StrVal));
3742 free((yyvsp[0].StrVal));
39643743 GEN_ERROR("Cannot build string arrays of non byte sized elements!");
39653744 }
3966 free((yyvsp[(3) - (3)].StrVal));
3745 free((yyvsp[0].StrVal));
39673746 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
3968 delete (yyvsp[(1) - (3)].TypeVal);
3747 delete (yyvsp[-2].TypeVal);
39693748 CHECK_FOR_ERROR
39703749 ;}
39713750 break;
39723751
39733752 case 145:
3974 #line 1464 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3753 #line 1464 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
39753754 { // Nonempty unsized arr
39763755 if (!UpRefs.empty())
3977 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
3978 const PackedType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
3756 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-3].TypeVal))->getDescription());
3757 const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get());
39793758 if (PTy == 0)
39803759 GEN_ERROR("Cannot make packed constant with type: '" +
3981 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'!");
3760 (*(yyvsp[-3].TypeVal))->getDescription() + "'!");
39823761 const Type *ETy = PTy->getElementType();
39833762 int NumElements = PTy->getNumElements();
39843763
39853764 // Verify that we have the correct size...
3986 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
3765 if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size())
39873766 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
3988 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
3767 utostr((yyvsp[-1].ConstVector)->size()) + " arguments, but has size of " +
39893768 itostr(NumElements) + "!");
39903769
39913770 // Verify all elements are correct type!
3992 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
3993 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
3771 for (unsigned i = 0; i < (yyvsp[-1].ConstVector)->size(); i++) {
3772 if (ETy != (*(yyvsp[-1].ConstVector))[i]->getType())
39943773 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
39953774 ETy->getDescription() +"' as required!\nIt is of type '"+
3996 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
3775 (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'.");
39973776 }
39983777
3999 (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4000 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
3778 (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector));
3779 delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector);
40013780 CHECK_FOR_ERROR
40023781 ;}
40033782 break;
40043783
40053784 case 146:
4006 #line 1492 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4007 {
4008 const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
3785 #line 1492 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3786 {
3787 const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get());
40093788 if (STy == 0)
40103789 GEN_ERROR("Cannot make struct constant with type: '" +
4011 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'!");
4012
4013 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
3790 (*(yyvsp[-3].TypeVal))->getDescription() + "'!");
3791
3792 if ((yyvsp[-1].ConstVector)->size() != STy->getNumContainedTypes())
40143793 GEN_ERROR("Illegal number of initializers for structure type!");
40153794
40163795 // Check to ensure that constants are compatible with the type initializer!
4017 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4018 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
3796 for (unsigned i = 0, e = (yyvsp[-1].ConstVector)->size(); i != e; ++i)
3797 if ((*(yyvsp[-1].ConstVector))[i]->getType() != STy->getElementType(i))
40193798 GEN_ERROR("Expected type '" +
40203799 STy->getElementType(i)->getDescription() +
40213800 "' for element #" + utostr(i) +
40253804 if (STy->isPacked())
40263805 GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'");
40273806
4028 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4029 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
3807 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector));
3808 delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector);
40303809 CHECK_FOR_ERROR
40313810 ;}
40323811 break;
40333812
40343813 case 147:
4035 #line 1517 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3814 #line 1517 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
40363815 {
40373816 if (!UpRefs.empty())
4038 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4039 const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get());
3817 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription());
3818 const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get());
40403819 if (STy == 0)
40413820 GEN_ERROR("Cannot make struct constant with type: '" +
4042 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'!");
3821 (*(yyvsp[-2].TypeVal))->getDescription() + "'!");
40433822
40443823 if (STy->getNumContainedTypes() != 0)
40453824 GEN_ERROR("Illegal number of initializers for structure type!");
40493828 GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'");
40503829
40513830 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector());
4052 delete (yyvsp[(1) - (3)].TypeVal);
3831 delete (yyvsp[-2].TypeVal);
40533832 CHECK_FOR_ERROR
40543833 ;}
40553834 break;
40563835
40573836 case 148:
4058 #line 1536 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4059 {
4060 const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get());
3837 #line 1536 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3838 {
3839 const StructType *STy = dyn_cast((yyvsp[-5].TypeVal)->get());
40613840 if (STy == 0)
40623841 GEN_ERROR("Cannot make struct constant with type: '" +
4063 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'!");
4064
4065 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
3842 (*(yyvsp[-5].TypeVal))->getDescription() + "'!");
3843
3844 if ((yyvsp[-2].ConstVector)->size() != STy->getNumContainedTypes())
40663845 GEN_ERROR("Illegal number of initializers for structure type!");
40673846
40683847 // Check to ensure that constants are compatible with the type initializer!
4069 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4070 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
3848 for (unsigned i = 0, e = (yyvsp[-2].ConstVector)->size(); i != e; ++i)
3849 if ((*(yyvsp[-2].ConstVector))[i]->getType() != STy->getElementType(i))
40713850 GEN_ERROR("Expected type '" +
40723851 STy->getElementType(i)->getDescription() +
40733852 "' for element #" + utostr(i) +
40773856 if (!STy->isPacked())
40783857 GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'");
40793858
4080 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4081 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
3859 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-2].ConstVector));
3860 delete (yyvsp[-5].TypeVal); delete (yyvsp[-2].ConstVector);
40823861 CHECK_FOR_ERROR
40833862 ;}
40843863 break;
40853864
40863865 case 149:
4087 #line 1561 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3866 #line 1561 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
40883867 {
40893868 if (!UpRefs.empty())
4090 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4091 const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get());
3869 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-4].TypeVal))->getDescription());
3870 const StructType *STy = dyn_cast((yyvsp[-4].TypeVal)->get());
40923871 if (STy == 0)
40933872 GEN_ERROR("Cannot make struct constant with type: '" +
4094 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'!");
3873 (*(yyvsp[-4].TypeVal))->getDescription() + "'!");
40953874
40963875 if (STy->getNumContainedTypes() != 0)
40973876 GEN_ERROR("Illegal number of initializers for structure type!");
41013880 GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'");
41023881
41033882 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector());
4104 delete (yyvsp[(1) - (5)].TypeVal);
3883 delete (yyvsp[-4].TypeVal);
41053884 CHECK_FOR_ERROR
41063885 ;}
41073886 break;
41083887
41093888 case 150:
4110 #line 1580 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3889 #line 1580 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
41113890 {
41123891 if (!UpRefs.empty())
4113 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4114 const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get());
3892 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription());
3893 const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get());
41153894 if (PTy == 0)
41163895 GEN_ERROR("Cannot make null pointer constant with type: '" +
4117 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'!");
3896 (*(yyvsp[-1].TypeVal))->getDescription() + "'!");
41183897
41193898 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4120 delete (yyvsp[(1) - (2)].TypeVal);
3899 delete (yyvsp[-1].TypeVal);
41213900 CHECK_FOR_ERROR
41223901 ;}
41233902 break;
41243903
41253904 case 151:
4126 #line 1592 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3905 #line 1592 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
41273906 {
41283907 if (!UpRefs.empty())
4129 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4130 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4131 delete (yyvsp[(1) - (2)].TypeVal);
3908 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription());
3909 (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get());
3910 delete (yyvsp[-1].TypeVal);
41323911 CHECK_FOR_ERROR
41333912 ;}
41343913 break;
41353914
41363915 case 152:
4137 #line 1599 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3916 #line 1599 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
41383917 {
41393918 if (!UpRefs.empty())
4140 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4141 const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get());
3919 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription());
3920 const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get());
41423921 if (Ty == 0)
41433922 GEN_ERROR("Global const reference must be a pointer type!");
41443923
41523931 Function *SavedCurFn = CurFun.CurrentFunction;
41533932 CurFun.CurrentFunction = 0;
41543933
4155 Value *V = getValNonImprovising(Ty, (yyvsp[(2) - (2)].ValIDVal));
3934 Value *V = getValNonImprovising(Ty, (yyvsp[0].ValIDVal));
41563935 CHECK_FOR_ERROR
41573936
41583937 CurFun.CurrentFunction = SavedCurFn;
41673946
41683947 // First check to see if the forward references value is already created!
41693948 PerModuleInfo::GlobalRefsType::iterator I =
4170 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
3949 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal)));
41713950
41723951 if (I != CurModule.GlobalRefs.end()) {
41733952 V = I->second; // Placeholder already exists, use it...
4174 (yyvsp[(2) - (2)].ValIDVal).destroy();
3953 (yyvsp[0].ValIDVal).destroy();
41753954 } else {
41763955 std::string Name;
4177 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4178 Name = (yyvsp[(2) - (2)].ValIDVal).Name;
4179 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
3956 if ((yyvsp[0].ValIDVal).Type == ValID::GlobalName)
3957 Name = (yyvsp[0].ValIDVal).Name;
3958 else if ((yyvsp[0].ValIDVal).Type != ValID::GlobalID)
41803959 GEN_ERROR("Invalid reference to global");
41813960
41823961 // Create the forward referenced global.
41923971 }
41933972
41943973 // Keep track of the fact that we have a forward ref to recycle it
4195 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
3974 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[0].ValIDVal)), GV));
41963975 V = GV;
41973976 }
41983977 }
41993978
42003979 (yyval.ConstVal) = cast(V);
4201 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
3980 delete (yyvsp[-1].TypeVal); // Free the type handle
42023981 CHECK_FOR_ERROR
42033982 ;}
42043983 break;
42053984
42063985 case 153:
4207 #line 1665 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
3986 #line 1665 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42083987 {
42093988 if (!UpRefs.empty())
4210 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4211 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
3989 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription());
3990 if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType())
42123991 GEN_ERROR("Mismatched types for constant expression: " +
4213 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4214 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4215 delete (yyvsp[(1) - (2)].TypeVal);
3992 (*(yyvsp[-1].TypeVal))->getDescription() + " and " + (yyvsp[0].ConstVal)->getType()->getDescription());
3993 (yyval.ConstVal) = (yyvsp[0].ConstVal);
3994 delete (yyvsp[-1].TypeVal);
42163995 CHECK_FOR_ERROR
42173996 ;}
42183997 break;
42193998
42203999 case 154:
4221 #line 1675 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4000 #line 1675 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42224001 {
42234002 if (!UpRefs.empty())
4224 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4225 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4003 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription());
4004 const Type *Ty = (yyvsp[-1].TypeVal)->get();
42264005 if (isa(Ty) || Ty == Type::LabelTy || isa(Ty))
42274006 GEN_ERROR("Cannot create a null initialized value of this type!");
42284007 (yyval.ConstVal) = Constant::getNullValue(Ty);
4229 delete (yyvsp[(1) - (2)].TypeVal);
4008 delete (yyvsp[-1].TypeVal);
42304009 CHECK_FOR_ERROR
42314010 ;}
42324011 break;
42334012
42344013 case 155:
4235 #line 1685 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4014 #line 1685 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42364015 { // integral constants
4237 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4016 if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)))
42384017 GEN_ERROR("Constant value doesn't fit in type!");
4239 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val));
4018 (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val));
42404019 CHECK_FOR_ERROR
42414020 ;}
42424021 break;
42434022
42444023 case 156:
4245 #line 1691 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4024 #line 1691 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42464025 { // integral constants
4247 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4026 if (!ConstantInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)))
42484027 GEN_ERROR("Constant value doesn't fit in type!");
4249 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val));
4028 (yyval.ConstVal) = ConstantInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val));
42504029 CHECK_FOR_ERROR
42514030 ;}
42524031 break;
42534032
42544033 case 157:
4255 #line 1697 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4034 #line 1697 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42564035 { // Boolean constants
4257 assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4036 assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?");
42584037 (yyval.ConstVal) = ConstantInt::getTrue();
42594038 CHECK_FOR_ERROR
42604039 ;}
42614040 break;
42624041
42634042 case 158:
4264 #line 1702 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4043 #line 1702 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42654044 { // Boolean constants
4266 assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4045 assert(cast((yyvsp[-1].PrimType))->getBitWidth() == 1 && "Not Bool?");
42674046 (yyval.ConstVal) = ConstantInt::getFalse();
42684047 CHECK_FOR_ERROR
42694048 ;}
42704049 break;
42714050
42724051 case 159:
4273 #line 1707 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4052 #line 1707 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42744053 { // Float & Double constants
4275 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)))
4054 if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal)))
42764055 GEN_ERROR("Floating point constant invalid for type!!");
4277 (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal));
4056 (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal));
42784057 CHECK_FOR_ERROR
42794058 ;}
42804059 break;
42814060
42824061 case 160:
4283 #line 1715 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4062 #line 1715 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
42844063 {
42854064 if (!UpRefs.empty())
4286 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4287 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4288 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4289 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4065 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-1].TypeVal))->getDescription());
4066 Constant *Val = (yyvsp[-3].ConstVal);
4067 const Type *DestTy = (yyvsp[-1].TypeVal)->get();
4068 if (!CastInst::castIsValid((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy))
42904069 GEN_ERROR("invalid cast opcode for cast from '" +
42914070 Val->getType()->getDescription() + "' to '" +
42924071 DestTy->getDescription() + "'!");
4293 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4294 delete (yyvsp[(5) - (6)].TypeVal);
4072 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-5].CastOpVal), (yyvsp[-3].ConstVal), DestTy);
4073 delete (yyvsp[-1].TypeVal);
42954074 ;}
42964075 break;
42974076
42984077 case 161:
4299 #line 1727 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4300 {
4301 if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()))
4078 #line 1727 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4079 {
4080 if (!isa((yyvsp[-2].ConstVal)->getType()))
43024081 GEN_ERROR("GetElementPtr requires a pointer operand!");
43034082
43044083 const Type *IdxTy =
4305 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), *(yyvsp[(4) - (5)].ValueList), true);
4084 GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true);
43064085 if (!IdxTy)
43074086 GEN_ERROR("Index list invalid for constant getelementptr!");
43084087
43094088 std::vector IdxVec;
4310 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4311 if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i]))
4089 for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e; ++i)
4090 if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i]))
43124091 IdxVec.push_back(C);
43134092 else
43144093 GEN_ERROR("Indices to constant getelementptr must be constants!");
43154094
4316 delete (yyvsp[(4) - (5)].ValueList);
4317
4318 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), IdxVec);
4095 delete (yyvsp[-1].ValueList);
4096
4097 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), IdxVec);
43194098 CHECK_FOR_ERROR
43204099 ;}
43214100 break;
43224101
43234102 case 162:
4324 #line 1748 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4325 {
4326 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4103 #line 1748 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4104 {
4105 if ((yyvsp[-5].ConstVal)->getType() != Type::Int1Ty)
43274106 GEN_ERROR("Select condition must be of boolean type!");
4328 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4107 if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
43294108 GEN_ERROR("Select operand types must match!");
4330 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4109 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43314110 CHECK_FOR_ERROR
43324111 ;}
43334112 break;
43344113
43354114 case 163:
4336 #line 1756 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4337 {
4338 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4115 #line 1756 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4116 {
4117 if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
43394118 GEN_ERROR("Binary operator types must match!");
43404119 CHECK_FOR_ERROR;
4341 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4120 (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43424121 ;}
43434122 break;
43444123
43454124 case 164:
4346 #line 1762 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4347 {
4348 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4125 #line 1762 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4126 {
4127 if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
43494128 GEN_ERROR("Logical operator types must match!");
4350 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4351 if (!isa((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4352 !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4129 if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) {
4130 if (!isa((yyvsp[-3].ConstVal)->getType()) ||
4131 !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isInteger())
43534132 GEN_ERROR("Logical operator requires integral operands!");
43544133 }
4355 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4134 (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43564135 CHECK_FOR_ERROR
43574136 ;}
43584137 break;
43594138
43604139 case 165:
4361 #line 1773 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4362 {
4363 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4140 #line 1773 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4141 {
4142 if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
43644143 GEN_ERROR("icmp operand types must match!");
4365 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4144 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[-5].IPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43664145 ;}
43674146 break;
43684147
43694148 case 166:
4370 #line 1778 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4371 {
4372 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4149 #line 1778 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4150 {
4151 if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType())
43734152 GEN_ERROR("fcmp operand types must match!");
4374 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4153 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[-5].FPredicate), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43754154 ;}
43764155 break;
43774156
43784157 case 167:
4379 #line 1783 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4380 {
4381 if ((yyvsp[(5) - (6)].ConstVal)->getType() != Type::Int8Ty)
4158 #line 1783 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4159 {
4160 if ((yyvsp[-1].ConstVal)->getType() != Type::Int8Ty)
43824161 GEN_ERROR("Shift count for shift constant must be i8 type!");
4383 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger())
4162 if (!(yyvsp[-3].ConstVal)->getType()->isInteger())
43844163 GEN_ERROR("Shift constant expression requires integer operand!");
43854164 CHECK_FOR_ERROR;
4386 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4165 (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43874166 CHECK_FOR_ERROR
43884167 ;}
43894168 break;
43904169
43914170 case 168:
4392 #line 1792 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4393 {
4394 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4171 #line 1792 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4172 {
4173 if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
43954174 GEN_ERROR("Invalid extractelement operands!");
4396 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4175 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
43974176 CHECK_FOR_ERROR
43984177 ;}
43994178 break;
44004179
44014180 case 169:
4402 #line 1798 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4403 {
4404 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4181 #line 1798 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4182 {
4183 if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
44054184 GEN_ERROR("Invalid insertelement operands!");
4406 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4185 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
44074186 CHECK_FOR_ERROR
44084187 ;}
44094188 break;
44104189
44114190 case 170:
4412 #line 1804 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4413 {
4414 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4191 #line 1804 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4192 {
4193 if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)))
44154194 GEN_ERROR("Invalid shufflevector operands!");
4416 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4195 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal));
44174196 CHECK_FOR_ERROR
44184197 ;}
44194198 break;
44204199
44214200 case 171:
4422 #line 1813 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4423 {
4424 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
4201 #line 1813 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4202 {
4203 ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal));
44254204 CHECK_FOR_ERROR
44264205 ;}
44274206 break;
44284207
44294208 case 172:
4430 #line 1817 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4209 #line 1817 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44314210 {
44324211 (yyval.ConstVector) = new std::vector();
4433 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
4212 (yyval.ConstVector)->push_back((yyvsp[0].ConstVal));
44344213 CHECK_FOR_ERROR
44354214 ;}
44364215 break;
44374216
44384217 case 173:
4439 #line 1825 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4218 #line 1825 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44404219 { (yyval.BoolVal) = false; ;}
44414220 break;
44424221
44434222 case 174:
4444 #line 1825 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4223 #line 1825 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44454224 { (yyval.BoolVal) = true; ;}
44464225 break;
44474226
44484227 case 175:
4449 #line 1836 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4228 #line 1836 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44504229 {
44514230 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
44524231 CurModule.ModuleDone();
44554234 break;
44564235
44574236 case 176:
4458 #line 1841 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4237 #line 1841 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44594238 {
44604239 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
44614240 CurModule.ModuleDone();
44644243 break;
44654244
44664245 case 179:
4467 #line 1854 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4246 #line 1854 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44684247 { CurFun.isDeclare = false; ;}
44694248 break;
44704249
44714250 case 180:
4472 #line 1854 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4251 #line 1854 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44734252 {
44744253 CurFun.FunctionDone();
44754254 CHECK_FOR_ERROR
44774256 break;
44784257
44794258 case 181:
4480 #line 1858 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4259 #line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44814260 { CurFun.isDeclare = true; ;}
44824261 break;
44834262
44844263 case 182:
4485 #line 1858 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4264 #line 1858 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44864265 {
44874266 CHECK_FOR_ERROR
44884267 ;}
44894268 break;
44904269
44914270 case 183:
4492 #line 1861 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4271 #line 1861 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
44934272 {
44944273 CHECK_FOR_ERROR
44954274 ;}
44964275 break;
44974276
44984277 case 184:
4499 #line 1864 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4278 #line 1864 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
45004279 {
45014280 // Emit an error if there are any unresolved types left.
45024281 if (!CurModule.LateResolveTypes.empty()) {
45124291 break;
45134292
45144293 case 185:
4515 #line 1876 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4294 #line 1876 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
45164295 {
45174296 if (!UpRefs.empty())
4518 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
4297 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription());
45194298 // Eagerly resolve types. This is not an optimization, this is a
45204299 // requirement that is due to the fact that we could have this:
45214300 //
45254304 // If types are not resolved eagerly, then the two types will not be
45264305 // determined to be the same type!
45274306 //
4528 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
4529
4530 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4307 ResolveTypeTo((yyvsp[-2].StrVal), *(yyvsp[0].TypeVal));
4308
4309 if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) {
45314310 CHECK_FOR_ERROR
45324311 // If this is a named type that is not a redefinition, add it to the slot
45334312 // table.
4534 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
4313 CurModule.Types.push_back(*(yyvsp[0].TypeVal));
45354314 }
45364315
4537 delete (yyvsp[(3) - (3)].TypeVal);
4316 delete (yyvsp[0].TypeVal);
45384317 CHECK_FOR_ERROR
45394318 ;}
45404319 break;
45414320
45424321 case 186:
4543 #line 1900 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4544 {
4545 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
4546
4547 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4322 #line 1900 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4323 {
4324 ResolveTypeTo((yyvsp[-2].StrVal), (yyvsp[0].PrimType));
4325
4326 if (!setTypeName((yyvsp[0].PrimType), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) {
45484327 CHECK_FOR_ERROR
45494328 // If this is a named type that is not a redefinition, add it to the slot
45504329 // table.
4551 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
4330 CurModule.Types.push_back((yyvsp[0].PrimType));
45524331 }
45534332 CHECK_FOR_ERROR
45544333 ;}
45554334 break;
45564335
45574336 case 187:
4558 #line 1911 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4337 #line 1911 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
45594338 {
45604339 /* "Externally Visible" Linkage */
4561 if ((yyvsp[(4) - (4)].ConstVal) == 0)
4340 if ((yyvsp[0].ConstVal) == 0)
45624341 GEN_ERROR("Global value initializer is not a constant!");
4563 CurGV = ParseGlobalVariable((yyvsp[(1) - (4)].StrVal), GlobalValue::ExternalLinkage,
4564 (yyvsp[(2) - (4)].Visibility), (yyvsp[(3) - (4)].BoolVal), (yyvsp[(4) - (4)].ConstVal)->getType(), (yyvsp[(4) - (4)].ConstVal));
4342 CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage,
4343 (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal));
45654344 CHECK_FOR_ERROR
45664345 ;}
45674346 break;
45684347
45694348 case 188:
4570 #line 1918 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4349 #line 1918 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
45714350 {
45724351 CurGV = 0;
45734352 ;}
45744353 break;
45754354
45764355 case 189:
4577 #line 1921 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4578 {
4579 if ((yyvsp[(5) - (5)].ConstVal) == 0)
4356 #line 1921 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4357 {
4358 if ((yyvsp[0].ConstVal) == 0)
45804359 GEN_ERROR("Global value initializer is not a constant!");
4581 CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal));
4360 CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal));
45824361 CHECK_FOR_ERROR
45834362 ;}
45844363 break;
45854364
45864365 case 190:
4587 #line 1926 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4366 #line 1926 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
45884367 {
45894368 CurGV = 0;
45904369 ;}
45914370 break;
45924371
45934372 case 191:
4594 #line 1929 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4373 #line 1929 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
45954374 {
45964375 if (!UpRefs.empty())
4597 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (5)].TypeVal))->getDescription());
4598 CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), *(yyvsp[(5) - (5)].TypeVal), 0);
4599 CHECK_FOR_ERROR
4600 delete (yyvsp[(5) - (5)].TypeVal);
4376 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription());
4377 CurGV = ParseGlobalVariable((yyvsp[-4].StrVal), (yyvsp[-3].Linkage), (yyvsp[-2].Visibility), (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0);
4378 CHECK_FOR_ERROR
4379 delete (yyvsp[0].TypeVal);
46014380 ;}
46024381 break;
46034382
46044383 case 192:
4605 #line 1935 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4384 #line 1935 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46064385 {
46074386 CurGV = 0;
46084387 CHECK_FOR_ERROR
46104389 break;
46114390
46124391 case 193:
4613 #line 1939 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4392 #line 1939 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46144393 {
46154394 CHECK_FOR_ERROR
46164395 ;}
46174396 break;
46184397
46194398 case 194:
4620 #line 1942 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4399 #line 1942 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46214400 {
46224401 CHECK_FOR_ERROR
46234402 ;}
46244403 break;
46254404
46264405 case 195:
4627 #line 1948 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4406 #line 1948 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46284407 {
46294408 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
4630 char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true);
4631 std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr);
4632 free((yyvsp[(1) - (1)].StrVal));
4409 char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true);
4410 std::string NewAsm((yyvsp[0].StrVal), EndStr);
4411 free((yyvsp[0].StrVal));
46334412
46344413 if (AsmSoFar.empty())
46354414 CurModule.CurrentModule->setModuleInlineAsm(NewAsm);
46404419 break;
46414420
46424421 case 196:
4643 #line 1961 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4644 {
4645 CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal));
4646 free((yyvsp[(3) - (3)].StrVal));
4422 #line 1961 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4423 {
4424 CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal));
4425 free((yyvsp[0].StrVal));
46474426 ;}
46484427 break;
46494428
46504429 case 197:
4651 #line 1965 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4652 {
4653 CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal));
4654 free((yyvsp[(3) - (3)].StrVal));
4430 #line 1965 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4431 {
4432 CurModule.CurrentModule->setDataLayout((yyvsp[0].StrVal));
4433 free((yyvsp[0].StrVal));
46554434 ;}
46564435 break;
46574436
46584437 case 199:
4659 #line 1972 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4660 {
4661 CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal));
4662 free((yyvsp[(3) - (3)].StrVal));
4438 #line 1972 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4439 {
4440 CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
4441 free((yyvsp[0].StrVal));
46634442 CHECK_FOR_ERROR
46644443 ;}
46654444 break;
46664445
46674446 case 200:
4668 #line 1977 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4669 {
4670 CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal));
4671 free((yyvsp[(1) - (1)].StrVal));
4447 #line 1977 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4448 {
4449 CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal));
4450 free((yyvsp[0].StrVal));
46724451 CHECK_FOR_ERROR
46734452 ;}
46744453 break;
46754454
46764455 case 201:
4677 #line 1982 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4456 #line 1982 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46784457 {
46794458 CHECK_FOR_ERROR
46804459 ;}
46814460 break;
46824461
46834462 case 202:
4684 #line 1991 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4463 #line 1991 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46854464 {
46864465 if (!UpRefs.empty())
4687 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
4688 if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy)
4466 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription());
4467 if (*(yyvsp[-2].TypeVal) == Type::VoidTy)
46894468 GEN_ERROR("void typed arguments are invalid!");
4690 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
4691 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
4692 (yyvsp[(1) - (5)].ArgList)->push_back(E);
4469 ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal);
4470 (yyval.ArgList) = (yyvsp[-4].ArgList);
4471 (yyvsp[-4].ArgList)->push_back(E);
46934472 CHECK_FOR_ERROR
46944473 ;}
46954474 break;
46964475
46974476 case 203:
4698 #line 2001 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4477 #line 2001 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
46994478 {
47004479 if (!UpRefs.empty())
4701 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4702 if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy)
4480 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[-2].TypeVal))->getDescription());
4481 if (*(yyvsp[-2].TypeVal) == Type::VoidTy)
47034482 GEN_ERROR("void typed arguments are invalid!");
4704 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
4483 ArgListEntry E; E.Attrs = (yyvsp[-1].ParamAttrs); E.Ty = (yyvsp[-2].TypeVal); E.Name = (yyvsp[0].StrVal);
47054484 (yyval.ArgList) = new ArgListType;
47064485 (yyval.ArgList)->push_back(E);
47074486 CHECK_FOR_ERROR
47094488 break;
47104489
47114490 case 204:
4712 #line 2012 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4713 {
4714 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
4491 #line 2012 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4492 {
4493 (yyval.ArgList) = (yyvsp[0].ArgList);
47154494 CHECK_FOR_ERROR
47164495 ;}
47174496 break;
47184497
47194498 case 205:
4720 #line 2016 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4721 {
4722 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
4499 #line 2016 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4500 {
4501 (yyval.ArgList) = (yyvsp[-2].ArgList);
47234502 struct ArgListEntry E;
47244503 E.Ty = new PATypeHolder(Type::VoidTy);
47254504 E.Name = 0;
47304509 break;
47314510
47324511 case 206:
4733 #line 2025 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4512 #line 2025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
47344513 {
47354514 (yyval.ArgList) = new ArgListType;
47364515 struct ArgListEntry E;
47434522 break;
47444523
47454524 case 207:
4746 #line 2034 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4525 #line 2034 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
47474526 {
47484527 (yyval.ArgList) = 0;
47494528 CHECK_FOR_ERROR
47514530 break;
47524531
47534532 case 208:
4754 #line 2040 "/home/asl/proj/llvm/src/lib/AsmParser/llvmAsmParser.y"
4755 {
4756 UnEscapeLexed((yyvsp[(3) - (9)].StrVal));
4757 std::string FunctionName((yyvsp[(3) - (9)].StrVal));
4758 free((yyvsp[(3) - (9)].StrVal)); // Free strdup'd memory!
4533 #line 2040 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
4534 {
4535 UnEscapeLexed((yyvsp[-6].StrVal));
4536 std::string FunctionName((yyvsp[-6].StrVal));
4537 free((yyvsp[-6].StrVal)); // Free strdup'd memory!
47594538
47604539 // Check the function result for abstractness if this is a define. We should
47614540 // have no abstract types at this point
4762 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal)))
4763 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription());
4541 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[-7].TypeVal)))
4542 GEN_ERROR("Reference to abstract result: "+ (yyvsp[-7].TypeVal)->get()->getDescription());
47644543
47654544 std::vector ParamTypeList;
47664545 std::vector ParamAttrs;
4767 ParamAttrs.push_back((yyvsp[(7) - (9)].ParamAttrs));
4768 if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments...
4769 for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I) {
4546 ParamAttrs.push_back((yyvsp[-2].ParamAttrs));
4547 if ((yyvsp[-4].ArgList)) { // If there are arguments...
4548 for (ArgListType::iterator I = (yyvsp[-4].ArgList)->begin(); I != (yyvsp[-4].ArgList)->end(); ++I) {
47704549 const Type* Ty = I->Ty->get();
47714550 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
47724551 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
47794558 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
47804559 if (isVarArg) ParamTypeList.pop_back();
47814560
4782 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg,
4561 FunctionType *FT = FunctionType::get(*(yyvsp[-7].TypeVal), ParamTypeList, isVarArg,
47834562 ParamAttrs);
47844563 const PointerType *PFT = PointerType::get(FT);
4785 delete (yyvsp[(2) - (9)].TypeVal);
4564 delete (yyvsp[-7].TypeVal);
47864565
47874566 ValID ID;
47884567 if (!FunctionName.empty()) {
48034582 (Fn = CurModule.CurrentModule->getFunction(FunctionName, FT))) {
48044583 // If this is the case, either we need to be a forward decl, or it needs
48054584 // to be.