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,
142 X86_SSECALLCC_TOK = 323,
210 EXTRACTELEMENT = 391,
232 OPTIMIZEFORSIZE = 413,
239 #define ESINT64VAL 258
240 #define EUINT64VAL 259
241 #define ESAPINTVAL 260
242 #define EUAPINTVAL 261
243 #define LOCALVAL_ID 262
244 #define GLOBALVAL_ID 263
252 #define PPC_FP128 271
256 #define GLOBALVAR 275
258 #define STRINGCONSTANT 277
259 #define ATSTRINGCONSTANT 278
260 #define PCTSTRINGCONSTANT 279
261 #define ZEROINITIALIZER 280
273 #define THREAD_LOCAL 292
275 #define DOTDOTDOT 294
281 #define APPENDING 300
282 #define DLLIMPORT 301
283 #define DLLEXPORT 302
284 #define EXTERN_WEAK 303
291 #define ADDRSPACE 310
297 #define SIDEEFFECT 316
300 #define FASTCC_TOK 319
301 #define COLDCC_TOK 320
302 #define X86_STDCALLCC_TOK 321
303 #define X86_FASTCALLCC_TOK 322
304 #define X86_SSECALLCC_TOK 323
305 #define DATALAYOUT 324
311 #define UNREACHABLE 330
356 #define GETELEMENTPTR 375
372 #define EXTRACTELEMENT 391
373 #define INSERTELEMENT 392
374 #define SHUFFLEVECTOR 393
375 #define GETRESULT 394
376 #define EXTRACTVALUE 395
377 #define INSERTVALUE 396
394 #define OPTIMIZEFORSIZE 413
397 #define PROTECTED 416
402 /* Copy the first part of user declarations. */
403 #line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
405 #include "ParserInternals.h"
406 #include "llvm/CallingConv.h"
407 #include "llvm/InlineAsm.h"
408 #include "llvm/Instructions.h"
409 #include "llvm/Module.h"
410 #include "llvm/ValueSymbolTable.h"
411 #include "llvm/AutoUpgrade.h"
412 #include "llvm/Support/GetElementPtrTypeIterator.h"
413 #include "llvm/Support/CommandLine.h"
414 #include "llvm/ADT/SmallVector.h"
415 #include "llvm/ADT/STLExtras.h"
416 #include "llvm/Support/MathExtras.h"
417 #include "llvm/Support/Streams.h"
423 // The following is a gross hack. In order to rid the libAsmParser library of
424 // exceptions, we have to have a way of getting the yyparse function to go into
425 // an error situation. So, whenever we want an error to occur, the GenerateError
426 // function (see bottom of file) sets TriggerError. Then, at the end of each
427 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
428 // (a goto) to put YACC in error state. Furthermore, several calls to
429 // GenerateError are made from inside productions and they must simulate the
430 // previous exception behavior by exiting the production immediately. We have
431 // replaced these with the GEN_ERROR macro which calls GeneratError and then
432 // immediately invokes YYERROR. This would be so much cleaner if it was a
433 // recursive descent parser.
434 static bool TriggerError = false;
435 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
436 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
438 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
439 int yylex(); // declaration" of xxx warnings.
441 using namespace llvm;
443 static Module *ParserResult;
445 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
446 // relating to upreferences in the input stream.
448 //#define DEBUG_UPREFS 1
450 #define UR_OUT(X) cerr << X
455 #define YYERROR_VERBOSE 1
457 static GlobalVariable *CurGV;
460 // This contains info used when building the body of a function. It is
461 // destroyed when the function is completed.
463 typedef std::vector<Value *> ValueList; // Numbered defs
466 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
468 static struct PerModuleInfo {
469 Module *CurrentModule;
470 ValueList Values; // Module level numbered definitions
471 ValueList LateResolveValues;
472 std::vector<PATypeHolder> Types;
473 std::map<ValID, PATypeHolder> LateResolveTypes;
475 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
476 /// how they were referenced and on which line of the input they came from so
477 /// that we can resolve them later and print error messages as appropriate.
478 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
480 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
481 // references to global values. Global values may be referenced before they
482 // are defined, and if so, the temporary object that they represent is held
483 // here. This is used for forward references of GlobalValues.
485 typedef std::map<std::pair<const PointerType *,
486 ValID>, GlobalValue*> GlobalRefsType;
487 GlobalRefsType GlobalRefs;
490 // If we could not resolve some functions at function compilation time
491 // (calls to functions before they are defined), resolve them now... Types
492 // are resolved when the constant pool has been completely parsed.
494 ResolveDefinitions(LateResolveValues);
498 // Check to make sure that all global value forward references have been
501 if (!GlobalRefs.empty()) {
502 std::string UndefinedReferences = "Unresolved global references exist:\n";
504 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
506 UndefinedReferences += " " + I->first.first->getDescription() + " " +
507 I->first.second.getName() + "\n";
509 GenerateError(UndefinedReferences);
513 // Look for intrinsic functions and CallInst that need to be upgraded
514 for (Module::iterator FI = CurrentModule->begin(),
515 FE = CurrentModule->end(); FI != FE; )
516 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
518 Values.clear(); // Clear out function local definitions
523 // GetForwardRefForGlobal - Check to see if there is a forward reference
524 // for this global. If so, remove it from the GlobalRefs map and return it.
525 // If not, just return null.
526 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
527 // Check to see if there is a forward reference to this global variable...
528 // if there is, eliminate it and patch the reference to use the new def'n.
529 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
530 GlobalValue *Ret = 0;
531 if (I != GlobalRefs.end()) {
538 bool TypeIsUnresolved(PATypeHolder* PATy) {
539 // If it isn't abstract, its resolved
540 const Type* Ty = PATy->get();
541 if (!Ty->isAbstract())
543 // Traverse the type looking for abstract types. If it isn't abstract then
544 // we don't need to traverse that leg of the type.
545 std::vector<const Type*> WorkList, SeenList;
546 WorkList.push_back(Ty);
547 while (!WorkList.empty()) {
548 const Type* Ty = WorkList.back();
549 SeenList.push_back(Ty);
551 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
552 // Check to see if this is an unresolved type
553 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
554 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
555 for ( ; I != E; ++I) {
556 if (I->second.get() == OpTy)
559 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
560 const Type* TheTy = SeqTy->getElementType();
561 if (TheTy->isAbstract() && TheTy != Ty) {
562 std::vector<const Type*>::iterator I = SeenList.begin(),
568 WorkList.push_back(TheTy);
570 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
571 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
572 const Type* TheTy = StrTy->getElementType(i);
573 if (TheTy->isAbstract() && TheTy != Ty) {
574 std::vector<const Type*>::iterator I = SeenList.begin(),
580 WorkList.push_back(TheTy);
589 static struct PerFunctionInfo {
590 Function *CurrentFunction; // Pointer to current function being created
592 ValueList Values; // Keep track of #'d definitions
594 ValueList LateResolveValues;
595 bool isDeclare; // Is this function a forward declararation?
596 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
597 GlobalValue::VisibilityTypes Visibility;
599 /// BBForwardRefs - When we see forward references to basic blocks, keep
600 /// track of them here.
601 std::map<ValID, BasicBlock*> BBForwardRefs;
603 inline PerFunctionInfo() {
606 Linkage = GlobalValue::ExternalLinkage;
607 Visibility = GlobalValue::DefaultVisibility;
610 inline void FunctionStart(Function *M) {
615 void FunctionDone() {
616 // Any forward referenced blocks left?
617 if (!BBForwardRefs.empty()) {
618 GenerateError("Undefined reference to label " +
619 BBForwardRefs.begin()->second->getName());
623 // Resolve all forward references now.
624 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
626 Values.clear(); // Clear out function local definitions
627 BBForwardRefs.clear();
630 Linkage = GlobalValue::ExternalLinkage;
631 Visibility = GlobalValue::DefaultVisibility;
633 } CurFun; // Info for the current function...
635 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
638 //===----------------------------------------------------------------------===//
639 // Code to handle definitions of all the types
640 //===----------------------------------------------------------------------===//
642 /// InsertValue - Insert a value into the value table. If it is named, this
643 /// returns -1, otherwise it returns the slot number for the value.
644 static int InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
645 // Things that have names or are void typed don't get slot numbers
646 if (V->hasName() || (V->getType() == Type::VoidTy))
649 // In the case of function values, we have to allow for the forward reference
650 // of basic blocks, which are included in the numbering. Consequently, we keep
651 // track of the next insertion location with NextValNum. When a BB gets
652 // inserted, it could change the size of the CurFun.Values vector.
653 if (&ValueTab == &CurFun.Values) {
654 if (ValueTab.size() <= CurFun.NextValNum)
655 ValueTab.resize(CurFun.NextValNum+1);
656 ValueTab[CurFun.NextValNum++] = V;
657 return CurFun.NextValNum-1;
659 // For all other lists, its okay to just tack it on the back of the vector.
660 ValueTab.push_back(V);
661 return ValueTab.size()-1;
664 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
666 case ValID::LocalID: // Is it a numbered definition?
667 // Module constants occupy the lowest numbered slots...
668 if (D.Num < CurModule.Types.size())
669 return CurModule.Types[D.Num];
671 case ValID::LocalName: // Is it a named definition?
672 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
673 D.destroy(); // Free old strdup'd memory...
678 GenerateError("Internal parser error: Invalid symbol type reference");
682 // If we reached here, we referenced either a symbol that we don't know about
683 // or an id number that hasn't been read yet. We may be referencing something
684 // forward, so just create an entry to be resolved later and get to it...
686 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
689 if (inFunctionScope()) {
690 if (D.Type == ValID::LocalName) {
691 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
694 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
699 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
700 if (I != CurModule.LateResolveTypes.end())
703 Type *Typ = OpaqueType::get();
704 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
708 // getExistingVal - Look up the value specified by the provided type and
709 // the provided ValID. If the value exists and has already been defined, return
710 // it. Otherwise return null.
712 static Value *getExistingVal(const Type *Ty, const ValID &D) {
713 if (isa<FunctionType>(Ty)) {
714 GenerateError("Functions are not values and "
715 "must be referenced as pointers");
720 case ValID::LocalID: { // Is it a numbered definition?
721 // Check that the number is within bounds.
722 if (D.Num >= CurFun.Values.size())
724 Value *Result = CurFun.Values[D.Num];
725 if (Ty != Result->getType()) {
726 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
727 Result->getType()->getDescription() + "' does not match "
728 "expected type, '" + Ty->getDescription() + "'");
733 case ValID::GlobalID: { // Is it a numbered definition?
734 if (D.Num >= CurModule.Values.size())
736 Value *Result = CurModule.Values[D.Num];
737 if (Ty != Result->getType()) {
738 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
739 Result->getType()->getDescription() + "' does not match "
740 "expected type, '" + Ty->getDescription() + "'");
746 case ValID::LocalName: { // Is it a named definition?
747 if (!inFunctionScope())
749 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
750 Value *N = SymTab.lookup(D.getName());
753 if (N->getType() != Ty)
756 D.destroy(); // Free old strdup'd memory...
759 case ValID::GlobalName: { // Is it a named definition?
760 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
761 Value *N = SymTab.lookup(D.getName());
764 if (N->getType() != Ty)
767 D.destroy(); // Free old strdup'd memory...
771 // Check to make sure that "Ty" is an integral type, and that our
772 // value will fit into the specified type...
773 case ValID::ConstSIntVal: // Is it a constant pool reference??
774 if (!isa<IntegerType>(Ty) ||
775 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
776 GenerateError("Signed integral constant '" +
777 itostr(D.ConstPool64) + "' is invalid for type '" +
778 Ty->getDescription() + "'");
781 return ConstantInt::get(Ty, D.ConstPool64, true);
783 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
784 if (isa<IntegerType>(Ty) &&
785 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
786 return ConstantInt::get(Ty, D.UConstPool64);
788 if (!isa<IntegerType>(Ty) ||
789 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
790 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
791 "' is invalid or out of range for type '" +
792 Ty->getDescription() + "'");
795 // This is really a signed reference. Transmogrify.
796 return ConstantInt::get(Ty, D.ConstPool64, true);
798 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
799 if (!isa<IntegerType>(Ty)) {
800 GenerateError("Integral constant '" + D.getName() +
801 "' is invalid or out of range for type '" +
802 Ty->getDescription() + "'");
807 APSInt Tmp = *D.ConstPoolInt;
808 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
809 return ConstantInt::get(Tmp);
812 case ValID::ConstFPVal: // Is it a floating point const pool reference?
813 if (!Ty->isFloatingPoint() ||
814 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
815 GenerateError("FP constant invalid for type");
818 // Lexer has no type info, so builds all float and double FP constants
819 // as double. Fix this here. Long double does not need this.
820 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
822 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
823 return ConstantFP::get(*D.ConstPoolFP);
825 case ValID::ConstNullVal: // Is it a null value?
826 if (!isa<PointerType>(Ty)) {
827 GenerateError("Cannot create a a non pointer null");
830 return ConstantPointerNull::get(cast<PointerType>(Ty));
832 case ValID::ConstUndefVal: // Is it an undef value?
833 return UndefValue::get(Ty);
835 case ValID::ConstZeroVal: // Is it a zero value?
836 return Constant::getNullValue(Ty);
838 case ValID::ConstantVal: // Fully resolved constant?
839 if (D.ConstantValue->getType() != Ty) {
840 GenerateError("Constant expression type different from required type");
843 return D.ConstantValue;
845 case ValID::InlineAsmVal: { // Inline asm expression
846 const PointerType *PTy = dyn_cast<PointerType>(Ty);
847 const FunctionType *FTy =
848 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
849 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
850 GenerateError("Invalid type for asm constraint string");
853 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
854 D.IAD->HasSideEffects);
855 D.destroy(); // Free InlineAsmDescriptor.
859 assert(0 && "Unhandled case!");
863 assert(0 && "Unhandled case!");
867 // getVal - This function is identical to getExistingVal, except that if a
868 // value is not already defined, it "improvises" by creating a placeholder var
869 // that looks and acts just like the requested variable. When the value is
870 // defined later, all uses of the placeholder variable are replaced with the
873 static Value *getVal(const Type *Ty, const ValID &ID) {
874 if (Ty == Type::LabelTy) {
875 GenerateError("Cannot use a basic block here");
879 // See if the value has already been defined.
880 Value *V = getExistingVal(Ty, ID);
882 if (TriggerError) return 0;
884 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
885 GenerateError("Invalid use of a non-first-class type");
889 // If we reached here, we referenced either a symbol that we don't know about
890 // or an id number that hasn't been read yet. We may be referencing something
891 // forward, so just create an entry to be resolved later and get to it...
894 case ValID::GlobalName:
895 case ValID::GlobalID: {
896 const PointerType *PTy = dyn_cast<PointerType>(Ty);
898 GenerateError("Invalid type for reference to global" );
901 const Type* ElTy = PTy->getElementType();
902 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
903 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
905 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
906 (Module*)0, false, PTy->getAddressSpace());
910 V = new Argument(Ty);
913 // Remember where this forward reference came from. FIXME, shouldn't we try
914 // to recycle these things??
915 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
918 if (inFunctionScope())
919 InsertValue(V, CurFun.LateResolveValues);
921 InsertValue(V, CurModule.LateResolveValues);
925 /// defineBBVal - This is a definition of a new basic block with the specified
926 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
927 static BasicBlock *defineBBVal(const ValID &ID) {
928 assert(inFunctionScope() && "Can't get basic block at global scope!");
932 // First, see if this was forward referenced
934 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
935 if (BBI != CurFun.BBForwardRefs.end()) {
937 // The forward declaration could have been inserted anywhere in the
938 // function: insert it into the correct place now.
939 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
940 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
942 // We're about to erase the entry, save the key so we can clean it up.
943 ValID Tmp = BBI->first;
945 // Erase the forward ref from the map as its no longer "forward"
946 CurFun.BBForwardRefs.erase(ID);
948 // The key has been removed from the map but so we don't want to leave
949 // strdup'd memory around so destroy it too.
952 // If its a numbered definition, bump the number and set the BB value.
953 if (ID.Type == ValID::LocalID) {
954 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
958 // We haven't seen this BB before and its first mention is a definition.
959 // Just create it and return it.
960 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
961 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
962 if (ID.Type == ValID::LocalID) {
963 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
972 /// getBBVal - get an existing BB value or create a forward reference for it.
974 static BasicBlock *getBBVal(const ValID &ID) {
975 assert(inFunctionScope() && "Can't get basic block at global scope!");
979 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
980 if (BBI != CurFun.BBForwardRefs.end()) {
982 } if (ID.Type == ValID::LocalName) {
983 std::string Name = ID.getName();
984 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
986 if (N->getType()->getTypeID() == Type::LabelTyID)
987 BB = cast<BasicBlock>(N);
989 GenerateError("Reference to label '" + Name + "' is actually of type '"+
990 N->getType()->getDescription() + "'");
992 } else if (ID.Type == ValID::LocalID) {
993 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
994 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
995 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
997 GenerateError("Reference to label '%" + utostr(ID.Num) +
998 "' is actually of type '"+
999 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
1002 GenerateError("Illegal label reference " + ID.getName());
1006 // If its already been defined, return it now.
1008 ID.destroy(); // Free strdup'd memory.
1012 // Otherwise, this block has not been seen before, create it.
1014 if (ID.Type == ValID::LocalName)
1015 Name = ID.getName();
1016 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1018 // Insert it in the forward refs map.
1019 CurFun.BBForwardRefs[ID] = BB;
1025 //===----------------------------------------------------------------------===//
1026 // Code to handle forward references in instructions
1027 //===----------------------------------------------------------------------===//
1029 // This code handles the late binding needed with statements that reference
1030 // values not defined yet... for example, a forward branch, or the PHI node for
1033 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1034 // and back patchs after we are done.
1037 // ResolveDefinitions - If we could not resolve some defs at parsing
1038 // time (forward branches, phi functions for loops, etc...) resolve the
1042 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1043 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1044 while (!LateResolvers.empty()) {
1045 Value *V = LateResolvers.back();
1046 LateResolvers.pop_back();
1048 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1049 CurModule.PlaceHolderInfo.find(V);
1050 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1052 ValID &DID = PHI->second.first;
1054 Value *TheRealValue = getExistingVal(V->getType(), DID);
1058 V->replaceAllUsesWith(TheRealValue);
1060 CurModule.PlaceHolderInfo.erase(PHI);
1061 } else if (FutureLateResolvers) {
1062 // Functions have their unresolved items forwarded to the module late
1064 InsertValue(V, *FutureLateResolvers);
1066 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1067 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1068 "' of type '" + V->getType()->getDescription() + "'",
1069 PHI->second.second);
1072 GenerateError("Reference to an invalid definition: #" +
1073 itostr(DID.Num) + " of type '" +
1074 V->getType()->getDescription() + "'",
1075 PHI->second.second);
1080 LateResolvers.clear();
1083 // ResolveTypeTo - A brand new type was just declared. This means that (if
1084 // name is not null) things referencing Name can be resolved. Otherwise, things
1085 // refering to the number can be resolved. Do this now.
1087 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1090 D = ValID::createLocalName(*Name);
1092 D = ValID::createLocalID(CurModule.Types.size());
1094 std::map<ValID, PATypeHolder>::iterator I =
1095 CurModule.LateResolveTypes.find(D);
1096 if (I != CurModule.LateResolveTypes.end()) {
1097 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1098 CurModule.LateResolveTypes.erase(I);
1102 // setValueName - Set the specified value to the name given. The name may be
1103 // null potentially, in which case this is a noop. The string passed in is
1104 // assumed to be a malloc'd string buffer, and is free'd by this function.
1106 static void setValueName(Value *V, std::string *NameStr) {
1107 if (!NameStr) return;
1108 std::string Name(*NameStr); // Copy string
1109 delete NameStr; // Free old string
1111 if (V->getType() == Type::VoidTy) {
1112 GenerateError("Can't assign name '" + Name+"' to value with void type");
1116 assert(inFunctionScope() && "Must be in function scope!");
1117 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1118 if (ST.lookup(Name)) {
1119 GenerateError("Redefinition of value '" + Name + "' of type '" +
1120 V->getType()->getDescription() + "'");
1128 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1129 /// this is a declaration, otherwise it is a definition.
1130 static GlobalVariable *
1131 ParseGlobalVariable(std::string *NameStr,
1132 GlobalValue::LinkageTypes Linkage,
1133 GlobalValue::VisibilityTypes Visibility,
1134 bool isConstantGlobal, const Type *Ty,
1135 Constant *Initializer, bool IsThreadLocal,
1136 unsigned AddressSpace = 0) {
1137 if (isa<FunctionType>(Ty)) {
1138 GenerateError("Cannot declare global vars of function type");
1141 if (Ty == Type::LabelTy) {
1142 GenerateError("Cannot declare global vars of label type");
1146 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1150 Name = *NameStr; // Copy string
1151 delete NameStr; // Free old string
1154 // See if this global value was forward referenced. If so, recycle the
1157 if (!Name.empty()) {
1158 ID = ValID::createGlobalName(Name);
1160 ID = ValID::createGlobalID(CurModule.Values.size());
1163 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1164 // Move the global to the end of the list, from whereever it was
1165 // previously inserted.
1166 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1167 CurModule.CurrentModule->getGlobalList().remove(GV);
1168 CurModule.CurrentModule->getGlobalList().push_back(GV);
1169 GV->setInitializer(Initializer);
1170 GV->setLinkage(Linkage);
1171 GV->setVisibility(Visibility);
1172 GV->setConstant(isConstantGlobal);
1173 GV->setThreadLocal(IsThreadLocal);
1174 InsertValue(GV, CurModule.Values);
1178 // If this global has a name
1179 if (!Name.empty()) {
1180 // if the global we're parsing has an initializer (is a definition) and
1181 // has external linkage.
1182 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1183 // If there is already a global with external linkage with this name
1184 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1185 // If we allow this GVar to get created, it will be renamed in the
1186 // symbol table because it conflicts with an existing GVar. We can't
1187 // allow redefinition of GVars whose linking indicates that their name
1188 // must stay the same. Issue the error.
1189 GenerateError("Redefinition of global variable named '" + Name +
1190 "' of type '" + Ty->getDescription() + "'");
1195 // Otherwise there is no existing GV to use, create one now.
1196 GlobalVariable *GV =
1197 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1198 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1199 GV->setVisibility(Visibility);
1200 InsertValue(GV, CurModule.Values);
1204 // setTypeName - Set the specified type to the name given. The name may be
1205 // null potentially, in which case this is a noop. The string passed in is
1206 // assumed to be a malloc'd string buffer, and is freed by this function.
1208 // This function returns true if the type has already been defined, but is
1209 // allowed to be redefined in the specified context. If the name is a new name
1210 // for the type plane, it is inserted and false is returned.
1211 static bool setTypeName(const Type *T, std::string *NameStr) {
1212 assert(!inFunctionScope() && "Can't give types function-local names!");
1213 if (NameStr == 0) return false;
1215 std::string Name(*NameStr); // Copy string
1216 delete NameStr; // Free old string
1218 // We don't allow assigning names to void type
1219 if (T == Type::VoidTy) {
1220 GenerateError("Can't assign name '" + Name + "' to the void type");
1224 // Set the type name, checking for conflicts as we do so.
1225 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1227 if (AlreadyExists) { // Inserting a name that is already defined???
1228 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1229 assert(Existing && "Conflict but no matching type?!");
1231 // There is only one case where this is allowed: when we are refining an
1232 // opaque type. In this case, Existing will be an opaque type.
1233 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1234 // We ARE replacing an opaque type!
1235 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1239 // Otherwise, this is an attempt to redefine a type. That's okay if
1240 // the redefinition is identical to the original. This will be so if
1241 // Existing and T point to the same Type object. In this one case we
1242 // allow the equivalent redefinition.
1243 if (Existing == T) return true; // Yes, it's equal.
1245 // Any other kind of (non-equivalent) redefinition is an error.
1246 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1247 T->getDescription() + "'");
1253 //===----------------------------------------------------------------------===//
1254 // Code for handling upreferences in type names...
1257 // TypeContains - Returns true if Ty directly contains E in it.
1259 static bool TypeContains(const Type *Ty, const Type *E) {
1260 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1261 E) != Ty->subtype_end();
1265 struct UpRefRecord {
1266 // NestingLevel - The number of nesting levels that need to be popped before
1267 // this type is resolved.
1268 unsigned NestingLevel;
1270 // LastContainedTy - This is the type at the current binding level for the
1271 // type. Every time we reduce the nesting level, this gets updated.
1272 const Type *LastContainedTy;
1274 // UpRefTy - This is the actual opaque type that the upreference is
1275 // represented with.
1276 OpaqueType *UpRefTy;
1278 UpRefRecord(unsigned NL, OpaqueType *URTy)
1279 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1283 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1284 static std::vector<UpRefRecord> UpRefs;
1286 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1287 /// called. It loops through the UpRefs vector, which is a list of the
1288 /// currently active types. For each type, if the up reference is contained in
1289 /// the newly completed type, we decrement the level count. When the level
1290 /// count reaches zero, the upreferenced type is the type that is passed in:
1291 /// thus we can complete the cycle.
1293 static PATypeHolder HandleUpRefs(const Type *ty) {
1294 // If Ty isn't abstract, or if there are no up-references in it, then there is
1295 // nothing to resolve here.
1296 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1298 PATypeHolder Ty(ty);
1299 UR_OUT("Type '" << Ty->getDescription() <<
1300 "' newly formed. Resolving upreferences.\n" <<
1301 UpRefs.size() << " upreferences active!\n");
1303 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1304 // to zero), we resolve them all together before we resolve them to Ty. At
1305 // the end of the loop, if there is anything to resolve to Ty, it will be in
1307 OpaqueType *TypeToResolve = 0;
1309 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1310 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1311 << UpRefs[i].second->getDescription() << ") = "
1312 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1313 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1314 // Decrement level of upreference
1315 unsigned Level = --UpRefs[i].NestingLevel;
1316 UpRefs[i].LastContainedTy = Ty;
1317 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1318 if (Level == 0) { // Upreference should be resolved!
1319 if (!TypeToResolve) {
1320 TypeToResolve = UpRefs[i].UpRefTy;
1322 UR_OUT(" * Resolving upreference for "
1323 << UpRefs[i].second->getDescription() << "\n";
1324 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1325 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1326 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1327 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1329 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1330 --i; // Do not skip the next element...
1335 if (TypeToResolve) {
1336 UR_OUT(" * Resolving upreference for "
1337 << UpRefs[i].second->getDescription() << "\n";
1338 std::string OldName = TypeToResolve->getDescription());
1339 TypeToResolve->refineAbstractTypeTo(Ty);
1345 //===----------------------------------------------------------------------===//
1346 // RunVMAsmParser - Define an interface to this parser
1347 //===----------------------------------------------------------------------===//
1349 static Module* RunParser(Module * M);
1351 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1353 Module *M = RunParser(new Module(LLLgetFilename()));
1360 /* Enabling traces. */
1365 /* Enabling verbose error messages. */
1366 #ifdef YYERROR_VERBOSE
1367 # undef YYERROR_VERBOSE
1368 # define YYERROR_VERBOSE 1
1370 # define YYERROR_VERBOSE 0
1373 /* Enabling the token table. */
1374 #ifndef YYTOKEN_TABLE
1375 # define YYTOKEN_TABLE 0
1378 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1379 typedef union YYSTYPE
1380 #line 970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
1382 llvm::Module *ModuleVal;
1383 llvm::Function *FunctionVal;
1384 llvm::BasicBlock *BasicBlockVal;
1385 llvm::TerminatorInst *TermInstVal;
1386 llvm::Instruction *InstVal;
1387 llvm::Constant *ConstVal;
1389 const llvm::Type *PrimType;
1390 std::list<llvm::PATypeHolder> *TypeList;
1391 llvm::PATypeHolder *TypeVal;
1392 llvm::Value *ValueVal;
1393 std::vector<llvm::Value*> *ValueList;
1394 std::vector<unsigned> *ConstantList;
1395 llvm::ArgListType *ArgList;
1396 llvm::TypeWithAttrs TypeWithAttrs;
1397 llvm::TypeWithAttrsList *TypeWithAttrsList;
1398 llvm::ParamList *ParamList;
1400 // Represent the RHS of PHI node
1401 std::list<std::pair<llvm::Value*,
1402 llvm::BasicBlock*> > *PHIList;
1403 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1404 std::vector<llvm::Constant*> *ConstVector;
1406 llvm::GlobalValue::LinkageTypes Linkage;
1407 llvm::GlobalValue::VisibilityTypes Visibility;
1408 llvm::ParameterAttributes ParamAttrs;
1409 llvm::FunctionNotes FunctionNotes;
1410 llvm::APInt *APIntVal;
1415 llvm::APFloat *FPVal;
1418 std::string *StrVal; // This memory must be deleted
1419 llvm::ValID ValIDVal;
1421 llvm::Instruction::BinaryOps BinaryOpVal;
1422 llvm::Instruction::TermOps TermOpVal;
1423 llvm::Instruction::MemoryOps MemOpVal;
1424 llvm::Instruction::CastOps CastOpVal;
1425 llvm::Instruction::OtherOps OtherOpVal;
1426 llvm::ICmpInst::Predicate IPredicate;
1427 llvm::FCmpInst::Predicate FPredicate;
1429 /* Line 193 of yacc.c. */
1430 #line 1431 "llvmAsmParser.tab.c"
1432 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1433 # define YYSTYPE_IS_DECLARED 1
1434 # define YYSTYPE_IS_TRIVIAL 1
1439 /* Copy the second part of user declarations. */
1442 /* Line 216 of yacc.c. */
1443 #line 1444 "llvmAsmParser.tab.c"
1450 typedef YYTYPE_UINT8 yytype_uint8;
1452 typedef unsigned char yytype_uint8;
1456 typedef YYTYPE_INT8 yytype_int8;
1457 #elif (defined __STDC__ || defined __C99__FUNC__ \
1458 || defined __cplusplus || defined _MSC_VER)
1459 typedef signed char yytype_int8;
1461 typedef short int yytype_int8;
1464 #ifdef YYTYPE_UINT16
1465 typedef YYTYPE_UINT16 yytype_uint16;
1467 typedef unsigned short int yytype_uint16;
1471 typedef YYTYPE_INT16 yytype_int16;
1473 typedef short int yytype_int16;
1477 # ifdef __SIZE_TYPE__
1478 # define YYSIZE_T __SIZE_TYPE__
1479 # elif defined size_t
1480 # define YYSIZE_T size_t
1481 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1482 || defined __cplusplus || defined _MSC_VER)
1483 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1484 # define YYSIZE_T size_t
1486 # define YYSIZE_T unsigned int
1490 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1493 # if defined YYENABLE_NLS && YYENABLE_NLS
1495 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1496 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1500 # define YY_(msgid) msgid
1504 /* Suppress unused-variable warnings by "using" E. */
1505 #if ! defined lint || defined __GNUC__
1506 # define YYUSE(e) ((void) (e))
1508 # define YYUSE(e) /* empty */
1511 /* Identity function, used to suppress warnings about constant conditions. */
1513 # define YYID(n) (n)
1515 #if (defined __STDC__ || defined __C99__FUNC__ \
1516 || defined __cplusplus || defined _MSC_VER)
1529 #if ! defined yyoverflow || YYERROR_VERBOSE
1531 /* The parser invokes alloca or malloc; define the necessary symbols. */
1533 # ifdef YYSTACK_USE_ALLOCA
1534 # if YYSTACK_USE_ALLOCA
1536 # define YYSTACK_ALLOC __builtin_alloca
1537 # elif defined __BUILTIN_VA_ARG_INCR
1538 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1540 # define YYSTACK_ALLOC __alloca
1541 # elif defined _MSC_VER
1542 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1543 # define alloca _alloca
1545 # define YYSTACK_ALLOC alloca
1546 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1547 || defined __cplusplus || defined _MSC_VER)
1548 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1550 # define _STDLIB_H 1
1557 # ifdef YYSTACK_ALLOC
1558 /* Pacify GCC's `empty if-body' warning. */
1559 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1560 # ifndef YYSTACK_ALLOC_MAXIMUM
1561 /* The OS might guarantee only one guard page at the bottom of the stack,
1562 and a page size can be as small as 4096 bytes. So we cannot safely
1563 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1564 to allow for a few compiler-allocated temporary stack slots. */
1565 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1568 # define YYSTACK_ALLOC YYMALLOC
1569 # define YYSTACK_FREE YYFREE
1570 # ifndef YYSTACK_ALLOC_MAXIMUM
1571 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1573 # if (defined __cplusplus && ! defined _STDLIB_H \
1574 && ! ((defined YYMALLOC || defined malloc) \
1575 && (defined YYFREE || defined free)))
1576 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1578 # define _STDLIB_H 1
1582 # define YYMALLOC malloc
1583 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1584 || defined __cplusplus || defined _MSC_VER)
1585 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1589 # define YYFREE free
1590 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1591 || defined __cplusplus || defined _MSC_VER)
1592 void free (void *); /* INFRINGES ON USER NAME SPACE */
1596 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1599 #if (! defined yyoverflow \
1600 && (! defined __cplusplus \
1601 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1603 /* A type that is properly aligned for any stack member. */
1610 /* The size of the maximum gap between one aligned stack and the next. */
1611 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1613 /* The size of an array large to enough to hold all stacks, each with
1615 # define YYSTACK_BYTES(N) \
1616 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1617 + YYSTACK_GAP_MAXIMUM)
1619 /* Copy COUNT objects from FROM to TO. The source and destination do
1622 # if defined __GNUC__ && 1 < __GNUC__
1623 # define YYCOPY(To, From, Count) \
1624 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1626 # define YYCOPY(To, From, Count) \
1630 for (yyi = 0; yyi < (Count); yyi++) \
1631 (To)[yyi] = (From)[yyi]; \
1637 /* Relocate STACK from its old location to the new one. The
1638 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1639 elements in the stack, and YYPTR gives the new location of the
1640 stack. Advance YYPTR to a properly aligned location for the next
1642 # define YYSTACK_RELOCATE(Stack) \
1645 YYSIZE_T yynewbytes; \
1646 YYCOPY (&yyptr->Stack, Stack, yysize); \
1647 Stack = &yyptr->Stack; \
1648 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1649 yyptr += yynewbytes / sizeof (*yyptr); \
1655 /* YYFINAL -- State number of the termination state. */
1657 /* YYLAST -- Last index in YYTABLE. */
1660 /* YYNTOKENS -- Number of terminals. */
1661 #define YYNTOKENS 176
1662 /* YYNNTS -- Number of nonterminals. */
1664 /* YYNRULES -- Number of rules. */
1665 #define YYNRULES 354
1666 /* YYNRULES -- Number of states. */
1667 #define YYNSTATES 721
1669 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1670 #define YYUNDEFTOK 2
1671 #define YYMAXUTOK 416
1673 #define YYTRANSLATE(YYX) \
1674 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1676 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1677 static const yytype_uint8 yytranslate[] =
1679 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1683 162, 163, 166, 2, 165, 2, 2, 2, 2, 2,
1684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1685 171, 164, 172, 2, 2, 2, 2, 2, 2, 2,
1686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1687 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1688 2, 168, 167, 170, 2, 2, 2, 2, 2, 175,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1691 169, 2, 2, 173, 2, 174, 2, 2, 2, 2,
1692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1703 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1704 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1705 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1706 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1707 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1708 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1709 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1710 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1711 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1712 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1713 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1714 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1715 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1716 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1717 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1718 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1719 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1720 155, 156, 157, 158, 159, 160, 161
1724 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1726 static const yytype_uint16 yyprhs[] =
1728 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1729 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1730 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1731 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1732 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1733 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1734 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1735 140, 143, 145, 147, 149, 150, 153, 155, 157, 159,
1736 161, 163, 165, 167, 169, 171, 172, 174, 176, 178,
1737 179, 181, 183, 184, 186, 188, 190, 192, 193, 195,
1738 197, 198, 200, 202, 204, 206, 208, 210, 213, 215,
1739 217, 219, 221, 223, 225, 227, 229, 231, 234, 235,
1740 238, 240, 242, 244, 246, 248, 250, 252, 253, 256,
1741 258, 262, 266, 270, 272, 273, 278, 279, 282, 283,
1742 286, 287, 291, 294, 295, 297, 298, 302, 304, 307,
1743 309, 311, 313, 315, 317, 319, 321, 323, 325, 329,
1744 331, 334, 340, 346, 352, 358, 362, 365, 371, 376,
1745 379, 381, 383, 385, 389, 391, 395, 397, 398, 400,
1746 404, 409, 413, 417, 422, 427, 431, 438, 444, 447,
1747 450, 453, 456, 459, 462, 465, 468, 471, 474, 477,
1748 480, 487, 493, 502, 509, 516, 524, 532, 540, 548,
1749 555, 564, 573, 579, 587, 591, 593, 595, 597, 599,
1750 600, 603, 610, 612, 613, 615, 618, 619, 623, 624,
1751 628, 632, 636, 640, 641, 650, 651, 661, 662, 672,
1752 678, 681, 685, 687, 691, 695, 699, 703, 705, 706,
1753 712, 716, 718, 722, 724, 725, 737, 739, 741, 746,
1754 748, 750, 753, 757, 758, 760, 762, 764, 766, 768,
1755 770, 772, 774, 776, 778, 780, 784, 788, 791, 794,
1756 798, 801, 807, 812, 814, 820, 822, 824, 826, 828,
1757 830, 832, 835, 837, 841, 844, 847, 851, 855, 858,
1758 859, 861, 864, 867, 871, 881, 891, 900, 915, 917,
1759 919, 926, 932, 935, 938, 945, 953, 958, 963, 970,
1760 977, 978, 979, 983, 986, 990, 993, 995, 1001, 1007,
1761 1014, 1021, 1028, 1035, 1040, 1047, 1052, 1057, 1064, 1071,
1762 1074, 1083, 1085, 1087, 1088, 1092, 1099, 1103, 1110, 1113,
1763 1119, 1127, 1133, 1138, 1143
1766 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1767 static const yytype_int16 yyrhs[] =
1769 226, 0, -1, 76, -1, 77, -1, 78, -1, 79,
1770 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1771 -1, 88, -1, 89, -1, 90, -1, 85, -1, 86,
1772 -1, 87, -1, 121, -1, 122, -1, 123, -1, 124,
1773 -1, 125, -1, 126, -1, 127, -1, 128, -1, 129,
1774 -1, 130, -1, 131, -1, 132, -1, 95, -1, 96,
1775 -1, 97, -1, 98, -1, 99, -1, 100, -1, 101,
1776 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1777 -1, 107, -1, 108, -1, 109, -1, 110, -1, 111,
1778 -1, 112, -1, 113, -1, 114, -1, 101, -1, 102,
1779 -1, 103, -1, 104, -1, 26, -1, 27, -1, 11,
1780 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1781 -1, 19, -1, 22, -1, 24, -1, 184, -1, -1,
1782 55, 162, 4, 163, -1, -1, 184, 164, -1, -1,
1783 7, 164, -1, 20, -1, 23, -1, 191, -1, -1,
1784 189, 164, -1, 42, -1, 44, -1, 43, -1, 45,
1785 -1, 47, -1, 49, -1, 46, -1, 48, -1, 51,
1786 -1, -1, 159, -1, 160, -1, 161, -1, -1, 46,
1787 -1, 48, -1, -1, 42, -1, 43, -1, 44, -1,
1788 47, -1, -1, 44, -1, 42, -1, -1, 63, -1,
1789 64, -1, 65, -1, 66, -1, 67, -1, 68, -1,
1790 62, 4, -1, 143, -1, 122, -1, 142, -1, 123,
1791 -1, 145, -1, 146, -1, 148, -1, 149, -1, 150,
1792 -1, 54, 4, -1, -1, 200, 199, -1, 144, -1,
1793 147, -1, 145, -1, 143, -1, 142, -1, 151, -1,
1794 152, -1, -1, 202, 201, -1, 204, -1, 203, 165,
1795 204, -1, 155, 164, 157, -1, 155, 164, 156, -1,
1796 158, -1, -1, 154, 162, 203, 163, -1, -1, 153,
1797 22, -1, -1, 54, 4, -1, -1, 165, 54, 4,
1798 -1, 34, 22, -1, -1, 209, -1, -1, 165, 212,
1799 211, -1, 209, -1, 54, 4, -1, 11, -1, 12,
1800 -1, 13, -1, 16, -1, 15, -1, 14, -1, 17,
1801 -1, 50, -1, 213, -1, 214, 186, 166, -1, 248,
1802 -1, 167, 4, -1, 214, 162, 218, 163, 202, -1,
1803 10, 162, 218, 163, 202, -1, 168, 4, 169, 214,
1804 170, -1, 171, 4, 169, 214, 172, -1, 173, 219,
1805 174, -1, 173, 174, -1, 171, 173, 219, 174, 172,
1806 -1, 171, 173, 174, 172, -1, 214, 200, -1, 214,
1807 -1, 10, -1, 215, -1, 217, 165, 215, -1, 217,
1808 -1, 217, 165, 39, -1, 39, -1, -1, 214, -1,
1809 219, 165, 214, -1, 214, 168, 222, 170, -1, 214,
1810 168, 170, -1, 214, 175, 22, -1, 214, 171, 222,
1811 172, -1, 214, 173, 222, 174, -1, 214, 173, 174,
1812 -1, 214, 171, 173, 222, 174, 172, -1, 214, 171,
1813 173, 174, 172, -1, 214, 40, -1, 214, 41, -1,
1814 214, 248, -1, 214, 221, -1, 214, 25, -1, 182,
1815 3, -1, 182, 5, -1, 182, 4, -1, 182, 6,
1816 -1, 11, 26, -1, 11, 27, -1, 183, 9, -1,
1817 179, 162, 220, 38, 214, 163, -1, 120, 162, 220,
1818 260, 163, -1, 134, 162, 220, 165, 220, 165, 220,
1819 163, -1, 177, 162, 220, 165, 220, 163, -1, 178,
1820 162, 220, 165, 220, 163, -1, 91, 180, 162, 220,
1821 165, 220, 163, -1, 92, 181, 162, 220, 165, 220,
1822 163, -1, 93, 180, 162, 220, 165, 220, 163, -1,
1823 94, 181, 162, 220, 165, 220, 163, -1, 136, 162,
1824 220, 165, 220, 163, -1, 137, 162, 220, 165, 220,
1825 165, 220, 163, -1, 138, 162, 220, 165, 220, 165,
1826 220, 163, -1, 140, 162, 220, 261, 163, -1, 141,
1827 162, 220, 165, 220, 261, 163, -1, 222, 165, 220,
1828 -1, 220, -1, 32, -1, 33, -1, 37, -1, -1,
1829 216, 248, -1, 126, 162, 225, 38, 214, 163, -1,
1830 227, -1, -1, 228, -1, 227, 228, -1, -1, 31,
1831 229, 244, -1, -1, 30, 230, 245, -1, 60, 59,
1832 234, -1, 187, 18, 214, -1, 187, 18, 10, -1,
1833 -1, 190, 194, 224, 223, 220, 186, 231, 211, -1,
1834 -1, 190, 192, 194, 224, 223, 220, 186, 232, 211,
1835 -1, -1, 190, 193, 194, 224, 223, 214, 186, 233,
1836 211, -1, 190, 194, 35, 197, 225, -1, 52, 235,
1837 -1, 56, 164, 236, -1, 22, -1, 53, 164, 22,
1838 -1, 69, 164, 22, -1, 168, 237, 170, -1, 237,
1839 165, 22, -1, 22, -1, -1, 238, 165, 214, 200,
1840 185, -1, 214, 200, 185, -1, 238, -1, 238, 165,
1841 39, -1, 39, -1, -1, 198, 216, 189, 162, 239,
1842 163, 202, 210, 207, 206, 205, -1, 28, -1, 173,
1843 -1, 196, 194, 240, 241, -1, 29, -1, 174, -1,
1844 252, 243, -1, 195, 194, 240, -1, -1, 61, -1,
1845 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1846 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1847 171, 222, 172, -1, 168, 222, 170, -1, 168, 170,
1848 -1, 175, 22, -1, 173, 222, 174, -1, 173, 174,
1849 -1, 171, 173, 222, 174, 172, -1, 171, 173, 174,
1850 172, -1, 221, -1, 59, 246, 22, 165, 22, -1,
1851 7, -1, 8, -1, 184, -1, 189, -1, 248, -1,
1852 247, -1, 214, 249, -1, 250, -1, 251, 165, 250,
1853 -1, 252, 253, -1, 242, 253, -1, 254, 187, 255,
1854 -1, 254, 188, 255, -1, 254, 257, -1, -1, 21,
1855 -1, 70, 251, -1, 70, 10, -1, 71, 17, 249,
1856 -1, 71, 11, 249, 165, 17, 249, 165, 17, 249,
1857 -1, 72, 182, 249, 165, 17, 249, 168, 256, 170,
1858 -1, 72, 182, 249, 165, 17, 249, 168, 170, -1,
1859 73, 198, 216, 249, 162, 259, 163, 202, 38, 17,
1860 249, 74, 17, 249, -1, 74, -1, 75, -1, 256,
1861 182, 247, 165, 17, 249, -1, 182, 247, 165, 17,
1862 249, -1, 187, 263, -1, 188, 263, -1, 214, 168,
1863 249, 165, 249, 170, -1, 258, 165, 168, 249, 165,
1864 249, 170, -1, 214, 200, 249, 200, -1, 17, 200,
1865 249, 200, -1, 259, 165, 214, 200, 249, 200, -1,
1866 259, 165, 17, 200, 249, 200, -1, -1, -1, 260,
1867 165, 250, -1, 165, 4, -1, 261, 165, 4, -1,
1868 58, 57, -1, 57, -1, 177, 214, 249, 165, 249,
1869 -1, 178, 214, 249, 165, 249, -1, 91, 180, 214,
1870 249, 165, 249, -1, 92, 181, 214, 249, 165, 249,
1871 -1, 93, 180, 214, 249, 165, 249, -1, 94, 181,
1872 214, 249, 165, 249, -1, 179, 250, 38, 214, -1,
1873 134, 250, 165, 250, 165, 250, -1, 135, 250, 165,
1874 214, -1, 136, 250, 165, 250, -1, 137, 250, 165,
1875 250, 165, 250, -1, 138, 250, 165, 250, 165, 250,
1876 -1, 133, 258, -1, 262, 198, 216, 249, 162, 259,
1877 163, 202, -1, 265, -1, 36, -1, -1, 115, 214,
1878 208, -1, 115, 214, 165, 11, 249, 208, -1, 116,
1879 214, 208, -1, 116, 214, 165, 11, 249, 208, -1,
1880 117, 250, -1, 264, 118, 214, 249, 208, -1, 264,
1881 119, 250, 165, 214, 249, 208, -1, 139, 214, 249,
1882 165, 4, -1, 120, 214, 249, 260, -1, 140, 214,
1883 249, 261, -1, 141, 214, 249, 165, 214, 249, 261,
1887 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1888 static const yytype_uint16 yyrline[] =
1890 0, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142,
1891 1142, 1143, 1143, 1143, 1143, 1143, 1143, 1144, 1144, 1144,
1892 1144, 1144, 1144, 1145, 1145, 1145, 1145, 1145, 1145, 1148,
1893 1148, 1149, 1149, 1150, 1150, 1151, 1151, 1152, 1152, 1156,
1894 1156, 1157, 1157, 1158, 1158, 1159, 1159, 1160, 1160, 1161,
1895 1161, 1162, 1162, 1163, 1164, 1169, 1170, 1170, 1170, 1170,
1896 1170, 1172, 1172, 1172, 1173, 1173, 1175, 1176, 1180, 1184,
1897 1189, 1195, 1195, 1197, 1198, 1203, 1209, 1210, 1211, 1212,
1898 1213, 1214, 1218, 1219, 1220, 1224, 1225, 1226, 1227, 1231,
1899 1232, 1233, 1237, 1238, 1239, 1240, 1241, 1245, 1246, 1247,
1900 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1264, 1265,
1901 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1277, 1278,
1902 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1292, 1293, 1298,
1903 1299, 1310, 1311, 1312, 1315, 1316, 1321, 1322, 1329, 1330,
1904 1336, 1337, 1346, 1354, 1355, 1360, 1361, 1362, 1367, 1380,
1905 1380, 1380, 1380, 1380, 1380, 1380, 1383, 1387, 1391, 1398,
1906 1403, 1411, 1440, 1465, 1470, 1480, 1490, 1494, 1504, 1511,
1907 1520, 1527, 1532, 1537, 1544, 1545, 1552, 1559, 1567, 1573,
1908 1585, 1613, 1629, 1656, 1684, 1710, 1730, 1756, 1776, 1788,
1909 1795, 1861, 1871, 1881, 1887, 1897, 1903, 1913, 1919, 1925,
1910 1938, 1950, 1971, 1979, 1985, 1996, 2001, 2006, 2011, 2016,
1911 2022, 2028, 2034, 2042, 2053, 2057, 2065, 2065, 2068, 2068,
1912 2071, 2083, 2104, 2109, 2117, 2118, 2122, 2122, 2126, 2126,
1913 2129, 2132, 2156, 2168, 2167, 2179, 2178, 2188, 2187, 2198,
1914 2238, 2241, 2247, 2257, 2261, 2266, 2268, 2273, 2278, 2287,
1915 2297, 2308, 2312, 2321, 2330, 2335, 2467, 2467, 2469, 2478,
1916 2478, 2480, 2485, 2497, 2501, 2506, 2510, 2514, 2519, 2524,
1917 2528, 2532, 2536, 2540, 2544, 2548, 2570, 2592, 2598, 2611,
1918 2623, 2628, 2640, 2646, 2650, 2660, 2664, 2668, 2673, 2680,
1919 2680, 2686, 2695, 2700, 2705, 2709, 2718, 2727, 2740, 2749,
1920 2753, 2761, 2781, 2785, 2790, 2801, 2820, 2829, 2915, 2919,
1921 2926, 2937, 2950, 2959, 2972, 2983, 2993, 3004, 3012, 3022,
1922 3029, 3032, 3033, 3041, 3047, 3056, 3060, 3065, 3081, 3098,
1923 3110, 3122, 3136, 3150, 3162, 3183, 3190, 3196, 3202, 3208,
1924 3223, 3313, 3318, 3322, 3329, 3336, 3346, 3353, 3363, 3371,
1925 3385, 3402, 3416, 3431, 3446
1929 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1930 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1931 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1932 static const char *const yytname[] =
1934 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1935 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1936 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1937 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1938 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1939 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1940 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1941 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1942 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1943 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1944 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1945 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1946 "X86_SSECALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE",
1947 "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV",
1948 "UREM", "SREM", "FREM", "AND", "OR", "XOR", "SHL", "LSHR", "ASHR",
1949 "ICMP", "FCMP", "VICMP", "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1950 "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE",
1951 "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1952 "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST",
1953 "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT",
1954 "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT",
1955 "SHUFFLEVECTOR", "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT",
1956 "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL",
1957 "NEST", "READNONE", "READONLY", "GC", "FNNOTE", "INLINE", "ALWAYS",
1958 "NEVER", "OPTIMIZEFORSIZE", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1959 "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1960 "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1961 "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1962 "OptLocalName", "OptAddrSpace", "OptLocalAssign", "LocalNumber",
1963 "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1964 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1965 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1966 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "FuncNoteList", "FuncNote",
1967 "OptFuncNotes", "OptGC", "OptAlign", "OptCAlign", "SectionString",
1968 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType",
1969 "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI",
1970 "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1971 "ThreadLocal", "AliaseeRef", "Module", "DefinitionList", "Definition",
1972 "@1", "@2", "@3", "@4", "@5", "AsmBlock", "TargetDefinition",
1973 "LibrariesDefinition", "LibList", "ArgListH", "ArgList",
1974 "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", "Function",
1975 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1976 "ValueRef", "ResolvedVal", "ReturnedVal", "BasicBlockList", "BasicBlock",
1977 "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", "PHIList",
1978 "ParamList", "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1979 "OptVolatile", "MemoryInst", 0
1984 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1986 static const yytype_uint16 yytoknum[] =
1988 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1989 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1990 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1991 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1992 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1993 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1994 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1995 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1996 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1997 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1998 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1999 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
2000 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2001 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2002 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2003 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
2004 415, 416, 40, 41, 61, 44, 42, 92, 91, 120,
2005 93, 60, 62, 123, 125, 99
2009 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2010 static const yytype_uint16 yyr1[] =
2012 0, 176, 177, 177, 177, 177, 177, 177, 177, 177,
2013 177, 178, 178, 178, 178, 178, 178, 179, 179, 179,
2014 179, 179, 179, 179, 179, 179, 179, 179, 179, 180,
2015 180, 180, 180, 180, 180, 180, 180, 180, 180, 181,
2016 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
2017 181, 181, 181, 181, 181, 182, 183, 183, 183, 183,
2018 183, 184, 184, 184, 185, 185, 186, 186, 187, 187,
2019 188, 189, 189, 190, 190, 191, 192, 192, 192, 192,
2020 192, 192, 193, 193, 193, 194, 194, 194, 194, 195,
2021 195, 195, 196, 196, 196, 196, 196, 197, 197, 197,
2022 198, 198, 198, 198, 198, 198, 198, 198, 199, 199,
2023 199, 199, 199, 199, 199, 199, 199, 199, 200, 200,
2024 201, 201, 201, 201, 201, 201, 201, 202, 202, 203,
2025 203, 204, 204, 204, 205, 205, 206, 206, 207, 207,
2026 208, 208, 209, 210, 210, 211, 211, 212, 212, 213,
2027 213, 213, 213, 213, 213, 213, 214, 214, 214, 214,
2028 214, 214, 214, 214, 214, 214, 214, 214, 214, 215,
2029 216, 216, 217, 217, 218, 218, 218, 218, 219, 219,
2030 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
2031 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
2032 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
2033 221, 221, 221, 221, 222, 222, 223, 223, 224, 224,
2034 225, 225, 226, 226, 227, 227, 229, 228, 230, 228,
2035 228, 228, 228, 231, 228, 232, 228, 233, 228, 228,
2036 228, 228, 234, 235, 235, 236, 237, 237, 237, 238,
2037 238, 239, 239, 239, 239, 240, 241, 241, 242, 243,
2038 243, 244, 245, 246, 246, 247, 247, 247, 247, 247,
2039 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
2040 247, 247, 247, 247, 247, 248, 248, 248, 248, 249,
2041 249, 250, 251, 251, 252, 252, 253, 253, 254, 254,
2042 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2043 256, 256, 257, 257, 258, 258, 259, 259, 259, 259,
2044 259, 260, 260, 261, 261, 262, 262, 263, 263, 263,
2045 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
2046 263, 263, 264, 264, 265, 265, 265, 265, 265, 265,
2047 265, 265, 265, 265, 265
2050 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2051 static const yytype_uint8 yyr2[] =
2053 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2054 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2055 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2056 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2057 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2058 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2059 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2060 2, 1, 1, 1, 0, 2, 1, 1, 1, 1,
2061 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
2062 1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
2063 0, 1, 1, 1, 1, 1, 1, 2, 1, 1,
2064 1, 1, 1, 1, 1, 1, 1, 2, 0, 2,
2065 1, 1, 1, 1, 1, 1, 1, 0, 2, 1,
2066 3, 3, 3, 1, 0, 4, 0, 2, 0, 2,
2067 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
2068 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2069 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
2070 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
2071 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
2072 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2073 6, 5, 8, 6, 6, 7, 7, 7, 7, 6,
2074 8, 8, 5, 7, 3, 1, 1, 1, 1, 0,
2075 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
2076 3, 3, 3, 0, 8, 0, 9, 0, 9, 5,
2077 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
2078 3, 1, 3, 1, 0, 11, 1, 1, 4, 1,
2079 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
2080 1, 1, 1, 1, 1, 3, 3, 2, 2, 3,
2081 2, 5, 4, 1, 5, 1, 1, 1, 1, 1,
2082 1, 2, 1, 3, 2, 2, 3, 3, 2, 0,
2083 1, 2, 2, 3, 9, 9, 8, 14, 1, 1,
2084 6, 5, 2, 2, 6, 7, 4, 4, 6, 6,
2085 0, 0, 3, 2, 3, 2, 1, 5, 5, 6,
2086 6, 6, 6, 4, 6, 4, 4, 6, 6, 2,
2087 8, 1, 1, 0, 3, 6, 3, 6, 2, 5,
2091 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2092 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2093 means the default is an error. */
2094 static const yytype_uint16 yydefact[] =
2096 74, 61, 71, 62, 72, 63, 228, 226, 0, 0,
2097 0, 0, 0, 0, 85, 73, 0, 74, 224, 89,
2098 92, 0, 0, 240, 0, 0, 68, 0, 75, 76,
2099 78, 77, 79, 82, 80, 83, 81, 84, 86, 87,
2100 88, 85, 85, 219, 1, 225, 90, 91, 85, 229,
2101 93, 94, 95, 96, 85, 299, 227, 299, 0, 0,
2102 248, 241, 242, 230, 285, 286, 232, 149, 150, 151,
2103 154, 153, 152, 155, 156, 0, 0, 0, 0, 287,
2104 288, 157, 231, 159, 219, 219, 97, 218, 0, 100,
2105 100, 300, 295, 69, 259, 260, 261, 294, 243, 244,
2106 247, 0, 177, 160, 0, 0, 0, 0, 166, 178,
2107 0, 0, 177, 0, 0, 0, 99, 98, 0, 216,
2108 217, 0, 0, 101, 102, 103, 104, 105, 106, 0,
2109 262, 0, 0, 343, 343, 298, 0, 245, 176, 118,
2110 172, 174, 0, 0, 0, 0, 0, 0, 165, 0,
2111 0, 158, 0, 0, 171, 0, 170, 0, 239, 149,
2112 150, 151, 154, 153, 152, 0, 0, 67, 67, 107,
2113 0, 256, 257, 258, 70, 342, 326, 0, 0, 0,
2114 0, 100, 308, 309, 2, 3, 4, 5, 6, 7,
2115 8, 9, 10, 14, 15, 16, 11, 12, 13, 0,
2116 0, 0, 0, 0, 0, 0, 0, 17, 18, 19,
2117 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
2118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2119 0, 296, 100, 312, 0, 341, 297, 313, 246, 169,
2120 0, 127, 67, 67, 168, 0, 179, 0, 127, 67,
2121 67, 0, 220, 197, 198, 193, 195, 194, 196, 199,
2122 192, 188, 189, 0, 0, 0, 0, 0, 0, 0,
2123 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2124 0, 191, 190, 233, 0, 325, 302, 67, 292, 301,
2125 0, 0, 55, 0, 0, 29, 30, 31, 32, 33,
2126 34, 35, 36, 37, 38, 0, 53, 54, 49, 50,
2127 51, 52, 39, 40, 41, 42, 43, 44, 45, 46,
2128 47, 48, 0, 0, 0, 140, 140, 348, 67, 67,
2129 339, 0, 0, 0, 0, 0, 67, 67, 67, 67,
2130 67, 0, 0, 0, 0, 0, 109, 111, 110, 108,
2131 112, 113, 114, 115, 116, 119, 175, 173, 162, 163,
2132 164, 167, 66, 161, 235, 237, 0, 0, 0, 0,
2133 0, 0, 0, 0, 0, 0, 0, 0, 181, 215,
2134 0, 0, 0, 185, 0, 182, 0, 0, 0, 145,
2135 254, 265, 266, 267, 268, 269, 274, 270, 271, 272,
2136 273, 263, 0, 0, 0, 0, 283, 290, 289, 291,
2137 0, 0, 303, 0, 0, 67, 67, 67, 67, 0,
2138 344, 0, 346, 321, 0, 0, 0, 0, 0, 0,
2139 0, 0, 0, 0, 0, 0, 0, 0, 67, 0,
2140 117, 124, 123, 120, 122, 121, 125, 126, 128, 145,
2141 145, 0, 0, 0, 0, 0, 321, 0, 0, 0,
2142 0, 0, 0, 0, 180, 166, 178, 0, 183, 184,
2143 0, 0, 0, 0, 234, 253, 118, 251, 0, 264,
2144 0, 277, 0, 0, 0, 280, 0, 278, 293, 0,
2145 0, 0, 0, 0, 0, 0, 0, 0, 0, 352,
2146 0, 0, 0, 335, 336, 0, 0, 0, 0, 353,
2147 0, 0, 0, 333, 0, 140, 0, 236, 238, 67,
2148 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2149 0, 214, 187, 0, 0, 0, 0, 0, 0, 147,
2150 145, 65, 0, 127, 0, 276, 166, 0, 275, 279,
2151 0, 0, 320, 0, 0, 0, 0, 140, 141, 140,
2152 0, 0, 0, 0, 0, 0, 351, 323, 0, 67,
2153 327, 328, 320, 0, 349, 67, 221, 0, 0, 0,
2154 0, 201, 0, 0, 0, 0, 212, 0, 186, 0,
2155 0, 67, 142, 148, 146, 64, 250, 252, 118, 143,
2156 0, 282, 0, 0, 0, 118, 118, 0, 329, 330,
2157 331, 332, 345, 347, 322, 0, 0, 334, 337, 338,
2158 324, 0, 0, 140, 0, 0, 0, 0, 0, 209,
2159 0, 0, 0, 203, 204, 200, 65, 144, 138, 284,
2160 281, 0, 0, 0, 0, 127, 0, 314, 0, 354,
2161 127, 350, 205, 206, 207, 208, 0, 0, 0, 213,
2162 249, 0, 136, 0, 306, 0, 0, 109, 111, 118,
2163 118, 0, 118, 118, 315, 340, 202, 210, 211, 139,
2164 0, 134, 304, 0, 305, 0, 317, 316, 0, 0,
2165 0, 137, 0, 255, 0, 0, 0, 118, 118, 0,
2166 0, 0, 0, 319, 318, 0, 133, 0, 129, 311,
2167 0, 0, 0, 135, 0, 310, 0, 132, 131, 130,
2171 /* YYDEFGOTO[NTERM-NUM]. */
2172 static const yytype_int16 yydefgoto[] =
2174 -1, 278, 279, 280, 305, 322, 165, 166, 79, 596,
2175 113, 12, 134, 80, 14, 15, 41, 42, 43, 48,
2176 54, 118, 129, 355, 239, 448, 358, 707, 708, 693,
2177 681, 662, 420, 539, 638, 474, 540, 81, 167, 140,
2178 157, 141, 142, 110, 379, 406, 380, 121, 88, 158,
2179 16, 17, 18, 20, 19, 389, 449, 450, 63, 23,
2180 61, 101, 477, 478, 130, 173, 55, 96, 56, 49,
2181 480, 407, 83, 409, 288, 289, 57, 92, 93, 231,
2182 666, 135, 330, 607, 499, 509, 232, 233, 234, 235
2185 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2187 #define YYPACT_NINF -613
2188 static const yytype_int16 yypact[] =
2190 872, -613, -613, -613, -613, -613, -613, -613, 37, -106,
2191 25, -23, 155, 44, -11, -613, 189, 1045, -613, 66,
2192 239, 56, 60, -613, 64, 218, -613, 1877, -613, -613,
2193 -613, -613, -613, -613, -613, -613, -613, -613, -613, -613,
2194 -613, 178, 178, 181, -613, -613, -613, -613, 178, -613,
2195 -613, -613, -613, -613, 178, 223, -613, 1, 226, 230,
2196 237, -613, -613, -613, -613, -613, 116, -613, -613, -613,
2197 -613, -613, -613, -613, -613, 291, 296, 3, 55, -613,
2198 -613, -613, 49, -613, 278, 278, 194, -613, 252, 485,
2199 485, -613, -613, 144, -613, -613, -613, -613, -613, -613,
2200 -613, -109, 1581, -613, 152, 161, 312, 116, -613, 49,
2201 -117, 171, 1581, 174, 252, 252, -613, -613, 1625, -613,
2202 -613, 1918, 342, -613, -613, -613, -613, -613, -613, 1959,
2203 -613, -14, 186, 2193, 2193, -613, 331, -613, -613, 49,
2204 -613, 192, 200, 2003, 2003, 193, -115, 2003, -613, 371,
2205 214, -613, 1918, 2003, 116, 220, 49, 163, -613, 267,
2206 376, 384, 390, 396, 400, 305, 413, 1444, 375, -613,
2207 279, -613, -613, -613, -613, -613, -613, 377, 2044, 173,
2208 427, 485, -613, -613, -613, -613, -613, -613, -613, -613,
2209 -613, -613, -613, -613, -613, -613, -613, -613, -613, 594,
2210 574, 594, 574, 2003, 2003, 2003, 2003, -613, -613, -613,
2211 -613, -613, -613, -613, -613, -613, -613, -613, -613, 2003,
2212 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003,
2213 2003, -613, 485, -613, 253, -613, -613, -613, -613, 108,
2214 1666, -613, -31, -36, -613, 271, 49, 276, -613, 375,
2215 -1, 1625, -613, -613, -613, -613, -613, -613, -613, -613,
2216 -613, -613, -613, 594, 574, 594, 574, 282, 283, 285,
2217 289, 290, 292, 293, 1707, 2085, 566, 424, 294, 297,
2218 299, -613, -613, -613, 300, -613, 116, 860, -613, 295,
2219 1033, 1033, -613, 1033, 1959, -613, -613, -613, -613, -613,
2220 -613, -613, -613, -613, -613, 2003, -613, -613, -613, -613,
2221 -613, -613, -613, -613, -613, -613, -613, -613, -613, -613,
2222 -613, -613, 2003, 2003, 2003, -37, 26, -613, 860, 65,
2223 306, 313, 316, 322, 323, 326, 860, 860, 860, 860,
2224 860, 411, 1959, 2003, 2003, 454, -613, -613, -613, -613,
2225 -613, -613, -613, -613, -613, -613, -613, -613, 284, -613,
2226 -613, -613, -613, 284, -613, 174, 432, 315, 330, 332,
2227 335, 1918, 1918, 1918, 1918, 1918, 1918, 1918, -613, -613,
2228 -55, 792, -28, -613, -114, -613, 1918, 1918, 1918, 328,
2229 1751, -613, -613, -613, -613, -613, -613, -613, -613, -613,
2230 -613, 437, 1792, 2129, 1490, 477, -613, -613, -613, -613,
2231 2003, 336, -613, 339, 1033, 860, 860, 860, 860, 33,
2232 -613, 34, -613, -613, 1033, 341, 2003, 2003, 2003, 2003,
2233 2003, 346, 347, 349, 350, 353, 2003, 1033, 860, 357,
2234 -613, -613, -613, -613, -613, -613, -613, -613, -613, 328,
2235 328, 2003, 1918, 1918, 1918, 1918, -613, 358, 359, 360,
2236 363, 347, 364, 1918, -613, 361, 1308, -110, -613, -613,
2237 365, 366, 462, -5, -613, -613, 49, 367, 372, -613,
2238 514, -613, -25, 1536, 47, -613, -52, -613, -613, 525,
2239 527, 393, 392, 395, 397, 398, 1033, 554, 1033, 399,
2240 401, 1033, 402, 49, -613, 406, 407, 557, 561, 419,
2241 2003, 1033, 1033, 49, 425, 426, 2003, -613, -613, -16,
2242 428, 429, 433, 434, 104, 1918, 1918, 1918, 1918, 149,
2243 1918, -613, -613, 420, 1918, 1918, 2003, 575, 598, -613,
2244 328, 521, 1833, -613, 438, -613, 435, 81, -613, -613,
2245 1033, 1033, 2170, 1033, 1033, 1033, 1033, 426, -613, 426,
2246 2003, 1033, 439, 2003, 2003, 2003, -613, -613, 601, 860,
2247 -613, -613, 2170, 552, -613, 860, -613, 1918, 1918, 1918,
2248 1918, -613, 445, 455, 452, 456, -613, 347, -613, 459,
2249 460, -9, -613, -613, -613, -613, -613, -613, 49, 13,
2250 602, -613, 453, 461, 463, 75, 49, 182, -613, -613,
2251 -613, -613, -613, -613, -613, 458, 1033, -613, -613, -613,
2252 -613, 347, 191, 426, 466, 467, 469, 471, 1918, -613,
2253 1918, 1918, 195, -613, -613, -613, 521, -613, 581, -613,
2254 -613, 620, -3, 703, 703, -613, 2211, -613, 468, 419,
2255 -613, -613, -613, -613, -613, -613, 476, 482, 483, -613,
2256 -613, 636, 494, 1033, -613, 1172, 4, 487, 488, -613,
2257 -613, 236, 75, 49, -613, 284, -613, -613, -613, -613,
2258 629, 499, -613, 489, -613, 1172, 108, 108, 638, 703,
2259 703, -613, 495, -613, 639, 493, 1033, -613, -613, -135,
2260 1033, 642, 586, 108, 108, 497, -613, 196, -613, -613,
2261 1033, 648, 217, -613, -135, -613, 1033, -613, -613, -613,
2265 /* YYPGOTO[NTERM-NUM]. */
2266 static const yytype_int16 yypgoto[] =
2268 -613, 258, 274, 287, -180, -175, -177, -613, 0, 36,
2269 -126, 580, -613, 11, -613, -613, -613, -613, 54, -613,
2270 -613, -613, -138, -613, -463, -613, -239, -613, -15, -613,
2271 -613, -613, -310, 101, -613, -424, -613, -613, -26, 464,
2272 -125, -613, 591, 599, -111, -165, -270, 298, 348, 465,
2273 -613, -613, 696, -613, -613, -613, -613, -613, -613, -613,
2274 -613, -613, -613, -613, 624, -613, -613, -613, -613, -613,
2275 -613, -612, -48, 58, -123, -613, -613, 658, -613, 583,
2276 -613, -613, -613, 146, 263, -449, -613, 590, -613, -613
2279 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2280 positive, shift that token. If negative, reduce the rule which
2281 number is the opposite. If zero, do what YYDEFACT says.
2282 If YYTABLE_NINF, syntax error. */
2283 #define YYTABLE_NINF -224
2284 static const yytype_int16 yytable[] =
2286 11, 82, 281, 293, 170, 382, 384, 105, 292, 363,
2287 168, 13, 529, 541, 171, 292, 422, 11, 111, 111,
2288 705, 323, 91, 706, 111, 517, 518, 324, 13, 537,
2289 94, 29, 30, 31, 32, 33, 34, 35, 36, 111,
2290 37, 249, 283, 294, 496, 498, 111, 537, 147, 538,
2291 147, 463, 109, 683, 111, 463, 136, 148, 24, 245,
2292 469, 137, 64, 65, 533, 107, 67, 68, 69, 70,
2293 71, 72, 73, 695, 1, 2, 139, 3, 4, 5,
2294 109, 111, 327, 367, 25, 369, 139, 497, 497, 368,
2295 21, 370, 156, 11, 342, 84, 85, 331, 332, 333,
2296 334, 335, 89, 156, 111, 74, 22, 341, 90, 252,
2297 463, 467, 46, 463, 47, 464, 594, 242, 243, 282,
2298 111, 246, 549, 364, 365, 112, 112, 250, 419, -67,
2299 -155, 112, 482, 484, 486, 636, 360, 463, 632, 359,
2300 463, 26, 643, 644, 468, 545, 112, 576, 38, 39,
2301 40, 132, 287, 112, 635, 441, 442, 443, 444, 172,
2302 445, 112, 345, 1, 446, 447, 3, 664, 5, 414,
2303 64, 65, 649, 27, 684, 95, 106, 325, 326, 287,
2304 328, 284, 1, 2, 290, 3, 4, 5, 112, 44,
2305 291, 421, -67, 329, 287, 287, 287, 287, 287, 336,
2306 337, 338, 339, 340, 287, 574, 686, 687, 28, 689,
2307 690, 112, 463, 547, 139, -67, 86, 437, 87, 548,
2308 58, 439, 75, 76, 59, 156, 77, 112, 78, 108,
2309 346, 347, 60, 424, 703, 704, 116, -155, 117, 408,
2310 62, -155, 408, 408, 91, 408, 463, 612, 98, 613,
2311 348, 349, 99, 350, 351, 602, 352, 353, 354, 100,
2312 456, 457, 458, 459, 460, 461, 462, 581, 156, 560,
2313 -55, -55, -55, -55, 688, 470, 471, 472, 102, 415,
2314 408, 50, 51, 52, 119, 120, 53, 488, 408, 408,
2315 408, 408, 408, 253, 254, 103, 416, 417, 418, 2,
2316 104, 281, 4, 502, 599, 504, 505, 506, 255, 256,
2317 257, 258, 586, 651, 568, 87, 156, 438, 287, 64,
2318 65, 143, 107, 67, 68, 69, 70, 71, 72, 73,
2319 144, 1, 2, 149, 3, 4, 5, 38, 39, 40,
2320 151, 520, 521, 522, 523, 645, 169, 646, 411, 412,
2321 174, 413, 531, 238, 650, 466, 646, 240, 659, 713,
2322 568, 714, 74, 241, 476, 244, 408, 408, 408, 408,
2323 408, 343, 344, 717, 718, 247, 408, 248, 441, 442,
2324 443, 444, 251, 445, 287, -56, 423, 446, 447, 408,
2325 408, 228, 228, -57, 431, 432, 433, 434, 435, -60,
2326 287, 503, 287, 287, 287, -59, 671, 229, 229, -58,
2327 513, 675, 152, 153, 582, 583, 584, 585, 282, 587,
2328 230, 230, 259, 589, 590, 519, 441, 442, 443, 444,
2329 111, 445, 114, 115, 285, 446, 447, 614, 292, 362,
2330 617, 618, 619, 361, 371, 372, 385, 373, 408, 436,
2331 408, 374, 375, 408, 376, 377, 386, 466, 440, 387,
2332 410, 388, 390, 408, 408, 665, 624, 625, 626, 627,
2333 451, 425, 491, 492, 493, 494, 495, 452, 426, 75,
2334 76, 427, 500, 77, 569, 78, 145, 428, 429, 685,
2335 575, 430, 453, 473, 454, 514, 515, 455, 479, 487,
2336 536, 489, 408, 408, 490, 408, 408, 408, 408, 501,
2337 591, 507, 508, 408, 510, 511, 598, 656, 512, 657,
2338 658, 408, 516, 525, 526, 527, 606, 408, 528, 530,
2339 534, 535, 542, 532, 287, 543, 544, 287, 287, 287,
2340 1, 595, 550, 3, 551, 5, 606, 122, 123, 124,
2341 125, 126, 127, 128, 557, 552, 559, 553, 558, 562,
2342 554, 566, 555, 556, 560, 567, 561, 563, 408, 570,
2343 571, 564, 565, 64, 65, 345, 107, 159, 160, 161,
2344 162, 163, 164, 73, 568, 1, 2, 572, 3, 4,
2345 5, 573, 588, 577, 578, 408, 408, 592, 579, 580,
2346 306, 307, 593, 600, 616, 620, 497, 601, 603, 604,
2347 628, 608, 609, 610, 611, 408, 74, 630, 629, 615,
2348 673, 631, 633, 634, 639, 640, 641, 621, 647, 652,
2349 653, 642, 654, 623, 655, 661, 595, 663, 674, 676,
2350 679, 408, 408, 346, 347, 677, 678, 680, 408, -18,
2351 -19, 691, 408, 692, 694, 696, 700, 699, 701, 710,
2352 711, 712, 408, 348, 349, 716, 350, 351, 408, 352,
2353 353, 354, 660, 133, 648, 308, 309, 310, 311, 312,
2354 313, 314, 315, 316, 317, 318, 319, 320, 321, 295,
2355 296, 297, 298, 299, 300, 301, 302, 303, 304, 719,
2356 637, 669, 670, 150, 357, 146, 391, 392, 393, 394,
2357 64, 65, 395, 45, 131, 97, 366, 236, 622, 524,
2358 0, 682, 1, 2, 237, 3, 4, 5, 396, 397,
2359 398, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2360 383, 0, 0, 399, 400, 0, 0, 697, 698, 0,
2361 0, 0, 0, 0, 702, 0, 0, 345, 709, 0,
2362 0, 0, 401, 0, 0, 0, 0, 0, 715, 0,
2363 0, 0, 0, 0, 720, 0, 0, 0, 0, 184,
2364 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2365 195, 196, 197, 198, 263, 264, 265, 266, 0, 64,
2366 65, 0, 107, 159, 160, 161, 162, 163, 164, 73,
2367 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2368 0, 0, 0, 267, 207, 667, 668, 210, 211, 212,
2369 213, 214, 215, 216, 217, 218, 0, 268, 0, 269,
2370 270, 271, 74, 272, 273, 348, 349, 0, 350, 351,
2371 0, 352, 353, 354, 0, 0, 0, 0, 0, 0,
2372 0, 0, 0, 391, 392, 393, 394, 64, 65, 395,
2373 0, 402, -223, 0, 403, 0, 404, 0, 405, 1,
2374 2, 0, 3, 4, 5, 396, 397, 398, 0, 0,
2375 -69, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2376 399, 400, 6, 7, 0, 0, 0, 0, 0, 0,
2377 0, 0, 0, 0, 0, 111, 0, 0, 0, 401,
2378 0, 0, 0, 0, 8, 0, 0, 0, 9, 0,
2379 0, 0, 10, 0, 0, 0, 184, 185, 186, 187,
2380 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
2381 198, 263, 264, 265, 266, 0, 0, 0, 0, 75,
2382 76, 0, 0, 77, 0, 78, 465, 0, 0, 0,
2383 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2384 267, 207, 208, 209, 210, 211, 212, 213, 214, 215,
2385 216, 217, 218, 0, 268, 0, 269, 270, 271, 0,
2386 272, 273, 0, 0, 0, 0, 0, 0, 0, 0,
2387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2388 0, 0, 112, 0, 0, 0, 0, 0, 402, 0,
2389 0, 403, 0, 404, 0, 405, 391, 392, 393, 394,
2390 64, 65, 395, 0, 0, -222, 0, 0, 0, 0,
2391 0, 0, 1, 2, 0, 3, 4, 5, 396, 397,
2392 398, 0, 0, -69, 1, 2, 0, 3, 4, 5,
2393 0, 0, 0, 399, 400, 6, 7, 0, 0, 0,
2394 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2395 0, 0, 401, 0, 0, 0, 0, 8, 0, 0,
2396 0, 9, 0, 0, 0, 10, 0, 0, 0, 184,
2397 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2398 195, 196, 197, 198, 263, 264, 265, 266, 0, 0,
2399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2400 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2401 0, 0, 0, 267, 207, 208, 209, 210, 211, 212,
2402 213, 214, 215, 216, 217, 218, 0, 268, 0, 269,
2403 270, 271, 0, 272, 273, 391, 392, 393, 394, 0,
2404 0, 395, 0, 0, 0, 0, 0, 0, 0, 0,
2405 0, 0, 0, 0, 0, 0, 0, 396, 397, 398,
2406 0, 402, 0, 0, 403, 0, 404, 0, 405, 0,
2407 0, 0, 399, 400, 0, 0, 0, 0, 0, 0,
2408 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2409 0, 401, 0, 0, 0, 0, 0, 0, 0, 0,
2410 0, 0, 0, 0, 0, 0, 0, 0, 184, 185,
2411 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
2412 196, 197, 198, 263, 264, 265, 266, 0, 0, 0,
2413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2414 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2415 0, 0, 267, 207, 208, 209, 210, 211, 212, 213,
2416 214, 215, 216, 217, 218, 0, 268, 0, 269, 270,
2417 271, 0, 272, 273, 0, 64, 65, 0, 0, 0,
2418 0, 0, 0, 0, 0, 0, 0, 1, 2, 0,
2419 3, 4, 5, 260, 0, 0, 0, 0, 0, 0,
2420 402, 0, 0, 403, 0, 404, 0, 405, 261, 262,
2421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2422 0, 0, 0, 111, 0, 0, 0, 0, 0, 0,
2423 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2424 0, 0, 0, 0, 184, 185, 186, 187, 188, 189,
2425 190, 191, 192, 193, 194, 195, 196, 197, 198, 263,
2426 264, 265, 266, 0, 0, 0, 0, 0, 0, 0,
2427 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2428 0, 0, 0, 0, 0, 0, 0, 0, 267, 207,
2429 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
2430 218, 0, 268, 0, 269, 270, 271, 0, 272, 273,
2431 0, 64, 65, 0, 0, 0, 0, 0, 0, 0,
2432 0, 0, 0, 1, 2, 0, 3, 4, 5, 260,
2433 112, 0, 0, 0, -67, 0, 274, 0, 0, 275,
2434 0, 276, 0, 277, 261, 262, 0, 0, 0, 0,
2435 0, 0, 0, 0, 0, 0, 0, 64, 65, 111,
2436 107, 159, 160, 161, 162, 163, 164, 73, 0, 1,
2437 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2438 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2439 194, 195, 196, 197, 198, 263, 264, 265, 266, 0,
2440 74, 0, 0, 64, 65, 0, 107, 159, 160, 161,
2441 162, 163, 164, 73, 0, 1, 2, 0, 3, 4,
2442 5, 0, 0, 0, 267, 207, 208, 209, 210, 211,
2443 212, 213, 214, 215, 216, 217, 218, 0, 268, 0,
2444 269, 270, 271, 0, 272, 273, 74, 0, 64, 65,
2445 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2446 1, 2, 0, 3, 4, 5, 112, 0, 0, 0,
2447 0, 0, 274, 0, 0, 275, 0, 276, 0, 277,
2448 138, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2449 0, 74, 64, 65, 0, 154, 67, 68, 69, 70,
2450 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2451 0, 0, 0, 0, 0, 0, 0, 75, 76, 0,
2452 0, 77, 0, 78, 485, 0, 0, 0, 0, 0,
2453 0, 0, 0, 64, 65, 74, 107, 67, 68, 69,
2454 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2455 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2456 0, 0, 0, 75, 76, 356, 0, 77, 0, 78,
2457 546, 0, 0, 0, 64, 65, 74, 107, 159, 160,
2458 161, 162, 163, 164, 73, 0, 1, 2, 0, 3,
2459 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2460 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2461 0, 155, 77, 0, 78, 0, 0, 74, 64, 65,
2462 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2463 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2464 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2465 475, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2466 65, 74, 107, 159, 160, 161, 162, 163, 164, 73,
2467 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2468 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2469 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2470 64, 65, 74, 107, 67, 68, 69, 70, 71, 72,
2471 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2472 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2473 0, 0, 597, 0, 75, 76, 0, 378, 77, 0,
2474 78, 0, 0, 74, 64, 65, 0, 66, 67, 68,
2475 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2476 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2477 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2478 0, 0, 77, 0, 78, 64, 65, 74, 107, 159,
2479 160, 161, 162, 163, 164, 73, 0, 1, 2, 0,
2480 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2481 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2482 76, 0, 481, 77, 0, 78, 64, 65, 74, 154,
2483 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2484 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2485 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2486 75, 76, 0, 0, 77, 0, 78, 0, 0, 74,
2487 64, 65, 0, 107, 67, 68, 69, 70, 71, 72,
2488 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2489 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2490 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2491 78, 64, 65, 74, 286, 67, 68, 69, 70, 71,
2492 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2493 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2494 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2495 0, 78, 64, 65, 74, 107, 159, 160, 161, 162,
2496 163, 164, 73, 0, 1, 2, 0, 3, 4, 5,
2497 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2498 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2499 77, 0, 78, 0, 0, 74, 64, 65, 0, 107,
2500 159, 160, 161, 162, 163, 164, 73, 0, 1, 2,
2501 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2503 75, 76, 0, 0, 77, 0, 78, 64, 65, 74,
2504 107, 67, 68, 69, 70, 71, 72, 605, 0, 1,
2505 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2507 0, 75, 76, 0, 0, 77, 0, 78, 64, 65,
2508 74, 107, 67, 68, 69, 70, 71, 72, 672, 175,
2509 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2510 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2511 176, 177, 75, 76, 0, 0, 77, 0, 381, 0,
2512 0, 74, 0, 178, 179, 180, 181, 182, 183, 184,
2513 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2514 195, 196, 197, 198, 199, 200, 201, 202, 0, 0,
2515 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2516 77, 0, 483, 0, 0, 0, 0, 0, 203, 204,
2517 205, 0, 0, 206, 207, 208, 209, 210, 211, 212,
2518 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
2519 223, 224, 225, 226, 227, 0, 0, 75, 76, 0,
2520 0, 77, 0, 78, 0, 0, 0, 0, 0, 0,
2521 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2522 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2523 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2527 static const yytype_int16 yycheck[] =
2529 0, 27, 167, 180, 129, 275, 276, 4, 11, 248,
2530 121, 0, 461, 476, 28, 11, 326, 17, 55, 55,
2531 155, 201, 21, 158, 55, 449, 450, 202, 17, 34,
2532 29, 42, 43, 44, 45, 46, 47, 48, 49, 55,
2533 51, 152, 168, 181, 11, 11, 55, 34, 165, 54,
2534 165, 165, 78, 665, 55, 165, 165, 174, 164, 174,
2535 174, 170, 7, 8, 174, 10, 11, 12, 13, 14,
2536 15, 16, 17, 685, 19, 20, 102, 22, 23, 24,
2537 106, 55, 205, 263, 59, 265, 112, 54, 54, 264,
2538 53, 266, 118, 93, 232, 41, 42, 220, 221, 222,
2539 223, 224, 48, 129, 55, 50, 69, 230, 54, 157,
2540 165, 381, 46, 165, 48, 170, 540, 143, 144, 167,
2541 55, 147, 174, 249, 250, 162, 162, 153, 165, 166,
2542 55, 162, 402, 403, 404, 598, 172, 165, 587, 170,
2543 165, 164, 605, 606, 172, 170, 162, 163, 159, 160,
2544 161, 7, 178, 162, 163, 142, 143, 144, 145, 173,
2545 147, 162, 54, 19, 151, 152, 22, 170, 24, 294,
2546 7, 8, 621, 18, 170, 174, 173, 203, 204, 205,
2547 206, 170, 19, 20, 11, 22, 23, 24, 162, 0,
2548 17, 165, 166, 219, 220, 221, 222, 223, 224, 225,
2549 226, 227, 228, 229, 230, 515, 669, 670, 164, 672,
2550 673, 162, 165, 483, 240, 166, 35, 342, 37, 172,
2551 164, 344, 167, 168, 164, 251, 171, 162, 173, 174,
2552 122, 123, 168, 168, 697, 698, 42, 162, 44, 287,
2553 22, 166, 290, 291, 21, 293, 165, 557, 22, 559,
2554 142, 143, 22, 145, 146, 174, 148, 149, 150, 22,
2555 371, 372, 373, 374, 375, 376, 377, 163, 294, 165,
2556 3, 4, 5, 6, 38, 386, 387, 388, 162, 305,
2557 328, 42, 43, 44, 32, 33, 47, 410, 336, 337,
2558 338, 339, 340, 26, 27, 4, 322, 323, 324, 20,
2559 4, 466, 23, 426, 543, 428, 429, 430, 3, 4,
2560 5, 6, 163, 623, 165, 37, 342, 343, 344, 7,
2561 8, 169, 10, 11, 12, 13, 14, 15, 16, 17,
2562 169, 19, 20, 162, 22, 23, 24, 159, 160, 161,
2563 166, 452, 453, 454, 455, 163, 4, 165, 290, 291,
2564 164, 293, 463, 22, 163, 381, 165, 165, 163, 163,
2565 165, 165, 50, 163, 390, 172, 414, 415, 416, 417,
2566 418, 118, 119, 156, 157, 4, 424, 163, 142, 143,
2567 144, 145, 162, 147, 410, 9, 328, 151, 152, 437,
2568 438, 133, 134, 9, 336, 337, 338, 339, 340, 9,
2569 426, 427, 428, 429, 430, 9, 645, 133, 134, 9,
2570 436, 650, 114, 115, 525, 526, 527, 528, 466, 530,
2571 133, 134, 9, 534, 535, 451, 142, 143, 144, 145,
2572 55, 147, 84, 85, 57, 151, 152, 560, 11, 163,
2573 563, 564, 565, 172, 162, 162, 22, 162, 496, 38,
2574 498, 162, 162, 501, 162, 162, 162, 483, 4, 162,
2575 165, 162, 162, 511, 512, 642, 577, 578, 579, 580,
2576 38, 165, 414, 415, 416, 417, 418, 162, 165, 167,
2577 168, 165, 424, 171, 510, 173, 174, 165, 165, 666,
2578 516, 165, 162, 165, 162, 437, 438, 162, 61, 22,
2579 38, 165, 550, 551, 165, 553, 554, 555, 556, 168,
2580 536, 165, 165, 561, 165, 165, 542, 628, 165, 630,
2581 631, 569, 165, 165, 165, 165, 552, 575, 165, 165,
2582 165, 165, 165, 172, 560, 163, 22, 563, 564, 565,
2583 19, 541, 17, 22, 17, 24, 572, 62, 63, 64,
2584 65, 66, 67, 68, 496, 162, 498, 165, 4, 501,
2585 165, 4, 165, 165, 165, 4, 165, 165, 616, 511,
2586 512, 165, 165, 7, 8, 54, 10, 11, 12, 13,
2587 14, 15, 16, 17, 165, 19, 20, 162, 22, 23,
2588 24, 165, 172, 165, 165, 643, 644, 22, 165, 165,
2589 26, 27, 4, 165, 165, 4, 54, 172, 550, 551,
2590 165, 553, 554, 555, 556, 663, 50, 165, 163, 561,
2591 646, 165, 163, 163, 22, 172, 165, 569, 170, 163,
2592 163, 168, 163, 575, 163, 54, 636, 17, 170, 163,
2593 4, 689, 690, 122, 123, 163, 163, 153, 696, 162,
2594 162, 22, 700, 154, 165, 17, 17, 162, 165, 17,
2595 74, 164, 710, 142, 143, 17, 145, 146, 716, 148,
2596 149, 150, 636, 93, 616, 101, 102, 103, 104, 105,
2597 106, 107, 108, 109, 110, 111, 112, 113, 114, 95,
2598 96, 97, 98, 99, 100, 101, 102, 103, 104, 714,
2599 599, 643, 644, 112, 240, 106, 3, 4, 5, 6,
2600 7, 8, 9, 17, 90, 57, 251, 134, 572, 456,
2601 -1, 663, 19, 20, 134, 22, 23, 24, 25, 26,
2602 27, -1, -1, 167, 168, -1, -1, 171, -1, 173,
2603 174, -1, -1, 40, 41, -1, -1, 689, 690, -1,
2604 -1, -1, -1, -1, 696, -1, -1, 54, 700, -1,
2605 -1, -1, 59, -1, -1, -1, -1, -1, 710, -1,
2606 -1, -1, -1, -1, 716, -1, -1, -1, -1, 76,
2607 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2608 87, 88, 89, 90, 91, 92, 93, 94, -1, 7,
2609 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2610 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2611 -1, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2612 127, 128, 129, 130, 131, 132, -1, 134, -1, 136,
2613 137, 138, 50, 140, 141, 142, 143, -1, 145, 146,
2614 -1, 148, 149, 150, -1, -1, -1, -1, -1, -1,
2615 -1, -1, -1, 3, 4, 5, 6, 7, 8, 9,
2616 -1, 168, 0, -1, 171, -1, 173, -1, 175, 19,
2617 20, -1, 22, 23, 24, 25, 26, 27, -1, -1,
2618 18, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2619 40, 41, 30, 31, -1, -1, -1, -1, -1, -1,
2620 -1, -1, -1, -1, -1, 55, -1, -1, -1, 59,
2621 -1, -1, -1, -1, 52, -1, -1, -1, 56, -1,
2622 -1, -1, 60, -1, -1, -1, 76, 77, 78, 79,
2623 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2624 90, 91, 92, 93, 94, -1, -1, -1, -1, 167,
2625 168, -1, -1, 171, -1, 173, 174, -1, -1, -1,
2626 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2627 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
2628 130, 131, 132, -1, 134, -1, 136, 137, 138, -1,
2629 140, 141, -1, -1, -1, -1, -1, -1, -1, -1,
2630 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2631 -1, -1, 162, -1, -1, -1, -1, -1, 168, -1,
2632 -1, 171, -1, 173, -1, 175, 3, 4, 5, 6,
2633 7, 8, 9, -1, -1, 0, -1, -1, -1, -1,
2634 -1, -1, 19, 20, -1, 22, 23, 24, 25, 26,
2635 27, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2636 -1, -1, -1, 40, 41, 30, 31, -1, -1, -1,
2637 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2638 -1, -1, 59, -1, -1, -1, -1, 52, -1, -1,
2639 -1, 56, -1, -1, -1, 60, -1, -1, -1, 76,
2640 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2641 87, 88, 89, 90, 91, 92, 93, 94, -1, -1,
2642 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2643 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2644 -1, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2645 127, 128, 129, 130, 131, 132, -1, 134, -1, 136,
2646 137, 138, -1, 140, 141, 3, 4, 5, 6, -1,
2647 -1, 9, -1, -1, -1, -1, -1, -1, -1, -1,
2648 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
2649 -1, 168, -1, -1, 171, -1, 173, -1, 175, -1,
2650 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2651 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2652 -1, 59, -1, -1, -1, -1, -1, -1, -1, -1,
2653 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
2654 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2655 88, 89, 90, 91, 92, 93, 94, -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, 120, 121, 122, 123, 124, 125, 126, 127,
2659 128, 129, 130, 131, 132, -1, 134, -1, 136, 137,
2660 138, -1, 140, 141, -1, 7, 8, -1, -1, -1,
2661 -1, -1, -1, -1, -1, -1, -1, 19, 20, -1,
2662 22, 23, 24, 25, -1, -1, -1, -1, -1, -1,
2663 168, -1, -1, 171, -1, 173, -1, 175, 40, 41,
2664 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2665 -1, -1, -1, 55, -1, -1, -1, -1, -1, -1,
2666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2667 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
2668 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2669 92, 93, 94, -1, -1, -1, -1, -1, -1, -1,
2670 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2671 -1, -1, -1, -1, -1, -1, -1, -1, 120, 121,
2672 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2673 132, -1, 134, -1, 136, 137, 138, -1, 140, 141,
2674 -1, 7, 8, -1, -1, -1, -1, -1, -1, -1,
2675 -1, -1, -1, 19, 20, -1, 22, 23, 24, 25,
2676 162, -1, -1, -1, 166, -1, 168, -1, -1, 171,
2677 -1, 173, -1, 175, 40, 41, -1, -1, -1, -1,
2678 -1, -1, -1, -1, -1, -1, -1, 7, 8, 55,
2679 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2680 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2681 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2682 86, 87, 88, 89, 90, 91, 92, 93, 94, -1,
2683 50, -1, -1, 7, 8, -1, 10, 11, 12, 13,
2684 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2685 24, -1, -1, -1, 120, 121, 122, 123, 124, 125,
2686 126, 127, 128, 129, 130, 131, 132, -1, 134, -1,
2687 136, 137, 138, -1, 140, 141, 50, -1, 7, 8,
2688 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2689 19, 20, -1, 22, 23, 24, 162, -1, -1, -1,
2690 -1, -1, 168, -1, -1, 171, -1, 173, -1, 175,
2691 39, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2692 -1, 50, 7, 8, -1, 10, 11, 12, 13, 14,
2693 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2694 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
2695 -1, 171, -1, 173, 174, -1, -1, -1, -1, -1,
2696 -1, -1, -1, 7, 8, 50, 10, 11, 12, 13,
2697 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2698 24, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2699 -1, -1, -1, 167, 168, 39, -1, 171, -1, 173,
2700 174, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2701 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2702 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2703 -1, -1, -1, -1, -1, -1, -1, -1, 167, 168,
2704 -1, 126, 171, -1, 173, -1, -1, 50, 7, 8,
2705 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2706 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2707 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2708 39, -1, 167, 168, -1, -1, 171, -1, 173, 7,
2709 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2710 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2711 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2712 -1, -1, -1, 167, 168, -1, -1, 171, -1, 173,
2713 7, 8, 50, 10, 11, 12, 13, 14, 15, 16,
2714 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2715 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2716 -1, -1, 39, -1, 167, 168, -1, 170, 171, -1,
2717 173, -1, -1, 50, 7, 8, -1, 10, 11, 12,
2718 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2719 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2720 -1, -1, -1, -1, -1, -1, -1, -1, 167, 168,
2721 -1, -1, 171, -1, 173, 7, 8, 50, 10, 11,
2722 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2723 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2724 -1, -1, -1, -1, -1, -1, -1, -1, -1, 167,
2725 168, -1, 170, 171, -1, 173, 7, 8, 50, 10,
2726 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2727 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2728 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2729 167, 168, -1, -1, 171, -1, 173, -1, -1, 50,
2730 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2731 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2732 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2733 -1, -1, -1, -1, 167, 168, -1, -1, 171, -1,
2734 173, 7, 8, 50, 10, 11, 12, 13, 14, 15,
2735 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2736 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2737 -1, -1, -1, -1, -1, 167, 168, -1, -1, 171,
2738 -1, 173, 7, 8, 50, 10, 11, 12, 13, 14,
2739 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2740 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2741 -1, -1, -1, -1, -1, -1, 167, 168, -1, -1,
2742 171, -1, 173, -1, -1, 50, 7, 8, -1, 10,
2743 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2744 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2745 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2746 167, 168, -1, -1, 171, -1, 173, 7, 8, 50,
2747 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2748 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2749 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2750 -1, 167, 168, -1, -1, 171, -1, 173, 7, 8,
2751 50, 10, 11, 12, 13, 14, 15, 16, 17, 36,
2752 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2753 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2754 57, 58, 167, 168, -1, -1, 171, -1, 173, -1,
2755 -1, 50, -1, 70, 71, 72, 73, 74, 75, 76,
2756 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2757 87, 88, 89, 90, 91, 92, 93, 94, -1, -1,
2758 -1, -1, -1, -1, -1, -1, 167, 168, -1, -1,
2759 171, -1, 173, -1, -1, -1, -1, -1, 115, 116,
2760 117, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2761 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2762 137, 138, 139, 140, 141, -1, -1, 167, 168, -1,
2763 -1, 171, -1, 173, -1, -1, -1, -1, -1, -1,
2764 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2765 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2766 -1, -1, -1, -1, -1, -1, -1, -1, 167, 168,
2767 -1, -1, 171, -1, 173
2770 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2771 symbol of state STATE-NUM. */
2772 static const yytype_uint16 yystos[] =
2774 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2775 60, 184, 187, 189, 190, 191, 226, 227, 228, 230,
2776 229, 53, 69, 235, 164, 59, 164, 18, 164, 42,
2777 43, 44, 45, 46, 47, 48, 49, 51, 159, 160,
2778 161, 192, 193, 194, 0, 228, 46, 48, 195, 245,
2779 42, 43, 44, 47, 196, 242, 244, 252, 164, 164,
2780 168, 236, 22, 234, 7, 8, 10, 11, 12, 13,
2781 14, 15, 16, 17, 50, 167, 168, 171, 173, 184,
2782 189, 213, 214, 248, 194, 194, 35, 37, 224, 194,
2783 194, 21, 253, 254, 29, 174, 243, 253, 22, 22,
2784 22, 237, 162, 4, 4, 4, 173, 10, 174, 214,
2785 219, 55, 162, 186, 224, 224, 42, 44, 197, 32,
2786 33, 223, 62, 63, 64, 65, 66, 67, 68, 198,
2787 240, 240, 7, 187, 188, 257, 165, 170, 39, 214,
2788 215, 217, 218, 169, 169, 174, 219, 165, 174, 162,
2789 218, 166, 223, 223, 10, 126, 214, 216, 225, 11,
2790 12, 13, 14, 15, 16, 182, 183, 214, 220, 4,
2791 216, 28, 173, 241, 164, 36, 57, 58, 70, 71,
2792 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
2793 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2794 92, 93, 94, 115, 116, 117, 120, 121, 122, 123,
2795 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2796 134, 135, 136, 137, 138, 139, 140, 141, 177, 178,
2797 179, 255, 262, 263, 264, 265, 255, 263, 22, 200,
2798 165, 163, 214, 214, 172, 174, 214, 4, 163, 220,
2799 214, 162, 248, 26, 27, 3, 4, 5, 6, 9,
2800 25, 40, 41, 91, 92, 93, 94, 120, 134, 136,
2801 137, 138, 140, 141, 168, 171, 173, 175, 177, 178,
2802 179, 221, 248, 186, 189, 57, 10, 214, 250, 251,
2803 11, 17, 11, 182, 198, 95, 96, 97, 98, 99,
2804 100, 101, 102, 103, 104, 180, 26, 27, 101, 102,
2805 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
2806 113, 114, 181, 180, 181, 214, 214, 250, 214, 214,
2807 258, 250, 250, 250, 250, 250, 214, 214, 214, 214,
2808 214, 250, 198, 118, 119, 54, 122, 123, 142, 143,
2809 145, 146, 148, 149, 150, 199, 39, 215, 202, 170,
2810 172, 172, 163, 202, 186, 186, 225, 180, 181, 180,
2811 181, 162, 162, 162, 162, 162, 162, 162, 170, 220,
2812 222, 173, 222, 174, 222, 22, 162, 162, 162, 231,
2813 162, 3, 4, 5, 6, 9, 25, 26, 27, 40,
2814 41, 59, 168, 171, 173, 175, 221, 247, 248, 249,
2815 165, 249, 249, 249, 216, 214, 214, 214, 214, 165,
2816 208, 165, 208, 249, 168, 165, 165, 165, 165, 165,
2817 165, 249, 249, 249, 249, 249, 38, 216, 214, 250,
2818 4, 142, 143, 144, 145, 147, 151, 152, 201, 232,
2819 233, 38, 162, 162, 162, 162, 220, 220, 220, 220,
2820 220, 220, 220, 165, 170, 174, 214, 222, 172, 174,
2821 220, 220, 220, 165, 211, 39, 214, 238, 239, 61,
2822 246, 170, 222, 173, 222, 174, 222, 22, 250, 165,
2823 165, 249, 249, 249, 249, 249, 11, 54, 11, 260,
2824 249, 168, 250, 214, 250, 250, 250, 165, 165, 261,
2825 165, 165, 165, 214, 249, 249, 165, 211, 211, 214,
2826 220, 220, 220, 220, 260, 165, 165, 165, 165, 261,
2827 165, 220, 172, 174, 165, 165, 38, 34, 54, 209,
2828 212, 200, 165, 163, 22, 170, 174, 222, 172, 174,
2829 17, 17, 162, 165, 165, 165, 165, 249, 4, 249,
2830 165, 165, 249, 165, 165, 165, 4, 4, 165, 214,
2831 249, 249, 162, 165, 208, 214, 163, 165, 165, 165,
2832 165, 163, 220, 220, 220, 220, 163, 220, 172, 220,
2833 220, 214, 22, 4, 211, 184, 185, 39, 214, 202,
2834 165, 172, 174, 249, 249, 17, 214, 259, 249, 249,
2835 249, 249, 208, 208, 250, 249, 165, 250, 250, 250,
2836 4, 249, 259, 249, 220, 220, 220, 220, 165, 163,
2837 165, 165, 261, 163, 163, 163, 200, 209, 210, 22,
2838 172, 165, 168, 200, 200, 163, 165, 170, 249, 261,
2839 163, 208, 163, 163, 163, 163, 220, 220, 220, 163,
2840 185, 54, 207, 17, 170, 182, 256, 122, 123, 249,
2841 249, 202, 17, 214, 170, 202, 163, 163, 163, 4,
2842 153, 206, 249, 247, 170, 182, 200, 200, 38, 200,
2843 200, 22, 154, 205, 165, 247, 17, 249, 249, 162,
2844 17, 165, 249, 200, 200, 155, 158, 203, 204, 249,
2845 17, 74, 164, 163, 165, 249, 17, 156, 157, 204,
2849 #define yyerrok (yyerrstatus = 0)
2850 #define yyclearin (yychar = YYEMPTY)
2851 #define YYEMPTY (-2)
2854 #define YYACCEPT goto yyacceptlab
2855 #define YYABORT goto yyabortlab
2856 #define YYERROR goto yyerrorlab
2859 /* Like YYERROR except do call yyerror. This remains here temporarily
2860 to ease the transition to the new meaning of YYERROR, for GCC.
2861 Once GCC version 2 has supplanted version 1, this can go. */
2863 #define YYFAIL goto yyerrlab
2865 #define YYRECOVERING() (!!yyerrstatus)
2867 #define YYBACKUP(Token, Value) \
2869 if (yychar == YYEMPTY && yylen == 1) \
2873 yytoken = YYTRANSLATE (yychar); \
2879 yyerror (YY_("syntax error: cannot back up")); \
2886 #define YYERRCODE 256
2889 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2890 If N is 0, then set CURRENT to the empty location which ends
2891 the previous symbol: RHS[0] (always defined). */
2893 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2894 #ifndef YYLLOC_DEFAULT
2895 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2899 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2900 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2901 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2902 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2906 (Current).first_line = (Current).last_line = \
2907 YYRHSLOC (Rhs, 0).last_line; \
2908 (Current).first_column = (Current).last_column = \
2909 YYRHSLOC (Rhs, 0).last_column; \
2915 /* YY_LOCATION_PRINT -- Print the location on the stream.
2916 This macro was not mandated originally: define only if we know
2917 we won't break user code: when these are the locations we know. */
2919 #ifndef YY_LOCATION_PRINT
2920 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2921 # define YY_LOCATION_PRINT(File, Loc) \
2922 fprintf (File, "%d.%d-%d.%d", \
2923 (Loc).first_line, (Loc).first_column, \
2924 (Loc).last_line, (Loc).last_column)
2926 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2931 /* YYLEX -- calling `yylex' with the right arguments. */
2934 # define YYLEX yylex (YYLEX_PARAM)
2936 # define YYLEX yylex ()
2939 /* Enable debugging if requested. */
2943 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2944 # define YYFPRINTF fprintf
2947 # define YYDPRINTF(Args) \
2953 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2957 YYFPRINTF (stderr, "%s ", Title); \
2958 yy_symbol_print (stderr, \
2960 YYFPRINTF (stderr, "\n"); \
2965 /*--------------------------------.
2966 | Print this symbol on YYOUTPUT. |
2967 `--------------------------------*/
2970 #if (defined __STDC__ || defined __C99__FUNC__ \
2971 || defined __cplusplus || defined _MSC_VER)
2973 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2976 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2979 YYSTYPE const * const yyvaluep;
2985 if (yytype < YYNTOKENS)
2986 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2998 /*--------------------------------.
2999 | Print this symbol on YYOUTPUT. |
3000 `--------------------------------*/
3002 #if (defined __STDC__ || defined __C99__FUNC__ \
3003 || defined __cplusplus || defined _MSC_VER)
3005 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3008 yy_symbol_print (yyoutput, yytype, yyvaluep)
3011 YYSTYPE const * const yyvaluep;
3014 if (yytype < YYNTOKENS)
3015 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3017 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3019 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3020 YYFPRINTF (yyoutput, ")");
3023 /*------------------------------------------------------------------.
3024 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3026 `------------------------------------------------------------------*/
3028 #if (defined __STDC__ || defined __C99__FUNC__ \
3029 || defined __cplusplus || defined _MSC_VER)
3031 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3034 yy_stack_print (bottom, top)
3035 yytype_int16 *bottom;
3039 YYFPRINTF (stderr, "Stack now");
3040 for (; bottom <= top; ++bottom)
3041 YYFPRINTF (stderr, " %d", *bottom);
3042 YYFPRINTF (stderr, "\n");
3045 # define YY_STACK_PRINT(Bottom, Top) \
3048 yy_stack_print ((Bottom), (Top)); \
3052 /*------------------------------------------------.
3053 | Report that the YYRULE is going to be reduced. |
3054 `------------------------------------------------*/
3056 #if (defined __STDC__ || defined __C99__FUNC__ \
3057 || defined __cplusplus || defined _MSC_VER)
3059 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3062 yy_reduce_print (yyvsp, yyrule)
3067 int yynrhs = yyr2[yyrule];
3069 unsigned long int yylno = yyrline[yyrule];
3070 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3072 /* The symbols being reduced. */
3073 for (yyi = 0; yyi < yynrhs; yyi++)
3075 fprintf (stderr, " $%d = ", yyi + 1);
3076 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3077 &(yyvsp[(yyi + 1) - (yynrhs)])
3079 fprintf (stderr, "\n");
3083 # define YY_REDUCE_PRINT(Rule) \
3086 yy_reduce_print (yyvsp, Rule); \
3089 /* Nonzero means print parse trace. It is left uninitialized so that
3090 multiple parsers can coexist. */
3092 #else /* !YYDEBUG */
3093 # define YYDPRINTF(Args)
3094 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3095 # define YY_STACK_PRINT(Bottom, Top)
3096 # define YY_REDUCE_PRINT(Rule)
3097 #endif /* !YYDEBUG */
3100 /* YYINITDEPTH -- initial size of the parser's stacks. */
3102 # define YYINITDEPTH 200
3105 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3106 if the built-in stack extension method is used).
3108 Do not make this value too large; the results are undefined if
3109 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3110 evaluated with infinite-precision integer arithmetic. */
3113 # define YYMAXDEPTH 10000
3121 # if defined __GLIBC__ && defined _STRING_H
3122 # define yystrlen strlen
3124 /* Return the length of YYSTR. */
3125 #if (defined __STDC__ || defined __C99__FUNC__ \
3126 || defined __cplusplus || defined _MSC_VER)
3128 yystrlen (const char *yystr)
3136 for (yylen = 0; yystr[yylen]; yylen++)
3144 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3145 # define yystpcpy stpcpy
3147 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3149 #if (defined __STDC__ || defined __C99__FUNC__ \
3150 || defined __cplusplus || defined _MSC_VER)
3152 yystpcpy (char *yydest, const char *yysrc)
3155 yystpcpy (yydest, yysrc)
3161 const char *yys = yysrc;
3163 while ((*yyd++ = *yys++) != '\0')
3172 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3173 quotes and backslashes, so that it's suitable for yyerror. The
3174 heuristic is that double-quoting is unnecessary unless the string
3175 contains an apostrophe, a comma, or backslash (other than
3176 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3177 null, do not copy; instead, return the length of what the result
3180 yytnamerr (char *yyres, const char *yystr)
3185 char const *yyp = yystr;
3192 goto do_not_strip_quotes;
3196 goto do_not_strip_quotes;
3209 do_not_strip_quotes: ;
3213 return yystrlen (yystr);
3215 return yystpcpy (yyres, yystr) - yyres;
3219 /* Copy into YYRESULT an error message about the unexpected token
3220 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3221 including the terminating null byte. If YYRESULT is null, do not
3222 copy anything; just return the number of bytes that would be
3223 copied. As a special case, return 0 if an ordinary "syntax error"
3224 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3225 size calculation. */
3227 yysyntax_error (char *yyresult, int yystate, int yychar)
3229 int yyn = yypact[yystate];
3231 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3235 int yytype = YYTRANSLATE (yychar);
3236 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3237 YYSIZE_T yysize = yysize0;
3239 int yysize_overflow = 0;
3240 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3241 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3245 /* This is so xgettext sees the translatable formats that are
3246 constructed on the fly. */
3247 YY_("syntax error, unexpected %s");
3248 YY_("syntax error, unexpected %s, expecting %s");
3249 YY_("syntax error, unexpected %s, expecting %s or %s");
3250 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3251 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3255 static char const yyunexpected[] = "syntax error, unexpected %s";
3256 static char const yyexpecting[] = ", expecting %s";
3257 static char const yyor[] = " or %s";
3258 char yyformat[sizeof yyunexpected
3259 + sizeof yyexpecting - 1
3260 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3261 * (sizeof yyor - 1))];
3262 char const *yyprefix = yyexpecting;
3264 /* Start YYX at -YYN if negative to avoid negative indexes in
3266 int yyxbegin = yyn < 0 ? -yyn : 0;
3268 /* Stay within bounds of both yycheck and yytname. */
3269 int yychecklim = YYLAST - yyn + 1;
3270 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3273 yyarg[0] = yytname[yytype];
3274 yyfmt = yystpcpy (yyformat, yyunexpected);
3276 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3277 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3279 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3283 yyformat[sizeof yyunexpected - 1] = '\0';
3286 yyarg[yycount++] = yytname[yyx];
3287 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3288 yysize_overflow |= (yysize1 < yysize);
3290 yyfmt = yystpcpy (yyfmt, yyprefix);
3294 yyf = YY_(yyformat);
3295 yysize1 = yysize + yystrlen (yyf);
3296 yysize_overflow |= (yysize1 < yysize);
3299 if (yysize_overflow)
3300 return YYSIZE_MAXIMUM;
3304 /* Avoid sprintf, as that infringes on the user's name space.
3305 Don't have undefined behavior even if the translation
3306 produced a string with the wrong number of "%s"s. */
3307 char *yyp = yyresult;
3309 while ((*yyp = *yyf) != '\0')
3311 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3313 yyp += yytnamerr (yyp, yyarg[yyi++]);
3326 #endif /* YYERROR_VERBOSE */
3329 /*-----------------------------------------------.
3330 | Release the memory associated to this symbol. |
3331 `-----------------------------------------------*/
3334 #if (defined __STDC__ || defined __C99__FUNC__ \
3335 || defined __cplusplus || defined _MSC_VER)
3337 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3340 yydestruct (yymsg, yytype, yyvaluep)
3350 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3361 /* Prevent warnings from -Wmissing-prototypes. */
3363 #ifdef YYPARSE_PARAM
3364 #if defined __STDC__ || defined __cplusplus
3365 int yyparse (void *YYPARSE_PARAM);
3369 #else /* ! YYPARSE_PARAM */
3370 #if defined __STDC__ || defined __cplusplus
3375 #endif /* ! YYPARSE_PARAM */
3379 /* The look-ahead symbol. */
3382 /* The semantic value of the look-ahead symbol. */
3385 /* Number of syntax errors so far. */
3394 #ifdef YYPARSE_PARAM
3395 #if (defined __STDC__ || defined __C99__FUNC__ \
3396 || defined __cplusplus || defined _MSC_VER)
3398 yyparse (void *YYPARSE_PARAM)
3401 yyparse (YYPARSE_PARAM)
3402 void *YYPARSE_PARAM;
3404 #else /* ! YYPARSE_PARAM */
3405 #if (defined __STDC__ || defined __C99__FUNC__ \
3406 || defined __cplusplus || defined _MSC_VER)
3420 /* Number of tokens to shift before error messages enabled. */
3422 /* Look-ahead token as an internal (translated) token number. */
3425 /* Buffer for error messages, and its allocated size. */
3427 char *yymsg = yymsgbuf;
3428 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3431 /* Three stacks and their tools:
3432 `yyss': related to states,
3433 `yyvs': related to semantic values,
3434 `yyls': related to locations.
3436 Refer to the stacks thru separate pointers, to allow yyoverflow
3437 to reallocate them elsewhere. */
3439 /* The state stack. */
3440 yytype_int16 yyssa[YYINITDEPTH];
3441 yytype_int16 *yyss = yyssa;
3442 yytype_int16 *yyssp;
3444 /* The semantic value stack. */
3445 YYSTYPE yyvsa[YYINITDEPTH];
3446 YYSTYPE *yyvs = yyvsa;
3451 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3453 YYSIZE_T yystacksize = YYINITDEPTH;
3455 /* The variables used to return semantic value and location from the
3460 /* The number of symbols on the RHS of the reduced rule.
3461 Keep to zero when no symbol should be popped. */
3464 YYDPRINTF ((stderr, "Starting parse\n"));
3469 yychar = YYEMPTY; /* Cause a token to be read. */
3471 /* Initialize stack pointers.
3472 Waste one element of value and location stack
3473 so that they stay on the same level as the state stack.
3474 The wasted elements are never initialized. */
3481 /*------------------------------------------------------------.
3482 | yynewstate -- Push a new state, which is found in yystate. |
3483 `------------------------------------------------------------*/
3485 /* In all cases, when you get here, the value and location stacks
3486 have just been pushed. So pushing a state here evens the stacks. */
3492 if (yyss + yystacksize - 1 <= yyssp)
3494 /* Get the current used size of the three stacks, in elements. */
3495 YYSIZE_T yysize = yyssp - yyss + 1;
3499 /* Give user a chance to reallocate the stack. Use copies of
3500 these so that the &'s don't force the real ones into
3502 YYSTYPE *yyvs1 = yyvs;
3503 yytype_int16 *yyss1 = yyss;
3506 /* Each stack pointer address is followed by the size of the
3507 data in use in that stack, in bytes. This used to be a
3508 conditional around just the two extra args, but that might
3509 be undefined if yyoverflow is a macro. */
3510 yyoverflow (YY_("memory exhausted"),
3511 &yyss1, yysize * sizeof (*yyssp),
3512 &yyvs1, yysize * sizeof (*yyvsp),
3519 #else /* no yyoverflow */
3520 # ifndef YYSTACK_RELOCATE
3521 goto yyexhaustedlab;
3523 /* Extend the stack our own way. */
3524 if (YYMAXDEPTH <= yystacksize)
3525 goto yyexhaustedlab;
3527 if (YYMAXDEPTH < yystacksize)
3528 yystacksize = YYMAXDEPTH;
3531 yytype_int16 *yyss1 = yyss;
3532 union yyalloc *yyptr =
3533 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3535 goto yyexhaustedlab;
3536 YYSTACK_RELOCATE (yyss);
3537 YYSTACK_RELOCATE (yyvs);
3539 # undef YYSTACK_RELOCATE
3541 YYSTACK_FREE (yyss1);
3544 #endif /* no yyoverflow */
3546 yyssp = yyss + yysize - 1;
3547 yyvsp = yyvs + yysize - 1;
3550 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3551 (unsigned long int) yystacksize));
3553 if (yyss + yystacksize - 1 <= yyssp)
3557 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3566 /* Do appropriate processing given the current state. Read a
3567 look-ahead token if we need one and don't already have one. */
3569 /* First try to decide what to do without reference to look-ahead token. */
3570 yyn = yypact[yystate];
3571 if (yyn == YYPACT_NINF)
3574 /* Not known => get a look-ahead token if don't already have one. */
3576 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3577 if (yychar == YYEMPTY)
3579 YYDPRINTF ((stderr, "Reading a token: "));
3583 if (yychar <= YYEOF)
3585 yychar = yytoken = YYEOF;
3586 YYDPRINTF ((stderr, "Now at end of input.\n"));
3590 yytoken = YYTRANSLATE (yychar);
3591 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3594 /* If the proper action on seeing token YYTOKEN is to reduce or to
3595 detect an error, take that action. */
3597 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3602 if (yyn == 0 || yyn == YYTABLE_NINF)
3611 /* Count tokens shifted since error; after three, turn off error
3616 /* Shift the look-ahead token. */
3617 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3619 /* Discard the shifted token unless it is eof. */
3620 if (yychar != YYEOF)
3629 /*-----------------------------------------------------------.
3630 | yydefault -- do the default action for the current state. |
3631 `-----------------------------------------------------------*/
3633 yyn = yydefact[yystate];
3639 /*-----------------------------.
3640 | yyreduce -- Do a reduction. |
3641 `-----------------------------*/
3643 /* yyn is the number of a rule to reduce with. */
3646 /* If YYLEN is nonzero, implement the default value of the action:
3649 Otherwise, the following line sets YYVAL to garbage.
3650 This behavior is undocumented and Bison
3651 users should not rely upon it. Assigning to YYVAL
3652 unconditionally makes the parser a bit smaller, and it avoids a
3653 GCC warning that YYVAL may be used uninitialized. */
3654 yyval = yyvsp[1-yylen];
3657 YY_REDUCE_PRINT (yyn);
3661 #line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3662 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3666 #line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3667 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3671 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3672 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3676 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3677 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3681 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3682 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3686 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3687 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3691 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3692 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3696 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3697 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3701 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3702 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3706 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3707 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3711 #line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3712 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3716 #line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3717 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3721 #line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3722 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3726 #line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3727 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3731 #line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3732 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3736 #line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3737 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3741 #line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3746 #line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3747 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3751 #line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3752 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3756 #line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3757 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3761 #line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3762 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3766 #line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3767 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3771 #line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3772 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3776 #line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3777 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3781 #line 1163 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3782 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3786 #line 1164 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3787 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3791 #line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3792 { (yyval.StrVal) = 0; ;}
3796 #line 1175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3797 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3801 #line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3802 { (yyval.UIntVal)=0; ;}
3806 #line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3808 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3814 #line 1184 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3822 #line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3824 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3830 #line 1198 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3838 #line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3840 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3846 #line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3847 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3851 #line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3852 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3856 #line 1211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3857 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3861 #line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3866 #line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3871 #line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3876 #line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3881 #line 1219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3886 #line 1220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3891 #line 1224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3892 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3896 #line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3897 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3901 #line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3906 #line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3907 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3911 #line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3912 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3916 #line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3917 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3921 #line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3922 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3926 #line 1237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3931 #line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3932 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3936 #line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3937 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3941 #line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3946 #line 1241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3947 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3951 #line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3952 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3956 #line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3957 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3961 #line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3962 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3966 #line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3967 { (yyval.UIntVal) = CallingConv::C; ;}
3971 #line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3972 { (yyval.UIntVal) = CallingConv::C; ;}
3976 #line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3977 { (yyval.UIntVal) = CallingConv::Fast; ;}
3981 #line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3982 { (yyval.UIntVal) = CallingConv::Cold; ;}
3986 #line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3987 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3991 #line 1255 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3992 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3996 #line 1256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3997 { (yyval.UIntVal) = CallingConv::X86_SSECall; ;}
4001 #line 1257 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4003 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
4004 GEN_ERROR("Calling conv too large");
4005 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4011 #line 1264 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4012 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4016 #line 1265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4017 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4021 #line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4022 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4026 #line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4027 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4031 #line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4032 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
4036 #line 1269 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4037 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
4041 #line 1270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4042 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
4046 #line 1271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4047 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
4051 #line 1272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4052 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
4056 #line 1273 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4057 { (yyval.ParamAttrs) =
4058 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4062 #line 1277 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4063 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4067 #line 1278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4069 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4074 #line 1283 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4075 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4079 #line 1284 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4080 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4084 #line 1285 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4085 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
4089 #line 1286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4090 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4094 #line 1287 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4095 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4099 #line 1288 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4100 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4104 #line 1289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4105 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4109 #line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4110 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4114 #line 1293 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4116 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4121 #line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4122 { (yyval.FunctionNotes) = (yyvsp[(1) - (1)].FunctionNotes); ;}
4126 #line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4128 FunctionNotes tmp = (yyvsp[(1) - (3)].FunctionNotes) | (yyvsp[(3) - (3)].FunctionNotes);
4129 if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_NoInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_AlwaysInline))
4130 GEN_ERROR("Function Notes may include only one inline notes!")
4131 if ((yyvsp[(3) - (3)].FunctionNotes) == FN_NOTE_AlwaysInline && ((yyvsp[(1) - (3)].FunctionNotes) & FN_NOTE_NoInline))
4132 GEN_ERROR("Function Notes may include only one inline notes!")
4133 (yyval.FunctionNotes) = tmp;
4139 #line 1310 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4140 { (yyval.FunctionNotes) = FN_NOTE_NoInline; ;}
4144 #line 1311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4145 { (yyval.FunctionNotes) = FN_NOTE_AlwaysInline; ;}
4149 #line 1312 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4150 { (yyval.FunctionNotes) = FN_NOTE_OptimizeForSize; ;}
4154 #line 1315 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4155 { (yyval.FunctionNotes) = FN_NOTE_None; ;}
4159 #line 1316 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4161 (yyval.FunctionNotes) = (yyvsp[(3) - (4)].FunctionNotes);
4166 #line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4167 { (yyval.StrVal) = 0; ;}
4171 #line 1322 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4173 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4178 #line 1329 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4179 { (yyval.UIntVal) = 0; ;}
4183 #line 1330 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4185 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4186 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4187 GEN_ERROR("Alignment must be a power of two");
4193 #line 1336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4194 { (yyval.UIntVal) = 0; ;}
4198 #line 1337 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4200 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4201 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4202 GEN_ERROR("Alignment must be a power of two");
4208 #line 1346 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4210 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4211 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4212 GEN_ERROR("Invalid character in section name");
4213 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4219 #line 1354 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4220 { (yyval.StrVal) = 0; ;}
4224 #line 1355 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4225 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4229 #line 1360 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4234 #line 1361 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4239 #line 1362 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4241 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4242 delete (yyvsp[(1) - (1)].StrVal);
4248 #line 1367 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4250 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4251 GEN_ERROR("Alignment must be a power of two");
4252 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4258 #line 1383 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4260 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4266 #line 1387 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4268 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4274 #line 1391 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4276 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4277 GEN_ERROR("Cannot form a pointer to a basic block");
4278 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4279 delete (yyvsp[(1) - (3)].TypeVal);
4285 #line 1398 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4286 { // Named types are also simple types...
4287 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4289 (yyval.TypeVal) = new PATypeHolder(tmp);
4294 #line 1403 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4295 { // Type UpReference
4296 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4297 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4298 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4299 (yyval.TypeVal) = new PATypeHolder(OT);
4300 UR_OUT("New Upreference!\n");
4306 #line 1411 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4308 // Allow but ignore attributes on function types; this permits auto-upgrade.
4309 // FIXME: remove in LLVM 3.0.
4310 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4311 if (!FunctionType::isValidReturnType(RetTy))
4312 GEN_ERROR("Invalid result type for LLVM function");
4314 std::vector<const Type*> Params;
4315 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4316 for (; I != E; ++I ) {
4317 const Type *Ty = I->Ty->get();
4318 Params.push_back(Ty);
4321 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4322 if (isVarArg) Params.pop_back();
4324 for (unsigned i = 0; i != Params.size(); ++i)
4325 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4326 GEN_ERROR("Function arguments must be value types!");
4330 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4331 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4332 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4333 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4339 #line 1440 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4341 // Allow but ignore attributes on function types; this permits auto-upgrade.
4342 // FIXME: remove in LLVM 3.0.
4343 std::vector<const Type*> Params;
4344 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4345 for ( ; I != E; ++I ) {
4346 const Type* Ty = I->Ty->get();
4347 Params.push_back(Ty);
4350 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4351 if (isVarArg) Params.pop_back();
4353 for (unsigned i = 0; i != Params.size(); ++i)
4354 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4355 GEN_ERROR("Function arguments must be value types!");
4359 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4360 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4361 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4367 #line 1465 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4368 { // Sized array type?
4369 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4370 delete (yyvsp[(4) - (5)].TypeVal);
4376 #line 1470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4378 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4379 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4380 GEN_ERROR("Unsigned result not equal to signed result");
4381 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4382 GEN_ERROR("Element type of a VectorType must be primitive");
4383 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4384 delete (yyvsp[(4) - (5)].TypeVal);
4390 #line 1480 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4391 { // Structure type?
4392 std::vector<const Type*> Elements;
4393 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4394 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4395 Elements.push_back(*I);
4397 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4398 delete (yyvsp[(2) - (3)].TypeList);
4404 #line 1490 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4405 { // Empty structure type?
4406 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4412 #line 1494 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4414 std::vector<const Type*> Elements;
4415 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4416 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4417 Elements.push_back(*I);
4419 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4420 delete (yyvsp[(3) - (5)].TypeList);
4426 #line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4427 { // Empty structure type?
4428 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4434 #line 1511 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4436 // Allow but ignore attributes on function types; this permits auto-upgrade.
4437 // FIXME: remove in LLVM 3.0.
4438 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4439 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4444 #line 1520 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4446 if (!UpRefs.empty())
4447 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4448 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4449 GEN_ERROR("LLVM functions cannot return aggregate types");
4450 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4455 #line 1527 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4457 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4462 #line 1532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4464 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4465 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4471 #line 1537 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4473 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4479 #line 1545 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4481 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4482 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4483 TWA.Ty = new PATypeHolder(Type::VoidTy);
4484 (yyval.TypeWithAttrsList)->push_back(TWA);
4490 #line 1552 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4492 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4493 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4494 TWA.Ty = new PATypeHolder(Type::VoidTy);
4495 (yyval.TypeWithAttrsList)->push_back(TWA);
4501 #line 1559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4503 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4509 #line 1567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4511 (yyval.TypeList) = new std::list<PATypeHolder>();
4512 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4513 delete (yyvsp[(1) - (1)].TypeVal);
4519 #line 1573 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4521 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4522 delete (yyvsp[(3) - (3)].TypeVal);
4528 #line 1585 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4529 { // Nonempty unsized arr
4530 if (!UpRefs.empty())
4531 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4532 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4534 GEN_ERROR("Cannot make array constant with type: '" +
4535 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4536 const Type *ETy = ATy->getElementType();
4537 uint64_t NumElements = ATy->getNumElements();
4539 // Verify that we have the correct size...
4540 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4541 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4542 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4543 utostr(NumElements) + "");
4545 // Verify all elements are correct type!
4546 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4547 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4548 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4549 ETy->getDescription() +"' as required!\nIt is of type '"+
4550 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4553 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4554 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4560 #line 1613 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4562 if (!UpRefs.empty())
4563 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4564 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4566 GEN_ERROR("Cannot make array constant with type: '" +
4567 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4569 uint64_t NumElements = ATy->getNumElements();
4570 if (NumElements != uint64_t(-1) && NumElements != 0)
4571 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4572 " arguments, but has size of " + utostr(NumElements) +"");
4573 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4574 delete (yyvsp[(1) - (3)].TypeVal);
4580 #line 1629 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4582 if (!UpRefs.empty())
4583 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4584 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4586 GEN_ERROR("Cannot make array constant with type: '" +
4587 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4589 uint64_t NumElements = ATy->getNumElements();
4590 const Type *ETy = ATy->getElementType();
4591 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4592 GEN_ERROR("Can't build string constant of size " +
4593 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4594 " when array has size " + utostr(NumElements) + "");
4595 std::vector<Constant*> Vals;
4596 if (ETy == Type::Int8Ty) {
4597 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4598 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4600 delete (yyvsp[(3) - (3)].StrVal);
4601 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4603 delete (yyvsp[(3) - (3)].StrVal);
4604 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4605 delete (yyvsp[(1) - (3)].TypeVal);
4611 #line 1656 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4612 { // Nonempty unsized arr
4613 if (!UpRefs.empty())
4614 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4615 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4617 GEN_ERROR("Cannot make packed constant with type: '" +
4618 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4619 const Type *ETy = PTy->getElementType();
4620 unsigned NumElements = PTy->getNumElements();
4622 // Verify that we have the correct size...
4623 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4624 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4625 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4626 utostr(NumElements) + "");
4628 // Verify all elements are correct type!
4629 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4630 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4631 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4632 ETy->getDescription() +"' as required!\nIt is of type '"+
4633 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4636 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4637 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4643 #line 1684 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4645 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4647 GEN_ERROR("Cannot make struct constant with type: '" +
4648 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4650 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4651 GEN_ERROR("Illegal number of initializers for structure type");
4653 // Check to ensure that constants are compatible with the type initializer!
4654 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4655 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4656 GEN_ERROR("Expected type '" +
4657 STy->getElementType(i)->getDescription() +
4658 "' for element #" + utostr(i) +
4659 " of structure initializer");
4661 // Check to ensure that Type is not packed
4662 if (STy->isPacked())
4663 GEN_ERROR("Unpacked Initializer to vector type '" +
4664 STy->getDescription() + "'");
4666 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4667 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4673 #line 1710 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4675 if (!UpRefs.empty())
4676 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4677 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4679 GEN_ERROR("Cannot make struct constant with type: '" +
4680 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4682 if (STy->getNumContainedTypes() != 0)
4683 GEN_ERROR("Illegal number of initializers for structure type");
4685 // Check to ensure that Type is not packed
4686 if (STy->isPacked())
4687 GEN_ERROR("Unpacked Initializer to vector type '" +
4688 STy->getDescription() + "'");
4690 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4691 delete (yyvsp[(1) - (3)].TypeVal);
4697 #line 1730 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4699 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4701 GEN_ERROR("Cannot make struct constant with type: '" +
4702 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4704 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4705 GEN_ERROR("Illegal number of initializers for structure type");
4707 // Check to ensure that constants are compatible with the type initializer!
4708 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4709 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4710 GEN_ERROR("Expected type '" +
4711 STy->getElementType(i)->getDescription() +
4712 "' for element #" + utostr(i) +
4713 " of structure initializer");
4715 // Check to ensure that Type is packed
4716 if (!STy->isPacked())
4717 GEN_ERROR("Vector initializer to non-vector type '" +
4718 STy->getDescription() + "'");
4720 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4721 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4727 #line 1756 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4729 if (!UpRefs.empty())
4730 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4731 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4733 GEN_ERROR("Cannot make struct constant with type: '" +
4734 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4736 if (STy->getNumContainedTypes() != 0)
4737 GEN_ERROR("Illegal number of initializers for structure type");
4739 // Check to ensure that Type is packed
4740 if (!STy->isPacked())
4741 GEN_ERROR("Vector initializer to non-vector type '" +
4742 STy->getDescription() + "'");
4744 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4745 delete (yyvsp[(1) - (5)].TypeVal);
4751 #line 1776 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4753 if (!UpRefs.empty())
4754 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4755 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4757 GEN_ERROR("Cannot make null pointer constant with type: '" +
4758 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4760 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4761 delete (yyvsp[(1) - (2)].TypeVal);
4767 #line 1788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4769 if (!UpRefs.empty())
4770 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4771 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4772 delete (yyvsp[(1) - (2)].TypeVal);
4778 #line 1795 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4780 if (!UpRefs.empty())
4781 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4782 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4784 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4786 // ConstExprs can exist in the body of a function, thus creating
4787 // GlobalValues whenever they refer to a variable. Because we are in
4788 // the context of a function, getExistingVal will search the functions
4789 // symbol table instead of the module symbol table for the global symbol,
4790 // which throws things all off. To get around this, we just tell
4791 // getExistingVal that we are at global scope here.
4793 Function *SavedCurFn = CurFun.CurrentFunction;
4794 CurFun.CurrentFunction = 0;
4796 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4799 CurFun.CurrentFunction = SavedCurFn;
4801 // If this is an initializer for a constant pointer, which is referencing a
4802 // (currently) undefined variable, create a stub now that shall be replaced
4803 // in the future with the right type of variable.
4806 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4807 const PointerType *PT = cast<PointerType>(Ty);
4809 // First check to see if the forward references value is already created!
4810 PerModuleInfo::GlobalRefsType::iterator I =
4811 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4813 if (I != CurModule.GlobalRefs.end()) {
4814 V = I->second; // Placeholder already exists, use it...
4815 (yyvsp[(2) - (2)].ValIDVal).destroy();
4818 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4819 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4820 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4821 GEN_ERROR("Invalid reference to global");
4823 // Create the forward referenced global.
4825 if (const FunctionType *FTy =
4826 dyn_cast<FunctionType>(PT->getElementType())) {
4827 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4828 CurModule.CurrentModule);
4830 GV = new GlobalVariable(PT->getElementType(), false,
4831 GlobalValue::ExternalWeakLinkage, 0,
4832 Name, CurModule.CurrentModule);
4835 // Keep track of the fact that we have a forward ref to recycle it
4836 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4841 (yyval.ConstVal) = cast<GlobalValue>(V);
4842 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4848 #line 1861 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4850 if (!UpRefs.empty())
4851 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4852 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4853 GEN_ERROR("Mismatched types for constant expression: " +
4854 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4855 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4856 delete (yyvsp[(1) - (2)].TypeVal);
4862 #line 1871 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4864 if (!UpRefs.empty())
4865 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4866 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4867 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4868 GEN_ERROR("Cannot create a null initialized value of this type");
4869 (yyval.ConstVal) = Constant::getNullValue(Ty);
4870 delete (yyvsp[(1) - (2)].TypeVal);
4876 #line 1881 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4877 { // integral constants
4878 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4879 GEN_ERROR("Constant value doesn't fit in type");
4880 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4886 #line 1887 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4887 { // arbitrary precision integer constants
4888 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4889 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4890 GEN_ERROR("Constant value does not fit in type");
4892 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4893 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4894 delete (yyvsp[(2) - (2)].APIntVal);
4900 #line 1897 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4901 { // integral constants
4902 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4903 GEN_ERROR("Constant value doesn't fit in type");
4904 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4910 #line 1903 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4911 { // arbitrary precision integer constants
4912 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4913 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4914 GEN_ERROR("Constant value does not fit in type");
4916 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4917 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4918 delete (yyvsp[(2) - (2)].APIntVal);
4924 #line 1913 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4925 { // Boolean constants
4926 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4927 GEN_ERROR("Constant true must have type i1");
4928 (yyval.ConstVal) = ConstantInt::getTrue();
4934 #line 1919 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4935 { // Boolean constants
4936 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4937 GEN_ERROR("Constant false must have type i1");
4938 (yyval.ConstVal) = ConstantInt::getFalse();
4944 #line 1925 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4945 { // Floating point constants
4946 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4947 GEN_ERROR("Floating point constant invalid for type");
4948 // Lexer has no type info, so builds all float and double FP constants
4949 // as double. Fix this here. Long double is done right.
4950 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4951 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4952 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4953 delete (yyvsp[(2) - (2)].FPVal);
4959 #line 1938 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4961 if (!UpRefs.empty())
4962 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4963 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4964 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4965 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4966 GEN_ERROR("invalid cast opcode for cast from '" +
4967 Val->getType()->getDescription() + "' to '" +
4968 DestTy->getDescription() + "'");
4969 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4970 delete (yyvsp[(5) - (6)].TypeVal);
4975 #line 1950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4977 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4978 GEN_ERROR("GetElementPtr requires a pointer operand");
4981 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4983 GEN_ERROR("Index list invalid for constant getelementptr");
4985 SmallVector<Constant*, 8> IdxVec;
4986 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4987 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4988 IdxVec.push_back(C);
4990 GEN_ERROR("Indices to constant getelementptr must be constants");
4992 delete (yyvsp[(4) - (5)].ValueList);
4994 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5000 #line 1971 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5002 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5003 GEN_ERROR("Select condition must be of boolean type");
5004 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5005 GEN_ERROR("Select operand types must match");
5006 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5012 #line 1979 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5014 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5015 GEN_ERROR("Binary operator types must match");
5017 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5022 #line 1985 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5024 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5025 GEN_ERROR("Logical operator types must match");
5026 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5027 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5028 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5029 GEN_ERROR("Logical operator requires integral operands");
5031 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5037 #line 1996 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5039 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5040 GEN_ERROR("icmp operand types must match");
5041 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5046 #line 2001 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5048 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5049 GEN_ERROR("fcmp operand types must match");
5050 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5055 #line 2006 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5057 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5058 GEN_ERROR("vicmp operand types must match");
5059 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5064 #line 2011 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5066 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5067 GEN_ERROR("vfcmp operand types must match");
5068 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5073 #line 2016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5075 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5076 GEN_ERROR("Invalid extractelement operands");
5077 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5083 #line 2022 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5085 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5086 GEN_ERROR("Invalid insertelement operands");
5087 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5093 #line 2028 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5095 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5096 GEN_ERROR("Invalid shufflevector operands");
5097 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5103 #line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5105 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5106 GEN_ERROR("ExtractValue requires an aggregate operand");
5108 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5109 delete (yyvsp[(4) - (5)].ConstantList);
5115 #line 2042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5117 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5118 GEN_ERROR("InsertValue requires an aggregate operand");
5120 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5121 delete (yyvsp[(6) - (7)].ConstantList);
5127 #line 2053 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5129 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5135 #line 2057 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5137 (yyval.ConstVector) = new std::vector<Constant*>();
5138 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5144 #line 2065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5145 { (yyval.BoolVal) = false; ;}
5149 #line 2065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5150 { (yyval.BoolVal) = true; ;}
5154 #line 2068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5155 { (yyval.BoolVal) = true; ;}
5159 #line 2068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5160 { (yyval.BoolVal) = false; ;}
5164 #line 2071 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5166 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5167 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5169 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5171 GEN_ERROR("Aliases can be created only to global values");
5173 (yyval.ConstVal) = Aliasee;
5175 delete (yyvsp[(1) - (2)].TypeVal);
5180 #line 2083 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5182 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5183 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5184 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5185 GEN_ERROR("invalid cast opcode for cast from '" +
5186 Val->getType()->getDescription() + "' to '" +
5187 DestTy->getDescription() + "'");
5189 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5191 delete (yyvsp[(5) - (6)].TypeVal);
5196 #line 2104 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5198 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5199 CurModule.ModuleDone();
5205 #line 2109 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5207 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5208 CurModule.ModuleDone();
5214 #line 2122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5215 { CurFun.isDeclare = false; ;}
5219 #line 2122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5221 CurFun.FunctionDone();
5227 #line 2126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5228 { CurFun.isDeclare = true; ;}
5232 #line 2126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5239 #line 2129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5246 #line 2132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5248 if (!UpRefs.empty())
5249 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5250 // Eagerly resolve types. This is not an optimization, this is a
5251 // requirement that is due to the fact that we could have this:
5253 // %list = type { %list * }
5254 // %list = type { %list * } ; repeated type decl
5256 // If types are not resolved eagerly, then the two types will not be
5257 // determined to be the same type!
5259 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5261 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5263 // If this is a named type that is not a redefinition, add it to the slot
5265 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5268 delete (yyvsp[(3) - (3)].TypeVal);
5274 #line 2156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5276 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5278 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5280 // If this is a named type that is not a redefinition, add it to the slot
5282 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5289 #line 2168 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5291 /* "Externally Visible" Linkage */
5292 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5293 GEN_ERROR("Global value initializer is not a constant");
5294 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5295 (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));
5301 #line 2175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5308 #line 2179 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5310 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5311 GEN_ERROR("Global value initializer is not a constant");
5312 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));
5318 #line 2184 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5325 #line 2188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5327 if (!UpRefs.empty())
5328 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5329 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));
5331 delete (yyvsp[(6) - (7)].TypeVal);
5336 #line 2194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5344 #line 2198 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5347 if ((yyvsp[(1) - (5)].StrVal)) {
5348 Name = *(yyvsp[(1) - (5)].StrVal);
5349 delete (yyvsp[(1) - (5)].StrVal);
5352 GEN_ERROR("Alias name cannot be empty");
5354 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5356 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5358 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5359 CurModule.CurrentModule);
5360 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5361 InsertValue(GA, CurModule.Values);
5364 // If there was a forward reference of this alias, resolve it now.
5368 ID = ValID::createGlobalName(Name);
5370 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5372 if (GlobalValue *FWGV =
5373 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5374 // Replace uses of the fwdref with the actual alias.
5375 FWGV->replaceAllUsesWith(GA);
5376 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5377 GV->eraseFromParent();
5379 cast<Function>(FWGV)->eraseFromParent();
5388 #line 2238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5395 #line 2241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5402 #line 2247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5404 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5405 if (AsmSoFar.empty())
5406 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5408 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5409 delete (yyvsp[(1) - (1)].StrVal);
5415 #line 2257 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5417 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5418 delete (yyvsp[(3) - (3)].StrVal);
5423 #line 2261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5425 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5426 delete (yyvsp[(3) - (3)].StrVal);
5431 #line 2268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5433 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5434 delete (yyvsp[(3) - (3)].StrVal);
5440 #line 2273 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5442 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5443 delete (yyvsp[(1) - (1)].StrVal);
5449 #line 2278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5456 #line 2287 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5458 if (!UpRefs.empty())
5459 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5460 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5461 GEN_ERROR("Argument types must be first-class");
5462 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5463 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5464 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5470 #line 2297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5472 if (!UpRefs.empty())
5473 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5474 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5475 GEN_ERROR("Argument types must be first-class");
5476 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5477 (yyval.ArgList) = new ArgListType;
5478 (yyval.ArgList)->push_back(E);
5484 #line 2308 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5486 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5492 #line 2312 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5494 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5495 struct ArgListEntry E;
5496 E.Ty = new PATypeHolder(Type::VoidTy);
5498 E.Attrs = ParamAttr::None;
5499 (yyval.ArgList)->push_back(E);
5505 #line 2321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5507 (yyval.ArgList) = new ArgListType;
5508 struct ArgListEntry E;
5509 E.Ty = new PATypeHolder(Type::VoidTy);
5511 E.Attrs = ParamAttr::None;
5512 (yyval.ArgList)->push_back(E);
5518 #line 2330 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5520 (yyval.ArgList) = 0;
5526 #line 2336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5528 std::string FunctionName(*(yyvsp[(3) - (11)].StrVal));
5529 delete (yyvsp[(3) - (11)].StrVal); // Free strdup'd memory!
5531 // Check the function result for abstractness if this is a define. We should
5532 // have no abstract types at this point
5533 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (11)].TypeVal)))
5534 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (11)].TypeVal)->get()->getDescription());
5536 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (11)].TypeVal)))
5537 GEN_ERROR("Invalid result type for LLVM function");
5539 std::vector<const Type*> ParamTypeList;
5540 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5541 if ((yyvsp[(7) - (11)].ParamAttrs) != ParamAttr::None)
5542 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (11)].ParamAttrs)));
5543 if ((yyvsp[(5) - (11)].ArgList)) { // If there are arguments...
5545 for (ArgListType::iterator I = (yyvsp[(5) - (11)].ArgList)->begin(); I != (yyvsp[(5) - (11)].ArgList)->end(); ++I, ++index) {
5546 const Type* Ty = I->Ty->get();
5547 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5548 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5549 ParamTypeList.push_back(Ty);
5550 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5551 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5555 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5556 if (isVarArg) ParamTypeList.pop_back();
5560 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5562 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (11)].TypeVal), ParamTypeList, isVarArg);
5563 const PointerType *PFT = PointerType::getUnqual(FT);
5564 delete (yyvsp[(2) - (11)].TypeVal);
5567 if (!FunctionName.empty()) {
5568 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5570 ID = ValID::createGlobalID(CurModule.Values.size());
5574 // See if this function was forward referenced. If so, recycle the object.
5575 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5576 // Move the function to the end of the list, from whereever it was
5577 // previously inserted.
5578 Fn = cast<Function>(FWRef);
5579 assert(Fn->getParamAttrs().isEmpty() &&
5580 "Forward reference has parameter attributes!");
5581 CurModule.CurrentModule->getFunctionList().remove(Fn);
5582 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5583 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5584 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5585 if (Fn->getFunctionType() != FT ) {
5586 // The existing function doesn't have the same type. This is an overload
5588 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5589 } else if (Fn->getParamAttrs() != PAL) {
5590 // The existing function doesn't have the same parameter attributes.
5591 // This is an overload error.
5592 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5593 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5594 // Neither the existing or the current function is a declaration and they
5595 // have the same name and same type. Clearly this is a redefinition.
5596 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5597 } else if (Fn->isDeclaration()) {
5598 // Make sure to strip off any argument names so we can't get conflicts.
5599 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5603 } else { // Not already defined?
5604 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5605 CurModule.CurrentModule);
5606 InsertValue(Fn, CurModule.Values);
5609 CurFun.FunctionStart(Fn);
5611 if (CurFun.isDeclare) {
5612 // If we have declaration, always overwrite linkage. This will allow us to
5613 // correctly handle cases, when pointer to function is passed as argument to
5614 // another function.
5615 Fn->setLinkage(CurFun.Linkage);
5616 Fn->setVisibility(CurFun.Visibility);
5618 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5619 Fn->setParamAttrs(PAL);
5620 Fn->setAlignment((yyvsp[(9) - (11)].UIntVal));
5621 if ((yyvsp[(8) - (11)].StrVal)) {
5622 Fn->setSection(*(yyvsp[(8) - (11)].StrVal));
5623 delete (yyvsp[(8) - (11)].StrVal);
5625 if ((yyvsp[(10) - (11)].StrVal)) {
5626 Fn->setGC((yyvsp[(10) - (11)].StrVal)->c_str());
5627 delete (yyvsp[(10) - (11)].StrVal);
5629 if ((yyvsp[(11) - (11)].FunctionNotes)) {
5630 Fn->setNotes((yyvsp[(11) - (11)].FunctionNotes));
5633 // Add all of the arguments we parsed to the function...
5634 if ((yyvsp[(5) - (11)].ArgList)) { // Is null if empty...
5635 if (isVarArg) { // Nuke the last entry
5636 assert((yyvsp[(5) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (11)].ArgList)->back().Name == 0 &&
5637 "Not a varargs marker!");
5638 delete (yyvsp[(5) - (11)].ArgList)->back().Ty;
5639 (yyvsp[(5) - (11)].ArgList)->pop_back(); // Delete the last entry
5641 Function::arg_iterator ArgIt = Fn->arg_begin();
5642 Function::arg_iterator ArgEnd = Fn->arg_end();
5644 for (ArgListType::iterator I = (yyvsp[(5) - (11)].ArgList)->begin();
5645 I != (yyvsp[(5) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5646 delete I->Ty; // Delete the typeholder...
5647 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5653 delete (yyvsp[(5) - (11)].ArgList); // We're now done with the argument list
5660 #line 2469 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5662 (yyval.FunctionVal) = CurFun.CurrentFunction;
5664 // Make sure that we keep track of the linkage type even if there was a
5665 // previous "declare".
5666 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5667 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5672 #line 2480 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5674 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5680 #line 2485 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5682 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5683 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5684 (yyval.FunctionVal) = CurFun.CurrentFunction;
5685 CurFun.FunctionDone();
5691 #line 2497 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5693 (yyval.BoolVal) = false;
5699 #line 2501 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5701 (yyval.BoolVal) = true;
5707 #line 2506 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5708 { // A reference to a direct constant
5709 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5715 #line 2510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5717 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5723 #line 2514 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5724 { // arbitrary precision integer constants
5725 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5726 delete (yyvsp[(1) - (1)].APIntVal);
5732 #line 2519 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5733 { // arbitrary precision integer constants
5734 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5735 delete (yyvsp[(1) - (1)].APIntVal);
5741 #line 2524 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5742 { // Perhaps it's an FP constant?
5743 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5749 #line 2528 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5751 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5757 #line 2532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5759 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5765 #line 2536 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5767 (yyval.ValIDVal) = ValID::createNull();
5773 #line 2540 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5775 (yyval.ValIDVal) = ValID::createUndef();
5781 #line 2544 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5782 { // A vector zero constant.
5783 (yyval.ValIDVal) = ValID::createZeroInit();
5789 #line 2548 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5790 { // Nonempty unsized packed vector
5791 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5792 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5794 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5795 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5797 VectorType* pt = VectorType::get(ETy, NumElements);
5798 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5800 // Verify all elements are correct type!
5801 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5802 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5803 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5804 ETy->getDescription() +"' as required!\nIt is of type '" +
5805 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5808 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5809 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5815 #line 2570 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5816 { // Nonempty unsized arr
5817 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5818 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5820 if (!ETy->isFirstClassType())
5821 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5823 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5824 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5826 // Verify all elements are correct type!
5827 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5828 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5829 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5830 ETy->getDescription() +"' as required!\nIt is of type '"+
5831 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5834 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5835 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5841 #line 2592 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5843 // Use undef instead of an array because it's inconvenient to determine
5844 // the element type at this point, there being no elements to examine.
5845 (yyval.ValIDVal) = ValID::createUndef();
5851 #line 2598 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5853 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5854 const Type *ETy = Type::Int8Ty;
5856 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5858 std::vector<Constant*> Vals;
5859 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5860 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5861 delete (yyvsp[(2) - (2)].StrVal);
5862 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5868 #line 2611 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5870 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5871 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5872 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5874 const StructType *STy = StructType::get(Elements);
5875 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5877 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5878 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5884 #line 2623 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5886 const StructType *STy = StructType::get(std::vector<const Type*>());
5887 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5893 #line 2628 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5895 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5896 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5897 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5899 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5900 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5902 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5903 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5909 #line 2640 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5911 const StructType *STy = StructType::get(std::vector<const Type*>(),
5913 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5919 #line 2646 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5921 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5927 #line 2650 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5929 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5930 delete (yyvsp[(3) - (5)].StrVal);
5931 delete (yyvsp[(5) - (5)].StrVal);
5937 #line 2660 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5938 { // Is it an integer reference...?
5939 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5945 #line 2664 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5947 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5953 #line 2668 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5954 { // Is it a named reference...?
5955 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5956 delete (yyvsp[(1) - (1)].StrVal);
5962 #line 2673 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5963 { // Is it a named reference...?
5964 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5965 delete (yyvsp[(1) - (1)].StrVal);
5971 #line 2686 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5973 if (!UpRefs.empty())
5974 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5975 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5976 delete (yyvsp[(1) - (2)].TypeVal);
5982 #line 2695 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5984 (yyval.ValueList) = new std::vector<Value *>();
5985 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5991 #line 2700 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5993 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
5999 #line 2705 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6001 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6007 #line 2709 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6008 { // Do not allow functions with 0 basic blocks
6009 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6015 #line 2718 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6017 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6019 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6020 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6021 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6027 #line 2727 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6030 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6031 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6032 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6033 " is incorrect, expected %" + utostr((unsigned)ValNum));
6035 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6036 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6042 #line 2740 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6044 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6045 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6046 if (CI2->getParent() == 0)
6047 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6048 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6049 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6055 #line 2749 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6056 { // Empty space between instruction lists
6057 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6063 #line 2753 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6064 { // Labelled (named) basic block
6065 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6066 delete (yyvsp[(1) - (1)].StrVal);
6073 #line 2761 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6074 { // Return with a result...
6075 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6076 assert(!VL.empty() && "Invalid ret operands!");
6077 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6078 if (VL.size() > 1 ||
6079 (isa<StructType>(ReturnType) &&
6080 (VL.empty() || VL[0]->getType() != ReturnType))) {
6081 Value *RV = UndefValue::get(ReturnType);
6082 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6083 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6084 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6087 (yyval.TermInstVal) = ReturnInst::Create(RV);
6089 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6091 delete (yyvsp[(2) - (2)].ValueList);
6097 #line 2781 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6098 { // Return with no result...
6099 (yyval.TermInstVal) = ReturnInst::Create();
6105 #line 2785 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6106 { // Unconditional Branch...
6107 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6109 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6114 #line 2790 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6116 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6117 GEN_ERROR("Branch condition must have type i1");
6118 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6120 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6122 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6124 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6129 #line 2801 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6131 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6133 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6135 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6136 (yyval.TermInstVal) = S;
6138 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6139 E = (yyvsp[(8) - (9)].JumpTable)->end();
6140 for (; I != E; ++I) {
6141 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6142 S->addCase(CI, I->second);
6144 GEN_ERROR("Switch case is constant, but not a simple integer");
6146 delete (yyvsp[(8) - (9)].JumpTable);
6152 #line 2820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6154 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6156 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6158 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6159 (yyval.TermInstVal) = S;
6165 #line 2830 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6168 // Handle the short syntax
6169 const PointerType *PFTy = 0;
6170 const FunctionType *Ty = 0;
6171 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
6172 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6173 // Pull out the types of all of the arguments...
6174 std::vector<const Type*> ParamTypes;
6175 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6176 for (; I != E; ++I) {
6177 const Type *Ty = I->Val->getType();
6178 if (Ty == Type::VoidTy)
6179 GEN_ERROR("Short call syntax cannot be used with varargs");
6180 ParamTypes.push_back(Ty);
6183 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6184 GEN_ERROR("Invalid result type for LLVM function");
6186 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6187 PFTy = PointerType::getUnqual(Ty);
6190 delete (yyvsp[(3) - (14)].TypeVal);
6192 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
6194 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6196 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6199 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6200 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6201 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6203 // Check the arguments
6205 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
6206 // Make sure no arguments is a good thing!
6207 if (Ty->getNumParams() != 0)
6208 GEN_ERROR("No arguments passed to a function that "
6209 "expects arguments");
6210 } else { // Has arguments?
6211 // Loop through FunctionType's arguments and ensure they are specified
6213 FunctionType::param_iterator I = Ty->param_begin();
6214 FunctionType::param_iterator E = Ty->param_end();
6215 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6218 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6219 if (ArgI->Val->getType() != *I)
6220 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6221 (*I)->getDescription() + "'");
6222 Args.push_back(ArgI->Val);
6223 if (ArgI->Attrs != ParamAttr::None)
6224 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6227 if (Ty->isVarArg()) {
6229 for (; ArgI != ArgE; ++ArgI, ++index) {
6230 Args.push_back(ArgI->Val); // push the remaining varargs
6231 if (ArgI->Attrs != ParamAttr::None)
6232 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6234 } else if (I != E || ArgI != ArgE)
6235 GEN_ERROR("Invalid number of parameters detected");
6240 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6242 // Create the InvokeInst
6243 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6244 Args.begin(), Args.end());
6245 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6246 II->setParamAttrs(PAL);
6247 (yyval.TermInstVal) = II;
6248 delete (yyvsp[(6) - (14)].ParamList);
6254 #line 2915 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6256 (yyval.TermInstVal) = new UnwindInst();
6262 #line 2919 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6264 (yyval.TermInstVal) = new UnreachableInst();
6270 #line 2926 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6272 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6273 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6276 GEN_ERROR("May only switch on a constant pool value");
6278 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6280 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6285 #line 2937 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6287 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6288 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6292 GEN_ERROR("May only switch on a constant pool value");
6294 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6296 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6301 #line 2950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6303 // Is this definition named?? if so, assign the name...
6304 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6306 InsertValue((yyvsp[(2) - (2)].InstVal));
6307 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6313 #line 2959 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6316 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6318 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6319 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6320 " is incorrect, expected %" + utostr((unsigned)ValNum));
6322 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6328 #line 2972 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6329 { // Used for PHI nodes
6330 if (!UpRefs.empty())
6331 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6332 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6333 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6335 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6337 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6338 delete (yyvsp[(1) - (6)].TypeVal);
6343 #line 2983 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6345 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6346 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6348 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6350 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6355 #line 2993 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6357 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6358 if (!UpRefs.empty())
6359 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6360 // Used for call and invoke instructions
6361 (yyval.ParamList) = new ParamList();
6362 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6363 (yyval.ParamList)->push_back(E);
6364 delete (yyvsp[(1) - (4)].TypeVal);
6370 #line 3004 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6372 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6373 // Labels are only valid in ASMs
6374 (yyval.ParamList) = new ParamList();
6375 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6376 (yyval.ParamList)->push_back(E);
6382 #line 3012 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6384 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6385 if (!UpRefs.empty())
6386 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6387 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6388 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6389 (yyval.ParamList)->push_back(E);
6390 delete (yyvsp[(3) - (6)].TypeVal);
6396 #line 3022 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6398 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6399 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6400 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6401 (yyval.ParamList)->push_back(E);
6407 #line 3029 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6408 { (yyval.ParamList) = new ParamList(); ;}
6412 #line 3032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6413 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6417 #line 3033 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6419 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6420 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6426 #line 3041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6428 (yyval.ConstantList) = new std::vector<unsigned>();
6429 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6430 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6431 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6436 #line 3047 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6438 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6439 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6440 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6441 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6447 #line 3056 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6449 (yyval.BoolVal) = true;
6455 #line 3060 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6457 (yyval.BoolVal) = false;
6463 #line 3065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6465 if (!UpRefs.empty())
6466 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6467 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6468 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6470 "Arithmetic operator requires integer, FP, or packed operands");
6471 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6473 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6475 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6476 if ((yyval.InstVal) == 0)
6477 GEN_ERROR("binary operator returned null");
6478 delete (yyvsp[(2) - (5)].TypeVal);
6483 #line 3081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6485 if (!UpRefs.empty())
6486 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6487 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6488 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6489 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6490 GEN_ERROR("Logical operator requires integral operands");
6492 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6494 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6496 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6497 if ((yyval.InstVal) == 0)
6498 GEN_ERROR("binary operator returned null");
6499 delete (yyvsp[(2) - (5)].TypeVal);
6504 #line 3098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6506 if (!UpRefs.empty())
6507 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6508 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6510 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6512 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6513 if ((yyval.InstVal) == 0)
6514 GEN_ERROR("icmp operator returned null");
6515 delete (yyvsp[(3) - (6)].TypeVal);
6520 #line 3110 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6522 if (!UpRefs.empty())
6523 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6524 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6526 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6528 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6529 if ((yyval.InstVal) == 0)
6530 GEN_ERROR("fcmp operator returned null");
6531 delete (yyvsp[(3) - (6)].TypeVal);
6536 #line 3122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6538 if (!UpRefs.empty())
6539 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6540 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6541 GEN_ERROR("Scalar types not supported by vicmp instruction");
6542 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6544 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6546 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6547 if ((yyval.InstVal) == 0)
6548 GEN_ERROR("vicmp operator returned null");
6549 delete (yyvsp[(3) - (6)].TypeVal);
6554 #line 3136 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6556 if (!UpRefs.empty())
6557 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6558 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6559 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6560 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6562 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6564 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6565 if ((yyval.InstVal) == 0)
6566 GEN_ERROR("vfcmp operator returned null");
6567 delete (yyvsp[(3) - (6)].TypeVal);
6572 #line 3150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6574 if (!UpRefs.empty())
6575 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6576 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6577 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6578 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6579 GEN_ERROR("invalid cast opcode for cast from '" +
6580 Val->getType()->getDescription() + "' to '" +
6581 DestTy->getDescription() + "'");
6582 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6583 delete (yyvsp[(4) - (4)].TypeVal);
6588 #line 3162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6590 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6592 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6593 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6594 GEN_ERROR("vector select value types must be vector types");
6595 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6596 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6597 if (cond_type->getElementType() != Type::Int1Ty)
6598 GEN_ERROR("vector select condition element type must be boolean");
6599 if (cond_type->getNumElements() != select_type->getNumElements())
6600 GEN_ERROR("vector select number of elements must be the same");
6602 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6603 GEN_ERROR("select condition must be boolean");
6605 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6606 GEN_ERROR("select value types must match");
6607 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6613 #line 3183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6615 if (!UpRefs.empty())
6616 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6617 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6618 delete (yyvsp[(4) - (4)].TypeVal);
6624 #line 3190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6626 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6627 GEN_ERROR("Invalid extractelement operands");
6628 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6634 #line 3196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6636 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6637 GEN_ERROR("Invalid insertelement operands");
6638 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6644 #line 3202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6646 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6647 GEN_ERROR("Invalid shufflevector operands");
6648 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6654 #line 3208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6656 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6657 if (!Ty->isFirstClassType())
6658 GEN_ERROR("PHI node operands must be of first class type");
6659 (yyval.InstVal) = PHINode::Create(Ty);
6660 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6661 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6662 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6663 GEN_ERROR("All elements of a PHI node must be of the same type");
6664 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6665 (yyvsp[(2) - (2)].PHIList)->pop_front();
6667 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6673 #line 3224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6676 // Handle the short syntax
6677 const PointerType *PFTy = 0;
6678 const FunctionType *Ty = 0;
6679 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6680 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6681 // Pull out the types of all of the arguments...
6682 std::vector<const Type*> ParamTypes;
6683 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6684 for (; I != E; ++I) {
6685 const Type *Ty = I->Val->getType();
6686 if (Ty == Type::VoidTy)
6687 GEN_ERROR("Short call syntax cannot be used with varargs");
6688 ParamTypes.push_back(Ty);
6691 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6692 GEN_ERROR("Invalid result type for LLVM function");
6694 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6695 PFTy = PointerType::getUnqual(Ty);
6698 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6701 // Check for call to invalid intrinsic to avoid crashing later.
6702 if (Function *theF = dyn_cast<Function>(V)) {
6703 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6704 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6705 !theF->getIntrinsicID(true))
6706 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6707 theF->getName() + "'");
6710 // Set up the ParamAttrs for the function
6711 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6712 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6713 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6714 // Check the arguments
6716 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6717 // Make sure no arguments is a good thing!
6718 if (Ty->getNumParams() != 0)
6719 GEN_ERROR("No arguments passed to a function that "
6720 "expects arguments");
6721 } else { // Has arguments?
6722 // Loop through FunctionType's arguments and ensure they are specified
6723 // correctly. Also, gather any parameter attributes.
6724 FunctionType::param_iterator I = Ty->param_begin();
6725 FunctionType::param_iterator E = Ty->param_end();
6726 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6729 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6730 if (ArgI->Val->getType() != *I)
6731 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6732 (*I)->getDescription() + "'");
6733 Args.push_back(ArgI->Val);
6734 if (ArgI->Attrs != ParamAttr::None)
6735 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6737 if (Ty->isVarArg()) {
6739 for (; ArgI != ArgE; ++ArgI, ++index) {
6740 Args.push_back(ArgI->Val); // push the remaining varargs
6741 if (ArgI->Attrs != ParamAttr::None)
6742 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6744 } else if (I != E || ArgI != ArgE)
6745 GEN_ERROR("Invalid number of parameters detected");
6748 // Finish off the ParamAttrs and check them
6751 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6753 // Create the call node
6754 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6755 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6756 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6757 CI->setParamAttrs(PAL);
6758 (yyval.InstVal) = CI;
6759 delete (yyvsp[(6) - (8)].ParamList);
6760 delete (yyvsp[(3) - (8)].TypeVal);
6766 #line 3313 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6768 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6774 #line 3318 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6776 (yyval.BoolVal) = true;
6782 #line 3322 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6784 (yyval.BoolVal) = false;
6790 #line 3329 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6792 if (!UpRefs.empty())
6793 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6794 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6795 delete (yyvsp[(2) - (3)].TypeVal);
6801 #line 3336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6803 if (!UpRefs.empty())
6804 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6805 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6806 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6807 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6809 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6810 delete (yyvsp[(2) - (6)].TypeVal);
6815 #line 3346 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6817 if (!UpRefs.empty())
6818 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6819 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6820 delete (yyvsp[(2) - (3)].TypeVal);
6826 #line 3353 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6828 if (!UpRefs.empty())
6829 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6830 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6831 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6832 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6834 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6835 delete (yyvsp[(2) - (6)].TypeVal);
6840 #line 3363 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6842 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6843 GEN_ERROR("Trying to free nonpointer type " +
6844 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6845 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6851 #line 3371 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6853 if (!UpRefs.empty())
6854 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6855 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6856 GEN_ERROR("Can't load from nonpointer type: " +
6857 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6858 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6859 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6860 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6861 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6863 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6864 delete (yyvsp[(3) - (5)].TypeVal);
6869 #line 3385 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6871 if (!UpRefs.empty())
6872 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6873 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6875 GEN_ERROR("Can't store to a nonpointer type: " +
6876 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6877 const Type *ElTy = PT->getElementType();
6878 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6879 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6880 "' into space of type '" + ElTy->getDescription() + "'");
6882 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6884 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6885 delete (yyvsp[(5) - (7)].TypeVal);
6890 #line 3402 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6892 if (!UpRefs.empty())
6893 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6894 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6895 GEN_ERROR("getresult insn requires an aggregate operand");
6896 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6897 GEN_ERROR("Invalid getresult index for type '" +
6898 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6900 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6902 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6903 delete (yyvsp[(2) - (5)].TypeVal);
6908 #line 3416 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6910 if (!UpRefs.empty())
6911 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6912 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6913 GEN_ERROR("getelementptr insn requires pointer operand");
6915 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6916 GEN_ERROR("Invalid getelementptr indices for type '" +
6917 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6918 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6920 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6921 delete (yyvsp[(2) - (4)].TypeVal);
6922 delete (yyvsp[(4) - (4)].ValueList);
6927 #line 3431 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6929 if (!UpRefs.empty())
6930 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6931 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6932 GEN_ERROR("extractvalue insn requires an aggregate operand");
6934 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6935 GEN_ERROR("Invalid extractvalue indices for type '" +
6936 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6937 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6939 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6940 delete (yyvsp[(2) - (4)].TypeVal);
6941 delete (yyvsp[(4) - (4)].ConstantList);
6946 #line 3446 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6948 if (!UpRefs.empty())
6949 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6950 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6951 GEN_ERROR("extractvalue insn requires an aggregate operand");
6953 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6954 GEN_ERROR("Invalid insertvalue indices for type '" +
6955 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6956 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6957 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6959 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6960 delete (yyvsp[(2) - (7)].TypeVal);
6961 delete (yyvsp[(5) - (7)].TypeVal);
6962 delete (yyvsp[(7) - (7)].ConstantList);
6967 /* Line 1267 of yacc.c. */
6968 #line 6969 "llvmAsmParser.tab.c"
6971 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6975 YY_STACK_PRINT (yyss, yyssp);
6980 /* Now `shift' the result of the reduction. Determine what state
6981 that goes to, based on the state we popped back to and the rule
6982 number reduced by. */
6986 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6987 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6988 yystate = yytable[yystate];
6990 yystate = yydefgoto[yyn - YYNTOKENS];
6995 /*------------------------------------.
6996 | yyerrlab -- here on detecting error |
6997 `------------------------------------*/
6999 /* If not already recovering from an error, report this error. */
7003 #if ! YYERROR_VERBOSE
7004 yyerror (YY_("syntax error"));
7007 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7008 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7010 YYSIZE_T yyalloc = 2 * yysize;
7011 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7012 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7013 if (yymsg != yymsgbuf)
7014 YYSTACK_FREE (yymsg);
7015 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7017 yymsg_alloc = yyalloc;
7021 yymsg_alloc = sizeof yymsgbuf;
7025 if (0 < yysize && yysize <= yymsg_alloc)
7027 (void) yysyntax_error (yymsg, yystate, yychar);
7032 yyerror (YY_("syntax error"));
7034 goto yyexhaustedlab;
7042 if (yyerrstatus == 3)
7044 /* If just tried and failed to reuse look-ahead token after an
7045 error, discard it. */
7047 if (yychar <= YYEOF)
7049 /* Return failure if at end of input. */
7050 if (yychar == YYEOF)
7055 yydestruct ("Error: discarding",
7061 /* Else will try to reuse look-ahead token after shifting the error
7066 /*---------------------------------------------------.
7067 | yyerrorlab -- error raised explicitly by YYERROR. |
7068 `---------------------------------------------------*/
7071 /* Pacify compilers like GCC when the user code never invokes
7072 YYERROR and the label yyerrorlab therefore never appears in user
7074 if (/*CONSTCOND*/ 0)
7077 /* Do not reclaim the symbols of the rule which action triggered
7081 YY_STACK_PRINT (yyss, yyssp);
7086 /*-------------------------------------------------------------.
7087 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7088 `-------------------------------------------------------------*/
7090 yyerrstatus = 3; /* Each real token shifted decrements this. */
7094 yyn = yypact[yystate];
7095 if (yyn != YYPACT_NINF)
7098 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7106 /* Pop the current state because it cannot handle the error token. */
7111 yydestruct ("Error: popping",
7112 yystos[yystate], yyvsp);
7115 YY_STACK_PRINT (yyss, yyssp);
7124 /* Shift the error token. */
7125 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7131 /*-------------------------------------.
7132 | yyacceptlab -- YYACCEPT comes here. |
7133 `-------------------------------------*/
7138 /*-----------------------------------.
7139 | yyabortlab -- YYABORT comes here. |
7140 `-----------------------------------*/
7146 /*-------------------------------------------------.
7147 | yyexhaustedlab -- memory exhaustion comes here. |
7148 `-------------------------------------------------*/
7150 yyerror (YY_("memory exhausted"));
7156 if (yychar != YYEOF && yychar != YYEMPTY)
7157 yydestruct ("Cleanup: discarding lookahead",
7159 /* Do not reclaim the symbols of the rule which action triggered
7160 this YYABORT or YYACCEPT. */
7162 YY_STACK_PRINT (yyss, yyssp);
7163 while (yyssp != yyss)
7165 yydestruct ("Cleanup: popping",
7166 yystos[*yyssp], yyvsp);
7171 YYSTACK_FREE (yyss);
7174 if (yymsg != yymsgbuf)
7175 YYSTACK_FREE (yymsg);
7177 /* Make sure YYID is used. */
7178 return YYID (yyresult);
7182 #line 3465 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
7185 // common code from the two 'RunVMAsmParser' functions
7186 static Module* RunParser(Module * M) {
7187 CurModule.CurrentModule = M;
7188 // Check to make sure the parser succeeded
7191 delete ParserResult;
7195 // Emit an error if there are any unresolved types left.
7196 if (!CurModule.LateResolveTypes.empty()) {
7197 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7198 if (DID.Type == ValID::LocalName) {
7199 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7201 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7204 delete ParserResult;
7208 // Emit an error if there are any unresolved values left.
7209 if (!CurModule.LateResolveValues.empty()) {
7210 Value *V = CurModule.LateResolveValues.back();
7211 std::map<Value*, std::pair<ValID, int> >::iterator I =
7212 CurModule.PlaceHolderInfo.find(V);
7214 if (I != CurModule.PlaceHolderInfo.end()) {
7215 ValID &DID = I->second.first;
7216 if (DID.Type == ValID::LocalName) {
7217 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7219 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7222 delete ParserResult;
7227 // Check to make sure that parsing produced a result
7231 // Reset ParserResult variable while saving its value for the result.
7232 Module *Result = ParserResult;
7238 void llvm::GenerateError(const std::string &message, int LineNo) {
7239 if (LineNo == -1) LineNo = LLLgetLineNo();
7240 // TODO: column number in exception
7242 TheParseError->setError(LLLgetFilename(), message, LineNo);
7246 int yyerror(const char *ErrorMsg) {
7247 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7248 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7249 if (yychar != YYEMPTY && yychar != 0) {
7250 errMsg += " while reading token: '";
7251 errMsg += std::string(LLLgetTokenStart(),
7252 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7254 GenerateError(errMsg);