1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse llvmAsmparse
63 #define yylex llvmAsmlex
64 #define yyerror llvmAsmerror
65 #define yylval llvmAsmlval
66 #define yychar llvmAsmchar
67 #define yydebug llvmAsmdebug
68 #define yynerrs llvmAsmnerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
97 ATSTRINGCONSTANT = 278,
98 PCTSTRINGCONSTANT = 279,
99 ZEROINITIALIZER = 280,
140 X86_STDCALLCC_TOK = 321,
141 X86_FASTCALLCC_TOK = 322,
209 EXTRACTELEMENT = 390,
233 #define ESINT64VAL 258
234 #define EUINT64VAL 259
235 #define ESAPINTVAL 260
236 #define EUAPINTVAL 261
237 #define LOCALVAL_ID 262
238 #define GLOBALVAL_ID 263
246 #define PPC_FP128 271
250 #define GLOBALVAR 275
252 #define STRINGCONSTANT 277
253 #define ATSTRINGCONSTANT 278
254 #define PCTSTRINGCONSTANT 279
255 #define ZEROINITIALIZER 280
267 #define THREAD_LOCAL 292
269 #define DOTDOTDOT 294
275 #define APPENDING 300
276 #define DLLIMPORT 301
277 #define DLLEXPORT 302
278 #define EXTERN_WEAK 303
285 #define ADDRSPACE 310
291 #define SIDEEFFECT 316
294 #define FASTCC_TOK 319
295 #define COLDCC_TOK 320
296 #define X86_STDCALLCC_TOK 321
297 #define X86_FASTCALLCC_TOK 322
298 #define DATALAYOUT 323
304 #define UNREACHABLE 329
349 #define GETELEMENTPTR 374
365 #define EXTRACTELEMENT 390
366 #define INSERTELEMENT 391
367 #define SHUFFLEVECTOR 392
368 #define GETRESULT 393
369 #define EXTRACTVALUE 394
370 #define INSERTVALUE 395
385 #define PROTECTED 410
390 /* Copy the first part of user declarations. */
391 #line 14 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
393 #include "ParserInternals.h"
394 #include "llvm/CallingConv.h"
395 #include "llvm/InlineAsm.h"
396 #include "llvm/Instructions.h"
397 #include "llvm/Module.h"
398 #include "llvm/ValueSymbolTable.h"
399 #include "llvm/AutoUpgrade.h"
400 #include "llvm/Support/GetElementPtrTypeIterator.h"
401 #include "llvm/Support/CommandLine.h"
402 #include "llvm/ADT/SmallVector.h"
403 #include "llvm/ADT/STLExtras.h"
404 #include "llvm/Support/MathExtras.h"
405 #include "llvm/Support/Streams.h"
411 // The following is a gross hack. In order to rid the libAsmParser library of
412 // exceptions, we have to have a way of getting the yyparse function to go into
413 // an error situation. So, whenever we want an error to occur, the GenerateError
414 // function (see bottom of file) sets TriggerError. Then, at the end of each
415 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
416 // (a goto) to put YACC in error state. Furthermore, several calls to
417 // GenerateError are made from inside productions and they must simulate the
418 // previous exception behavior by exiting the production immediately. We have
419 // replaced these with the GEN_ERROR macro which calls GeneratError and then
420 // immediately invokes YYERROR. This would be so much cleaner if it was a
421 // recursive descent parser.
422 static bool TriggerError = false;
423 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
424 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
426 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
427 int yylex(); // declaration" of xxx warnings.
429 using namespace llvm;
431 static Module *ParserResult;
433 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
434 // relating to upreferences in the input stream.
436 //#define DEBUG_UPREFS 1
438 #define UR_OUT(X) cerr << X
443 #define YYERROR_VERBOSE 1
445 static GlobalVariable *CurGV;
448 // This contains info used when building the body of a function. It is
449 // destroyed when the function is completed.
451 typedef std::vector<Value *> ValueList; // Numbered defs
454 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
456 static struct PerModuleInfo {
457 Module *CurrentModule;
458 ValueList Values; // Module level numbered definitions
459 ValueList LateResolveValues;
460 std::vector<PATypeHolder> Types;
461 std::map<ValID, PATypeHolder> LateResolveTypes;
463 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
464 /// how they were referenced and on which line of the input they came from so
465 /// that we can resolve them later and print error messages as appropriate.
466 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
468 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
469 // references to global values. Global values may be referenced before they
470 // are defined, and if so, the temporary object that they represent is held
471 // here. This is used for forward references of GlobalValues.
473 typedef std::map<std::pair<const PointerType *,
474 ValID>, GlobalValue*> GlobalRefsType;
475 GlobalRefsType GlobalRefs;
478 // If we could not resolve some functions at function compilation time
479 // (calls to functions before they are defined), resolve them now... Types
480 // are resolved when the constant pool has been completely parsed.
482 ResolveDefinitions(LateResolveValues);
486 // Check to make sure that all global value forward references have been
489 if (!GlobalRefs.empty()) {
490 std::string UndefinedReferences = "Unresolved global references exist:\n";
492 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
494 UndefinedReferences += " " + I->first.first->getDescription() + " " +
495 I->first.second.getName() + "\n";
497 GenerateError(UndefinedReferences);
501 // Look for intrinsic functions and CallInst that need to be upgraded
502 for (Module::iterator FI = CurrentModule->begin(),
503 FE = CurrentModule->end(); FI != FE; )
504 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
506 Values.clear(); // Clear out function local definitions
511 // GetForwardRefForGlobal - Check to see if there is a forward reference
512 // for this global. If so, remove it from the GlobalRefs map and return it.
513 // If not, just return null.
514 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
515 // Check to see if there is a forward reference to this global variable...
516 // if there is, eliminate it and patch the reference to use the new def'n.
517 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
518 GlobalValue *Ret = 0;
519 if (I != GlobalRefs.end()) {
526 bool TypeIsUnresolved(PATypeHolder* PATy) {
527 // If it isn't abstract, its resolved
528 const Type* Ty = PATy->get();
529 if (!Ty->isAbstract())
531 // Traverse the type looking for abstract types. If it isn't abstract then
532 // we don't need to traverse that leg of the type.
533 std::vector<const Type*> WorkList, SeenList;
534 WorkList.push_back(Ty);
535 while (!WorkList.empty()) {
536 const Type* Ty = WorkList.back();
537 SeenList.push_back(Ty);
539 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
540 // Check to see if this is an unresolved type
541 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
542 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
543 for ( ; I != E; ++I) {
544 if (I->second.get() == OpTy)
547 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
548 const Type* TheTy = SeqTy->getElementType();
549 if (TheTy->isAbstract() && TheTy != Ty) {
550 std::vector<const Type*>::iterator I = SeenList.begin(),
556 WorkList.push_back(TheTy);
558 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
559 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
560 const Type* TheTy = StrTy->getElementType(i);
561 if (TheTy->isAbstract() && TheTy != Ty) {
562 std::vector<const Type*>::iterator I = SeenList.begin(),
568 WorkList.push_back(TheTy);
577 static struct PerFunctionInfo {
578 Function *CurrentFunction; // Pointer to current function being created
580 ValueList Values; // Keep track of #'d definitions
582 ValueList LateResolveValues;
583 bool isDeclare; // Is this function a forward declararation?
584 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
585 GlobalValue::VisibilityTypes Visibility;
587 /// BBForwardRefs - When we see forward references to basic blocks, keep
588 /// track of them here.
589 std::map<ValID, BasicBlock*> BBForwardRefs;
591 inline PerFunctionInfo() {
594 Linkage = GlobalValue::ExternalLinkage;
595 Visibility = GlobalValue::DefaultVisibility;
598 inline void FunctionStart(Function *M) {
603 void FunctionDone() {
604 // Any forward referenced blocks left?
605 if (!BBForwardRefs.empty()) {
606 GenerateError("Undefined reference to label " +
607 BBForwardRefs.begin()->second->getName());
611 // Resolve all forward references now.
612 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
614 Values.clear(); // Clear out function local definitions
615 BBForwardRefs.clear();
618 Linkage = GlobalValue::ExternalLinkage;
619 Visibility = GlobalValue::DefaultVisibility;
621 } CurFun; // Info for the current function...
623 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
626 //===----------------------------------------------------------------------===//
627 // Code to handle definitions of all the types
628 //===----------------------------------------------------------------------===//
630 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
631 // Things that have names or are void typed don't get slot numbers
632 if (V->hasName() || (V->getType() == Type::VoidTy))
635 // In the case of function values, we have to allow for the forward reference
636 // of basic blocks, which are included in the numbering. Consequently, we keep
637 // track of the next insertion location with NextValNum. When a BB gets
638 // inserted, it could change the size of the CurFun.Values vector.
639 if (&ValueTab == &CurFun.Values) {
640 if (ValueTab.size() <= CurFun.NextValNum)
641 ValueTab.resize(CurFun.NextValNum+1);
642 ValueTab[CurFun.NextValNum++] = V;
645 // For all other lists, its okay to just tack it on the back of the vector.
646 ValueTab.push_back(V);
649 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
651 case ValID::LocalID: // Is it a numbered definition?
652 // Module constants occupy the lowest numbered slots...
653 if (D.Num < CurModule.Types.size())
654 return CurModule.Types[D.Num];
656 case ValID::LocalName: // Is it a named definition?
657 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
658 D.destroy(); // Free old strdup'd memory...
663 GenerateError("Internal parser error: Invalid symbol type reference");
667 // If we reached here, we referenced either a symbol that we don't know about
668 // or an id number that hasn't been read yet. We may be referencing something
669 // forward, so just create an entry to be resolved later and get to it...
671 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
674 if (inFunctionScope()) {
675 if (D.Type == ValID::LocalName) {
676 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
679 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
684 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
685 if (I != CurModule.LateResolveTypes.end())
688 Type *Typ = OpaqueType::get();
689 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
693 // getExistingVal - Look up the value specified by the provided type and
694 // the provided ValID. If the value exists and has already been defined, return
695 // it. Otherwise return null.
697 static Value *getExistingVal(const Type *Ty, const ValID &D) {
698 if (isa<FunctionType>(Ty)) {
699 GenerateError("Functions are not values and "
700 "must be referenced as pointers");
705 case ValID::LocalID: { // Is it a numbered definition?
706 // Check that the number is within bounds.
707 if (D.Num >= CurFun.Values.size())
709 Value *Result = CurFun.Values[D.Num];
710 if (Ty != Result->getType()) {
711 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
712 Result->getType()->getDescription() + "' does not match "
713 "expected type, '" + Ty->getDescription() + "'");
718 case ValID::GlobalID: { // Is it a numbered definition?
719 if (D.Num >= CurModule.Values.size())
721 Value *Result = CurModule.Values[D.Num];
722 if (Ty != Result->getType()) {
723 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
724 Result->getType()->getDescription() + "' does not match "
725 "expected type, '" + Ty->getDescription() + "'");
731 case ValID::LocalName: { // Is it a named definition?
732 if (!inFunctionScope())
734 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
735 Value *N = SymTab.lookup(D.getName());
738 if (N->getType() != Ty)
741 D.destroy(); // Free old strdup'd memory...
744 case ValID::GlobalName: { // Is it a named definition?
745 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
746 Value *N = SymTab.lookup(D.getName());
749 if (N->getType() != Ty)
752 D.destroy(); // Free old strdup'd memory...
756 // Check to make sure that "Ty" is an integral type, and that our
757 // value will fit into the specified type...
758 case ValID::ConstSIntVal: // Is it a constant pool reference??
759 if (!isa<IntegerType>(Ty) ||
760 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
761 GenerateError("Signed integral constant '" +
762 itostr(D.ConstPool64) + "' is invalid for type '" +
763 Ty->getDescription() + "'");
766 return ConstantInt::get(Ty, D.ConstPool64, true);
768 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
769 if (isa<IntegerType>(Ty) &&
770 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
771 return ConstantInt::get(Ty, D.UConstPool64);
773 if (!isa<IntegerType>(Ty) ||
774 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
775 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
776 "' is invalid or out of range for type '" +
777 Ty->getDescription() + "'");
780 // This is really a signed reference. Transmogrify.
781 return ConstantInt::get(Ty, D.ConstPool64, true);
783 case ValID::ConstFPVal: // Is it a floating point const pool reference?
784 if (!Ty->isFloatingPoint() ||
785 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
786 GenerateError("FP constant invalid for type");
789 // Lexer has no type info, so builds all float and double FP constants
790 // as double. Fix this here. Long double does not need this.
791 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
793 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
794 return ConstantFP::get(*D.ConstPoolFP);
796 case ValID::ConstNullVal: // Is it a null value?
797 if (!isa<PointerType>(Ty)) {
798 GenerateError("Cannot create a a non pointer null");
801 return ConstantPointerNull::get(cast<PointerType>(Ty));
803 case ValID::ConstUndefVal: // Is it an undef value?
804 return UndefValue::get(Ty);
806 case ValID::ConstZeroVal: // Is it a zero value?
807 return Constant::getNullValue(Ty);
809 case ValID::ConstantVal: // Fully resolved constant?
810 if (D.ConstantValue->getType() != Ty) {
811 GenerateError("Constant expression type different from required type");
814 return D.ConstantValue;
816 case ValID::InlineAsmVal: { // Inline asm expression
817 const PointerType *PTy = dyn_cast<PointerType>(Ty);
818 const FunctionType *FTy =
819 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
820 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
821 GenerateError("Invalid type for asm constraint string");
824 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
825 D.IAD->HasSideEffects);
826 D.destroy(); // Free InlineAsmDescriptor.
830 assert(0 && "Unhandled case!");
834 assert(0 && "Unhandled case!");
838 // getVal - This function is identical to getExistingVal, except that if a
839 // value is not already defined, it "improvises" by creating a placeholder var
840 // that looks and acts just like the requested variable. When the value is
841 // defined later, all uses of the placeholder variable are replaced with the
844 static Value *getVal(const Type *Ty, const ValID &ID) {
845 if (Ty == Type::LabelTy) {
846 GenerateError("Cannot use a basic block here");
850 // See if the value has already been defined.
851 Value *V = getExistingVal(Ty, ID);
853 if (TriggerError) return 0;
855 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
856 GenerateError("Invalid use of a non-first-class type");
860 // If we reached here, we referenced either a symbol that we don't know about
861 // or an id number that hasn't been read yet. We may be referencing something
862 // forward, so just create an entry to be resolved later and get to it...
865 case ValID::GlobalName:
866 case ValID::GlobalID: {
867 const PointerType *PTy = dyn_cast<PointerType>(Ty);
869 GenerateError("Invalid type for reference to global" );
872 const Type* ElTy = PTy->getElementType();
873 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
874 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
876 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
877 (Module*)0, false, PTy->getAddressSpace());
881 V = new Argument(Ty);
884 // Remember where this forward reference came from. FIXME, shouldn't we try
885 // to recycle these things??
886 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
889 if (inFunctionScope())
890 InsertValue(V, CurFun.LateResolveValues);
892 InsertValue(V, CurModule.LateResolveValues);
896 /// defineBBVal - This is a definition of a new basic block with the specified
897 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
898 static BasicBlock *defineBBVal(const ValID &ID) {
899 assert(inFunctionScope() && "Can't get basic block at global scope!");
903 // First, see if this was forward referenced
905 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
906 if (BBI != CurFun.BBForwardRefs.end()) {
908 // The forward declaration could have been inserted anywhere in the
909 // function: insert it into the correct place now.
910 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
911 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
913 // We're about to erase the entry, save the key so we can clean it up.
914 ValID Tmp = BBI->first;
916 // Erase the forward ref from the map as its no longer "forward"
917 CurFun.BBForwardRefs.erase(ID);
919 // The key has been removed from the map but so we don't want to leave
920 // strdup'd memory around so destroy it too.
923 // If its a numbered definition, bump the number and set the BB value.
924 if (ID.Type == ValID::LocalID) {
925 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
929 // We haven't seen this BB before and its first mention is a definition.
930 // Just create it and return it.
931 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
932 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
933 if (ID.Type == ValID::LocalID) {
934 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
943 /// getBBVal - get an existing BB value or create a forward reference for it.
945 static BasicBlock *getBBVal(const ValID &ID) {
946 assert(inFunctionScope() && "Can't get basic block at global scope!");
950 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
951 if (BBI != CurFun.BBForwardRefs.end()) {
953 } if (ID.Type == ValID::LocalName) {
954 std::string Name = ID.getName();
955 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
957 if (N->getType()->getTypeID() == Type::LabelTyID)
958 BB = cast<BasicBlock>(N);
960 GenerateError("Reference to label '" + Name + "' is actually of type '"+
961 N->getType()->getDescription() + "'");
963 } else if (ID.Type == ValID::LocalID) {
964 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
965 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
966 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
968 GenerateError("Reference to label '%" + utostr(ID.Num) +
969 "' is actually of type '"+
970 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
973 GenerateError("Illegal label reference " + ID.getName());
977 // If its already been defined, return it now.
979 ID.destroy(); // Free strdup'd memory.
983 // Otherwise, this block has not been seen before, create it.
985 if (ID.Type == ValID::LocalName)
987 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
989 // Insert it in the forward refs map.
990 CurFun.BBForwardRefs[ID] = BB;
996 //===----------------------------------------------------------------------===//
997 // Code to handle forward references in instructions
998 //===----------------------------------------------------------------------===//
1000 // This code handles the late binding needed with statements that reference
1001 // values not defined yet... for example, a forward branch, or the PHI node for
1004 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1005 // and back patchs after we are done.
1008 // ResolveDefinitions - If we could not resolve some defs at parsing
1009 // time (forward branches, phi functions for loops, etc...) resolve the
1013 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1014 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1015 while (!LateResolvers.empty()) {
1016 Value *V = LateResolvers.back();
1017 LateResolvers.pop_back();
1019 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1020 CurModule.PlaceHolderInfo.find(V);
1021 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1023 ValID &DID = PHI->second.first;
1025 Value *TheRealValue = getExistingVal(V->getType(), DID);
1029 V->replaceAllUsesWith(TheRealValue);
1031 CurModule.PlaceHolderInfo.erase(PHI);
1032 } else if (FutureLateResolvers) {
1033 // Functions have their unresolved items forwarded to the module late
1035 InsertValue(V, *FutureLateResolvers);
1037 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1038 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1039 "' of type '" + V->getType()->getDescription() + "'",
1040 PHI->second.second);
1043 GenerateError("Reference to an invalid definition: #" +
1044 itostr(DID.Num) + " of type '" +
1045 V->getType()->getDescription() + "'",
1046 PHI->second.second);
1051 LateResolvers.clear();
1054 // ResolveTypeTo - A brand new type was just declared. This means that (if
1055 // name is not null) things referencing Name can be resolved. Otherwise, things
1056 // refering to the number can be resolved. Do this now.
1058 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1061 D = ValID::createLocalName(*Name);
1063 D = ValID::createLocalID(CurModule.Types.size());
1065 std::map<ValID, PATypeHolder>::iterator I =
1066 CurModule.LateResolveTypes.find(D);
1067 if (I != CurModule.LateResolveTypes.end()) {
1068 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1069 CurModule.LateResolveTypes.erase(I);
1073 // setValueName - Set the specified value to the name given. The name may be
1074 // null potentially, in which case this is a noop. The string passed in is
1075 // assumed to be a malloc'd string buffer, and is free'd by this function.
1077 static void setValueName(Value *V, std::string *NameStr) {
1078 if (!NameStr) return;
1079 std::string Name(*NameStr); // Copy string
1080 delete NameStr; // Free old string
1082 if (V->getType() == Type::VoidTy) {
1083 GenerateError("Can't assign name '" + Name+"' to value with void type");
1087 assert(inFunctionScope() && "Must be in function scope!");
1088 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1089 if (ST.lookup(Name)) {
1090 GenerateError("Redefinition of value '" + Name + "' of type '" +
1091 V->getType()->getDescription() + "'");
1099 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1100 /// this is a declaration, otherwise it is a definition.
1101 static GlobalVariable *
1102 ParseGlobalVariable(std::string *NameStr,
1103 GlobalValue::LinkageTypes Linkage,
1104 GlobalValue::VisibilityTypes Visibility,
1105 bool isConstantGlobal, const Type *Ty,
1106 Constant *Initializer, bool IsThreadLocal,
1107 unsigned AddressSpace = 0) {
1108 if (isa<FunctionType>(Ty)) {
1109 GenerateError("Cannot declare global vars of function type");
1112 if (Ty == Type::LabelTy) {
1113 GenerateError("Cannot declare global vars of label type");
1117 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1121 Name = *NameStr; // Copy string
1122 delete NameStr; // Free old string
1125 // See if this global value was forward referenced. If so, recycle the
1128 if (!Name.empty()) {
1129 ID = ValID::createGlobalName(Name);
1131 ID = ValID::createGlobalID(CurModule.Values.size());
1134 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1135 // Move the global to the end of the list, from whereever it was
1136 // previously inserted.
1137 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1138 CurModule.CurrentModule->getGlobalList().remove(GV);
1139 CurModule.CurrentModule->getGlobalList().push_back(GV);
1140 GV->setInitializer(Initializer);
1141 GV->setLinkage(Linkage);
1142 GV->setVisibility(Visibility);
1143 GV->setConstant(isConstantGlobal);
1144 GV->setThreadLocal(IsThreadLocal);
1145 InsertValue(GV, CurModule.Values);
1149 // If this global has a name
1150 if (!Name.empty()) {
1151 // if the global we're parsing has an initializer (is a definition) and
1152 // has external linkage.
1153 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1154 // If there is already a global with external linkage with this name
1155 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1156 // If we allow this GVar to get created, it will be renamed in the
1157 // symbol table because it conflicts with an existing GVar. We can't
1158 // allow redefinition of GVars whose linking indicates that their name
1159 // must stay the same. Issue the error.
1160 GenerateError("Redefinition of global variable named '" + Name +
1161 "' of type '" + Ty->getDescription() + "'");
1166 // Otherwise there is no existing GV to use, create one now.
1167 GlobalVariable *GV =
1168 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1169 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1170 GV->setVisibility(Visibility);
1171 InsertValue(GV, CurModule.Values);
1175 // setTypeName - Set the specified type to the name given. The name may be
1176 // null potentially, in which case this is a noop. The string passed in is
1177 // assumed to be a malloc'd string buffer, and is freed by this function.
1179 // This function returns true if the type has already been defined, but is
1180 // allowed to be redefined in the specified context. If the name is a new name
1181 // for the type plane, it is inserted and false is returned.
1182 static bool setTypeName(const Type *T, std::string *NameStr) {
1183 assert(!inFunctionScope() && "Can't give types function-local names!");
1184 if (NameStr == 0) return false;
1186 std::string Name(*NameStr); // Copy string
1187 delete NameStr; // Free old string
1189 // We don't allow assigning names to void type
1190 if (T == Type::VoidTy) {
1191 GenerateError("Can't assign name '" + Name + "' to the void type");
1195 // Set the type name, checking for conflicts as we do so.
1196 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1198 if (AlreadyExists) { // Inserting a name that is already defined???
1199 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1200 assert(Existing && "Conflict but no matching type?!");
1202 // There is only one case where this is allowed: when we are refining an
1203 // opaque type. In this case, Existing will be an opaque type.
1204 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1205 // We ARE replacing an opaque type!
1206 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1210 // Otherwise, this is an attempt to redefine a type. That's okay if
1211 // the redefinition is identical to the original. This will be so if
1212 // Existing and T point to the same Type object. In this one case we
1213 // allow the equivalent redefinition.
1214 if (Existing == T) return true; // Yes, it's equal.
1216 // Any other kind of (non-equivalent) redefinition is an error.
1217 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1218 T->getDescription() + "'");
1224 //===----------------------------------------------------------------------===//
1225 // Code for handling upreferences in type names...
1228 // TypeContains - Returns true if Ty directly contains E in it.
1230 static bool TypeContains(const Type *Ty, const Type *E) {
1231 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1232 E) != Ty->subtype_end();
1236 struct UpRefRecord {
1237 // NestingLevel - The number of nesting levels that need to be popped before
1238 // this type is resolved.
1239 unsigned NestingLevel;
1241 // LastContainedTy - This is the type at the current binding level for the
1242 // type. Every time we reduce the nesting level, this gets updated.
1243 const Type *LastContainedTy;
1245 // UpRefTy - This is the actual opaque type that the upreference is
1246 // represented with.
1247 OpaqueType *UpRefTy;
1249 UpRefRecord(unsigned NL, OpaqueType *URTy)
1250 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1254 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1255 static std::vector<UpRefRecord> UpRefs;
1257 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1258 /// called. It loops through the UpRefs vector, which is a list of the
1259 /// currently active types. For each type, if the up reference is contained in
1260 /// the newly completed type, we decrement the level count. When the level
1261 /// count reaches zero, the upreferenced type is the type that is passed in:
1262 /// thus we can complete the cycle.
1264 static PATypeHolder HandleUpRefs(const Type *ty) {
1265 // If Ty isn't abstract, or if there are no up-references in it, then there is
1266 // nothing to resolve here.
1267 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1269 PATypeHolder Ty(ty);
1270 UR_OUT("Type '" << Ty->getDescription() <<
1271 "' newly formed. Resolving upreferences.\n" <<
1272 UpRefs.size() << " upreferences active!\n");
1274 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1275 // to zero), we resolve them all together before we resolve them to Ty. At
1276 // the end of the loop, if there is anything to resolve to Ty, it will be in
1278 OpaqueType *TypeToResolve = 0;
1280 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1281 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1282 << UpRefs[i].second->getDescription() << ") = "
1283 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1284 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1285 // Decrement level of upreference
1286 unsigned Level = --UpRefs[i].NestingLevel;
1287 UpRefs[i].LastContainedTy = Ty;
1288 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1289 if (Level == 0) { // Upreference should be resolved!
1290 if (!TypeToResolve) {
1291 TypeToResolve = UpRefs[i].UpRefTy;
1293 UR_OUT(" * Resolving upreference for "
1294 << UpRefs[i].second->getDescription() << "\n";
1295 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1296 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1297 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1298 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1300 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1301 --i; // Do not skip the next element...
1306 if (TypeToResolve) {
1307 UR_OUT(" * Resolving upreference for "
1308 << UpRefs[i].second->getDescription() << "\n";
1309 std::string OldName = TypeToResolve->getDescription());
1310 TypeToResolve->refineAbstractTypeTo(Ty);
1316 //===----------------------------------------------------------------------===//
1317 // RunVMAsmParser - Define an interface to this parser
1318 //===----------------------------------------------------------------------===//
1320 static Module* RunParser(Module * M);
1322 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1324 Module *M = RunParser(new Module(LLLgetFilename()));
1331 /* Enabling traces. */
1336 /* Enabling verbose error messages. */
1337 #ifdef YYERROR_VERBOSE
1338 # undef YYERROR_VERBOSE
1339 # define YYERROR_VERBOSE 1
1341 # define YYERROR_VERBOSE 0
1344 /* Enabling the token table. */
1345 #ifndef YYTOKEN_TABLE
1346 # define YYTOKEN_TABLE 0
1349 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1350 typedef union YYSTYPE
1351 #line 953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
1353 llvm::Module *ModuleVal;
1354 llvm::Function *FunctionVal;
1355 llvm::BasicBlock *BasicBlockVal;
1356 llvm::TerminatorInst *TermInstVal;
1357 llvm::Instruction *InstVal;
1358 llvm::Constant *ConstVal;
1360 const llvm::Type *PrimType;
1361 std::list<llvm::PATypeHolder> *TypeList;
1362 llvm::PATypeHolder *TypeVal;
1363 llvm::Value *ValueVal;
1364 std::vector<llvm::Value*> *ValueList;
1365 std::vector<unsigned> *ConstantList;
1366 llvm::ArgListType *ArgList;
1367 llvm::TypeWithAttrs TypeWithAttrs;
1368 llvm::TypeWithAttrsList *TypeWithAttrsList;
1369 llvm::ParamList *ParamList;
1371 // Represent the RHS of PHI node
1372 std::list<std::pair<llvm::Value*,
1373 llvm::BasicBlock*> > *PHIList;
1374 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1375 std::vector<llvm::Constant*> *ConstVector;
1377 llvm::GlobalValue::LinkageTypes Linkage;
1378 llvm::GlobalValue::VisibilityTypes Visibility;
1379 llvm::ParameterAttributes ParamAttrs;
1380 llvm::APInt *APIntVal;
1385 llvm::APFloat *FPVal;
1388 std::string *StrVal; // This memory must be deleted
1389 llvm::ValID ValIDVal;
1391 llvm::Instruction::BinaryOps BinaryOpVal;
1392 llvm::Instruction::TermOps TermOpVal;
1393 llvm::Instruction::MemoryOps MemOpVal;
1394 llvm::Instruction::CastOps CastOpVal;
1395 llvm::Instruction::OtherOps OtherOpVal;
1396 llvm::ICmpInst::Predicate IPredicate;
1397 llvm::FCmpInst::Predicate FPredicate;
1399 /* Line 193 of yacc.c. */
1400 #line 1401 "llvmAsmParser.tab.c"
1402 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1403 # define YYSTYPE_IS_DECLARED 1
1404 # define YYSTYPE_IS_TRIVIAL 1
1409 /* Copy the second part of user declarations. */
1412 /* Line 216 of yacc.c. */
1413 #line 1414 "llvmAsmParser.tab.c"
1420 typedef YYTYPE_UINT8 yytype_uint8;
1422 typedef unsigned char yytype_uint8;
1426 typedef YYTYPE_INT8 yytype_int8;
1427 #elif (defined __STDC__ || defined __C99__FUNC__ \
1428 || defined __cplusplus || defined _MSC_VER)
1429 typedef signed char yytype_int8;
1431 typedef short int yytype_int8;
1434 #ifdef YYTYPE_UINT16
1435 typedef YYTYPE_UINT16 yytype_uint16;
1437 typedef unsigned short int yytype_uint16;
1441 typedef YYTYPE_INT16 yytype_int16;
1443 typedef short int yytype_int16;
1447 # ifdef __SIZE_TYPE__
1448 # define YYSIZE_T __SIZE_TYPE__
1449 # elif defined size_t
1450 # define YYSIZE_T size_t
1451 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1452 || defined __cplusplus || defined _MSC_VER)
1453 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1454 # define YYSIZE_T size_t
1456 # define YYSIZE_T unsigned int
1460 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1463 # if defined YYENABLE_NLS && YYENABLE_NLS
1465 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1466 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1470 # define YY_(msgid) msgid
1474 /* Suppress unused-variable warnings by "using" E. */
1475 #if ! defined lint || defined __GNUC__
1476 # define YYUSE(e) ((void) (e))
1478 # define YYUSE(e) /* empty */
1481 /* Identity function, used to suppress warnings about constant conditions. */
1483 # define YYID(n) (n)
1485 #if (defined __STDC__ || defined __C99__FUNC__ \
1486 || defined __cplusplus || defined _MSC_VER)
1499 #if ! defined yyoverflow || YYERROR_VERBOSE
1501 /* The parser invokes alloca or malloc; define the necessary symbols. */
1503 # ifdef YYSTACK_USE_ALLOCA
1504 # if YYSTACK_USE_ALLOCA
1506 # define YYSTACK_ALLOC __builtin_alloca
1507 # elif defined __BUILTIN_VA_ARG_INCR
1508 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1510 # define YYSTACK_ALLOC __alloca
1511 # elif defined _MSC_VER
1512 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1513 # define alloca _alloca
1515 # define YYSTACK_ALLOC alloca
1516 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1517 || defined __cplusplus || defined _MSC_VER)
1518 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1520 # define _STDLIB_H 1
1527 # ifdef YYSTACK_ALLOC
1528 /* Pacify GCC's `empty if-body' warning. */
1529 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1530 # ifndef YYSTACK_ALLOC_MAXIMUM
1531 /* The OS might guarantee only one guard page at the bottom of the stack,
1532 and a page size can be as small as 4096 bytes. So we cannot safely
1533 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1534 to allow for a few compiler-allocated temporary stack slots. */
1535 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1538 # define YYSTACK_ALLOC YYMALLOC
1539 # define YYSTACK_FREE YYFREE
1540 # ifndef YYSTACK_ALLOC_MAXIMUM
1541 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1543 # if (defined __cplusplus && ! defined _STDLIB_H \
1544 && ! ((defined YYMALLOC || defined malloc) \
1545 && (defined YYFREE || defined free)))
1546 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1548 # define _STDLIB_H 1
1552 # define YYMALLOC malloc
1553 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1554 || defined __cplusplus || defined _MSC_VER)
1555 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1559 # define YYFREE free
1560 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1561 || defined __cplusplus || defined _MSC_VER)
1562 void free (void *); /* INFRINGES ON USER NAME SPACE */
1566 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1569 #if (! defined yyoverflow \
1570 && (! defined __cplusplus \
1571 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1573 /* A type that is properly aligned for any stack member. */
1580 /* The size of the maximum gap between one aligned stack and the next. */
1581 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1583 /* The size of an array large to enough to hold all stacks, each with
1585 # define YYSTACK_BYTES(N) \
1586 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1587 + YYSTACK_GAP_MAXIMUM)
1589 /* Copy COUNT objects from FROM to TO. The source and destination do
1592 # if defined __GNUC__ && 1 < __GNUC__
1593 # define YYCOPY(To, From, Count) \
1594 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1596 # define YYCOPY(To, From, Count) \
1600 for (yyi = 0; yyi < (Count); yyi++) \
1601 (To)[yyi] = (From)[yyi]; \
1607 /* Relocate STACK from its old location to the new one. The
1608 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1609 elements in the stack, and YYPTR gives the new location of the
1610 stack. Advance YYPTR to a properly aligned location for the next
1612 # define YYSTACK_RELOCATE(Stack) \
1615 YYSIZE_T yynewbytes; \
1616 YYCOPY (&yyptr->Stack, Stack, yysize); \
1617 Stack = &yyptr->Stack; \
1618 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1619 yyptr += yynewbytes / sizeof (*yyptr); \
1625 /* YYFINAL -- State number of the termination state. */
1627 /* YYLAST -- Last index in YYTABLE. */
1630 /* YYNTOKENS -- Number of terminals. */
1631 #define YYNTOKENS 170
1632 /* YYNNTS -- Number of nonterminals. */
1634 /* YYNRULES -- Number of rules. */
1635 #define YYNRULES 333
1636 /* YYNRULES -- Number of states. */
1637 #define YYNSTATES 683
1639 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1640 #define YYUNDEFTOK 2
1641 #define YYMAXUTOK 410
1643 #define YYTRANSLATE(YYX) \
1644 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1646 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1647 static const yytype_uint8 yytranslate[] =
1649 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1653 156, 157, 160, 2, 159, 2, 2, 2, 2, 2,
1654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1655 165, 158, 166, 2, 2, 2, 2, 2, 2, 2,
1656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1658 2, 162, 161, 164, 2, 2, 2, 2, 2, 169,
1659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1660 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1661 163, 2, 2, 167, 2, 168, 2, 2, 2, 2,
1662 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1663 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1664 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1665 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1666 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1667 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1668 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1669 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1671 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1672 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1673 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1674 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1675 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1676 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1677 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1678 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1679 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1680 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1681 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1682 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1683 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1684 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1685 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1686 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1687 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1688 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1689 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1694 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1696 static const yytype_uint16 yyprhs[] =
1698 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1699 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1700 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1701 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1702 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1703 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1704 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1705 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1706 160, 162, 164, 166, 168, 169, 171, 173, 175, 176,
1707 178, 180, 181, 183, 185, 187, 189, 190, 192, 194,
1708 195, 197, 199, 201, 203, 205, 208, 210, 212, 214,
1709 216, 218, 220, 222, 224, 226, 229, 230, 233, 235,
1710 237, 239, 241, 243, 245, 246, 249, 250, 253, 254,
1711 257, 258, 262, 265, 266, 268, 269, 273, 275, 278,
1712 280, 282, 284, 286, 288, 290, 292, 294, 296, 300,
1713 302, 305, 311, 317, 323, 329, 333, 336, 342, 347,
1714 350, 352, 354, 356, 360, 362, 366, 368, 369, 371,
1715 375, 380, 384, 388, 393, 398, 402, 409, 415, 418,
1716 421, 424, 427, 430, 433, 436, 439, 442, 445, 448,
1717 451, 458, 464, 473, 480, 487, 495, 503, 511, 519,
1718 526, 535, 544, 550, 558, 562, 564, 566, 568, 570,
1719 571, 574, 581, 583, 584, 586, 589, 590, 594, 595,
1720 599, 603, 607, 611, 612, 621, 622, 632, 633, 643,
1721 649, 652, 656, 658, 662, 666, 670, 674, 676, 677,
1722 683, 687, 689, 693, 695, 696, 707, 709, 711, 716,
1723 718, 720, 723, 727, 728, 730, 732, 734, 736, 738,
1724 740, 742, 744, 746, 750, 752, 758, 760, 762, 764,
1725 766, 768, 770, 773, 775, 779, 782, 785, 789, 792,
1726 793, 795, 798, 801, 805, 815, 825, 834, 849, 851,
1727 853, 860, 866, 869, 876, 884, 889, 894, 901, 908,
1728 909, 910, 914, 917, 921, 924, 926, 932, 938, 945,
1729 952, 959, 966, 971, 978, 983, 988, 995, 1002, 1005,
1730 1014, 1016, 1018, 1019, 1023, 1030, 1034, 1041, 1044, 1050,
1731 1058, 1064, 1069, 1074
1734 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1735 static const yytype_int16 yyrhs[] =
1737 216, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1738 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1739 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1740 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1741 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1742 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1743 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1744 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1745 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1746 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1747 -1, 102, -1, 103, -1, 26, -1, 27, -1, 11,
1748 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1749 -1, 19, -1, 22, -1, 24, -1, 178, -1, -1,
1750 55, 156, 4, 157, -1, -1, 178, 158, -1, -1,
1751 20, -1, 23, -1, 184, -1, -1, 182, 158, -1,
1752 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1753 49, -1, 46, -1, 48, -1, 51, -1, -1, 153,
1754 -1, 154, -1, 155, -1, -1, 46, -1, 48, -1,
1755 -1, 42, -1, 43, -1, 44, -1, 47, -1, -1,
1756 44, -1, 42, -1, -1, 63, -1, 64, -1, 65,
1757 -1, 66, -1, 67, -1, 62, 4, -1, 142, -1,
1758 121, -1, 141, -1, 122, -1, 144, -1, 145, -1,
1759 147, -1, 148, -1, 149, -1, 54, 4, -1, -1,
1760 193, 192, -1, 143, -1, 146, -1, 142, -1, 141,
1761 -1, 150, -1, 151, -1, -1, 195, 194, -1, -1,
1762 152, 22, -1, -1, 54, 4, -1, -1, 159, 54,
1763 4, -1, 34, 22, -1, -1, 199, -1, -1, 159,
1764 202, 201, -1, 199, -1, 54, 4, -1, 11, -1,
1765 12, -1, 13, -1, 16, -1, 15, -1, 14, -1,
1766 17, -1, 50, -1, 203, -1, 204, 180, 160, -1,
1767 238, -1, 161, 4, -1, 204, 156, 208, 157, 195,
1768 -1, 10, 156, 208, 157, 195, -1, 162, 4, 163,
1769 204, 164, -1, 165, 4, 163, 204, 166, -1, 167,
1770 209, 168, -1, 167, 168, -1, 165, 167, 209, 168,
1771 166, -1, 165, 167, 168, 166, -1, 204, 193, -1,
1772 204, -1, 10, -1, 205, -1, 207, 159, 205, -1,
1773 207, -1, 207, 159, 39, -1, 39, -1, -1, 204,
1774 -1, 209, 159, 204, -1, 204, 162, 212, 164, -1,
1775 204, 162, 164, -1, 204, 169, 22, -1, 204, 165,
1776 212, 166, -1, 204, 167, 212, 168, -1, 204, 167,
1777 168, -1, 204, 165, 167, 212, 168, 166, -1, 204,
1778 165, 167, 168, 166, -1, 204, 40, -1, 204, 41,
1779 -1, 204, 238, -1, 204, 211, -1, 204, 25, -1,
1780 176, 3, -1, 176, 5, -1, 176, 4, -1, 176,
1781 6, -1, 11, 26, -1, 11, 27, -1, 177, 9,
1782 -1, 173, 156, 210, 38, 204, 157, -1, 119, 156,
1783 210, 250, 157, -1, 133, 156, 210, 159, 210, 159,
1784 210, 157, -1, 171, 156, 210, 159, 210, 157, -1,
1785 172, 156, 210, 159, 210, 157, -1, 90, 174, 156,
1786 210, 159, 210, 157, -1, 91, 175, 156, 210, 159,
1787 210, 157, -1, 92, 174, 156, 210, 159, 210, 157,
1788 -1, 93, 175, 156, 210, 159, 210, 157, -1, 135,
1789 156, 210, 159, 210, 157, -1, 136, 156, 210, 159,
1790 210, 159, 210, 157, -1, 137, 156, 210, 159, 210,
1791 159, 210, 157, -1, 139, 156, 210, 251, 157, -1,
1792 140, 156, 210, 159, 210, 251, 157, -1, 212, 159,
1793 210, -1, 210, -1, 32, -1, 33, -1, 37, -1,
1794 -1, 206, 238, -1, 125, 156, 215, 38, 204, 157,
1795 -1, 217, -1, -1, 218, -1, 217, 218, -1, -1,
1796 31, 219, 234, -1, -1, 30, 220, 235, -1, 60,
1797 59, 224, -1, 181, 18, 204, -1, 181, 18, 10,
1798 -1, -1, 183, 187, 214, 213, 210, 180, 221, 201,
1799 -1, -1, 183, 185, 187, 214, 213, 210, 180, 222,
1800 201, -1, -1, 183, 186, 187, 214, 213, 204, 180,
1801 223, 201, -1, 183, 187, 35, 190, 215, -1, 52,
1802 225, -1, 56, 158, 226, -1, 22, -1, 53, 158,
1803 22, -1, 68, 158, 22, -1, 162, 227, 164, -1,
1804 227, 159, 22, -1, 22, -1, -1, 228, 159, 204,
1805 193, 179, -1, 204, 193, 179, -1, 228, -1, 228,
1806 159, 39, -1, 39, -1, -1, 191, 206, 182, 156,
1807 229, 157, 195, 200, 197, 196, -1, 28, -1, 167,
1808 -1, 189, 187, 230, 231, -1, 29, -1, 168, -1,
1809 242, 233, -1, 188, 187, 230, -1, -1, 61, -1,
1810 3, -1, 4, -1, 9, -1, 26, -1, 27, -1,
1811 40, -1, 41, -1, 25, -1, 165, 212, 166, -1,
1812 211, -1, 59, 236, 22, 159, 22, -1, 7, -1,
1813 8, -1, 178, -1, 182, -1, 238, -1, 237, -1,
1814 204, 239, -1, 240, -1, 241, 159, 240, -1, 242,
1815 243, -1, 232, 243, -1, 244, 181, 245, -1, 244,
1816 247, -1, -1, 21, -1, 69, 241, -1, 69, 10,
1817 -1, 70, 17, 239, -1, 70, 11, 239, 159, 17,
1818 239, 159, 17, 239, -1, 71, 176, 239, 159, 17,
1819 239, 162, 246, 164, -1, 71, 176, 239, 159, 17,
1820 239, 162, 164, -1, 72, 191, 206, 239, 156, 249,
1821 157, 195, 38, 17, 239, 73, 17, 239, -1, 73,
1822 -1, 74, -1, 246, 176, 237, 159, 17, 239, -1,
1823 176, 237, 159, 17, 239, -1, 181, 253, -1, 204,
1824 162, 239, 159, 239, 164, -1, 248, 159, 162, 239,
1825 159, 239, 164, -1, 204, 193, 239, 193, -1, 17,
1826 193, 239, 193, -1, 249, 159, 204, 193, 239, 193,
1827 -1, 249, 159, 17, 193, 239, 193, -1, -1, -1,
1828 250, 159, 240, -1, 159, 4, -1, 251, 159, 4,
1829 -1, 58, 57, -1, 57, -1, 171, 204, 239, 159,
1830 239, -1, 172, 204, 239, 159, 239, -1, 90, 174,
1831 204, 239, 159, 239, -1, 91, 175, 204, 239, 159,
1832 239, -1, 92, 174, 204, 239, 159, 239, -1, 93,
1833 175, 204, 239, 159, 239, -1, 173, 240, 38, 204,
1834 -1, 133, 240, 159, 240, 159, 240, -1, 134, 240,
1835 159, 204, -1, 135, 240, 159, 240, -1, 136, 240,
1836 159, 240, 159, 240, -1, 137, 240, 159, 240, 159,
1837 240, -1, 132, 248, -1, 252, 191, 206, 239, 156,
1838 249, 157, 195, -1, 255, -1, 36, -1, -1, 114,
1839 204, 198, -1, 114, 204, 159, 11, 239, 198, -1,
1840 115, 204, 198, -1, 115, 204, 159, 11, 239, 198,
1841 -1, 116, 240, -1, 254, 117, 204, 239, 198, -1,
1842 254, 118, 240, 159, 204, 239, 198, -1, 138, 204,
1843 239, 159, 4, -1, 119, 204, 239, 250, -1, 139,
1844 204, 239, 251, -1, 140, 204, 239, 159, 204, 239,
1848 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1849 static const yytype_uint16 yyrline[] =
1851 0, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118,
1852 1118, 1119, 1119, 1119, 1119, 1119, 1119, 1120, 1120, 1120,
1853 1120, 1120, 1120, 1121, 1121, 1121, 1121, 1121, 1121, 1124,
1854 1124, 1125, 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1132,
1855 1132, 1133, 1133, 1134, 1134, 1135, 1135, 1136, 1136, 1137,
1856 1137, 1138, 1138, 1139, 1140, 1145, 1146, 1146, 1146, 1146,
1857 1146, 1148, 1148, 1148, 1149, 1149, 1151, 1152, 1156, 1160,
1858 1165, 1165, 1167, 1168, 1173, 1179, 1180, 1181, 1182, 1183,
1859 1184, 1188, 1189, 1190, 1194, 1195, 1196, 1197, 1201, 1202,
1860 1203, 1207, 1208, 1209, 1210, 1211, 1215, 1216, 1217, 1220,
1861 1221, 1222, 1223, 1224, 1225, 1226, 1233, 1234, 1235, 1236,
1862 1237, 1238, 1239, 1240, 1241, 1242, 1246, 1247, 1252, 1253,
1863 1254, 1255, 1256, 1257, 1260, 1261, 1266, 1267, 1274, 1275,
1864 1281, 1282, 1291, 1299, 1300, 1305, 1306, 1307, 1312, 1325,
1865 1325, 1325, 1325, 1325, 1325, 1325, 1328, 1332, 1336, 1343,
1866 1348, 1356, 1385, 1410, 1415, 1425, 1435, 1439, 1449, 1456,
1867 1465, 1472, 1477, 1482, 1489, 1490, 1497, 1504, 1512, 1518,
1868 1530, 1558, 1574, 1601, 1629, 1655, 1675, 1701, 1721, 1733,
1869 1740, 1806, 1816, 1826, 1832, 1842, 1848, 1858, 1864, 1870,
1870 1883, 1895, 1916, 1924, 1930, 1941, 1946, 1951, 1956, 1961,
1871 1967, 1973, 1979, 1987, 1998, 2002, 2010, 2010, 2013, 2013,
1872 2016, 2028, 2049, 2054, 2062, 2063, 2067, 2067, 2071, 2071,
1873 2074, 2077, 2101, 2113, 2112, 2124, 2123, 2133, 2132, 2143,
1874 2183, 2186, 2192, 2202, 2206, 2211, 2213, 2218, 2223, 2232,
1875 2242, 2253, 2257, 2266, 2275, 2280, 2409, 2409, 2411, 2420,
1876 2420, 2422, 2427, 2439, 2443, 2448, 2452, 2456, 2460, 2464,
1877 2468, 2472, 2476, 2480, 2508, 2512, 2522, 2526, 2530, 2535,
1878 2542, 2542, 2548, 2557, 2562, 2567, 2571, 2580, 2589, 2598,
1879 2602, 2610, 2617, 2621, 2626, 2637, 2656, 2665, 2751, 2755,
1880 2762, 2773, 2786, 2796, 2807, 2817, 2828, 2836, 2846, 2853,
1881 2856, 2857, 2865, 2871, 2880, 2884, 2889, 2905, 2922, 2936,
1882 2950, 2964, 2978, 2990, 2998, 3005, 3011, 3017, 3023, 3038,
1883 3128, 3133, 3137, 3144, 3151, 3161, 3168, 3178, 3186, 3200,
1884 3217, 3225, 3240, 3255
1888 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1889 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1890 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1891 static const char *const yytname[] =
1893 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1894 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1895 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1896 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1897 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1898 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1899 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1900 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1901 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1902 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1903 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1904 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1905 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1906 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1907 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1908 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1909 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1910 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1911 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1912 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1913 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1914 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1915 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1916 "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1917 "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1918 "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1919 "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1920 "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName",
1921 "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1922 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1923 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1924 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1925 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1926 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1927 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1928 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1929 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1930 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1931 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1932 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1933 "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1934 "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1935 "JumpTable", "Inst", "PHIList", "ParamList", "IndexList",
1936 "ConstantIndexList", "OptTailCall", "InstVal", "OptVolatile",
1942 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1944 static const yytype_uint16 yytoknum[] =
1946 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1947 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1948 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1949 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1950 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1951 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1952 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1953 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1954 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1955 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1956 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1957 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1958 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1959 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1960 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1961 405, 406, 407, 408, 409, 410, 40, 41, 61, 44,
1962 42, 92, 91, 120, 93, 60, 62, 123, 125, 99
1966 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1967 static const yytype_uint8 yyr1[] =
1969 0, 170, 171, 171, 171, 171, 171, 171, 171, 171,
1970 171, 172, 172, 172, 172, 172, 172, 173, 173, 173,
1971 173, 173, 173, 173, 173, 173, 173, 173, 173, 174,
1972 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1973 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
1974 175, 175, 175, 175, 175, 176, 177, 177, 177, 177,
1975 177, 178, 178, 178, 179, 179, 180, 180, 181, 181,
1976 182, 182, 183, 183, 184, 185, 185, 185, 185, 185,
1977 185, 186, 186, 186, 187, 187, 187, 187, 188, 188,
1978 188, 189, 189, 189, 189, 189, 190, 190, 190, 191,
1979 191, 191, 191, 191, 191, 191, 192, 192, 192, 192,
1980 192, 192, 192, 192, 192, 192, 193, 193, 194, 194,
1981 194, 194, 194, 194, 195, 195, 196, 196, 197, 197,
1982 198, 198, 199, 200, 200, 201, 201, 202, 202, 203,
1983 203, 203, 203, 203, 203, 203, 204, 204, 204, 204,
1984 204, 204, 204, 204, 204, 204, 204, 204, 204, 205,
1985 206, 206, 207, 207, 208, 208, 208, 208, 209, 209,
1986 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1987 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1988 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1989 211, 211, 211, 211, 212, 212, 213, 213, 214, 214,
1990 215, 215, 216, 216, 217, 217, 219, 218, 220, 218,
1991 218, 218, 218, 221, 218, 222, 218, 223, 218, 218,
1992 218, 218, 224, 225, 225, 226, 227, 227, 227, 228,
1993 228, 229, 229, 229, 229, 230, 231, 231, 232, 233,
1994 233, 234, 235, 236, 236, 237, 237, 237, 237, 237,
1995 237, 237, 237, 237, 237, 237, 238, 238, 238, 238,
1996 239, 239, 240, 241, 241, 242, 242, 243, 244, 244,
1997 244, 245, 245, 245, 245, 245, 245, 245, 245, 245,
1998 246, 246, 247, 248, 248, 249, 249, 249, 249, 249,
1999 250, 250, 251, 251, 252, 252, 253, 253, 253, 253,
2000 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
2001 253, 254, 254, 255, 255, 255, 255, 255, 255, 255,
2005 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2006 static const yytype_uint8 yyr2[] =
2008 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2009 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2010 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2011 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2012 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2013 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2014 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2015 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
2016 1, 1, 1, 1, 0, 1, 1, 1, 0, 1,
2017 1, 0, 1, 1, 1, 1, 0, 1, 1, 0,
2018 1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
2019 1, 1, 1, 1, 1, 2, 0, 2, 1, 1,
2020 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2021 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
2022 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2023 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
2024 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
2025 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
2026 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2027 6, 5, 8, 6, 6, 7, 7, 7, 7, 6,
2028 8, 8, 5, 7, 3, 1, 1, 1, 1, 0,
2029 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
2030 3, 3, 3, 0, 8, 0, 9, 0, 9, 5,
2031 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
2032 3, 1, 3, 1, 0, 10, 1, 1, 4, 1,
2033 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
2034 1, 1, 1, 3, 1, 5, 1, 1, 1, 1,
2035 1, 1, 2, 1, 3, 2, 2, 3, 2, 0,
2036 1, 2, 2, 3, 9, 9, 8, 14, 1, 1,
2037 6, 5, 2, 6, 7, 4, 4, 6, 6, 0,
2038 0, 3, 2, 3, 2, 1, 5, 5, 6, 6,
2039 6, 6, 4, 6, 4, 4, 6, 6, 2, 8,
2040 1, 1, 0, 3, 6, 3, 6, 2, 5, 7,
2044 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2045 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2046 means the default is an error. */
2047 static const yytype_uint16 yydefact[] =
2049 73, 61, 70, 62, 71, 63, 218, 216, 0, 0,
2050 0, 0, 0, 0, 84, 72, 0, 73, 214, 88,
2051 91, 0, 0, 230, 0, 0, 68, 0, 74, 75,
2052 77, 76, 78, 81, 79, 82, 80, 83, 85, 86,
2053 87, 84, 84, 209, 1, 215, 89, 90, 84, 219,
2054 92, 93, 94, 95, 84, 279, 217, 279, 0, 0,
2055 238, 231, 232, 220, 266, 267, 222, 139, 140, 141,
2056 144, 143, 142, 145, 146, 0, 0, 0, 0, 268,
2057 269, 147, 221, 149, 209, 209, 96, 208, 0, 99,
2058 99, 280, 276, 69, 249, 250, 251, 275, 233, 234,
2059 237, 0, 167, 150, 0, 0, 0, 0, 156, 168,
2060 0, 0, 167, 0, 0, 0, 98, 97, 0, 206,
2061 207, 0, 0, 100, 101, 102, 103, 104, 0, 252,
2062 0, 322, 278, 0, 235, 166, 116, 162, 164, 0,
2063 0, 0, 0, 0, 0, 155, 0, 0, 148, 0,
2064 0, 161, 0, 160, 0, 229, 139, 140, 141, 144,
2065 143, 142, 0, 0, 67, 67, 105, 0, 246, 247,
2066 248, 321, 305, 0, 0, 0, 0, 99, 288, 289,
2067 2, 3, 4, 5, 6, 7, 8, 9, 10, 14,
2068 15, 16, 11, 12, 13, 0, 0, 0, 0, 0,
2069 0, 0, 0, 17, 18, 19, 20, 21, 22, 23,
2070 24, 25, 26, 27, 28, 0, 0, 0, 0, 0,
2071 0, 0, 0, 0, 0, 0, 0, 277, 99, 292,
2072 0, 320, 236, 159, 0, 124, 67, 67, 158, 0,
2073 169, 0, 124, 67, 67, 0, 210, 187, 188, 183,
2074 185, 184, 186, 189, 182, 178, 179, 0, 0, 0,
2075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2076 0, 0, 0, 0, 0, 181, 180, 223, 0, 304,
2077 282, 67, 273, 281, 0, 0, 55, 0, 0, 29,
2078 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2079 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2080 43, 44, 45, 46, 47, 48, 0, 0, 0, 130,
2081 130, 327, 67, 67, 318, 0, 0, 0, 0, 0,
2082 67, 67, 67, 67, 67, 0, 0, 0, 0, 0,
2083 107, 109, 108, 106, 110, 111, 112, 113, 114, 117,
2084 165, 163, 152, 153, 154, 157, 66, 151, 225, 227,
2085 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2086 0, 0, 171, 205, 0, 0, 0, 175, 0, 172,
2087 0, 0, 0, 135, 244, 255, 256, 257, 262, 258,
2088 259, 260, 261, 253, 0, 264, 271, 270, 272, 0,
2089 0, 283, 0, 0, 67, 67, 67, 67, 0, 323,
2090 0, 325, 300, 0, 0, 0, 0, 0, 0, 0,
2091 0, 0, 0, 0, 0, 0, 0, 67, 0, 115,
2092 121, 120, 118, 119, 122, 123, 125, 135, 135, 0,
2093 0, 0, 0, 0, 300, 0, 0, 0, 0, 0,
2094 0, 0, 170, 156, 168, 0, 173, 174, 0, 0,
2095 0, 0, 224, 243, 116, 241, 0, 254, 0, 0,
2096 274, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2097 0, 331, 0, 0, 0, 314, 315, 0, 0, 0,
2098 0, 332, 0, 0, 0, 312, 0, 130, 0, 226,
2099 228, 67, 0, 0, 0, 0, 0, 0, 0, 0,
2100 0, 0, 0, 204, 177, 0, 0, 0, 0, 0,
2101 0, 137, 135, 65, 0, 124, 0, 263, 0, 0,
2102 299, 0, 0, 0, 0, 130, 131, 130, 0, 0,
2103 0, 0, 0, 0, 330, 302, 0, 67, 306, 307,
2104 299, 0, 328, 67, 211, 0, 0, 0, 0, 191,
2105 0, 0, 0, 0, 202, 0, 176, 0, 0, 67,
2106 132, 138, 136, 64, 240, 242, 116, 133, 0, 0,
2107 0, 116, 116, 0, 308, 309, 310, 311, 324, 326,
2108 301, 0, 0, 313, 316, 317, 303, 0, 0, 130,
2109 0, 0, 0, 0, 0, 199, 0, 0, 0, 193,
2110 194, 190, 65, 134, 128, 265, 0, 0, 0, 0,
2111 124, 0, 293, 0, 333, 124, 329, 195, 196, 197,
2112 198, 0, 0, 0, 203, 239, 0, 126, 0, 286,
2113 0, 0, 107, 109, 116, 116, 0, 116, 116, 294,
2114 319, 192, 200, 201, 129, 0, 245, 284, 0, 285,
2115 0, 296, 295, 0, 0, 0, 127, 0, 0, 0,
2116 116, 116, 0, 0, 0, 298, 297, 291, 0, 0,
2120 /* YYDEFGOTO[NTERM-NUM]. */
2121 static const yytype_int16 yydefgoto[] =
2123 -1, 272, 273, 274, 299, 316, 162, 163, 79, 574,
2124 113, 12, 80, 14, 15, 41, 42, 43, 48, 54,
2125 118, 128, 349, 233, 436, 352, 656, 637, 409, 521,
2126 614, 462, 522, 81, 164, 137, 154, 138, 139, 110,
2127 373, 395, 374, 121, 88, 155, 16, 17, 18, 20,
2128 19, 383, 437, 438, 63, 23, 61, 101, 465, 466,
2129 129, 170, 55, 96, 56, 49, 468, 396, 83, 398,
2130 282, 283, 57, 92, 93, 227, 641, 132, 324, 583,
2131 481, 491, 228, 229, 230, 231
2134 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2136 #define YYPACT_NINF -611
2137 static const yytype_int16 yypact[] =
2139 645, -611, -611, -611, -611, -611, -611, -611, -11, -112,
2140 3, -74, 83, -41, 26, -611, 111, 692, -611, -17,
2141 199, -19, 54, -611, 21, 124, -611, 1670, -611, -611,
2142 -611, -611, -611, -611, -611, -611, -611, -611, -611, -611,
2143 -611, 17, 17, 72, -611, -611, -611, -611, 17, -611,
2144 -611, -611, -611, -611, 17, 137, -611, -5, 196, 204,
2145 215, -611, -611, -611, -611, -611, 65, -611, -611, -611,
2146 -611, -611, -611, -611, -611, 262, 265, 2, 322, -611,
2147 -611, -611, -40, -611, 240, 240, 219, -611, 319, 193,
2148 193, -611, -611, 257, -611, -611, -611, -611, -611, -611,
2149 -611, 52, 1252, -611, 120, 131, 671, 65, -611, -40,
2150 -101, 132, 1252, 139, 319, 319, -611, -611, 1359, -611,
2151 -611, 1711, 299, -611, -611, -611, -611, -611, 1772, -611,
2152 -16, 2051, -611, 287, -611, -611, -40, -611, 154, 160,
2153 1831, 1831, 159, -77, 1831, -611, 316, 183, -611, 1711,
2154 1831, 65, 175, -40, 278, -611, 248, 334, 338, 356,
2155 357, 358, 244, 359, 1310, 314, -611, 36, -611, -611,
2156 -611, -611, -611, 313, 1872, 34, 360, 193, -611, -611,
2157 -611, -611, -611, -611, -611, -611, -611, -611, -611, -611,
2158 -611, -611, -611, -611, -611, 324, 522, 324, 522, 1831,
2159 1831, 1831, 1831, -611, -611, -611, -611, -611, -611, -611,
2160 -611, -611, -611, -611, -611, 1831, 1831, 1831, 1831, 1831,
2161 1831, 1831, 1831, 1831, 1831, 1831, 1831, -611, 193, -611,
2162 236, -611, -611, 174, 1548, -611, -12, -23, -611, 208,
2163 -40, 218, -611, 314, -22, 1359, -611, -611, -611, -611,
2164 -611, -611, -611, -611, -611, -611, -611, 324, 522, 324,
2165 522, 220, 221, 222, 224, 227, 229, 230, 1589, 1890,
2166 931, 366, 241, 251, 252, -611, -611, -611, 253, -611,
2167 65, 881, -611, 237, 1025, 1025, -611, 1025, 1772, -611,
2168 -611, -611, -611, -611, -611, -611, -611, -611, -611, 1831,
2169 -611, -611, -611, -611, -611, -611, -611, -611, -611, -611,
2170 -611, -611, -611, -611, -611, -611, 1831, 1831, 1831, -6,
2171 8, -611, 881, -7, 239, 269, 272, 277, 279, 280,
2172 881, 881, 881, 881, 881, 372, 1772, 1831, 1831, 433,
2173 -611, -611, -611, -611, -611, -611, -611, -611, -611, -611,
2174 -611, -611, -47, -611, -611, -611, -611, -47, -611, 139,
2175 403, 286, 288, 289, 290, 1711, 1711, 1711, 1711, 1711,
2176 1711, 1711, -611, -611, 58, 972, -54, -611, 46, -611,
2177 1711, 1711, 1711, 291, 1611, -611, -611, -611, -611, -611,
2178 -611, -611, -611, 386, 1711, -611, -611, -611, -611, 1831,
2179 292, -611, 293, 1025, 881, 881, 881, 881, 24, -611,
2180 25, -611, -611, 1025, 294, 1831, 1831, 1831, 1831, 1831,
2181 296, 303, 304, 305, 306, 1831, 1025, 881, 309, -611,
2182 -611, -611, -611, -611, -611, -611, -611, 291, 291, 1831,
2183 1711, 1711, 1711, 1711, -611, 310, 311, 312, 315, 303,
2184 320, 1711, -611, 307, 1159, 56, -611, -611, 321, 323,
2185 415, 10, -611, -611, -40, 326, 331, -611, 459, -53,
2186 -611, 474, 477, 339, 337, 340, 341, 342, 1025, 493,
2187 1025, 343, 344, 1025, 346, -40, -611, 347, 348, 504,
2188 505, 351, 1831, 1025, 1025, -40, 355, 354, 1831, -611,
2189 -611, 45, 362, 363, 367, 368, -69, 1711, 1711, 1711,
2190 1711, 121, 1711, -611, -611, 352, 1711, 1711, 1831, 492,
2191 521, -611, 291, 123, 1652, -611, 369, -611, 1025, 1025,
2192 1934, 1025, 1025, 1025, 1025, 354, -611, 354, 1831, 1025,
2193 370, 1831, 1831, 1831, -611, -611, 531, 881, -611, -611,
2194 1934, 482, -611, 881, -611, 1711, 1711, 1711, 1711, -611,
2195 378, 381, 382, 387, -611, 303, -611, 393, 398, 53,
2196 -611, -611, -611, -611, -611, -611, -40, -14, 534, 399,
2197 395, 6, -40, 125, -611, -611, -611, -611, -611, -611,
2198 -611, 396, 1025, -611, -611, -611, -611, 303, 167, 354,
2199 402, 404, 405, 406, 1711, -611, 1711, 1711, 191, -611,
2200 -611, -611, 123, -611, 510, -611, 550, -4, 734, 734,
2201 -611, 1952, -611, 407, 351, -611, -611, -611, -611, -611,
2202 -611, 411, 412, 417, -611, -611, 568, 423, 1025, -611,
2203 1455, -3, 420, 421, -611, -611, -20, 6, -40, -611,
2204 -47, -611, -611, -611, -611, 556, -611, -611, 422, -611,
2205 1455, 174, 174, 563, 734, 734, -611, 566, 425, 1025,
2206 -611, -611, 1025, 569, 512, 174, 174, -611, 1025, 570,
2210 /* YYPGOTO[NTERM-NUM]. */
2211 static const yytype_int16 yypgoto[] =
2213 -611, 457, 458, 463, -176, -171, -174, -611, 0, -15,
2214 -146, 503, 11, -611, -611, -611, -611, 12, -611, -611,
2215 -611, -143, -611, -441, -611, -238, -611, -611, -310, 22,
2216 -611, -412, -611, -611, -26, 364, -123, -611, 488, 495,
2217 35, -161, -256, 242, 276, 361, -611, -611, 585, -611,
2218 -611, -611, -611, -611, -611, -611, -611, -611, -611, -611,
2219 513, -611, -611, -611, -611, -611, -611, -610, -99, 127,
2220 -179, -611, -611, 547, -611, -611, -611, -611, -611, 59,
2221 164, -440, -611, -611, -611, -611
2224 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2225 positive, shift that token. If negative, reduce the rule which
2226 number is the opposite. If zero, do what YYDEFACT says.
2227 If YYTABLE_NINF, syntax error. */
2228 #define YYTABLE_NINF -214
2229 static const yytype_int16 yytable[] =
2231 11, 82, 287, 275, 357, 167, 105, 286, 286, 511,
2232 411, 13, 168, 376, 378, 111, 91, 11, 663, 277,
2233 519, 317, 321, 523, 94, 499, 500, 318, 13, 46,
2234 658, 47, 111, 111, 288, 478, 480, 325, 326, 327,
2235 328, 329, 21, 111, 519, 284, 24, 335, 111, 111,
2236 668, 285, 109, 84, 85, 246, 2, 22, 144, 4,
2237 89, -145, 25, 111, 520, 276, 90, 145, 29, 30,
2238 31, 32, 33, 34, 35, 36, 136, 37, 479, 479,
2239 109, 361, 144, 363, 26, 336, 136, 362, 559, 364,
2240 538, 239, 153, 11, 430, 431, 432, 358, 359, 433,
2241 111, 27, 153, 434, 435, 451, 451, 86, 111, 87,
2242 572, 44, 456, 527, 236, 237, 112, 28, 240, 455,
2243 -67, 430, 431, 432, 244, 608, 433, 430, 431, 432,
2244 434, 435, 433, 112, 112, 612, 434, 435, 469, 58,
2245 618, 619, 1, 354, 112, 3, 62, 5, 281, 112,
2246 112, 169, 353, 408, -67, 413, 165, 624, 91, 428,
2247 639, 659, -145, 95, 112, 403, -145, 410, -67, 106,
2248 38, 39, 40, 319, 320, 281, 322, 339, 278, 38,
2249 39, 40, 397, 60, 243, 397, 397, 552, 397, 323,
2250 281, 281, 281, 281, 281, 330, 331, 332, 333, 334,
2251 281, 112, 554, 661, 662, 451, 664, 665, 136, 112,
2252 611, 133, 59, 426, 457, 451, 134, 451, 98, 153,
2253 470, 102, 452, 397, 515, 588, 99, 589, 339, 675,
2254 676, 397, 397, 397, 397, 397, 484, 100, 486, 487,
2255 488, 50, 51, 52, 340, 341, 53, 249, 250, 251,
2256 252, -55, -55, -55, -55, 122, 123, 124, 125, 126,
2257 127, 116, 153, 117, 342, 343, 103, 344, 345, 104,
2258 346, 347, 348, 404, 247, 248, 1, 87, 564, 3,
2259 546, 5, 620, 140, 621, 64, 65, 577, 146, 626,
2260 405, 406, 407, 275, 141, 340, 341, 1, 2, 148,
2261 3, 4, 5, 166, 397, 397, 397, 397, 397, 232,
2262 153, 427, 281, 234, 397, 342, 343, 235, 344, 345,
2263 241, 346, 347, 348, 625, 238, 621, 397, 397, 64,
2264 65, 245, 107, 67, 68, 69, 70, 71, 72, 73,
2265 242, 1, 2, -56, 3, 4, 5, -57, 634, 454,
2266 546, 119, 120, 337, 338, 276, 149, 150, 464, 590,
2267 114, 115, 593, 594, 595, -60, -59, -58, 253, 111,
2268 279, 286, 74, 281, 355, 356, 365, 366, 367, 397,
2269 368, 397, 646, 369, 397, 370, 371, 650, 379, 281,
2270 485, 281, 281, 281, 397, 397, 399, 380, 414, 495,
2271 444, 445, 446, 447, 448, 449, 450, 381, 382, 384,
2272 425, 400, 401, 501, 402, 458, 459, 460, 289, 290,
2273 291, 292, 293, 294, 295, 296, 297, 298, 415, 397,
2274 397, 416, 397, 397, 397, 397, 417, 429, 418, 419,
2275 397, 439, 440, 640, 441, 442, 443, 467, 397, 412,
2276 461, 471, 472, 518, 397, 489, 483, 420, 421, 422,
2277 423, 424, 490, 492, 493, 494, 547, 660, 498, 507,
2278 508, 509, 553, 514, 510, 502, 503, 504, 505, 512,
2279 516, 526, 517, 75, 76, 524, 513, 77, 525, 78,
2280 108, 528, 569, 397, 529, 530, 531, 536, 576, 532,
2281 533, 534, 538, 539, 582, 541, 542, 543, 544, 545,
2282 546, 550, 281, 551, 570, 281, 281, 281, 566, 397,
2283 397, 555, 556, 573, 582, 571, 557, 558, 578, 592,
2284 473, 474, 475, 476, 477, 596, 479, 604, 605, 397,
2285 482, 606, 560, 561, 562, 563, 607, 565, 300, 301,
2286 609, 567, 568, 496, 497, 610, 615, 617, 616, 627,
2287 622, 628, 629, 630, 636, 397, 397, 638, 651, 652,
2288 397, 649, 654, 397, 653, 655, -18, -19, 666, 397,
2289 669, 667, 397, 672, 673, 679, 678, 681, 224, 225,
2290 600, 601, 602, 603, 226, 648, 131, 635, 351, 613,
2291 147, 143, 45, 130, 97, 535, 360, 537, 506, 598,
2292 540, 0, 573, 0, 0, 0, 0, 0, 0, 0,
2293 548, 549, 302, 303, 304, 305, 306, 307, 308, 309,
2294 310, 311, 312, 313, 314, 315, 0, 0, 0, 631,
2295 0, 632, 633, 0, 0, -213, 0, 0, 0, 0,
2296 0, 0, 0, 0, 0, 579, 580, 0, 584, 585,
2297 586, 587, 0, -69, 1, 2, 591, 3, 4, 5,
2298 0, 0, 0, 0, 597, 6, 7, 0, 64, 65,
2299 599, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2300 1, 2, -212, 3, 4, 5, 0, 8, 0, 0,
2301 0, 9, 0, 0, 0, 10, 0, 0, 0, 0,
2302 -69, 1, 2, 0, 3, 4, 5, 0, 0, 623,
2303 0, 74, 6, 7, 0, 0, 0, 0, 0, 0,
2304 0, 0, 0, 0, 0, 0, 0, 385, 386, 0,
2305 0, 64, 65, 387, 8, 644, 645, 0, 9, 0,
2306 0, 0, 10, 1, 2, 0, 3, 4, 5, 388,
2307 389, 390, 0, 0, 0, 657, 0, 0, 0, 0,
2308 0, 0, 0, 0, 391, 392, 0, 0, 0, 0,
2309 0, 0, 0, 0, 0, 0, 0, 0, 339, 0,
2310 0, 670, 671, 393, 0, 0, 674, 0, 0, 677,
2311 0, 0, 0, 0, 0, 680, 0, 0, 682, 180,
2312 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
2313 191, 192, 193, 194, 257, 258, 259, 260, 0, 0,
2314 0, 0, 75, 76, 0, 0, 77, 0, 78, 142,
2315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2316 0, 0, 0, 261, 203, 642, 643, 206, 207, 208,
2317 209, 210, 211, 212, 213, 214, 0, 262, 0, 263,
2318 264, 265, 0, 266, 267, 342, 343, 0, 344, 345,
2319 0, 346, 347, 348, 385, 386, 0, 0, 64, 65,
2320 387, 0, 0, 0, 0, 0, 0, 0, 0, 394,
2321 1, 2, 0, 3, 4, 5, 388, 389, 390, 0,
2322 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2323 0, 391, 392, 0, 0, 0, 0, 0, 0, 0,
2324 0, 0, 0, 0, 0, 0, 111, 0, 64, 65,
2325 393, 107, 156, 157, 158, 159, 160, 161, 73, 0,
2326 1, 2, 0, 3, 4, 5, 180, 181, 182, 183,
2327 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2328 194, 257, 258, 259, 260, 0, 0, 0, 0, 64,
2329 65, 74, 107, 156, 157, 158, 159, 160, 161, 73,
2330 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2331 261, 203, 204, 205, 206, 207, 208, 209, 210, 211,
2332 212, 213, 214, 0, 262, 0, 263, 264, 265, 0,
2333 266, 267, 74, 0, 0, 0, 0, 0, 385, 386,
2334 0, 0, 64, 65, 387, 0, 0, 112, 0, 0,
2335 0, 0, 0, 0, 1, 2, 394, 3, 4, 5,
2336 388, 389, 390, 0, 0, 0, 0, 0, 0, 0,
2337 0, 0, 0, 0, 0, 391, 392, 0, 0, 0,
2338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2339 0, 0, 0, 0, 393, 0, 0, 0, 0, 0,
2340 0, 0, 75, 76, 0, 0, 77, 0, 78, 377,
2341 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2342 190, 191, 192, 193, 194, 257, 258, 259, 260, 0,
2343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2344 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2345 453, 0, 0, 0, 261, 203, 204, 205, 206, 207,
2346 208, 209, 210, 211, 212, 213, 214, 0, 262, 0,
2347 263, 264, 265, 0, 266, 267, 64, 65, 0, 0,
2348 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
2349 0, 3, 4, 5, 254, 0, 0, 0, 0, 0,
2350 394, 0, 0, 0, 0, 0, 0, 0, 0, 255,
2351 256, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2352 0, 0, 0, 0, 111, 0, 0, 0, 0, 0,
2353 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2354 0, 0, 0, 0, 180, 181, 182, 183, 184, 185,
2355 186, 187, 188, 189, 190, 191, 192, 193, 194, 257,
2356 258, 259, 260, 0, 0, 0, 0, 0, 0, 64,
2357 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2358 0, 1, 2, 0, 3, 4, 5, 0, 261, 203,
2359 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
2360 214, 135, 262, 0, 263, 264, 265, 0, 266, 267,
2361 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2362 0, 0, 0, 0, 0, 112, 0, 64, 65, -67,
2363 0, 268, 0, 0, 269, 0, 270, 0, 271, 1,
2364 2, 0, 3, 4, 5, 254, 0, 0, 0, 0,
2365 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2366 255, 256, 0, 0, 0, 0, 0, 0, 0, 0,
2367 0, 0, 0, 0, 0, 111, 64, 65, 0, 151,
2368 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2369 0, 3, 4, 5, 0, 180, 181, 182, 183, 184,
2370 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2371 257, 258, 259, 260, 0, 0, 0, 0, 0, 74,
2372 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2373 0, 0, 0, 0, 0, 0, 0, 0, 0, 261,
2374 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
2375 213, 214, 0, 262, 0, 263, 264, 265, 0, 266,
2376 267, 0, 0, 0, 0, 0, 0, 0, 385, 386,
2377 0, 0, 0, 0, 387, 0, 112, 0, 0, 0,
2378 0, 0, 268, 0, 0, 269, 0, 270, 0, 271,
2379 388, 389, 390, 0, 152, 0, 0, 0, 0, 0,
2380 0, 0, 0, 0, 0, 391, 392, 0, 0, 0,
2381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2382 0, 0, 0, 0, 393, 0, 0, 0, 0, 0,
2383 75, 76, 0, 0, 77, 0, 78, 0, 0, 0,
2384 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2385 190, 191, 192, 193, 194, 257, 258, 259, 260, 0,
2386 0, 0, 0, 0, 0, 64, 65, 0, 107, 67,
2387 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2388 3, 4, 5, 0, 261, 203, 204, 205, 206, 207,
2389 208, 209, 210, 211, 212, 213, 214, 350, 262, 0,
2390 263, 264, 265, 0, 266, 267, 64, 65, 74, 107,
2391 156, 157, 158, 159, 160, 161, 73, 0, 1, 2,
2392 0, 3, 4, 5, 0, 0, 0, 0, 64, 65,
2393 394, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2394 1, 2, 0, 3, 4, 5, 0, 0, 0, 74,
2395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2396 463, 0, 0, 0, 0, 0, 0, 0, 0, 64,
2397 65, 74, 107, 67, 68, 69, 70, 71, 72, 73,
2398 0, 1, 2, 0, 3, 4, 5, 64, 65, 0,
2399 66, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2400 2, 575, 3, 4, 5, 0, 0, 0, 0, 0,
2401 0, 0, 74, 0, 0, 0, 0, 0, 0, 75,
2402 76, 0, 0, 77, 0, 78, 0, 0, 64, 65,
2403 74, 107, 156, 157, 158, 159, 160, 161, 73, 0,
2404 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2405 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2406 75, 76, 0, 372, 77, 0, 78, 0, 0, 0,
2407 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
2408 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2409 65, 0, 151, 67, 68, 69, 70, 71, 72, 73,
2410 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2411 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2412 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2413 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2414 0, 75, 76, 0, 0, 77, 0, 78, 64, 65,
2415 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2416 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2418 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2419 65, 74, 280, 67, 68, 69, 70, 71, 72, 73,
2420 0, 1, 2, 0, 3, 4, 5, 64, 65, 0,
2421 107, 156, 157, 158, 159, 160, 161, 73, 0, 1,
2422 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2423 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2424 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2425 74, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2426 72, 581, 0, 1, 2, 0, 3, 4, 5, 64,
2427 65, 0, 107, 67, 68, 69, 70, 71, 72, 647,
2428 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2429 0, 0, 0, 0, 74, 0, 0, 0, 0, 0,
2430 0, 0, 75, 76, 0, 0, 77, 0, 78, 0,
2431 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2432 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2434 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2436 0, 75, 76, 0, 0, 77, 0, 375, 0, 0,
2437 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2438 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2439 0, 0, 0, 0, 0, 0, 0, 171, 0, 0,
2440 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2441 0, 78, 0, 0, 0, 0, 0, 0, 172, 173,
2442 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2443 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2444 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2445 194, 195, 196, 197, 198, 0, 0, 0, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2447 0, 0, 0, 0, 0, 199, 200, 201, 0, 0,
2448 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
2449 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
2453 static const yytype_int16 yycheck[] =
2455 0, 27, 176, 164, 242, 128, 4, 11, 11, 449,
2456 320, 0, 28, 269, 270, 55, 21, 17, 38, 165,
2457 34, 197, 201, 464, 29, 437, 438, 198, 17, 46,
2458 640, 48, 55, 55, 177, 11, 11, 216, 217, 218,
2459 219, 220, 53, 55, 34, 11, 158, 226, 55, 55,
2460 660, 17, 78, 41, 42, 154, 20, 68, 159, 23,
2461 48, 55, 59, 55, 54, 164, 54, 168, 42, 43,
2462 44, 45, 46, 47, 48, 49, 102, 51, 54, 54,
2463 106, 257, 159, 259, 158, 228, 112, 258, 157, 260,
2464 159, 168, 118, 93, 141, 142, 143, 243, 244, 146,
2465 55, 18, 128, 150, 151, 159, 159, 35, 55, 37,
2466 522, 0, 166, 166, 140, 141, 156, 158, 144, 375,
2467 160, 141, 142, 143, 150, 565, 146, 141, 142, 143,
2468 150, 151, 146, 156, 156, 576, 150, 151, 394, 158,
2469 581, 582, 19, 166, 156, 22, 22, 24, 174, 156,
2470 156, 167, 164, 159, 160, 162, 121, 597, 21, 338,
2471 164, 164, 156, 168, 156, 288, 160, 159, 160, 167,
2472 153, 154, 155, 199, 200, 201, 202, 54, 167, 153,
2473 154, 155, 281, 162, 149, 284, 285, 497, 287, 215,
2474 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
2475 226, 156, 157, 644, 645, 159, 647, 648, 234, 156,
2476 157, 159, 158, 336, 168, 159, 164, 159, 22, 245,
2477 399, 156, 164, 322, 168, 535, 22, 537, 54, 670,
2478 671, 330, 331, 332, 333, 334, 415, 22, 417, 418,
2479 419, 42, 43, 44, 121, 122, 47, 3, 4, 5,
2480 6, 3, 4, 5, 6, 62, 63, 64, 65, 66,
2481 67, 42, 288, 44, 141, 142, 4, 144, 145, 4,
2482 147, 148, 149, 299, 26, 27, 19, 37, 157, 22,
2483 159, 24, 157, 163, 159, 7, 8, 525, 156, 599,
2484 316, 317, 318, 454, 163, 121, 122, 19, 20, 160,
2485 22, 23, 24, 4, 403, 404, 405, 406, 407, 22,
2486 336, 337, 338, 159, 413, 141, 142, 157, 144, 145,
2487 4, 147, 148, 149, 157, 166, 159, 426, 427, 7,
2488 8, 156, 10, 11, 12, 13, 14, 15, 16, 17,
2489 157, 19, 20, 9, 22, 23, 24, 9, 157, 375,
2490 159, 32, 33, 117, 118, 454, 114, 115, 384, 538,
2491 84, 85, 541, 542, 543, 9, 9, 9, 9, 55,
2492 57, 11, 50, 399, 166, 157, 156, 156, 156, 478,
2493 156, 480, 620, 156, 483, 156, 156, 625, 22, 415,
2494 416, 417, 418, 419, 493, 494, 159, 156, 159, 425,
2495 365, 366, 367, 368, 369, 370, 371, 156, 156, 156,
2496 38, 284, 285, 439, 287, 380, 381, 382, 94, 95,
2497 96, 97, 98, 99, 100, 101, 102, 103, 159, 528,
2498 529, 159, 531, 532, 533, 534, 159, 4, 159, 159,
2499 539, 38, 156, 617, 156, 156, 156, 61, 547, 322,
2500 159, 159, 159, 38, 553, 159, 162, 330, 331, 332,
2501 333, 334, 159, 159, 159, 159, 492, 641, 159, 159,
2502 159, 159, 498, 166, 159, 440, 441, 442, 443, 159,
2503 159, 22, 159, 161, 162, 159, 451, 165, 157, 167,
2504 168, 17, 518, 592, 17, 156, 159, 4, 524, 159,
2505 159, 159, 159, 159, 530, 159, 159, 159, 4, 4,
2506 159, 156, 538, 159, 22, 541, 542, 543, 166, 618,
2507 619, 159, 159, 523, 550, 4, 159, 159, 159, 159,
2508 403, 404, 405, 406, 407, 4, 54, 159, 157, 638,
2509 413, 159, 507, 508, 509, 510, 159, 512, 26, 27,
2510 157, 516, 517, 426, 427, 157, 22, 162, 159, 157,
2511 164, 157, 157, 157, 54, 664, 665, 17, 157, 157,
2512 669, 164, 4, 672, 157, 152, 156, 156, 22, 678,
2513 17, 159, 681, 17, 159, 73, 17, 17, 131, 131,
2514 555, 556, 557, 558, 131, 621, 93, 612, 234, 577,
2515 112, 106, 17, 90, 57, 478, 245, 480, 444, 550,
2516 483, -1, 612, -1, -1, -1, -1, -1, -1, -1,
2517 493, 494, 100, 101, 102, 103, 104, 105, 106, 107,
2518 108, 109, 110, 111, 112, 113, -1, -1, -1, 604,
2519 -1, 606, 607, -1, -1, 0, -1, -1, -1, -1,
2520 -1, -1, -1, -1, -1, 528, 529, -1, 531, 532,
2521 533, 534, -1, 18, 19, 20, 539, 22, 23, 24,
2522 -1, -1, -1, -1, 547, 30, 31, -1, 7, 8,
2523 553, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2524 19, 20, 0, 22, 23, 24, -1, 52, -1, -1,
2525 -1, 56, -1, -1, -1, 60, -1, -1, -1, -1,
2526 18, 19, 20, -1, 22, 23, 24, -1, -1, 592,
2527 -1, 50, 30, 31, -1, -1, -1, -1, -1, -1,
2528 -1, -1, -1, -1, -1, -1, -1, 3, 4, -1,
2529 -1, 7, 8, 9, 52, 618, 619, -1, 56, -1,
2530 -1, -1, 60, 19, 20, -1, 22, 23, 24, 25,
2531 26, 27, -1, -1, -1, 638, -1, -1, -1, -1,
2532 -1, -1, -1, -1, 40, 41, -1, -1, -1, -1,
2533 -1, -1, -1, -1, -1, -1, -1, -1, 54, -1,
2534 -1, 664, 665, 59, -1, -1, 669, -1, -1, 672,
2535 -1, -1, -1, -1, -1, 678, -1, -1, 681, 75,
2536 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2537 86, 87, 88, 89, 90, 91, 92, 93, -1, -1,
2538 -1, -1, 161, 162, -1, -1, 165, -1, 167, 168,
2539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2540 -1, -1, -1, 119, 120, 121, 122, 123, 124, 125,
2541 126, 127, 128, 129, 130, 131, -1, 133, -1, 135,
2542 136, 137, -1, 139, 140, 141, 142, -1, 144, 145,
2543 -1, 147, 148, 149, 3, 4, -1, -1, 7, 8,
2544 9, -1, -1, -1, -1, -1, -1, -1, -1, 165,
2545 19, 20, -1, 22, 23, 24, 25, 26, 27, -1,
2546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2547 -1, 40, 41, -1, -1, -1, -1, -1, -1, -1,
2548 -1, -1, -1, -1, -1, -1, 55, -1, 7, 8,
2549 59, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2550 19, 20, -1, 22, 23, 24, 75, 76, 77, 78,
2551 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2552 89, 90, 91, 92, 93, -1, -1, -1, -1, 7,
2553 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2554 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2555 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2556 129, 130, 131, -1, 133, -1, 135, 136, 137, -1,
2557 139, 140, 50, -1, -1, -1, -1, -1, 3, 4,
2558 -1, -1, 7, 8, 9, -1, -1, 156, -1, -1,
2559 -1, -1, -1, -1, 19, 20, 165, 22, 23, 24,
2560 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
2561 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2562 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2563 -1, -1, -1, -1, 59, -1, -1, -1, -1, -1,
2564 -1, -1, 161, 162, -1, -1, 165, -1, 167, 168,
2565 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2566 85, 86, 87, 88, 89, 90, 91, 92, 93, -1,
2567 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2568 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2569 168, -1, -1, -1, 119, 120, 121, 122, 123, 124,
2570 125, 126, 127, 128, 129, 130, 131, -1, 133, -1,
2571 135, 136, 137, -1, 139, 140, 7, 8, -1, -1,
2572 -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
2573 -1, 22, 23, 24, 25, -1, -1, -1, -1, -1,
2574 165, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2575 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2576 -1, -1, -1, -1, 55, -1, -1, -1, -1, -1,
2577 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2578 -1, -1, -1, -1, 75, 76, 77, 78, 79, 80,
2579 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2580 91, 92, 93, -1, -1, -1, -1, -1, -1, 7,
2581 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2582 -1, 19, 20, -1, 22, 23, 24, -1, 119, 120,
2583 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2584 131, 39, 133, -1, 135, 136, 137, -1, 139, 140,
2585 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2586 -1, -1, -1, -1, -1, 156, -1, 7, 8, 160,
2587 -1, 162, -1, -1, 165, -1, 167, -1, 169, 19,
2588 20, -1, 22, 23, 24, 25, -1, -1, -1, -1,
2589 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2590 40, 41, -1, -1, -1, -1, -1, -1, -1, -1,
2591 -1, -1, -1, -1, -1, 55, 7, 8, -1, 10,
2592 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2593 -1, 22, 23, 24, -1, 75, 76, 77, 78, 79,
2594 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2595 90, 91, 92, 93, -1, -1, -1, -1, -1, 50,
2596 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2597 -1, -1, -1, -1, -1, -1, -1, -1, -1, 119,
2598 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
2599 130, 131, -1, 133, -1, 135, 136, 137, -1, 139,
2600 140, -1, -1, -1, -1, -1, -1, -1, 3, 4,
2601 -1, -1, -1, -1, 9, -1, 156, -1, -1, -1,
2602 -1, -1, 162, -1, -1, 165, -1, 167, -1, 169,
2603 25, 26, 27, -1, 125, -1, -1, -1, -1, -1,
2604 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2605 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2606 -1, -1, -1, -1, 59, -1, -1, -1, -1, -1,
2607 161, 162, -1, -1, 165, -1, 167, -1, -1, -1,
2608 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2609 85, 86, 87, 88, 89, 90, 91, 92, 93, -1,
2610 -1, -1, -1, -1, -1, 7, 8, -1, 10, 11,
2611 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2612 22, 23, 24, -1, 119, 120, 121, 122, 123, 124,
2613 125, 126, 127, 128, 129, 130, 131, 39, 133, -1,
2614 135, 136, 137, -1, 139, 140, 7, 8, 50, 10,
2615 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2616 -1, 22, 23, 24, -1, -1, -1, -1, 7, 8,
2617 165, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2618 19, 20, -1, 22, 23, 24, -1, -1, -1, 50,
2619 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2620 39, -1, -1, -1, -1, -1, -1, -1, -1, 7,
2621 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2622 -1, 19, 20, -1, 22, 23, 24, 7, 8, -1,
2623 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2624 20, 39, 22, 23, 24, -1, -1, -1, -1, -1,
2625 -1, -1, 50, -1, -1, -1, -1, -1, -1, 161,
2626 162, -1, -1, 165, -1, 167, -1, -1, 7, 8,
2627 50, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2628 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2629 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2630 161, 162, -1, 164, 165, -1, 167, -1, -1, -1,
2631 -1, 50, -1, -1, -1, -1, -1, -1, -1, -1,
2632 -1, -1, 161, 162, -1, -1, 165, -1, 167, 7,
2633 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2634 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2635 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2636 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2637 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2638 -1, 161, 162, -1, -1, 165, -1, 167, 7, 8,
2639 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2640 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2642 -1, -1, 161, 162, -1, -1, 165, -1, 167, 7,
2643 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2644 -1, 19, 20, -1, 22, 23, 24, 7, 8, -1,
2645 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2646 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2647 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2648 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2649 50, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2650 16, 17, -1, 19, 20, -1, 22, 23, 24, 7,
2651 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2652 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2653 -1, -1, -1, -1, 50, -1, -1, -1, -1, -1,
2654 -1, -1, 161, 162, -1, -1, 165, -1, 167, -1,
2655 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2656 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2657 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2658 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2659 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2660 -1, 161, 162, -1, -1, 165, -1, 167, -1, -1,
2661 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2663 -1, -1, -1, -1, -1, -1, -1, 36, -1, -1,
2664 -1, -1, -1, -1, -1, 161, 162, -1, -1, 165,
2665 -1, 167, -1, -1, -1, -1, -1, -1, 57, 58,
2666 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2667 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
2668 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2669 89, 90, 91, 92, 93, -1, -1, -1, -1, -1,
2670 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2671 -1, -1, -1, -1, -1, 114, 115, 116, -1, -1,
2672 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2673 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,
2677 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2678 symbol of state STATE-NUM. */
2679 static const yytype_uint8 yystos[] =
2681 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2682 60, 178, 181, 182, 183, 184, 216, 217, 218, 220,
2683 219, 53, 68, 225, 158, 59, 158, 18, 158, 42,
2684 43, 44, 45, 46, 47, 48, 49, 51, 153, 154,
2685 155, 185, 186, 187, 0, 218, 46, 48, 188, 235,
2686 42, 43, 44, 47, 189, 232, 234, 242, 158, 158,
2687 162, 226, 22, 224, 7, 8, 10, 11, 12, 13,
2688 14, 15, 16, 17, 50, 161, 162, 165, 167, 178,
2689 182, 203, 204, 238, 187, 187, 35, 37, 214, 187,
2690 187, 21, 243, 244, 29, 168, 233, 243, 22, 22,
2691 22, 227, 156, 4, 4, 4, 167, 10, 168, 204,
2692 209, 55, 156, 180, 214, 214, 42, 44, 190, 32,
2693 33, 213, 62, 63, 64, 65, 66, 67, 191, 230,
2694 230, 181, 247, 159, 164, 39, 204, 205, 207, 208,
2695 163, 163, 168, 209, 159, 168, 156, 208, 160, 213,
2696 213, 10, 125, 204, 206, 215, 11, 12, 13, 14,
2697 15, 16, 176, 177, 204, 210, 4, 206, 28, 167,
2698 231, 36, 57, 58, 69, 70, 71, 72, 73, 74,
2699 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2700 85, 86, 87, 88, 89, 90, 91, 92, 93, 114,
2701 115, 116, 119, 120, 121, 122, 123, 124, 125, 126,
2702 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2703 137, 138, 139, 140, 171, 172, 173, 245, 252, 253,
2704 254, 255, 22, 193, 159, 157, 204, 204, 166, 168,
2705 204, 4, 157, 210, 204, 156, 238, 26, 27, 3,
2706 4, 5, 6, 9, 25, 40, 41, 90, 91, 92,
2707 93, 119, 133, 135, 136, 137, 139, 140, 162, 165,
2708 167, 169, 171, 172, 173, 211, 238, 180, 182, 57,
2709 10, 204, 240, 241, 11, 17, 11, 176, 191, 94,
2710 95, 96, 97, 98, 99, 100, 101, 102, 103, 174,
2711 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2712 108, 109, 110, 111, 112, 113, 175, 174, 175, 204,
2713 204, 240, 204, 204, 248, 240, 240, 240, 240, 240,
2714 204, 204, 204, 204, 204, 240, 191, 117, 118, 54,
2715 121, 122, 141, 142, 144, 145, 147, 148, 149, 192,
2716 39, 205, 195, 164, 166, 166, 157, 195, 180, 180,
2717 215, 174, 175, 174, 175, 156, 156, 156, 156, 156,
2718 156, 156, 164, 210, 212, 167, 212, 168, 212, 22,
2719 156, 156, 156, 221, 156, 3, 4, 9, 25, 26,
2720 27, 40, 41, 59, 165, 211, 237, 238, 239, 159,
2721 239, 239, 239, 206, 204, 204, 204, 204, 159, 198,
2722 159, 198, 239, 162, 159, 159, 159, 159, 159, 159,
2723 239, 239, 239, 239, 239, 38, 206, 204, 240, 4,
2724 141, 142, 143, 146, 150, 151, 194, 222, 223, 38,
2725 156, 156, 156, 156, 210, 210, 210, 210, 210, 210,
2726 210, 159, 164, 168, 204, 212, 166, 168, 210, 210,
2727 210, 159, 201, 39, 204, 228, 229, 61, 236, 212,
2728 240, 159, 159, 239, 239, 239, 239, 239, 11, 54,
2729 11, 250, 239, 162, 240, 204, 240, 240, 240, 159,
2730 159, 251, 159, 159, 159, 204, 239, 239, 159, 201,
2731 201, 204, 210, 210, 210, 210, 250, 159, 159, 159,
2732 159, 251, 159, 210, 166, 168, 159, 159, 38, 34,
2733 54, 199, 202, 193, 159, 157, 22, 166, 17, 17,
2734 156, 159, 159, 159, 159, 239, 4, 239, 159, 159,
2735 239, 159, 159, 159, 4, 4, 159, 204, 239, 239,
2736 156, 159, 198, 204, 157, 159, 159, 159, 159, 157,
2737 210, 210, 210, 210, 157, 210, 166, 210, 210, 204,
2738 22, 4, 201, 178, 179, 39, 204, 195, 159, 239,
2739 239, 17, 204, 249, 239, 239, 239, 239, 198, 198,
2740 240, 239, 159, 240, 240, 240, 4, 239, 249, 239,
2741 210, 210, 210, 210, 159, 157, 159, 159, 251, 157,
2742 157, 157, 193, 199, 200, 22, 159, 162, 193, 193,
2743 157, 159, 164, 239, 251, 157, 198, 157, 157, 157,
2744 157, 210, 210, 210, 157, 179, 54, 197, 17, 164,
2745 176, 246, 121, 122, 239, 239, 195, 17, 204, 164,
2746 195, 157, 157, 157, 4, 152, 196, 239, 237, 164,
2747 176, 193, 193, 38, 193, 193, 22, 159, 237, 17,
2748 239, 239, 17, 159, 239, 193, 193, 239, 17, 73,
2752 #define yyerrok (yyerrstatus = 0)
2753 #define yyclearin (yychar = YYEMPTY)
2754 #define YYEMPTY (-2)
2757 #define YYACCEPT goto yyacceptlab
2758 #define YYABORT goto yyabortlab
2759 #define YYERROR goto yyerrorlab
2762 /* Like YYERROR except do call yyerror. This remains here temporarily
2763 to ease the transition to the new meaning of YYERROR, for GCC.
2764 Once GCC version 2 has supplanted version 1, this can go. */
2766 #define YYFAIL goto yyerrlab
2768 #define YYRECOVERING() (!!yyerrstatus)
2770 #define YYBACKUP(Token, Value) \
2772 if (yychar == YYEMPTY && yylen == 1) \
2776 yytoken = YYTRANSLATE (yychar); \
2782 yyerror (YY_("syntax error: cannot back up")); \
2789 #define YYERRCODE 256
2792 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2793 If N is 0, then set CURRENT to the empty location which ends
2794 the previous symbol: RHS[0] (always defined). */
2796 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2797 #ifndef YYLLOC_DEFAULT
2798 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2802 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2803 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2804 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2805 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2809 (Current).first_line = (Current).last_line = \
2810 YYRHSLOC (Rhs, 0).last_line; \
2811 (Current).first_column = (Current).last_column = \
2812 YYRHSLOC (Rhs, 0).last_column; \
2818 /* YY_LOCATION_PRINT -- Print the location on the stream.
2819 This macro was not mandated originally: define only if we know
2820 we won't break user code: when these are the locations we know. */
2822 #ifndef YY_LOCATION_PRINT
2823 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2824 # define YY_LOCATION_PRINT(File, Loc) \
2825 fprintf (File, "%d.%d-%d.%d", \
2826 (Loc).first_line, (Loc).first_column, \
2827 (Loc).last_line, (Loc).last_column)
2829 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2834 /* YYLEX -- calling `yylex' with the right arguments. */
2837 # define YYLEX yylex (YYLEX_PARAM)
2839 # define YYLEX yylex ()
2842 /* Enable debugging if requested. */
2846 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2847 # define YYFPRINTF fprintf
2850 # define YYDPRINTF(Args) \
2856 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2860 YYFPRINTF (stderr, "%s ", Title); \
2861 yy_symbol_print (stderr, \
2863 YYFPRINTF (stderr, "\n"); \
2868 /*--------------------------------.
2869 | Print this symbol on YYOUTPUT. |
2870 `--------------------------------*/
2873 #if (defined __STDC__ || defined __C99__FUNC__ \
2874 || defined __cplusplus || defined _MSC_VER)
2876 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2879 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2882 YYSTYPE const * const yyvaluep;
2888 if (yytype < YYNTOKENS)
2889 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2901 /*--------------------------------.
2902 | Print this symbol on YYOUTPUT. |
2903 `--------------------------------*/
2905 #if (defined __STDC__ || defined __C99__FUNC__ \
2906 || defined __cplusplus || defined _MSC_VER)
2908 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2911 yy_symbol_print (yyoutput, yytype, yyvaluep)
2914 YYSTYPE const * const yyvaluep;
2917 if (yytype < YYNTOKENS)
2918 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2920 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2922 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2923 YYFPRINTF (yyoutput, ")");
2926 /*------------------------------------------------------------------.
2927 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2929 `------------------------------------------------------------------*/
2931 #if (defined __STDC__ || defined __C99__FUNC__ \
2932 || defined __cplusplus || defined _MSC_VER)
2934 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2937 yy_stack_print (bottom, top)
2938 yytype_int16 *bottom;
2942 YYFPRINTF (stderr, "Stack now");
2943 for (; bottom <= top; ++bottom)
2944 YYFPRINTF (stderr, " %d", *bottom);
2945 YYFPRINTF (stderr, "\n");
2948 # define YY_STACK_PRINT(Bottom, Top) \
2951 yy_stack_print ((Bottom), (Top)); \
2955 /*------------------------------------------------.
2956 | Report that the YYRULE is going to be reduced. |
2957 `------------------------------------------------*/
2959 #if (defined __STDC__ || defined __C99__FUNC__ \
2960 || defined __cplusplus || defined _MSC_VER)
2962 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
2965 yy_reduce_print (yyvsp, yyrule)
2970 int yynrhs = yyr2[yyrule];
2972 unsigned long int yylno = yyrline[yyrule];
2973 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2975 /* The symbols being reduced. */
2976 for (yyi = 0; yyi < yynrhs; yyi++)
2978 fprintf (stderr, " $%d = ", yyi + 1);
2979 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2980 &(yyvsp[(yyi + 1) - (yynrhs)])
2982 fprintf (stderr, "\n");
2986 # define YY_REDUCE_PRINT(Rule) \
2989 yy_reduce_print (yyvsp, Rule); \
2992 /* Nonzero means print parse trace. It is left uninitialized so that
2993 multiple parsers can coexist. */
2995 #else /* !YYDEBUG */
2996 # define YYDPRINTF(Args)
2997 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2998 # define YY_STACK_PRINT(Bottom, Top)
2999 # define YY_REDUCE_PRINT(Rule)
3000 #endif /* !YYDEBUG */
3003 /* YYINITDEPTH -- initial size of the parser's stacks. */
3005 # define YYINITDEPTH 200
3008 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3009 if the built-in stack extension method is used).
3011 Do not make this value too large; the results are undefined if
3012 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3013 evaluated with infinite-precision integer arithmetic. */
3016 # define YYMAXDEPTH 10000
3024 # if defined __GLIBC__ && defined _STRING_H
3025 # define yystrlen strlen
3027 /* Return the length of YYSTR. */
3028 #if (defined __STDC__ || defined __C99__FUNC__ \
3029 || defined __cplusplus || defined _MSC_VER)
3031 yystrlen (const char *yystr)
3039 for (yylen = 0; yystr[yylen]; yylen++)
3047 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3048 # define yystpcpy stpcpy
3050 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3052 #if (defined __STDC__ || defined __C99__FUNC__ \
3053 || defined __cplusplus || defined _MSC_VER)
3055 yystpcpy (char *yydest, const char *yysrc)
3058 yystpcpy (yydest, yysrc)
3064 const char *yys = yysrc;
3066 while ((*yyd++ = *yys++) != '\0')
3075 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3076 quotes and backslashes, so that it's suitable for yyerror. The
3077 heuristic is that double-quoting is unnecessary unless the string
3078 contains an apostrophe, a comma, or backslash (other than
3079 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3080 null, do not copy; instead, return the length of what the result
3083 yytnamerr (char *yyres, const char *yystr)
3088 char const *yyp = yystr;
3095 goto do_not_strip_quotes;
3099 goto do_not_strip_quotes;
3112 do_not_strip_quotes: ;
3116 return yystrlen (yystr);
3118 return yystpcpy (yyres, yystr) - yyres;
3122 /* Copy into YYRESULT an error message about the unexpected token
3123 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3124 including the terminating null byte. If YYRESULT is null, do not
3125 copy anything; just return the number of bytes that would be
3126 copied. As a special case, return 0 if an ordinary "syntax error"
3127 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3128 size calculation. */
3130 yysyntax_error (char *yyresult, int yystate, int yychar)
3132 int yyn = yypact[yystate];
3134 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3138 int yytype = YYTRANSLATE (yychar);
3139 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3140 YYSIZE_T yysize = yysize0;
3142 int yysize_overflow = 0;
3143 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3144 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3148 /* This is so xgettext sees the translatable formats that are
3149 constructed on the fly. */
3150 YY_("syntax error, unexpected %s");
3151 YY_("syntax error, unexpected %s, expecting %s");
3152 YY_("syntax error, unexpected %s, expecting %s or %s");
3153 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3154 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3158 static char const yyunexpected[] = "syntax error, unexpected %s";
3159 static char const yyexpecting[] = ", expecting %s";
3160 static char const yyor[] = " or %s";
3161 char yyformat[sizeof yyunexpected
3162 + sizeof yyexpecting - 1
3163 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3164 * (sizeof yyor - 1))];
3165 char const *yyprefix = yyexpecting;
3167 /* Start YYX at -YYN if negative to avoid negative indexes in
3169 int yyxbegin = yyn < 0 ? -yyn : 0;
3171 /* Stay within bounds of both yycheck and yytname. */
3172 int yychecklim = YYLAST - yyn + 1;
3173 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3176 yyarg[0] = yytname[yytype];
3177 yyfmt = yystpcpy (yyformat, yyunexpected);
3179 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3180 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3182 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3186 yyformat[sizeof yyunexpected - 1] = '\0';
3189 yyarg[yycount++] = yytname[yyx];
3190 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3191 yysize_overflow |= (yysize1 < yysize);
3193 yyfmt = yystpcpy (yyfmt, yyprefix);
3197 yyf = YY_(yyformat);
3198 yysize1 = yysize + yystrlen (yyf);
3199 yysize_overflow |= (yysize1 < yysize);
3202 if (yysize_overflow)
3203 return YYSIZE_MAXIMUM;
3207 /* Avoid sprintf, as that infringes on the user's name space.
3208 Don't have undefined behavior even if the translation
3209 produced a string with the wrong number of "%s"s. */
3210 char *yyp = yyresult;
3212 while ((*yyp = *yyf) != '\0')
3214 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3216 yyp += yytnamerr (yyp, yyarg[yyi++]);
3229 #endif /* YYERROR_VERBOSE */
3232 /*-----------------------------------------------.
3233 | Release the memory associated to this symbol. |
3234 `-----------------------------------------------*/
3237 #if (defined __STDC__ || defined __C99__FUNC__ \
3238 || defined __cplusplus || defined _MSC_VER)
3240 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3243 yydestruct (yymsg, yytype, yyvaluep)
3253 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3264 /* Prevent warnings from -Wmissing-prototypes. */
3266 #ifdef YYPARSE_PARAM
3267 #if defined __STDC__ || defined __cplusplus
3268 int yyparse (void *YYPARSE_PARAM);
3272 #else /* ! YYPARSE_PARAM */
3273 #if defined __STDC__ || defined __cplusplus
3278 #endif /* ! YYPARSE_PARAM */
3282 /* The look-ahead symbol. */
3285 /* The semantic value of the look-ahead symbol. */
3288 /* Number of syntax errors so far. */
3297 #ifdef YYPARSE_PARAM
3298 #if (defined __STDC__ || defined __C99__FUNC__ \
3299 || defined __cplusplus || defined _MSC_VER)
3301 yyparse (void *YYPARSE_PARAM)
3304 yyparse (YYPARSE_PARAM)
3305 void *YYPARSE_PARAM;
3307 #else /* ! YYPARSE_PARAM */
3308 #if (defined __STDC__ || defined __C99__FUNC__ \
3309 || defined __cplusplus || defined _MSC_VER)
3323 /* Number of tokens to shift before error messages enabled. */
3325 /* Look-ahead token as an internal (translated) token number. */
3328 /* Buffer for error messages, and its allocated size. */
3330 char *yymsg = yymsgbuf;
3331 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3334 /* Three stacks and their tools:
3335 `yyss': related to states,
3336 `yyvs': related to semantic values,
3337 `yyls': related to locations.
3339 Refer to the stacks thru separate pointers, to allow yyoverflow
3340 to reallocate them elsewhere. */
3342 /* The state stack. */
3343 yytype_int16 yyssa[YYINITDEPTH];
3344 yytype_int16 *yyss = yyssa;
3345 yytype_int16 *yyssp;
3347 /* The semantic value stack. */
3348 YYSTYPE yyvsa[YYINITDEPTH];
3349 YYSTYPE *yyvs = yyvsa;
3354 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3356 YYSIZE_T yystacksize = YYINITDEPTH;
3358 /* The variables used to return semantic value and location from the
3363 /* The number of symbols on the RHS of the reduced rule.
3364 Keep to zero when no symbol should be popped. */
3367 YYDPRINTF ((stderr, "Starting parse\n"));
3372 yychar = YYEMPTY; /* Cause a token to be read. */
3374 /* Initialize stack pointers.
3375 Waste one element of value and location stack
3376 so that they stay on the same level as the state stack.
3377 The wasted elements are never initialized. */
3384 /*------------------------------------------------------------.
3385 | yynewstate -- Push a new state, which is found in yystate. |
3386 `------------------------------------------------------------*/
3388 /* In all cases, when you get here, the value and location stacks
3389 have just been pushed. So pushing a state here evens the stacks. */
3395 if (yyss + yystacksize - 1 <= yyssp)
3397 /* Get the current used size of the three stacks, in elements. */
3398 YYSIZE_T yysize = yyssp - yyss + 1;
3402 /* Give user a chance to reallocate the stack. Use copies of
3403 these so that the &'s don't force the real ones into
3405 YYSTYPE *yyvs1 = yyvs;
3406 yytype_int16 *yyss1 = yyss;
3409 /* Each stack pointer address is followed by the size of the
3410 data in use in that stack, in bytes. This used to be a
3411 conditional around just the two extra args, but that might
3412 be undefined if yyoverflow is a macro. */
3413 yyoverflow (YY_("memory exhausted"),
3414 &yyss1, yysize * sizeof (*yyssp),
3415 &yyvs1, yysize * sizeof (*yyvsp),
3422 #else /* no yyoverflow */
3423 # ifndef YYSTACK_RELOCATE
3424 goto yyexhaustedlab;
3426 /* Extend the stack our own way. */
3427 if (YYMAXDEPTH <= yystacksize)
3428 goto yyexhaustedlab;
3430 if (YYMAXDEPTH < yystacksize)
3431 yystacksize = YYMAXDEPTH;
3434 yytype_int16 *yyss1 = yyss;
3435 union yyalloc *yyptr =
3436 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3438 goto yyexhaustedlab;
3439 YYSTACK_RELOCATE (yyss);
3440 YYSTACK_RELOCATE (yyvs);
3442 # undef YYSTACK_RELOCATE
3444 YYSTACK_FREE (yyss1);
3447 #endif /* no yyoverflow */
3449 yyssp = yyss + yysize - 1;
3450 yyvsp = yyvs + yysize - 1;
3453 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3454 (unsigned long int) yystacksize));
3456 if (yyss + yystacksize - 1 <= yyssp)
3460 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3469 /* Do appropriate processing given the current state. Read a
3470 look-ahead token if we need one and don't already have one. */
3472 /* First try to decide what to do without reference to look-ahead token. */
3473 yyn = yypact[yystate];
3474 if (yyn == YYPACT_NINF)
3477 /* Not known => get a look-ahead token if don't already have one. */
3479 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3480 if (yychar == YYEMPTY)
3482 YYDPRINTF ((stderr, "Reading a token: "));
3486 if (yychar <= YYEOF)
3488 yychar = yytoken = YYEOF;
3489 YYDPRINTF ((stderr, "Now at end of input.\n"));
3493 yytoken = YYTRANSLATE (yychar);
3494 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3497 /* If the proper action on seeing token YYTOKEN is to reduce or to
3498 detect an error, take that action. */
3500 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3505 if (yyn == 0 || yyn == YYTABLE_NINF)
3514 /* Count tokens shifted since error; after three, turn off error
3519 /* Shift the look-ahead token. */
3520 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3522 /* Discard the shifted token unless it is eof. */
3523 if (yychar != YYEOF)
3532 /*-----------------------------------------------------------.
3533 | yydefault -- do the default action for the current state. |
3534 `-----------------------------------------------------------*/
3536 yyn = yydefact[yystate];
3542 /*-----------------------------.
3543 | yyreduce -- Do a reduction. |
3544 `-----------------------------*/
3546 /* yyn is the number of a rule to reduce with. */
3549 /* If YYLEN is nonzero, implement the default value of the action:
3552 Otherwise, the following line sets YYVAL to garbage.
3553 This behavior is undocumented and Bison
3554 users should not rely upon it. Assigning to YYVAL
3555 unconditionally makes the parser a bit smaller, and it avoids a
3556 GCC warning that YYVAL may be used uninitialized. */
3557 yyval = yyvsp[1-yylen];
3560 YY_REDUCE_PRINT (yyn);
3564 #line 1124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3565 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3569 #line 1124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3570 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3574 #line 1125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3575 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3579 #line 1125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3580 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3584 #line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3585 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3589 #line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3590 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3594 #line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3595 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3599 #line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3600 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3604 #line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3605 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3609 #line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3610 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3614 #line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3615 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3619 #line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3620 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3624 #line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3625 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3629 #line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3630 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3634 #line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3635 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3639 #line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3640 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3644 #line 1135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3645 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3649 #line 1135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3650 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3654 #line 1136 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3655 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3659 #line 1136 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3660 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3664 #line 1137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3665 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3669 #line 1137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3670 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3674 #line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3675 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3679 #line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3680 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3684 #line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3685 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3689 #line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3690 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3694 #line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3695 { (yyval.StrVal) = 0; ;}
3699 #line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3700 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3704 #line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3705 { (yyval.UIntVal)=0; ;}
3709 #line 1156 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3711 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3717 #line 1160 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3725 #line 1168 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3733 #line 1173 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3735 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3741 #line 1179 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3746 #line 1180 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3747 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3751 #line 1181 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3752 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3756 #line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3757 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3761 #line 1183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3762 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3766 #line 1184 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3767 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3771 #line 1188 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3772 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3776 #line 1189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3777 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3781 #line 1190 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3782 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3786 #line 1194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3787 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3791 #line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3792 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3796 #line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3797 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3801 #line 1197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3802 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3806 #line 1201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3807 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3811 #line 1202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3812 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3816 #line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3817 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3821 #line 1207 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3822 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3826 #line 1208 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3827 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3831 #line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3832 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3836 #line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3837 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3841 #line 1211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3842 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3846 #line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3847 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3851 #line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3852 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3856 #line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3857 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3861 #line 1220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.UIntVal) = CallingConv::C; ;}
3866 #line 1221 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.UIntVal) = CallingConv::C; ;}
3871 #line 1222 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.UIntVal) = CallingConv::Fast; ;}
3876 #line 1223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.UIntVal) = CallingConv::Cold; ;}
3881 #line 1224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3886 #line 1225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3891 #line 1226 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3893 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3894 GEN_ERROR("Calling conv too large");
3895 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3901 #line 1233 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3906 #line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3907 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3911 #line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3912 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3916 #line 1236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3917 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3921 #line 1237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3922 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3926 #line 1238 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3931 #line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3932 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
3936 #line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3937 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
3941 #line 1241 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
3946 #line 1242 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3947 { (yyval.ParamAttrs) =
3948 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
3952 #line 1246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3953 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3957 #line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3959 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3964 #line 1252 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3965 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
3969 #line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3970 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
3974 #line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3975 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3979 #line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3980 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3984 #line 1256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3985 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
3989 #line 1257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3990 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
3994 #line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3995 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3999 #line 1261 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4001 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4006 #line 1266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4007 { (yyval.StrVal) = 0; ;}
4011 #line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4013 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4018 #line 1274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4019 { (yyval.UIntVal) = 0; ;}
4023 #line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4025 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4026 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4027 GEN_ERROR("Alignment must be a power of two");
4033 #line 1281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4034 { (yyval.UIntVal) = 0; ;}
4038 #line 1282 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4040 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4041 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4042 GEN_ERROR("Alignment must be a power of two");
4048 #line 1291 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4050 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4051 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4052 GEN_ERROR("Invalid character in section name");
4053 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4059 #line 1299 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4060 { (yyval.StrVal) = 0; ;}
4064 #line 1300 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4065 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4069 #line 1305 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4074 #line 1306 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4079 #line 1307 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4081 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4082 delete (yyvsp[(1) - (1)].StrVal);
4088 #line 1312 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4090 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4091 GEN_ERROR("Alignment must be a power of two");
4092 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4098 #line 1328 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4100 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4106 #line 1332 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4108 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4114 #line 1336 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4116 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4117 GEN_ERROR("Cannot form a pointer to a basic block");
4118 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4119 delete (yyvsp[(1) - (3)].TypeVal);
4125 #line 1343 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4126 { // Named types are also simple types...
4127 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4129 (yyval.TypeVal) = new PATypeHolder(tmp);
4134 #line 1348 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4135 { // Type UpReference
4136 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4137 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4138 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4139 (yyval.TypeVal) = new PATypeHolder(OT);
4140 UR_OUT("New Upreference!\n");
4146 #line 1356 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4148 // Allow but ignore attributes on function types; this permits auto-upgrade.
4149 // FIXME: remove in LLVM 3.0.
4150 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4151 if (!FunctionType::isValidReturnType(RetTy))
4152 GEN_ERROR("Invalid result type for LLVM function");
4154 std::vector<const Type*> Params;
4155 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4156 for (; I != E; ++I ) {
4157 const Type *Ty = I->Ty->get();
4158 Params.push_back(Ty);
4161 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4162 if (isVarArg) Params.pop_back();
4164 for (unsigned i = 0; i != Params.size(); ++i)
4165 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4166 GEN_ERROR("Function arguments must be value types!");
4170 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4171 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4172 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4173 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4179 #line 1385 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4181 // Allow but ignore attributes on function types; this permits auto-upgrade.
4182 // FIXME: remove in LLVM 3.0.
4183 std::vector<const Type*> Params;
4184 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4185 for ( ; I != E; ++I ) {
4186 const Type* Ty = I->Ty->get();
4187 Params.push_back(Ty);
4190 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4191 if (isVarArg) Params.pop_back();
4193 for (unsigned i = 0; i != Params.size(); ++i)
4194 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4195 GEN_ERROR("Function arguments must be value types!");
4199 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4200 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4201 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4207 #line 1410 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4208 { // Sized array type?
4209 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4210 delete (yyvsp[(4) - (5)].TypeVal);
4216 #line 1415 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4218 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4219 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4220 GEN_ERROR("Unsigned result not equal to signed result");
4221 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4222 GEN_ERROR("Element type of a VectorType must be primitive");
4223 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4224 delete (yyvsp[(4) - (5)].TypeVal);
4230 #line 1425 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4231 { // Structure type?
4232 std::vector<const Type*> Elements;
4233 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4234 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4235 Elements.push_back(*I);
4237 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4238 delete (yyvsp[(2) - (3)].TypeList);
4244 #line 1435 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4245 { // Empty structure type?
4246 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4252 #line 1439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4254 std::vector<const Type*> Elements;
4255 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4256 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4257 Elements.push_back(*I);
4259 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4260 delete (yyvsp[(3) - (5)].TypeList);
4266 #line 1449 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4267 { // Empty structure type?
4268 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4274 #line 1456 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4276 // Allow but ignore attributes on function types; this permits auto-upgrade.
4277 // FIXME: remove in LLVM 3.0.
4278 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4279 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4284 #line 1465 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4286 if (!UpRefs.empty())
4287 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4288 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4289 GEN_ERROR("LLVM functions cannot return aggregate types");
4290 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4295 #line 1472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4297 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4302 #line 1477 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4304 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4305 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4311 #line 1482 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4313 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4319 #line 1490 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4321 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4322 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4323 TWA.Ty = new PATypeHolder(Type::VoidTy);
4324 (yyval.TypeWithAttrsList)->push_back(TWA);
4330 #line 1497 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4332 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4333 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4334 TWA.Ty = new PATypeHolder(Type::VoidTy);
4335 (yyval.TypeWithAttrsList)->push_back(TWA);
4341 #line 1504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4343 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4349 #line 1512 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4351 (yyval.TypeList) = new std::list<PATypeHolder>();
4352 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4353 delete (yyvsp[(1) - (1)].TypeVal);
4359 #line 1518 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4361 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4362 delete (yyvsp[(3) - (3)].TypeVal);
4368 #line 1530 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4369 { // Nonempty unsized arr
4370 if (!UpRefs.empty())
4371 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4372 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4374 GEN_ERROR("Cannot make array constant with type: '" +
4375 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4376 const Type *ETy = ATy->getElementType();
4377 int NumElements = ATy->getNumElements();
4379 // Verify that we have the correct size...
4380 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4381 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4382 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4383 itostr(NumElements) + "");
4385 // Verify all elements are correct type!
4386 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4387 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4388 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4389 ETy->getDescription() +"' as required!\nIt is of type '"+
4390 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4393 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4394 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4400 #line 1558 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4402 if (!UpRefs.empty())
4403 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4404 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4406 GEN_ERROR("Cannot make array constant with type: '" +
4407 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4409 int NumElements = ATy->getNumElements();
4410 if (NumElements != -1 && NumElements != 0)
4411 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4412 " arguments, but has size of " + itostr(NumElements) +"");
4413 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4414 delete (yyvsp[(1) - (3)].TypeVal);
4420 #line 1574 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4422 if (!UpRefs.empty())
4423 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4424 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4426 GEN_ERROR("Cannot make array constant with type: '" +
4427 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4429 int NumElements = ATy->getNumElements();
4430 const Type *ETy = ATy->getElementType();
4431 if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
4432 GEN_ERROR("Can't build string constant of size " +
4433 itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
4434 " when array has size " + itostr(NumElements) + "");
4435 std::vector<Constant*> Vals;
4436 if (ETy == Type::Int8Ty) {
4437 for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4438 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4440 delete (yyvsp[(3) - (3)].StrVal);
4441 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4443 delete (yyvsp[(3) - (3)].StrVal);
4444 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4445 delete (yyvsp[(1) - (3)].TypeVal);
4451 #line 1601 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4452 { // Nonempty unsized arr
4453 if (!UpRefs.empty())
4454 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4455 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4457 GEN_ERROR("Cannot make packed constant with type: '" +
4458 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4459 const Type *ETy = PTy->getElementType();
4460 int NumElements = PTy->getNumElements();
4462 // Verify that we have the correct size...
4463 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4464 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4465 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4466 itostr(NumElements) + "");
4468 // Verify all elements are correct type!
4469 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4470 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4471 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4472 ETy->getDescription() +"' as required!\nIt is of type '"+
4473 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4476 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4477 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4483 #line 1629 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4485 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4487 GEN_ERROR("Cannot make struct constant with type: '" +
4488 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4490 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4491 GEN_ERROR("Illegal number of initializers for structure type");
4493 // Check to ensure that constants are compatible with the type initializer!
4494 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4495 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4496 GEN_ERROR("Expected type '" +
4497 STy->getElementType(i)->getDescription() +
4498 "' for element #" + utostr(i) +
4499 " of structure initializer");
4501 // Check to ensure that Type is not packed
4502 if (STy->isPacked())
4503 GEN_ERROR("Unpacked Initializer to vector type '" +
4504 STy->getDescription() + "'");
4506 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4507 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4513 #line 1655 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4515 if (!UpRefs.empty())
4516 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4517 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4519 GEN_ERROR("Cannot make struct constant with type: '" +
4520 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4522 if (STy->getNumContainedTypes() != 0)
4523 GEN_ERROR("Illegal number of initializers for structure type");
4525 // Check to ensure that Type is not packed
4526 if (STy->isPacked())
4527 GEN_ERROR("Unpacked Initializer to vector type '" +
4528 STy->getDescription() + "'");
4530 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4531 delete (yyvsp[(1) - (3)].TypeVal);
4537 #line 1675 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4539 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4541 GEN_ERROR("Cannot make struct constant with type: '" +
4542 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4544 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4545 GEN_ERROR("Illegal number of initializers for structure type");
4547 // Check to ensure that constants are compatible with the type initializer!
4548 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4549 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4550 GEN_ERROR("Expected type '" +
4551 STy->getElementType(i)->getDescription() +
4552 "' for element #" + utostr(i) +
4553 " of structure initializer");
4555 // Check to ensure that Type is packed
4556 if (!STy->isPacked())
4557 GEN_ERROR("Vector initializer to non-vector type '" +
4558 STy->getDescription() + "'");
4560 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4561 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4567 #line 1701 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4569 if (!UpRefs.empty())
4570 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4571 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4573 GEN_ERROR("Cannot make struct constant with type: '" +
4574 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4576 if (STy->getNumContainedTypes() != 0)
4577 GEN_ERROR("Illegal number of initializers for structure type");
4579 // Check to ensure that Type is packed
4580 if (!STy->isPacked())
4581 GEN_ERROR("Vector initializer to non-vector type '" +
4582 STy->getDescription() + "'");
4584 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4585 delete (yyvsp[(1) - (5)].TypeVal);
4591 #line 1721 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4593 if (!UpRefs.empty())
4594 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4595 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4597 GEN_ERROR("Cannot make null pointer constant with type: '" +
4598 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4600 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4601 delete (yyvsp[(1) - (2)].TypeVal);
4607 #line 1733 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4609 if (!UpRefs.empty())
4610 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4611 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4612 delete (yyvsp[(1) - (2)].TypeVal);
4618 #line 1740 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4620 if (!UpRefs.empty())
4621 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4622 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4624 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4626 // ConstExprs can exist in the body of a function, thus creating
4627 // GlobalValues whenever they refer to a variable. Because we are in
4628 // the context of a function, getExistingVal will search the functions
4629 // symbol table instead of the module symbol table for the global symbol,
4630 // which throws things all off. To get around this, we just tell
4631 // getExistingVal that we are at global scope here.
4633 Function *SavedCurFn = CurFun.CurrentFunction;
4634 CurFun.CurrentFunction = 0;
4636 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4639 CurFun.CurrentFunction = SavedCurFn;
4641 // If this is an initializer for a constant pointer, which is referencing a
4642 // (currently) undefined variable, create a stub now that shall be replaced
4643 // in the future with the right type of variable.
4646 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4647 const PointerType *PT = cast<PointerType>(Ty);
4649 // First check to see if the forward references value is already created!
4650 PerModuleInfo::GlobalRefsType::iterator I =
4651 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4653 if (I != CurModule.GlobalRefs.end()) {
4654 V = I->second; // Placeholder already exists, use it...
4655 (yyvsp[(2) - (2)].ValIDVal).destroy();
4658 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4659 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4660 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4661 GEN_ERROR("Invalid reference to global");
4663 // Create the forward referenced global.
4665 if (const FunctionType *FTy =
4666 dyn_cast<FunctionType>(PT->getElementType())) {
4667 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4668 CurModule.CurrentModule);
4670 GV = new GlobalVariable(PT->getElementType(), false,
4671 GlobalValue::ExternalWeakLinkage, 0,
4672 Name, CurModule.CurrentModule);
4675 // Keep track of the fact that we have a forward ref to recycle it
4676 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4681 (yyval.ConstVal) = cast<GlobalValue>(V);
4682 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4688 #line 1806 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4690 if (!UpRefs.empty())
4691 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4692 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4693 GEN_ERROR("Mismatched types for constant expression: " +
4694 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4695 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4696 delete (yyvsp[(1) - (2)].TypeVal);
4702 #line 1816 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4704 if (!UpRefs.empty())
4705 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4706 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4707 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4708 GEN_ERROR("Cannot create a null initialized value of this type");
4709 (yyval.ConstVal) = Constant::getNullValue(Ty);
4710 delete (yyvsp[(1) - (2)].TypeVal);
4716 #line 1826 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4717 { // integral constants
4718 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4719 GEN_ERROR("Constant value doesn't fit in type");
4720 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4726 #line 1832 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4727 { // arbitrary precision integer constants
4728 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4729 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4730 GEN_ERROR("Constant value does not fit in type");
4732 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4733 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4734 delete (yyvsp[(2) - (2)].APIntVal);
4740 #line 1842 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4741 { // integral constants
4742 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4743 GEN_ERROR("Constant value doesn't fit in type");
4744 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4750 #line 1848 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4751 { // arbitrary precision integer constants
4752 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4753 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4754 GEN_ERROR("Constant value does not fit in type");
4756 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4757 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4758 delete (yyvsp[(2) - (2)].APIntVal);
4764 #line 1858 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4765 { // Boolean constants
4766 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4767 GEN_ERROR("Constant true must have type i1");
4768 (yyval.ConstVal) = ConstantInt::getTrue();
4774 #line 1864 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4775 { // Boolean constants
4776 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4777 GEN_ERROR("Constant false must have type i1");
4778 (yyval.ConstVal) = ConstantInt::getFalse();
4784 #line 1870 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4785 { // Floating point constants
4786 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4787 GEN_ERROR("Floating point constant invalid for type");
4788 // Lexer has no type info, so builds all float and double FP constants
4789 // as double. Fix this here. Long double is done right.
4790 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4791 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4792 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4793 delete (yyvsp[(2) - (2)].FPVal);
4799 #line 1883 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4801 if (!UpRefs.empty())
4802 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4803 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4804 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4805 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4806 GEN_ERROR("invalid cast opcode for cast from '" +
4807 Val->getType()->getDescription() + "' to '" +
4808 DestTy->getDescription() + "'");
4809 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4810 delete (yyvsp[(5) - (6)].TypeVal);
4815 #line 1895 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4817 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4818 GEN_ERROR("GetElementPtr requires a pointer operand");
4821 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4823 GEN_ERROR("Index list invalid for constant getelementptr");
4825 SmallVector<Constant*, 8> IdxVec;
4826 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4827 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4828 IdxVec.push_back(C);
4830 GEN_ERROR("Indices to constant getelementptr must be constants");
4832 delete (yyvsp[(4) - (5)].ValueList);
4834 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4840 #line 1916 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4842 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4843 GEN_ERROR("Select condition must be of boolean type");
4844 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4845 GEN_ERROR("Select operand types must match");
4846 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4852 #line 1924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4854 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4855 GEN_ERROR("Binary operator types must match");
4857 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4862 #line 1930 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4864 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4865 GEN_ERROR("Logical operator types must match");
4866 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4867 if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4868 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4869 GEN_ERROR("Logical operator requires integral operands");
4871 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4877 #line 1941 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4879 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4880 GEN_ERROR("icmp operand types must match");
4881 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4886 #line 1946 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4888 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4889 GEN_ERROR("fcmp operand types must match");
4890 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4895 #line 1951 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4897 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4898 GEN_ERROR("vicmp operand types must match");
4899 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4904 #line 1956 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4906 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4907 GEN_ERROR("vfcmp operand types must match");
4908 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4913 #line 1961 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4915 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4916 GEN_ERROR("Invalid extractelement operands");
4917 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4923 #line 1967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4925 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4926 GEN_ERROR("Invalid insertelement operands");
4927 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4933 #line 1973 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4935 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4936 GEN_ERROR("Invalid shufflevector operands");
4937 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4943 #line 1979 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4945 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4946 GEN_ERROR("ExtractValue requires an aggregate operand");
4948 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
4949 delete (yyvsp[(4) - (5)].ConstantList);
4955 #line 1987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4957 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
4958 GEN_ERROR("InsertValue requires an aggregate operand");
4960 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
4961 delete (yyvsp[(6) - (7)].ConstantList);
4967 #line 1998 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4969 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
4975 #line 2002 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4977 (yyval.ConstVector) = new std::vector<Constant*>();
4978 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
4984 #line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4985 { (yyval.BoolVal) = false; ;}
4989 #line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4990 { (yyval.BoolVal) = true; ;}
4994 #line 2013 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4995 { (yyval.BoolVal) = true; ;}
4999 #line 2013 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5000 { (yyval.BoolVal) = false; ;}
5004 #line 2016 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5006 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5007 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5009 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5011 GEN_ERROR("Aliases can be created only to global values");
5013 (yyval.ConstVal) = Aliasee;
5015 delete (yyvsp[(1) - (2)].TypeVal);
5020 #line 2028 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5022 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5023 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5024 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5025 GEN_ERROR("invalid cast opcode for cast from '" +
5026 Val->getType()->getDescription() + "' to '" +
5027 DestTy->getDescription() + "'");
5029 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5031 delete (yyvsp[(5) - (6)].TypeVal);
5036 #line 2049 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5038 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5039 CurModule.ModuleDone();
5045 #line 2054 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5047 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5048 CurModule.ModuleDone();
5054 #line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5055 { CurFun.isDeclare = false; ;}
5059 #line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5061 CurFun.FunctionDone();
5067 #line 2071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5068 { CurFun.isDeclare = true; ;}
5072 #line 2071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5079 #line 2074 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5086 #line 2077 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5088 if (!UpRefs.empty())
5089 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5090 // Eagerly resolve types. This is not an optimization, this is a
5091 // requirement that is due to the fact that we could have this:
5093 // %list = type { %list * }
5094 // %list = type { %list * } ; repeated type decl
5096 // If types are not resolved eagerly, then the two types will not be
5097 // determined to be the same type!
5099 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5101 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5103 // If this is a named type that is not a redefinition, add it to the slot
5105 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5108 delete (yyvsp[(3) - (3)].TypeVal);
5114 #line 2101 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5116 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5118 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5120 // If this is a named type that is not a redefinition, add it to the slot
5122 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5129 #line 2113 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5131 /* "Externally Visible" Linkage */
5132 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5133 GEN_ERROR("Global value initializer is not a constant");
5134 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5135 (yyvsp[(2) - (6)].Visibility), (yyvsp[(4) - (6)].BoolVal), (yyvsp[(5) - (6)].ConstVal)->getType(), (yyvsp[(5) - (6)].ConstVal), (yyvsp[(3) - (6)].BoolVal), (yyvsp[(6) - (6)].UIntVal));
5141 #line 2120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5148 #line 2124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5150 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5151 GEN_ERROR("Global value initializer is not a constant");
5152 CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), (yyvsp[(6) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ConstVal), (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
5158 #line 2129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5165 #line 2133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5167 if (!UpRefs.empty())
5168 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5169 CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), *(yyvsp[(6) - (7)].TypeVal), 0, (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
5171 delete (yyvsp[(6) - (7)].TypeVal);
5176 #line 2139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5184 #line 2143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5187 if ((yyvsp[(1) - (5)].StrVal)) {
5188 Name = *(yyvsp[(1) - (5)].StrVal);
5189 delete (yyvsp[(1) - (5)].StrVal);
5192 GEN_ERROR("Alias name cannot be empty");
5194 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5196 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5198 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5199 CurModule.CurrentModule);
5200 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5201 InsertValue(GA, CurModule.Values);
5204 // If there was a forward reference of this alias, resolve it now.
5208 ID = ValID::createGlobalName(Name);
5210 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5212 if (GlobalValue *FWGV =
5213 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5214 // Replace uses of the fwdref with the actual alias.
5215 FWGV->replaceAllUsesWith(GA);
5216 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5217 GV->eraseFromParent();
5219 cast<Function>(FWGV)->eraseFromParent();
5228 #line 2183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5235 #line 2186 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5242 #line 2192 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5244 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5245 if (AsmSoFar.empty())
5246 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5248 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5249 delete (yyvsp[(1) - (1)].StrVal);
5255 #line 2202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5257 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5258 delete (yyvsp[(3) - (3)].StrVal);
5263 #line 2206 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5265 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5266 delete (yyvsp[(3) - (3)].StrVal);
5271 #line 2213 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5273 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5274 delete (yyvsp[(3) - (3)].StrVal);
5280 #line 2218 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5282 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5283 delete (yyvsp[(1) - (1)].StrVal);
5289 #line 2223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5296 #line 2232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5298 if (!UpRefs.empty())
5299 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5300 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5301 GEN_ERROR("Argument types must be first-class");
5302 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5303 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5304 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5310 #line 2242 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5312 if (!UpRefs.empty())
5313 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5314 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5315 GEN_ERROR("Argument types must be first-class");
5316 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5317 (yyval.ArgList) = new ArgListType;
5318 (yyval.ArgList)->push_back(E);
5324 #line 2253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5326 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5332 #line 2257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5334 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5335 struct ArgListEntry E;
5336 E.Ty = new PATypeHolder(Type::VoidTy);
5338 E.Attrs = ParamAttr::None;
5339 (yyval.ArgList)->push_back(E);
5345 #line 2266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5347 (yyval.ArgList) = new ArgListType;
5348 struct ArgListEntry E;
5349 E.Ty = new PATypeHolder(Type::VoidTy);
5351 E.Attrs = ParamAttr::None;
5352 (yyval.ArgList)->push_back(E);
5358 #line 2275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5360 (yyval.ArgList) = 0;
5366 #line 2281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5368 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5369 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5371 // Check the function result for abstractness if this is a define. We should
5372 // have no abstract types at this point
5373 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5374 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5376 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
5377 GEN_ERROR("Invalid result type for LLVM function");
5379 std::vector<const Type*> ParamTypeList;
5380 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5381 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5382 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
5383 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5385 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5386 const Type* Ty = I->Ty->get();
5387 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5388 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5389 ParamTypeList.push_back(Ty);
5390 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5391 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5395 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5396 if (isVarArg) ParamTypeList.pop_back();
5400 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5402 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5403 const PointerType *PFT = PointerType::getUnqual(FT);
5404 delete (yyvsp[(2) - (10)].TypeVal);
5407 if (!FunctionName.empty()) {
5408 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5410 ID = ValID::createGlobalID(CurModule.Values.size());
5414 // See if this function was forward referenced. If so, recycle the object.
5415 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5416 // Move the function to the end of the list, from whereever it was
5417 // previously inserted.
5418 Fn = cast<Function>(FWRef);
5419 assert(Fn->getParamAttrs().isEmpty() &&
5420 "Forward reference has parameter attributes!");
5421 CurModule.CurrentModule->getFunctionList().remove(Fn);
5422 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5423 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5424 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5425 if (Fn->getFunctionType() != FT ) {
5426 // The existing function doesn't have the same type. This is an overload
5428 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5429 } else if (Fn->getParamAttrs() != PAL) {
5430 // The existing function doesn't have the same parameter attributes.
5431 // This is an overload error.
5432 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5433 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5434 // Neither the existing or the current function is a declaration and they
5435 // have the same name and same type. Clearly this is a redefinition.
5436 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5437 } else if (Fn->isDeclaration()) {
5438 // Make sure to strip off any argument names so we can't get conflicts.
5439 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5443 } else { // Not already defined?
5444 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5445 CurModule.CurrentModule);
5446 InsertValue(Fn, CurModule.Values);
5449 CurFun.FunctionStart(Fn);
5451 if (CurFun.isDeclare) {
5452 // If we have declaration, always overwrite linkage. This will allow us to
5453 // correctly handle cases, when pointer to function is passed as argument to
5454 // another function.
5455 Fn->setLinkage(CurFun.Linkage);
5456 Fn->setVisibility(CurFun.Visibility);
5458 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5459 Fn->setParamAttrs(PAL);
5460 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5461 if ((yyvsp[(8) - (10)].StrVal)) {
5462 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5463 delete (yyvsp[(8) - (10)].StrVal);
5465 if ((yyvsp[(10) - (10)].StrVal)) {
5466 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5467 delete (yyvsp[(10) - (10)].StrVal);
5470 // Add all of the arguments we parsed to the function...
5471 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5472 if (isVarArg) { // Nuke the last entry
5473 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5474 "Not a varargs marker!");
5475 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5476 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5478 Function::arg_iterator ArgIt = Fn->arg_begin();
5479 Function::arg_iterator ArgEnd = Fn->arg_end();
5481 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5482 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5483 delete I->Ty; // Delete the typeholder...
5484 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5490 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5497 #line 2411 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5499 (yyval.FunctionVal) = CurFun.CurrentFunction;
5501 // Make sure that we keep track of the linkage type even if there was a
5502 // previous "declare".
5503 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5504 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5509 #line 2422 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5511 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5517 #line 2427 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5519 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5520 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5521 (yyval.FunctionVal) = CurFun.CurrentFunction;
5522 CurFun.FunctionDone();
5528 #line 2439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5530 (yyval.BoolVal) = false;
5536 #line 2443 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5538 (yyval.BoolVal) = true;
5544 #line 2448 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5545 { // A reference to a direct constant
5546 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5552 #line 2452 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5554 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5560 #line 2456 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5561 { // Perhaps it's an FP constant?
5562 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5568 #line 2460 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5570 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5576 #line 2464 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5578 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5584 #line 2468 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5586 (yyval.ValIDVal) = ValID::createNull();
5592 #line 2472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5594 (yyval.ValIDVal) = ValID::createUndef();
5600 #line 2476 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5601 { // A vector zero constant.
5602 (yyval.ValIDVal) = ValID::createZeroInit();
5608 #line 2480 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5609 { // Nonempty unsized packed vector
5610 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5611 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5613 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5614 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5616 VectorType* pt = VectorType::get(ETy, NumElements);
5617 PATypeHolder* PTy = new PATypeHolder(
5625 // Verify all elements are correct type!
5626 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5627 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5628 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5629 ETy->getDescription() +"' as required!\nIt is of type '" +
5630 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5633 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5634 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5640 #line 2508 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5642 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5648 #line 2512 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5650 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5651 delete (yyvsp[(3) - (5)].StrVal);
5652 delete (yyvsp[(5) - (5)].StrVal);
5658 #line 2522 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5659 { // Is it an integer reference...?
5660 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5666 #line 2526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5668 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5674 #line 2530 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5675 { // Is it a named reference...?
5676 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5677 delete (yyvsp[(1) - (1)].StrVal);
5683 #line 2535 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5684 { // Is it a named reference...?
5685 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5686 delete (yyvsp[(1) - (1)].StrVal);
5692 #line 2548 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5694 if (!UpRefs.empty())
5695 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5696 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5697 delete (yyvsp[(1) - (2)].TypeVal);
5703 #line 2557 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5705 (yyval.ValueList) = new std::vector<Value *>();
5706 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5712 #line 2562 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5714 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
5720 #line 2567 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5722 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5728 #line 2571 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5729 { // Do not allow functions with 0 basic blocks
5730 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5736 #line 2580 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5738 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5740 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5741 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5742 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5748 #line 2589 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5750 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5751 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5752 if (CI2->getParent() == 0)
5753 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5754 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5755 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5761 #line 2598 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5762 { // Empty space between instruction lists
5763 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5769 #line 2602 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5770 { // Labelled (named) basic block
5771 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5772 delete (yyvsp[(1) - (1)].StrVal);
5779 #line 2610 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5780 { // Return with a result...
5781 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
5782 assert(!VL.empty() && "Invalid ret operands!");
5783 (yyval.TermInstVal) = ReturnInst::Create(&VL[0], VL.size());
5784 delete (yyvsp[(2) - (2)].ValueList);
5790 #line 2617 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5791 { // Return with no result...
5792 (yyval.TermInstVal) = ReturnInst::Create();
5798 #line 2621 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5799 { // Unconditional Branch...
5800 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5802 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
5807 #line 2626 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5809 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
5810 GEN_ERROR("Branch condition must have type i1");
5811 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5813 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5815 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5817 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
5822 #line 2637 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5824 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
5826 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5828 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
5829 (yyval.TermInstVal) = S;
5831 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
5832 E = (yyvsp[(8) - (9)].JumpTable)->end();
5833 for (; I != E; ++I) {
5834 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
5835 S->addCase(CI, I->second);
5837 GEN_ERROR("Switch case is constant, but not a simple integer");
5839 delete (yyvsp[(8) - (9)].JumpTable);
5845 #line 2656 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5847 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
5849 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
5851 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
5852 (yyval.TermInstVal) = S;
5858 #line 2666 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5861 // Handle the short syntax
5862 const PointerType *PFTy = 0;
5863 const FunctionType *Ty = 0;
5864 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
5865 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
5866 // Pull out the types of all of the arguments...
5867 std::vector<const Type*> ParamTypes;
5868 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
5869 for (; I != E; ++I) {
5870 const Type *Ty = I->Val->getType();
5871 if (Ty == Type::VoidTy)
5872 GEN_ERROR("Short call syntax cannot be used with varargs");
5873 ParamTypes.push_back(Ty);
5876 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
5877 GEN_ERROR("Invalid result type for LLVM function");
5879 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
5880 PFTy = PointerType::getUnqual(Ty);
5883 delete (yyvsp[(3) - (14)].TypeVal);
5885 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
5887 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
5889 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
5892 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5893 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
5894 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
5896 // Check the arguments
5898 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
5899 // Make sure no arguments is a good thing!
5900 if (Ty->getNumParams() != 0)
5901 GEN_ERROR("No arguments passed to a function that "
5902 "expects arguments");
5903 } else { // Has arguments?
5904 // Loop through FunctionType's arguments and ensure they are specified
5906 FunctionType::param_iterator I = Ty->param_begin();
5907 FunctionType::param_iterator E = Ty->param_end();
5908 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
5911 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
5912 if (ArgI->Val->getType() != *I)
5913 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
5914 (*I)->getDescription() + "'");
5915 Args.push_back(ArgI->Val);
5916 if (ArgI->Attrs != ParamAttr::None)
5917 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
5920 if (Ty->isVarArg()) {
5922 for (; ArgI != ArgE; ++ArgI, ++index) {
5923 Args.push_back(ArgI->Val); // push the remaining varargs
5924 if (ArgI->Attrs != ParamAttr::None)
5925 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
5927 } else if (I != E || ArgI != ArgE)
5928 GEN_ERROR("Invalid number of parameters detected");
5933 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5935 // Create the InvokeInst
5936 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
5937 Args.begin(), Args.end());
5938 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
5939 II->setParamAttrs(PAL);
5940 (yyval.TermInstVal) = II;
5941 delete (yyvsp[(6) - (14)].ParamList);
5947 #line 2751 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5949 (yyval.TermInstVal) = new UnwindInst();
5955 #line 2755 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5957 (yyval.TermInstVal) = new UnreachableInst();
5963 #line 2762 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5965 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
5966 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
5969 GEN_ERROR("May only switch on a constant pool value");
5971 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
5973 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5978 #line 2773 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5980 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
5981 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
5985 GEN_ERROR("May only switch on a constant pool value");
5987 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
5989 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5994 #line 2786 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5996 // Is this definition named?? if so, assign the name...
5997 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
5999 InsertValue((yyvsp[(2) - (2)].InstVal));
6000 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6006 #line 2796 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6007 { // Used for PHI nodes
6008 if (!UpRefs.empty())
6009 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6010 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6011 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6013 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6015 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6016 delete (yyvsp[(1) - (6)].TypeVal);
6021 #line 2807 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6023 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6024 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6026 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6028 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6033 #line 2817 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6035 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6036 if (!UpRefs.empty())
6037 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6038 // Used for call and invoke instructions
6039 (yyval.ParamList) = new ParamList();
6040 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6041 (yyval.ParamList)->push_back(E);
6042 delete (yyvsp[(1) - (4)].TypeVal);
6048 #line 2828 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6050 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6051 // Labels are only valid in ASMs
6052 (yyval.ParamList) = new ParamList();
6053 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6054 (yyval.ParamList)->push_back(E);
6060 #line 2836 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6062 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6063 if (!UpRefs.empty())
6064 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6065 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6066 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6067 (yyval.ParamList)->push_back(E);
6068 delete (yyvsp[(3) - (6)].TypeVal);
6074 #line 2846 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6076 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6077 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6078 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6079 (yyval.ParamList)->push_back(E);
6085 #line 2853 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6086 { (yyval.ParamList) = new ParamList(); ;}
6090 #line 2856 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6091 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6095 #line 2857 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6097 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6098 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6104 #line 2865 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6106 (yyval.ConstantList) = new std::vector<unsigned>();
6107 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6108 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6109 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6114 #line 2871 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6116 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6117 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6118 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6119 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6125 #line 2880 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6127 (yyval.BoolVal) = true;
6133 #line 2884 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6135 (yyval.BoolVal) = false;
6141 #line 2889 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6143 if (!UpRefs.empty())
6144 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6145 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6146 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6148 "Arithmetic operator requires integer, FP, or packed operands");
6149 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6151 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6153 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6154 if ((yyval.InstVal) == 0)
6155 GEN_ERROR("binary operator returned null");
6156 delete (yyvsp[(2) - (5)].TypeVal);
6161 #line 2905 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6163 if (!UpRefs.empty())
6164 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6165 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6166 if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6167 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6168 GEN_ERROR("Logical operator requires integral operands");
6170 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6172 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6174 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6175 if ((yyval.InstVal) == 0)
6176 GEN_ERROR("binary operator returned null");
6177 delete (yyvsp[(2) - (5)].TypeVal);
6182 #line 2922 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6184 if (!UpRefs.empty())
6185 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6186 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6187 GEN_ERROR("Vector types not supported by icmp instruction");
6188 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6190 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6192 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6193 if ((yyval.InstVal) == 0)
6194 GEN_ERROR("icmp operator returned null");
6195 delete (yyvsp[(3) - (6)].TypeVal);
6200 #line 2936 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6202 if (!UpRefs.empty())
6203 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6204 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6205 GEN_ERROR("Vector types not supported by fcmp instruction");
6206 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6208 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6210 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6211 if ((yyval.InstVal) == 0)
6212 GEN_ERROR("fcmp operator returned null");
6213 delete (yyvsp[(3) - (6)].TypeVal);
6218 #line 2950 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6220 if (!UpRefs.empty())
6221 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6222 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6223 GEN_ERROR("Scalar types not supported by vicmp instruction");
6224 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6226 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6228 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6229 if ((yyval.InstVal) == 0)
6230 GEN_ERROR("icmp operator returned null");
6231 delete (yyvsp[(3) - (6)].TypeVal);
6236 #line 2964 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6238 if (!UpRefs.empty())
6239 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6240 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6241 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6242 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6244 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6246 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6247 if ((yyval.InstVal) == 0)
6248 GEN_ERROR("fcmp operator returned null");
6249 delete (yyvsp[(3) - (6)].TypeVal);
6254 #line 2978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6256 if (!UpRefs.empty())
6257 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6258 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6259 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6260 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6261 GEN_ERROR("invalid cast opcode for cast from '" +
6262 Val->getType()->getDescription() + "' to '" +
6263 DestTy->getDescription() + "'");
6264 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6265 delete (yyvsp[(4) - (4)].TypeVal);
6270 #line 2990 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6272 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6273 GEN_ERROR("select condition must be boolean");
6274 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6275 GEN_ERROR("select value types should match");
6276 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6282 #line 2998 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6284 if (!UpRefs.empty())
6285 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6286 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6287 delete (yyvsp[(4) - (4)].TypeVal);
6293 #line 3005 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6295 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6296 GEN_ERROR("Invalid extractelement operands");
6297 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6303 #line 3011 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6305 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6306 GEN_ERROR("Invalid insertelement operands");
6307 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6313 #line 3017 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6315 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6316 GEN_ERROR("Invalid shufflevector operands");
6317 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6323 #line 3023 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6325 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6326 if (!Ty->isFirstClassType())
6327 GEN_ERROR("PHI node operands must be of first class type");
6328 (yyval.InstVal) = PHINode::Create(Ty);
6329 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6330 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6331 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6332 GEN_ERROR("All elements of a PHI node must be of the same type");
6333 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6334 (yyvsp[(2) - (2)].PHIList)->pop_front();
6336 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6342 #line 3039 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6345 // Handle the short syntax
6346 const PointerType *PFTy = 0;
6347 const FunctionType *Ty = 0;
6348 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6349 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6350 // Pull out the types of all of the arguments...
6351 std::vector<const Type*> ParamTypes;
6352 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6353 for (; I != E; ++I) {
6354 const Type *Ty = I->Val->getType();
6355 if (Ty == Type::VoidTy)
6356 GEN_ERROR("Short call syntax cannot be used with varargs");
6357 ParamTypes.push_back(Ty);
6360 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6361 GEN_ERROR("Invalid result type for LLVM function");
6363 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6364 PFTy = PointerType::getUnqual(Ty);
6367 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6370 // Check for call to invalid intrinsic to avoid crashing later.
6371 if (Function *theF = dyn_cast<Function>(V)) {
6372 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6373 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6374 !theF->getIntrinsicID(true))
6375 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6376 theF->getName() + "'");
6379 // Set up the ParamAttrs for the function
6380 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6381 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6382 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6383 // Check the arguments
6385 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6386 // Make sure no arguments is a good thing!
6387 if (Ty->getNumParams() != 0)
6388 GEN_ERROR("No arguments passed to a function that "
6389 "expects arguments");
6390 } else { // Has arguments?
6391 // Loop through FunctionType's arguments and ensure they are specified
6392 // correctly. Also, gather any parameter attributes.
6393 FunctionType::param_iterator I = Ty->param_begin();
6394 FunctionType::param_iterator E = Ty->param_end();
6395 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6398 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6399 if (ArgI->Val->getType() != *I)
6400 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6401 (*I)->getDescription() + "'");
6402 Args.push_back(ArgI->Val);
6403 if (ArgI->Attrs != ParamAttr::None)
6404 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6406 if (Ty->isVarArg()) {
6408 for (; ArgI != ArgE; ++ArgI, ++index) {
6409 Args.push_back(ArgI->Val); // push the remaining varargs
6410 if (ArgI->Attrs != ParamAttr::None)
6411 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6413 } else if (I != E || ArgI != ArgE)
6414 GEN_ERROR("Invalid number of parameters detected");
6417 // Finish off the ParamAttrs and check them
6420 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6422 // Create the call node
6423 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6424 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6425 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6426 CI->setParamAttrs(PAL);
6427 (yyval.InstVal) = CI;
6428 delete (yyvsp[(6) - (8)].ParamList);
6429 delete (yyvsp[(3) - (8)].TypeVal);
6435 #line 3128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6437 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6443 #line 3133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6445 (yyval.BoolVal) = true;
6451 #line 3137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6453 (yyval.BoolVal) = false;
6459 #line 3144 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6461 if (!UpRefs.empty())
6462 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6463 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6464 delete (yyvsp[(2) - (3)].TypeVal);
6470 #line 3151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6472 if (!UpRefs.empty())
6473 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6474 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6475 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6476 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6478 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6479 delete (yyvsp[(2) - (6)].TypeVal);
6484 #line 3161 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6486 if (!UpRefs.empty())
6487 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6488 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6489 delete (yyvsp[(2) - (3)].TypeVal);
6495 #line 3168 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6497 if (!UpRefs.empty())
6498 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6499 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6500 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6501 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6503 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6504 delete (yyvsp[(2) - (6)].TypeVal);
6509 #line 3178 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6511 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6512 GEN_ERROR("Trying to free nonpointer type " +
6513 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6514 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6520 #line 3186 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6522 if (!UpRefs.empty())
6523 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6524 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6525 GEN_ERROR("Can't load from nonpointer type: " +
6526 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6527 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6528 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6529 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6530 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6532 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6533 delete (yyvsp[(3) - (5)].TypeVal);
6538 #line 3200 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6540 if (!UpRefs.empty())
6541 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6542 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6544 GEN_ERROR("Can't store to a nonpointer type: " +
6545 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6546 const Type *ElTy = PT->getElementType();
6547 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6548 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6549 "' into space of type '" + ElTy->getDescription() + "'");
6551 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6553 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6554 delete (yyvsp[(5) - (7)].TypeVal);
6559 #line 3217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6561 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
6562 if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
6563 GEN_ERROR("Invalid getresult operands");
6564 (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val));
6565 delete (yyvsp[(2) - (5)].TypeVal);
6571 #line 3225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6573 if (!UpRefs.empty())
6574 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6575 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6576 GEN_ERROR("getelementptr insn requires pointer operand");
6578 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6579 GEN_ERROR("Invalid getelementptr indices for type '" +
6580 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6581 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6583 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6584 delete (yyvsp[(2) - (4)].TypeVal);
6585 delete (yyvsp[(4) - (4)].ValueList);
6590 #line 3240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6592 if (!UpRefs.empty())
6593 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6594 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6595 GEN_ERROR("extractvalue insn requires an aggregate operand");
6597 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6598 GEN_ERROR("Invalid extractvalue indices for type '" +
6599 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6600 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6602 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6603 delete (yyvsp[(2) - (4)].TypeVal);
6604 delete (yyvsp[(4) - (4)].ConstantList);
6609 #line 3255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6611 if (!UpRefs.empty())
6612 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6613 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6614 GEN_ERROR("extractvalue insn requires an aggregate operand");
6616 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6617 GEN_ERROR("Invalid insertvalue indices for type '" +
6618 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6619 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6620 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6622 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6623 delete (yyvsp[(2) - (7)].TypeVal);
6624 delete (yyvsp[(5) - (7)].TypeVal);
6625 delete (yyvsp[(7) - (7)].ConstantList);
6630 /* Line 1267 of yacc.c. */
6631 #line 6632 "llvmAsmParser.tab.c"
6634 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6638 YY_STACK_PRINT (yyss, yyssp);
6643 /* Now `shift' the result of the reduction. Determine what state
6644 that goes to, based on the state we popped back to and the rule
6645 number reduced by. */
6649 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6650 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6651 yystate = yytable[yystate];
6653 yystate = yydefgoto[yyn - YYNTOKENS];
6658 /*------------------------------------.
6659 | yyerrlab -- here on detecting error |
6660 `------------------------------------*/
6662 /* If not already recovering from an error, report this error. */
6666 #if ! YYERROR_VERBOSE
6667 yyerror (YY_("syntax error"));
6670 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6671 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6673 YYSIZE_T yyalloc = 2 * yysize;
6674 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6675 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6676 if (yymsg != yymsgbuf)
6677 YYSTACK_FREE (yymsg);
6678 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6680 yymsg_alloc = yyalloc;
6684 yymsg_alloc = sizeof yymsgbuf;
6688 if (0 < yysize && yysize <= yymsg_alloc)
6690 (void) yysyntax_error (yymsg, yystate, yychar);
6695 yyerror (YY_("syntax error"));
6697 goto yyexhaustedlab;
6705 if (yyerrstatus == 3)
6707 /* If just tried and failed to reuse look-ahead token after an
6708 error, discard it. */
6710 if (yychar <= YYEOF)
6712 /* Return failure if at end of input. */
6713 if (yychar == YYEOF)
6718 yydestruct ("Error: discarding",
6724 /* Else will try to reuse look-ahead token after shifting the error
6729 /*---------------------------------------------------.
6730 | yyerrorlab -- error raised explicitly by YYERROR. |
6731 `---------------------------------------------------*/
6734 /* Pacify compilers like GCC when the user code never invokes
6735 YYERROR and the label yyerrorlab therefore never appears in user
6737 if (/*CONSTCOND*/ 0)
6740 /* Do not reclaim the symbols of the rule which action triggered
6744 YY_STACK_PRINT (yyss, yyssp);
6749 /*-------------------------------------------------------------.
6750 | yyerrlab1 -- common code for both syntax error and YYERROR. |
6751 `-------------------------------------------------------------*/
6753 yyerrstatus = 3; /* Each real token shifted decrements this. */
6757 yyn = yypact[yystate];
6758 if (yyn != YYPACT_NINF)
6761 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6769 /* Pop the current state because it cannot handle the error token. */
6774 yydestruct ("Error: popping",
6775 yystos[yystate], yyvsp);
6778 YY_STACK_PRINT (yyss, yyssp);
6787 /* Shift the error token. */
6788 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6794 /*-------------------------------------.
6795 | yyacceptlab -- YYACCEPT comes here. |
6796 `-------------------------------------*/
6801 /*-----------------------------------.
6802 | yyabortlab -- YYABORT comes here. |
6803 `-----------------------------------*/
6809 /*-------------------------------------------------.
6810 | yyexhaustedlab -- memory exhaustion comes here. |
6811 `-------------------------------------------------*/
6813 yyerror (YY_("memory exhausted"));
6819 if (yychar != YYEOF && yychar != YYEMPTY)
6820 yydestruct ("Cleanup: discarding lookahead",
6822 /* Do not reclaim the symbols of the rule which action triggered
6823 this YYABORT or YYACCEPT. */
6825 YY_STACK_PRINT (yyss, yyssp);
6826 while (yyssp != yyss)
6828 yydestruct ("Cleanup: popping",
6829 yystos[*yyssp], yyvsp);
6834 YYSTACK_FREE (yyss);
6837 if (yymsg != yymsgbuf)
6838 YYSTACK_FREE (yymsg);
6840 /* Make sure YYID is used. */
6841 return YYID (yyresult);
6845 #line 3274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6848 // common code from the two 'RunVMAsmParser' functions
6849 static Module* RunParser(Module * M) {
6850 CurModule.CurrentModule = M;
6851 // Check to make sure the parser succeeded
6854 delete ParserResult;
6858 // Emit an error if there are any unresolved types left.
6859 if (!CurModule.LateResolveTypes.empty()) {
6860 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
6861 if (DID.Type == ValID::LocalName) {
6862 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
6864 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
6867 delete ParserResult;
6871 // Emit an error if there are any unresolved values left.
6872 if (!CurModule.LateResolveValues.empty()) {
6873 Value *V = CurModule.LateResolveValues.back();
6874 std::map<Value*, std::pair<ValID, int> >::iterator I =
6875 CurModule.PlaceHolderInfo.find(V);
6877 if (I != CurModule.PlaceHolderInfo.end()) {
6878 ValID &DID = I->second.first;
6879 if (DID.Type == ValID::LocalName) {
6880 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
6882 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
6885 delete ParserResult;
6890 // Check to make sure that parsing produced a result
6894 // Reset ParserResult variable while saving its value for the result.
6895 Module *Result = ParserResult;
6901 void llvm::GenerateError(const std::string &message, int LineNo) {
6902 if (LineNo == -1) LineNo = LLLgetLineNo();
6903 // TODO: column number in exception
6905 TheParseError->setError(LLLgetFilename(), message, LineNo);
6909 int yyerror(const char *ErrorMsg) {
6910 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
6911 std::string errMsg = where + "error: " + std::string(ErrorMsg);
6912 if (yychar != YYEMPTY && yychar != 0) {
6913 errMsg += " while reading token: '";
6914 errMsg += std::string(LLLgetTokenStart(),
6915 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
6917 GenerateError(errMsg);