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 "/Volumes/Nanpura/mainline/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 "/Volumes/Nanpura/mainline/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::Attributes ParamAttrs;
1409 llvm::APInt *APIntVal;
1414 llvm::APFloat *FPVal;
1417 std::string *StrVal; // This memory must be deleted
1418 llvm::ValID ValIDVal;
1420 llvm::Instruction::BinaryOps BinaryOpVal;
1421 llvm::Instruction::TermOps TermOpVal;
1422 llvm::Instruction::MemoryOps MemOpVal;
1423 llvm::Instruction::CastOps CastOpVal;
1424 llvm::Instruction::OtherOps OtherOpVal;
1425 llvm::ICmpInst::Predicate IPredicate;
1426 llvm::FCmpInst::Predicate FPredicate;
1428 /* Line 193 of yacc.c. */
1429 #line 1430 "llvmAsmParser.tab.c"
1431 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1432 # define YYSTYPE_IS_DECLARED 1
1433 # define YYSTYPE_IS_TRIVIAL 1
1438 /* Copy the second part of user declarations. */
1441 /* Line 216 of yacc.c. */
1442 #line 1443 "llvmAsmParser.tab.c"
1449 typedef YYTYPE_UINT8 yytype_uint8;
1451 typedef unsigned char yytype_uint8;
1455 typedef YYTYPE_INT8 yytype_int8;
1456 #elif (defined __STDC__ || defined __C99__FUNC__ \
1457 || defined __cplusplus || defined _MSC_VER)
1458 typedef signed char yytype_int8;
1460 typedef short int yytype_int8;
1463 #ifdef YYTYPE_UINT16
1464 typedef YYTYPE_UINT16 yytype_uint16;
1466 typedef unsigned short int yytype_uint16;
1470 typedef YYTYPE_INT16 yytype_int16;
1472 typedef short int yytype_int16;
1476 # ifdef __SIZE_TYPE__
1477 # define YYSIZE_T __SIZE_TYPE__
1478 # elif defined size_t
1479 # define YYSIZE_T size_t
1480 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1481 || defined __cplusplus || defined _MSC_VER)
1482 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1483 # define YYSIZE_T size_t
1485 # define YYSIZE_T unsigned int
1489 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1492 # if defined YYENABLE_NLS && YYENABLE_NLS
1494 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1495 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1499 # define YY_(msgid) msgid
1503 /* Suppress unused-variable warnings by "using" E. */
1504 #if ! defined lint || defined __GNUC__
1505 # define YYUSE(e) ((void) (e))
1507 # define YYUSE(e) /* empty */
1510 /* Identity function, used to suppress warnings about constant conditions. */
1512 # define YYID(n) (n)
1514 #if (defined __STDC__ || defined __C99__FUNC__ \
1515 || defined __cplusplus || defined _MSC_VER)
1528 #if ! defined yyoverflow || YYERROR_VERBOSE
1530 /* The parser invokes alloca or malloc; define the necessary symbols. */
1532 # ifdef YYSTACK_USE_ALLOCA
1533 # if YYSTACK_USE_ALLOCA
1535 # define YYSTACK_ALLOC __builtin_alloca
1536 # elif defined __BUILTIN_VA_ARG_INCR
1537 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1539 # define YYSTACK_ALLOC __alloca
1540 # elif defined _MSC_VER
1541 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1542 # define alloca _alloca
1544 # define YYSTACK_ALLOC alloca
1545 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1546 || defined __cplusplus || defined _MSC_VER)
1547 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1549 # define _STDLIB_H 1
1556 # ifdef YYSTACK_ALLOC
1557 /* Pacify GCC's `empty if-body' warning. */
1558 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1559 # ifndef YYSTACK_ALLOC_MAXIMUM
1560 /* The OS might guarantee only one guard page at the bottom of the stack,
1561 and a page size can be as small as 4096 bytes. So we cannot safely
1562 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1563 to allow for a few compiler-allocated temporary stack slots. */
1564 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1567 # define YYSTACK_ALLOC YYMALLOC
1568 # define YYSTACK_FREE YYFREE
1569 # ifndef YYSTACK_ALLOC_MAXIMUM
1570 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1572 # if (defined __cplusplus && ! defined _STDLIB_H \
1573 && ! ((defined YYMALLOC || defined malloc) \
1574 && (defined YYFREE || defined free)))
1575 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1577 # define _STDLIB_H 1
1581 # define YYMALLOC malloc
1582 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1583 || defined __cplusplus || defined _MSC_VER)
1584 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1588 # define YYFREE free
1589 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1590 || defined __cplusplus || defined _MSC_VER)
1591 void free (void *); /* INFRINGES ON USER NAME SPACE */
1595 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1598 #if (! defined yyoverflow \
1599 && (! defined __cplusplus \
1600 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1602 /* A type that is properly aligned for any stack member. */
1609 /* The size of the maximum gap between one aligned stack and the next. */
1610 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1612 /* The size of an array large to enough to hold all stacks, each with
1614 # define YYSTACK_BYTES(N) \
1615 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1616 + YYSTACK_GAP_MAXIMUM)
1618 /* Copy COUNT objects from FROM to TO. The source and destination do
1621 # if defined __GNUC__ && 1 < __GNUC__
1622 # define YYCOPY(To, From, Count) \
1623 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1625 # define YYCOPY(To, From, Count) \
1629 for (yyi = 0; yyi < (Count); yyi++) \
1630 (To)[yyi] = (From)[yyi]; \
1636 /* Relocate STACK from its old location to the new one. The
1637 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1638 elements in the stack, and YYPTR gives the new location of the
1639 stack. Advance YYPTR to a properly aligned location for the next
1641 # define YYSTACK_RELOCATE(Stack) \
1644 YYSIZE_T yynewbytes; \
1645 YYCOPY (&yyptr->Stack, Stack, yysize); \
1646 Stack = &yyptr->Stack; \
1647 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1648 yyptr += yynewbytes / sizeof (*yyptr); \
1654 /* YYFINAL -- State number of the termination state. */
1656 /* YYLAST -- Last index in YYTABLE. */
1659 /* YYNTOKENS -- Number of terminals. */
1660 #define YYNTOKENS 176
1661 /* YYNNTS -- Number of nonterminals. */
1663 /* YYNRULES -- Number of rules. */
1664 #define YYNRULES 354
1665 /* YYNRULES -- Number of states. */
1666 #define YYNSTATES 721
1668 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1669 #define YYUNDEFTOK 2
1670 #define YYMAXUTOK 416
1672 #define YYTRANSLATE(YYX) \
1673 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1675 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1676 static const yytype_uint8 yytranslate[] =
1678 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1679 2, 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 162, 163, 166, 2, 165, 2, 2, 2, 2, 2,
1683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1684 171, 164, 172, 2, 2, 2, 2, 2, 2, 2,
1685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1687 2, 168, 167, 170, 2, 2, 2, 2, 2, 175,
1688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 169, 2, 2, 173, 2, 174, 2, 2, 2, 2,
1691 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
1704 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1705 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1706 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1707 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1708 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1709 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1710 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1711 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1712 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1713 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1714 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1715 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1716 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1717 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1718 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1719 155, 156, 157, 158, 159, 160, 161
1723 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1725 static const yytype_uint16 yyprhs[] =
1727 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1728 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1729 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1730 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1731 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1732 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1733 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1734 140, 143, 145, 147, 149, 150, 153, 155, 157, 159,
1735 161, 163, 165, 167, 169, 171, 172, 174, 176, 178,
1736 179, 181, 183, 184, 186, 188, 190, 192, 193, 195,
1737 197, 198, 200, 202, 204, 206, 208, 210, 213, 215,
1738 217, 219, 221, 223, 225, 227, 229, 231, 234, 235,
1739 238, 240, 242, 244, 246, 248, 250, 252, 253, 256,
1740 258, 262, 266, 270, 272, 273, 278, 279, 282, 283,
1741 286, 287, 291, 294, 295, 297, 298, 302, 304, 307,
1742 309, 311, 313, 315, 317, 319, 321, 323, 325, 329,
1743 331, 334, 340, 346, 352, 358, 362, 365, 371, 376,
1744 379, 381, 383, 385, 389, 391, 395, 397, 398, 400,
1745 404, 409, 413, 417, 422, 427, 431, 438, 444, 447,
1746 450, 453, 456, 459, 462, 465, 468, 471, 474, 477,
1747 480, 487, 493, 502, 509, 516, 524, 532, 540, 548,
1748 555, 564, 573, 579, 587, 591, 593, 595, 597, 599,
1749 600, 603, 610, 612, 613, 615, 618, 619, 623, 624,
1750 628, 632, 636, 640, 641, 650, 651, 661, 662, 672,
1751 678, 681, 685, 687, 691, 695, 699, 703, 705, 706,
1752 712, 716, 718, 722, 724, 725, 737, 739, 741, 746,
1753 748, 750, 753, 757, 758, 760, 762, 764, 766, 768,
1754 770, 772, 774, 776, 778, 780, 784, 788, 791, 794,
1755 798, 801, 807, 812, 814, 820, 822, 824, 826, 828,
1756 830, 832, 835, 837, 841, 844, 847, 851, 855, 858,
1757 859, 861, 864, 867, 871, 881, 891, 900, 915, 917,
1758 919, 926, 932, 935, 938, 945, 953, 958, 963, 970,
1759 977, 978, 979, 983, 986, 990, 993, 995, 1001, 1007,
1760 1014, 1021, 1028, 1035, 1040, 1047, 1052, 1057, 1064, 1071,
1761 1074, 1083, 1085, 1087, 1088, 1092, 1099, 1103, 1110, 1113,
1762 1119, 1127, 1133, 1138, 1143
1765 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1766 static const yytype_int16 yyrhs[] =
1768 226, 0, -1, 76, -1, 77, -1, 78, -1, 79,
1769 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1770 -1, 88, -1, 89, -1, 90, -1, 85, -1, 86,
1771 -1, 87, -1, 121, -1, 122, -1, 123, -1, 124,
1772 -1, 125, -1, 126, -1, 127, -1, 128, -1, 129,
1773 -1, 130, -1, 131, -1, 132, -1, 95, -1, 96,
1774 -1, 97, -1, 98, -1, 99, -1, 100, -1, 101,
1775 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1776 -1, 107, -1, 108, -1, 109, -1, 110, -1, 111,
1777 -1, 112, -1, 113, -1, 114, -1, 101, -1, 102,
1778 -1, 103, -1, 104, -1, 26, -1, 27, -1, 11,
1779 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1780 -1, 19, -1, 22, -1, 24, -1, 184, -1, -1,
1781 55, 162, 4, 163, -1, -1, 184, 164, -1, -1,
1782 7, 164, -1, 20, -1, 23, -1, 191, -1, -1,
1783 189, 164, -1, 42, -1, 44, -1, 43, -1, 45,
1784 -1, 47, -1, 49, -1, 46, -1, 48, -1, 51,
1785 -1, -1, 159, -1, 160, -1, 161, -1, -1, 46,
1786 -1, 48, -1, -1, 42, -1, 43, -1, 44, -1,
1787 47, -1, -1, 44, -1, 42, -1, -1, 63, -1,
1788 64, -1, 65, -1, 66, -1, 67, -1, 68, -1,
1789 62, 4, -1, 143, -1, 122, -1, 142, -1, 123,
1790 -1, 145, -1, 146, -1, 148, -1, 149, -1, 150,
1791 -1, 54, 4, -1, -1, 200, 199, -1, 144, -1,
1792 147, -1, 145, -1, 143, -1, 142, -1, 151, -1,
1793 152, -1, -1, 202, 201, -1, 204, -1, 203, 165,
1794 204, -1, 155, 164, 157, -1, 155, 164, 156, -1,
1795 158, -1, -1, 154, 162, 203, 163, -1, -1, 153,
1796 22, -1, -1, 54, 4, -1, -1, 165, 54, 4,
1797 -1, 34, 22, -1, -1, 209, -1, -1, 165, 212,
1798 211, -1, 209, -1, 54, 4, -1, 11, -1, 12,
1799 -1, 13, -1, 16, -1, 15, -1, 14, -1, 17,
1800 -1, 50, -1, 213, -1, 214, 186, 166, -1, 248,
1801 -1, 167, 4, -1, 214, 162, 218, 163, 202, -1,
1802 10, 162, 218, 163, 202, -1, 168, 4, 169, 214,
1803 170, -1, 171, 4, 169, 214, 172, -1, 173, 219,
1804 174, -1, 173, 174, -1, 171, 173, 219, 174, 172,
1805 -1, 171, 173, 174, 172, -1, 214, 200, -1, 214,
1806 -1, 10, -1, 215, -1, 217, 165, 215, -1, 217,
1807 -1, 217, 165, 39, -1, 39, -1, -1, 214, -1,
1808 219, 165, 214, -1, 214, 168, 222, 170, -1, 214,
1809 168, 170, -1, 214, 175, 22, -1, 214, 171, 222,
1810 172, -1, 214, 173, 222, 174, -1, 214, 173, 174,
1811 -1, 214, 171, 173, 222, 174, 172, -1, 214, 171,
1812 173, 174, 172, -1, 214, 40, -1, 214, 41, -1,
1813 214, 248, -1, 214, 221, -1, 214, 25, -1, 182,
1814 3, -1, 182, 5, -1, 182, 4, -1, 182, 6,
1815 -1, 11, 26, -1, 11, 27, -1, 183, 9, -1,
1816 179, 162, 220, 38, 214, 163, -1, 120, 162, 220,
1817 260, 163, -1, 134, 162, 220, 165, 220, 165, 220,
1818 163, -1, 177, 162, 220, 165, 220, 163, -1, 178,
1819 162, 220, 165, 220, 163, -1, 91, 180, 162, 220,
1820 165, 220, 163, -1, 92, 181, 162, 220, 165, 220,
1821 163, -1, 93, 180, 162, 220, 165, 220, 163, -1,
1822 94, 181, 162, 220, 165, 220, 163, -1, 136, 162,
1823 220, 165, 220, 163, -1, 137, 162, 220, 165, 220,
1824 165, 220, 163, -1, 138, 162, 220, 165, 220, 165,
1825 220, 163, -1, 140, 162, 220, 261, 163, -1, 141,
1826 162, 220, 165, 220, 261, 163, -1, 222, 165, 220,
1827 -1, 220, -1, 32, -1, 33, -1, 37, -1, -1,
1828 216, 248, -1, 126, 162, 225, 38, 214, 163, -1,
1829 227, -1, -1, 228, -1, 227, 228, -1, -1, 31,
1830 229, 244, -1, -1, 30, 230, 245, -1, 60, 59,
1831 234, -1, 187, 18, 214, -1, 187, 18, 10, -1,
1832 -1, 190, 194, 224, 223, 220, 186, 231, 211, -1,
1833 -1, 190, 192, 194, 224, 223, 220, 186, 232, 211,
1834 -1, -1, 190, 193, 194, 224, 223, 214, 186, 233,
1835 211, -1, 190, 194, 35, 197, 225, -1, 52, 235,
1836 -1, 56, 164, 236, -1, 22, -1, 53, 164, 22,
1837 -1, 69, 164, 22, -1, 168, 237, 170, -1, 237,
1838 165, 22, -1, 22, -1, -1, 238, 165, 214, 200,
1839 185, -1, 214, 200, 185, -1, 238, -1, 238, 165,
1840 39, -1, 39, -1, -1, 198, 216, 189, 162, 239,
1841 163, 202, 210, 207, 206, 205, -1, 28, -1, 173,
1842 -1, 196, 194, 240, 241, -1, 29, -1, 174, -1,
1843 252, 243, -1, 195, 194, 240, -1, -1, 61, -1,
1844 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1845 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1846 171, 222, 172, -1, 168, 222, 170, -1, 168, 170,
1847 -1, 175, 22, -1, 173, 222, 174, -1, 173, 174,
1848 -1, 171, 173, 222, 174, 172, -1, 171, 173, 174,
1849 172, -1, 221, -1, 59, 246, 22, 165, 22, -1,
1850 7, -1, 8, -1, 184, -1, 189, -1, 248, -1,
1851 247, -1, 214, 249, -1, 250, -1, 251, 165, 250,
1852 -1, 252, 253, -1, 242, 253, -1, 254, 187, 255,
1853 -1, 254, 188, 255, -1, 254, 257, -1, -1, 21,
1854 -1, 70, 251, -1, 70, 10, -1, 71, 17, 249,
1855 -1, 71, 11, 249, 165, 17, 249, 165, 17, 249,
1856 -1, 72, 182, 249, 165, 17, 249, 168, 256, 170,
1857 -1, 72, 182, 249, 165, 17, 249, 168, 170, -1,
1858 73, 198, 216, 249, 162, 259, 163, 202, 38, 17,
1859 249, 74, 17, 249, -1, 74, -1, 75, -1, 256,
1860 182, 247, 165, 17, 249, -1, 182, 247, 165, 17,
1861 249, -1, 187, 263, -1, 188, 263, -1, 214, 168,
1862 249, 165, 249, 170, -1, 258, 165, 168, 249, 165,
1863 249, 170, -1, 214, 200, 249, 200, -1, 17, 200,
1864 249, 200, -1, 259, 165, 214, 200, 249, 200, -1,
1865 259, 165, 17, 200, 249, 200, -1, -1, -1, 260,
1866 165, 250, -1, 165, 4, -1, 261, 165, 4, -1,
1867 58, 57, -1, 57, -1, 177, 214, 249, 165, 249,
1868 -1, 178, 214, 249, 165, 249, -1, 91, 180, 214,
1869 249, 165, 249, -1, 92, 181, 214, 249, 165, 249,
1870 -1, 93, 180, 214, 249, 165, 249, -1, 94, 181,
1871 214, 249, 165, 249, -1, 179, 250, 38, 214, -1,
1872 134, 250, 165, 250, 165, 250, -1, 135, 250, 165,
1873 214, -1, 136, 250, 165, 250, -1, 137, 250, 165,
1874 250, 165, 250, -1, 138, 250, 165, 250, 165, 250,
1875 -1, 133, 258, -1, 262, 198, 216, 249, 162, 259,
1876 163, 202, -1, 265, -1, 36, -1, -1, 115, 214,
1877 208, -1, 115, 214, 165, 11, 249, 208, -1, 116,
1878 214, 208, -1, 116, 214, 165, 11, 249, 208, -1,
1879 117, 250, -1, 264, 118, 214, 249, 208, -1, 264,
1880 119, 250, 165, 214, 249, 208, -1, 139, 214, 249,
1881 165, 4, -1, 120, 214, 249, 260, -1, 140, 214,
1882 249, 261, -1, 141, 214, 249, 165, 214, 249, 261,
1886 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1887 static const yytype_uint16 yyrline[] =
1889 0, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141, 1141,
1890 1141, 1142, 1142, 1142, 1142, 1142, 1142, 1143, 1143, 1143,
1891 1143, 1143, 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1147,
1892 1147, 1148, 1148, 1149, 1149, 1150, 1150, 1151, 1151, 1155,
1893 1155, 1156, 1156, 1157, 1157, 1158, 1158, 1159, 1159, 1160,
1894 1160, 1161, 1161, 1162, 1163, 1168, 1169, 1169, 1169, 1169,
1895 1169, 1171, 1171, 1171, 1172, 1172, 1174, 1175, 1179, 1183,
1896 1188, 1194, 1194, 1196, 1197, 1202, 1208, 1209, 1210, 1211,
1897 1212, 1213, 1217, 1218, 1219, 1223, 1224, 1225, 1226, 1230,
1898 1231, 1232, 1236, 1237, 1238, 1239, 1240, 1244, 1245, 1246,
1899 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1263, 1264,
1900 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272, 1276, 1277,
1901 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1291, 1292, 1297,
1902 1298, 1311, 1312, 1313, 1316, 1317, 1322, 1323, 1330, 1331,
1903 1337, 1338, 1347, 1355, 1356, 1361, 1362, 1363, 1368, 1381,
1904 1381, 1381, 1381, 1381, 1381, 1381, 1384, 1388, 1392, 1399,
1905 1404, 1412, 1441, 1466, 1471, 1481, 1491, 1495, 1505, 1512,
1906 1521, 1528, 1533, 1538, 1545, 1546, 1553, 1560, 1568, 1574,
1907 1586, 1614, 1630, 1657, 1685, 1711, 1731, 1757, 1777, 1789,
1908 1796, 1862, 1872, 1882, 1888, 1898, 1904, 1914, 1920, 1926,
1909 1939, 1951, 1972, 1980, 1986, 1997, 2002, 2007, 2012, 2017,
1910 2023, 2029, 2035, 2043, 2054, 2058, 2066, 2066, 2069, 2069,
1911 2072, 2084, 2105, 2110, 2118, 2119, 2123, 2123, 2127, 2127,
1912 2130, 2133, 2157, 2169, 2168, 2180, 2179, 2189, 2188, 2199,
1913 2239, 2242, 2248, 2258, 2262, 2267, 2269, 2274, 2279, 2288,
1914 2298, 2309, 2313, 2322, 2331, 2336, 2468, 2468, 2470, 2479,
1915 2479, 2481, 2486, 2498, 2502, 2507, 2511, 2515, 2520, 2525,
1916 2529, 2533, 2537, 2541, 2545, 2549, 2571, 2593, 2599, 2612,
1917 2624, 2629, 2641, 2647, 2651, 2661, 2665, 2669, 2674, 2681,
1918 2681, 2687, 2696, 2701, 2706, 2710, 2719, 2728, 2741, 2750,
1919 2754, 2762, 2782, 2786, 2791, 2802, 2821, 2830, 2916, 2920,
1920 2927, 2938, 2951, 2960, 2973, 2984, 2994, 3005, 3013, 3023,
1921 3030, 3033, 3034, 3042, 3048, 3057, 3061, 3066, 3082, 3099,
1922 3111, 3123, 3137, 3151, 3163, 3184, 3191, 3197, 3203, 3209,
1923 3224, 3314, 3319, 3323, 3330, 3337, 3347, 3354, 3364, 3372,
1924 3386, 3403, 3417, 3432, 3447
1928 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1929 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1930 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1931 static const char *const yytname[] =
1933 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1934 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1935 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1936 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1937 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1938 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1939 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1940 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1941 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1942 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1943 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1944 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1945 "X86_SSECALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE",
1946 "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV",
1947 "UREM", "SREM", "FREM", "AND", "OR", "XOR", "SHL", "LSHR", "ASHR",
1948 "ICMP", "FCMP", "VICMP", "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1949 "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE",
1950 "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1951 "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST",
1952 "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT",
1953 "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT",
1954 "SHUFFLEVECTOR", "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT",
1955 "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL",
1956 "NEST", "READNONE", "READONLY", "GC", "FNNOTE", "INLINE", "ALWAYS",
1957 "NEVER", "OPTIMIZEFORSIZE", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1958 "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1959 "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1960 "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1961 "OptLocalName", "OptAddrSpace", "OptLocalAssign", "LocalNumber",
1962 "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1963 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1964 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1965 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "FuncNoteList", "FuncNote",
1966 "OptFuncNotes", "OptGC", "OptAlign", "OptCAlign", "SectionString",
1967 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType",
1968 "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI",
1969 "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1970 "ThreadLocal", "AliaseeRef", "Module", "DefinitionList", "Definition",
1971 "@1", "@2", "@3", "@4", "@5", "AsmBlock", "TargetDefinition",
1972 "LibrariesDefinition", "LibList", "ArgListH", "ArgList",
1973 "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", "Function",
1974 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1975 "ValueRef", "ResolvedVal", "ReturnedVal", "BasicBlockList", "BasicBlock",
1976 "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", "PHIList",
1977 "ParamList", "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1978 "OptVolatile", "MemoryInst", 0
1983 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1985 static const yytype_uint16 yytoknum[] =
1987 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1988 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1989 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1990 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1991 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1992 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1993 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1994 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1995 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1996 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1997 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1998 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1999 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2000 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2001 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2002 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
2003 415, 416, 40, 41, 61, 44, 42, 92, 91, 120,
2004 93, 60, 62, 123, 125, 99
2008 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2009 static const yytype_uint16 yyr1[] =
2011 0, 176, 177, 177, 177, 177, 177, 177, 177, 177,
2012 177, 178, 178, 178, 178, 178, 178, 179, 179, 179,
2013 179, 179, 179, 179, 179, 179, 179, 179, 179, 180,
2014 180, 180, 180, 180, 180, 180, 180, 180, 180, 181,
2015 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
2016 181, 181, 181, 181, 181, 182, 183, 183, 183, 183,
2017 183, 184, 184, 184, 185, 185, 186, 186, 187, 187,
2018 188, 189, 189, 190, 190, 191, 192, 192, 192, 192,
2019 192, 192, 193, 193, 193, 194, 194, 194, 194, 195,
2020 195, 195, 196, 196, 196, 196, 196, 197, 197, 197,
2021 198, 198, 198, 198, 198, 198, 198, 198, 199, 199,
2022 199, 199, 199, 199, 199, 199, 199, 199, 200, 200,
2023 201, 201, 201, 201, 201, 201, 201, 202, 202, 203,
2024 203, 204, 204, 204, 205, 205, 206, 206, 207, 207,
2025 208, 208, 209, 210, 210, 211, 211, 212, 212, 213,
2026 213, 213, 213, 213, 213, 213, 214, 214, 214, 214,
2027 214, 214, 214, 214, 214, 214, 214, 214, 214, 215,
2028 216, 216, 217, 217, 218, 218, 218, 218, 219, 219,
2029 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
2030 220, 220, 220, 220, 220, 220, 220, 220, 220, 220,
2031 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
2032 221, 221, 221, 221, 222, 222, 223, 223, 224, 224,
2033 225, 225, 226, 226, 227, 227, 229, 228, 230, 228,
2034 228, 228, 228, 231, 228, 232, 228, 233, 228, 228,
2035 228, 228, 234, 235, 235, 236, 237, 237, 237, 238,
2036 238, 239, 239, 239, 239, 240, 241, 241, 242, 243,
2037 243, 244, 245, 246, 246, 247, 247, 247, 247, 247,
2038 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
2039 247, 247, 247, 247, 247, 248, 248, 248, 248, 249,
2040 249, 250, 251, 251, 252, 252, 253, 253, 254, 254,
2041 254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2042 256, 256, 257, 257, 258, 258, 259, 259, 259, 259,
2043 259, 260, 260, 261, 261, 262, 262, 263, 263, 263,
2044 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
2045 263, 263, 264, 264, 265, 265, 265, 265, 265, 265,
2046 265, 265, 265, 265, 265
2049 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2050 static const yytype_uint8 yyr2[] =
2052 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2053 1, 1, 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, 0, 4, 0, 2, 0,
2059 2, 1, 1, 1, 0, 2, 1, 1, 1, 1,
2060 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
2061 1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
2062 0, 1, 1, 1, 1, 1, 1, 2, 1, 1,
2063 1, 1, 1, 1, 1, 1, 1, 2, 0, 2,
2064 1, 1, 1, 1, 1, 1, 1, 0, 2, 1,
2065 3, 3, 3, 1, 0, 4, 0, 2, 0, 2,
2066 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
2067 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2068 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
2069 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
2070 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
2071 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2072 6, 5, 8, 6, 6, 7, 7, 7, 7, 6,
2073 8, 8, 5, 7, 3, 1, 1, 1, 1, 0,
2074 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
2075 3, 3, 3, 0, 8, 0, 9, 0, 9, 5,
2076 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
2077 3, 1, 3, 1, 0, 11, 1, 1, 4, 1,
2078 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
2079 1, 1, 1, 1, 1, 3, 3, 2, 2, 3,
2080 2, 5, 4, 1, 5, 1, 1, 1, 1, 1,
2081 1, 2, 1, 3, 2, 2, 3, 3, 2, 0,
2082 1, 2, 2, 3, 9, 9, 8, 14, 1, 1,
2083 6, 5, 2, 2, 6, 7, 4, 4, 6, 6,
2084 0, 0, 3, 2, 3, 2, 1, 5, 5, 6,
2085 6, 6, 6, 4, 6, 4, 4, 6, 6, 2,
2086 8, 1, 1, 0, 3, 6, 3, 6, 2, 5,
2090 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2091 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2092 means the default is an error. */
2093 static const yytype_uint16 yydefact[] =
2095 74, 61, 71, 62, 72, 63, 228, 226, 0, 0,
2096 0, 0, 0, 0, 85, 73, 0, 74, 224, 89,
2097 92, 0, 0, 240, 0, 0, 68, 0, 75, 76,
2098 78, 77, 79, 82, 80, 83, 81, 84, 86, 87,
2099 88, 85, 85, 219, 1, 225, 90, 91, 85, 229,
2100 93, 94, 95, 96, 85, 299, 227, 299, 0, 0,
2101 248, 241, 242, 230, 285, 286, 232, 149, 150, 151,
2102 154, 153, 152, 155, 156, 0, 0, 0, 0, 287,
2103 288, 157, 231, 159, 219, 219, 97, 218, 0, 100,
2104 100, 300, 295, 69, 259, 260, 261, 294, 243, 244,
2105 247, 0, 177, 160, 0, 0, 0, 0, 166, 178,
2106 0, 0, 177, 0, 0, 0, 99, 98, 0, 216,
2107 217, 0, 0, 101, 102, 103, 104, 105, 106, 0,
2108 262, 0, 0, 343, 343, 298, 0, 245, 176, 118,
2109 172, 174, 0, 0, 0, 0, 0, 0, 165, 0,
2110 0, 158, 0, 0, 171, 0, 170, 0, 239, 149,
2111 150, 151, 154, 153, 152, 0, 0, 67, 67, 107,
2112 0, 256, 257, 258, 70, 342, 326, 0, 0, 0,
2113 0, 100, 308, 309, 2, 3, 4, 5, 6, 7,
2114 8, 9, 10, 14, 15, 16, 11, 12, 13, 0,
2115 0, 0, 0, 0, 0, 0, 0, 17, 18, 19,
2116 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
2117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2118 0, 296, 100, 312, 0, 341, 297, 313, 246, 169,
2119 0, 127, 67, 67, 168, 0, 179, 0, 127, 67,
2120 67, 0, 220, 197, 198, 193, 195, 194, 196, 199,
2121 192, 188, 189, 0, 0, 0, 0, 0, 0, 0,
2122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2123 0, 191, 190, 233, 0, 325, 302, 67, 292, 301,
2124 0, 0, 55, 0, 0, 29, 30, 31, 32, 33,
2125 34, 35, 36, 37, 38, 0, 53, 54, 49, 50,
2126 51, 52, 39, 40, 41, 42, 43, 44, 45, 46,
2127 47, 48, 0, 0, 0, 140, 140, 348, 67, 67,
2128 339, 0, 0, 0, 0, 0, 67, 67, 67, 67,
2129 67, 0, 0, 0, 0, 0, 109, 111, 110, 108,
2130 112, 113, 114, 115, 116, 119, 175, 173, 162, 163,
2131 164, 167, 66, 161, 235, 237, 0, 0, 0, 0,
2132 0, 0, 0, 0, 0, 0, 0, 0, 181, 215,
2133 0, 0, 0, 185, 0, 182, 0, 0, 0, 145,
2134 254, 265, 266, 267, 268, 269, 274, 270, 271, 272,
2135 273, 263, 0, 0, 0, 0, 283, 290, 289, 291,
2136 0, 0, 303, 0, 0, 67, 67, 67, 67, 0,
2137 344, 0, 346, 321, 0, 0, 0, 0, 0, 0,
2138 0, 0, 0, 0, 0, 0, 0, 0, 67, 0,
2139 117, 124, 123, 120, 122, 121, 125, 126, 128, 145,
2140 145, 0, 0, 0, 0, 0, 321, 0, 0, 0,
2141 0, 0, 0, 0, 180, 166, 178, 0, 183, 184,
2142 0, 0, 0, 0, 234, 253, 118, 251, 0, 264,
2143 0, 277, 0, 0, 0, 280, 0, 278, 293, 0,
2144 0, 0, 0, 0, 0, 0, 0, 0, 0, 352,
2145 0, 0, 0, 335, 336, 0, 0, 0, 0, 353,
2146 0, 0, 0, 333, 0, 140, 0, 236, 238, 67,
2147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2148 0, 214, 187, 0, 0, 0, 0, 0, 0, 147,
2149 145, 65, 0, 127, 0, 276, 166, 0, 275, 279,
2150 0, 0, 320, 0, 0, 0, 0, 140, 141, 140,
2151 0, 0, 0, 0, 0, 0, 351, 323, 0, 67,
2152 327, 328, 320, 0, 349, 67, 221, 0, 0, 0,
2153 0, 201, 0, 0, 0, 0, 212, 0, 186, 0,
2154 0, 67, 142, 148, 146, 64, 250, 252, 118, 143,
2155 0, 282, 0, 0, 0, 118, 118, 0, 329, 330,
2156 331, 332, 345, 347, 322, 0, 0, 334, 337, 338,
2157 324, 0, 0, 140, 0, 0, 0, 0, 0, 209,
2158 0, 0, 0, 203, 204, 200, 65, 144, 138, 284,
2159 281, 0, 0, 0, 0, 127, 0, 314, 0, 354,
2160 127, 350, 205, 206, 207, 208, 0, 0, 0, 213,
2161 249, 0, 136, 0, 306, 0, 0, 109, 111, 118,
2162 118, 0, 118, 118, 315, 340, 202, 210, 211, 139,
2163 0, 134, 304, 0, 305, 0, 317, 316, 0, 0,
2164 0, 137, 0, 255, 0, 0, 0, 118, 118, 0,
2165 0, 0, 0, 319, 318, 0, 133, 0, 129, 311,
2166 0, 0, 0, 135, 0, 310, 0, 132, 131, 130,
2170 /* YYDEFGOTO[NTERM-NUM]. */
2171 static const yytype_int16 yydefgoto[] =
2173 -1, 278, 279, 280, 305, 322, 165, 166, 79, 596,
2174 113, 12, 134, 80, 14, 15, 41, 42, 43, 48,
2175 54, 118, 129, 355, 239, 448, 358, 707, 708, 693,
2176 681, 662, 420, 539, 638, 474, 540, 81, 167, 140,
2177 157, 141, 142, 110, 379, 406, 380, 121, 88, 158,
2178 16, 17, 18, 20, 19, 389, 449, 450, 63, 23,
2179 61, 101, 477, 478, 130, 173, 55, 96, 56, 49,
2180 480, 407, 83, 409, 288, 289, 57, 92, 93, 231,
2181 666, 135, 330, 607, 499, 509, 232, 233, 234, 235
2184 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2186 #define YYPACT_NINF -613
2187 static const yytype_int16 yypact[] =
2189 872, -613, -613, -613, -613, -613, -613, -613, 37, -106,
2190 25, -23, 155, 44, -11, -613, 189, 1045, -613, 66,
2191 239, 56, 60, -613, 64, 218, -613, 1877, -613, -613,
2192 -613, -613, -613, -613, -613, -613, -613, -613, -613, -613,
2193 -613, 178, 178, 181, -613, -613, -613, -613, 178, -613,
2194 -613, -613, -613, -613, 178, 223, -613, 1, 226, 230,
2195 237, -613, -613, -613, -613, -613, 116, -613, -613, -613,
2196 -613, -613, -613, -613, -613, 291, 296, 3, 55, -613,
2197 -613, -613, 49, -613, 278, 278, 194, -613, 252, 485,
2198 485, -613, -613, 144, -613, -613, -613, -613, -613, -613,
2199 -613, -109, 1581, -613, 152, 161, 312, 116, -613, 49,
2200 -117, 171, 1581, 174, 252, 252, -613, -613, 1625, -613,
2201 -613, 1918, 342, -613, -613, -613, -613, -613, -613, 1959,
2202 -613, -14, 186, 2193, 2193, -613, 331, -613, -613, 49,
2203 -613, 192, 200, 2003, 2003, 193, -115, 2003, -613, 371,
2204 214, -613, 1918, 2003, 116, 220, 49, 163, -613, 267,
2205 376, 384, 390, 396, 400, 305, 413, 1444, 375, -613,
2206 279, -613, -613, -613, -613, -613, -613, 377, 2044, 173,
2207 427, 485, -613, -613, -613, -613, -613, -613, -613, -613,
2208 -613, -613, -613, -613, -613, -613, -613, -613, -613, 594,
2209 574, 594, 574, 2003, 2003, 2003, 2003, -613, -613, -613,
2210 -613, -613, -613, -613, -613, -613, -613, -613, -613, 2003,
2211 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003,
2212 2003, -613, 485, -613, 253, -613, -613, -613, -613, 108,
2213 1666, -613, -31, -36, -613, 271, 49, 276, -613, 375,
2214 -1, 1625, -613, -613, -613, -613, -613, -613, -613, -613,
2215 -613, -613, -613, 594, 574, 594, 574, 282, 283, 285,
2216 289, 290, 292, 293, 1707, 2085, 566, 424, 294, 297,
2217 299, -613, -613, -613, 300, -613, 116, 860, -613, 295,
2218 1033, 1033, -613, 1033, 1959, -613, -613, -613, -613, -613,
2219 -613, -613, -613, -613, -613, 2003, -613, -613, -613, -613,
2220 -613, -613, -613, -613, -613, -613, -613, -613, -613, -613,
2221 -613, -613, 2003, 2003, 2003, -37, 26, -613, 860, 65,
2222 306, 313, 316, 322, 323, 326, 860, 860, 860, 860,
2223 860, 411, 1959, 2003, 2003, 454, -613, -613, -613, -613,
2224 -613, -613, -613, -613, -613, -613, -613, -613, 284, -613,
2225 -613, -613, -613, 284, -613, 174, 432, 315, 330, 332,
2226 335, 1918, 1918, 1918, 1918, 1918, 1918, 1918, -613, -613,
2227 -55, 792, -28, -613, -114, -613, 1918, 1918, 1918, 328,
2228 1751, -613, -613, -613, -613, -613, -613, -613, -613, -613,
2229 -613, 437, 1792, 2129, 1490, 477, -613, -613, -613, -613,
2230 2003, 336, -613, 339, 1033, 860, 860, 860, 860, 33,
2231 -613, 34, -613, -613, 1033, 341, 2003, 2003, 2003, 2003,
2232 2003, 346, 347, 349, 350, 353, 2003, 1033, 860, 357,
2233 -613, -613, -613, -613, -613, -613, -613, -613, -613, 328,
2234 328, 2003, 1918, 1918, 1918, 1918, -613, 358, 359, 360,
2235 363, 347, 364, 1918, -613, 361, 1308, -110, -613, -613,
2236 365, 366, 462, -5, -613, -613, 49, 367, 372, -613,
2237 514, -613, -25, 1536, 47, -613, -52, -613, -613, 525,
2238 527, 393, 392, 395, 397, 398, 1033, 554, 1033, 399,
2239 401, 1033, 402, 49, -613, 406, 407, 557, 561, 419,
2240 2003, 1033, 1033, 49, 425, 426, 2003, -613, -613, -16,
2241 428, 429, 433, 434, 104, 1918, 1918, 1918, 1918, 149,
2242 1918, -613, -613, 420, 1918, 1918, 2003, 575, 598, -613,
2243 328, 521, 1833, -613, 438, -613, 435, 81, -613, -613,
2244 1033, 1033, 2170, 1033, 1033, 1033, 1033, 426, -613, 426,
2245 2003, 1033, 439, 2003, 2003, 2003, -613, -613, 601, 860,
2246 -613, -613, 2170, 552, -613, 860, -613, 1918, 1918, 1918,
2247 1918, -613, 445, 455, 452, 456, -613, 347, -613, 459,
2248 460, -9, -613, -613, -613, -613, -613, -613, 49, 13,
2249 602, -613, 453, 461, 463, 75, 49, 182, -613, -613,
2250 -613, -613, -613, -613, -613, 458, 1033, -613, -613, -613,
2251 -613, 347, 191, 426, 466, 467, 469, 471, 1918, -613,
2252 1918, 1918, 195, -613, -613, -613, 521, -613, 581, -613,
2253 -613, 620, -3, 703, 703, -613, 2211, -613, 468, 419,
2254 -613, -613, -613, -613, -613, -613, 476, 482, 483, -613,
2255 -613, 636, 494, 1033, -613, 1172, 4, 487, 488, -613,
2256 -613, 236, 75, 49, -613, 284, -613, -613, -613, -613,
2257 629, 499, -613, 489, -613, 1172, 108, 108, 638, 703,
2258 703, -613, 495, -613, 639, 493, 1033, -613, -613, -135,
2259 1033, 642, 586, 108, 108, 497, -613, 196, -613, -613,
2260 1033, 648, 217, -613, -135, -613, 1033, -613, -613, -613,
2264 /* YYPGOTO[NTERM-NUM]. */
2265 static const yytype_int16 yypgoto[] =
2267 -613, 258, 274, 287, -180, -175, -177, -613, 0, 36,
2268 -126, 580, -613, 11, -613, -613, -613, -613, 54, -613,
2269 -613, -613, -138, -613, -463, -613, -239, -613, -15, -613,
2270 -613, -613, -310, 101, -613, -424, -613, -613, -26, 464,
2271 -125, -613, 591, 599, -111, -165, -270, 298, 348, 465,
2272 -613, -613, 696, -613, -613, -613, -613, -613, -613, -613,
2273 -613, -613, -613, -613, 624, -613, -613, -613, -613, -613,
2274 -613, -612, -48, 58, -123, -613, -613, 658, -613, 583,
2275 -613, -613, -613, 146, 263, -449, -613, 590, -613, -613
2278 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2279 positive, shift that token. If negative, reduce the rule which
2280 number is the opposite. If zero, do what YYDEFACT says.
2281 If YYTABLE_NINF, syntax error. */
2282 #define YYTABLE_NINF -224
2283 static const yytype_int16 yytable[] =
2285 11, 82, 281, 293, 170, 382, 384, 105, 292, 363,
2286 168, 13, 529, 541, 171, 292, 422, 11, 111, 111,
2287 705, 323, 91, 706, 111, 517, 518, 324, 13, 537,
2288 94, 29, 30, 31, 32, 33, 34, 35, 36, 111,
2289 37, 249, 283, 294, 496, 498, 111, 537, 147, 538,
2290 147, 463, 109, 683, 111, 463, 136, 148, 24, 245,
2291 469, 137, 64, 65, 533, 107, 67, 68, 69, 70,
2292 71, 72, 73, 695, 1, 2, 139, 3, 4, 5,
2293 109, 111, 327, 367, 25, 369, 139, 497, 497, 368,
2294 21, 370, 156, 11, 342, 84, 85, 331, 332, 333,
2295 334, 335, 89, 156, 111, 74, 22, 341, 90, 252,
2296 463, 467, 46, 463, 47, 464, 594, 242, 243, 282,
2297 111, 246, 549, 364, 365, 112, 112, 250, 419, -67,
2298 -155, 112, 482, 484, 486, 636, 360, 463, 632, 359,
2299 463, 26, 643, 644, 468, 545, 112, 576, 38, 39,
2300 40, 132, 287, 112, 635, 441, 442, 443, 444, 172,
2301 445, 112, 345, 1, 446, 447, 3, 664, 5, 414,
2302 64, 65, 649, 27, 684, 95, 106, 325, 326, 287,
2303 328, 284, 1, 2, 290, 3, 4, 5, 112, 44,
2304 291, 421, -67, 329, 287, 287, 287, 287, 287, 336,
2305 337, 338, 339, 340, 287, 574, 686, 687, 28, 689,
2306 690, 112, 463, 547, 139, -67, 86, 437, 87, 548,
2307 58, 439, 75, 76, 59, 156, 77, 112, 78, 108,
2308 346, 347, 60, 424, 703, 704, 116, -155, 117, 408,
2309 62, -155, 408, 408, 91, 408, 463, 612, 98, 613,
2310 348, 349, 99, 350, 351, 602, 352, 353, 354, 100,
2311 456, 457, 458, 459, 460, 461, 462, 581, 156, 560,
2312 -55, -55, -55, -55, 688, 470, 471, 472, 102, 415,
2313 408, 50, 51, 52, 119, 120, 53, 488, 408, 408,
2314 408, 408, 408, 253, 254, 103, 416, 417, 418, 2,
2315 104, 281, 4, 502, 599, 504, 505, 506, 255, 256,
2316 257, 258, 586, 651, 568, 87, 156, 438, 287, 64,
2317 65, 143, 107, 67, 68, 69, 70, 71, 72, 73,
2318 144, 1, 2, 149, 3, 4, 5, 38, 39, 40,
2319 151, 520, 521, 522, 523, 645, 169, 646, 411, 412,
2320 174, 413, 531, 238, 650, 466, 646, 240, 659, 713,
2321 568, 714, 74, 241, 476, 244, 408, 408, 408, 408,
2322 408, 343, 344, 717, 718, 247, 408, 248, 441, 442,
2323 443, 444, 251, 445, 287, -56, 423, 446, 447, 408,
2324 408, 228, 228, -57, 431, 432, 433, 434, 435, -60,
2325 287, 503, 287, 287, 287, -59, 671, 229, 229, -58,
2326 513, 675, 152, 153, 582, 583, 584, 585, 282, 587,
2327 230, 230, 259, 589, 590, 519, 441, 442, 443, 444,
2328 111, 445, 114, 115, 285, 446, 447, 614, 292, 362,
2329 617, 618, 619, 361, 371, 372, 385, 373, 408, 436,
2330 408, 374, 375, 408, 376, 377, 386, 466, 440, 387,
2331 410, 388, 390, 408, 408, 665, 624, 625, 626, 627,
2332 451, 425, 491, 492, 493, 494, 495, 452, 426, 75,
2333 76, 427, 500, 77, 569, 78, 145, 428, 429, 685,
2334 575, 430, 453, 473, 454, 514, 515, 455, 479, 487,
2335 536, 489, 408, 408, 490, 408, 408, 408, 408, 501,
2336 591, 507, 508, 408, 510, 511, 598, 656, 512, 657,
2337 658, 408, 516, 525, 526, 527, 606, 408, 528, 530,
2338 534, 535, 542, 532, 287, 543, 544, 287, 287, 287,
2339 1, 595, 550, 3, 551, 5, 606, 122, 123, 124,
2340 125, 126, 127, 128, 557, 552, 559, 553, 558, 562,
2341 554, 566, 555, 556, 560, 567, 561, 563, 408, 570,
2342 571, 564, 565, 64, 65, 345, 107, 159, 160, 161,
2343 162, 163, 164, 73, 568, 1, 2, 572, 3, 4,
2344 5, 573, 588, 577, 578, 408, 408, 592, 579, 580,
2345 306, 307, 593, 600, 616, 620, 497, 601, 603, 604,
2346 628, 608, 609, 610, 611, 408, 74, 630, 629, 615,
2347 673, 631, 633, 634, 639, 640, 641, 621, 647, 652,
2348 653, 642, 654, 623, 655, 661, 595, 663, 674, 676,
2349 679, 408, 408, 346, 347, 677, 678, 680, 408, -18,
2350 -19, 691, 408, 692, 694, 696, 700, 699, 701, 710,
2351 711, 712, 408, 348, 349, 716, 350, 351, 408, 352,
2352 353, 354, 660, 133, 648, 308, 309, 310, 311, 312,
2353 313, 314, 315, 316, 317, 318, 319, 320, 321, 295,
2354 296, 297, 298, 299, 300, 301, 302, 303, 304, 719,
2355 637, 669, 670, 150, 357, 146, 391, 392, 393, 394,
2356 64, 65, 395, 45, 131, 97, 366, 236, 622, 524,
2357 0, 682, 1, 2, 237, 3, 4, 5, 396, 397,
2358 398, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2359 383, 0, 0, 399, 400, 0, 0, 697, 698, 0,
2360 0, 0, 0, 0, 702, 0, 0, 345, 709, 0,
2361 0, 0, 401, 0, 0, 0, 0, 0, 715, 0,
2362 0, 0, 0, 0, 720, 0, 0, 0, 0, 184,
2363 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2364 195, 196, 197, 198, 263, 264, 265, 266, 0, 64,
2365 65, 0, 107, 159, 160, 161, 162, 163, 164, 73,
2366 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2367 0, 0, 0, 267, 207, 667, 668, 210, 211, 212,
2368 213, 214, 215, 216, 217, 218, 0, 268, 0, 269,
2369 270, 271, 74, 272, 273, 348, 349, 0, 350, 351,
2370 0, 352, 353, 354, 0, 0, 0, 0, 0, 0,
2371 0, 0, 0, 391, 392, 393, 394, 64, 65, 395,
2372 0, 402, -223, 0, 403, 0, 404, 0, 405, 1,
2373 2, 0, 3, 4, 5, 396, 397, 398, 0, 0,
2374 -69, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2375 399, 400, 6, 7, 0, 0, 0, 0, 0, 0,
2376 0, 0, 0, 0, 0, 111, 0, 0, 0, 401,
2377 0, 0, 0, 0, 8, 0, 0, 0, 9, 0,
2378 0, 0, 10, 0, 0, 0, 184, 185, 186, 187,
2379 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
2380 198, 263, 264, 265, 266, 0, 0, 0, 0, 75,
2381 76, 0, 0, 77, 0, 78, 465, 0, 0, 0,
2382 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2383 267, 207, 208, 209, 210, 211, 212, 213, 214, 215,
2384 216, 217, 218, 0, 268, 0, 269, 270, 271, 0,
2385 272, 273, 0, 0, 0, 0, 0, 0, 0, 0,
2386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2387 0, 0, 112, 0, 0, 0, 0, 0, 402, 0,
2388 0, 403, 0, 404, 0, 405, 391, 392, 393, 394,
2389 64, 65, 395, 0, 0, -222, 0, 0, 0, 0,
2390 0, 0, 1, 2, 0, 3, 4, 5, 396, 397,
2391 398, 0, 0, -69, 1, 2, 0, 3, 4, 5,
2392 0, 0, 0, 399, 400, 6, 7, 0, 0, 0,
2393 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2394 0, 0, 401, 0, 0, 0, 0, 8, 0, 0,
2395 0, 9, 0, 0, 0, 10, 0, 0, 0, 184,
2396 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2397 195, 196, 197, 198, 263, 264, 265, 266, 0, 0,
2398 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2400 0, 0, 0, 267, 207, 208, 209, 210, 211, 212,
2401 213, 214, 215, 216, 217, 218, 0, 268, 0, 269,
2402 270, 271, 0, 272, 273, 391, 392, 393, 394, 0,
2403 0, 395, 0, 0, 0, 0, 0, 0, 0, 0,
2404 0, 0, 0, 0, 0, 0, 0, 396, 397, 398,
2405 0, 402, 0, 0, 403, 0, 404, 0, 405, 0,
2406 0, 0, 399, 400, 0, 0, 0, 0, 0, 0,
2407 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2408 0, 401, 0, 0, 0, 0, 0, 0, 0, 0,
2409 0, 0, 0, 0, 0, 0, 0, 0, 184, 185,
2410 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
2411 196, 197, 198, 263, 264, 265, 266, 0, 0, 0,
2412 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2413 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2414 0, 0, 267, 207, 208, 209, 210, 211, 212, 213,
2415 214, 215, 216, 217, 218, 0, 268, 0, 269, 270,
2416 271, 0, 272, 273, 0, 64, 65, 0, 0, 0,
2417 0, 0, 0, 0, 0, 0, 0, 1, 2, 0,
2418 3, 4, 5, 260, 0, 0, 0, 0, 0, 0,
2419 402, 0, 0, 403, 0, 404, 0, 405, 261, 262,
2420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2421 0, 0, 0, 111, 0, 0, 0, 0, 0, 0,
2422 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2423 0, 0, 0, 0, 184, 185, 186, 187, 188, 189,
2424 190, 191, 192, 193, 194, 195, 196, 197, 198, 263,
2425 264, 265, 266, 0, 0, 0, 0, 0, 0, 0,
2426 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2427 0, 0, 0, 0, 0, 0, 0, 0, 267, 207,
2428 208, 209, 210, 211, 212, 213, 214, 215, 216, 217,
2429 218, 0, 268, 0, 269, 270, 271, 0, 272, 273,
2430 0, 64, 65, 0, 0, 0, 0, 0, 0, 0,
2431 0, 0, 0, 1, 2, 0, 3, 4, 5, 260,
2432 112, 0, 0, 0, -67, 0, 274, 0, 0, 275,
2433 0, 276, 0, 277, 261, 262, 0, 0, 0, 0,
2434 0, 0, 0, 0, 0, 0, 0, 64, 65, 111,
2435 107, 159, 160, 161, 162, 163, 164, 73, 0, 1,
2436 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2437 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2438 194, 195, 196, 197, 198, 263, 264, 265, 266, 0,
2439 74, 0, 0, 64, 65, 0, 107, 159, 160, 161,
2440 162, 163, 164, 73, 0, 1, 2, 0, 3, 4,
2441 5, 0, 0, 0, 267, 207, 208, 209, 210, 211,
2442 212, 213, 214, 215, 216, 217, 218, 0, 268, 0,
2443 269, 270, 271, 0, 272, 273, 74, 0, 64, 65,
2444 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2445 1, 2, 0, 3, 4, 5, 112, 0, 0, 0,
2446 0, 0, 274, 0, 0, 275, 0, 276, 0, 277,
2447 138, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2448 0, 74, 64, 65, 0, 154, 67, 68, 69, 70,
2449 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2450 0, 0, 0, 0, 0, 0, 0, 75, 76, 0,
2451 0, 77, 0, 78, 485, 0, 0, 0, 0, 0,
2452 0, 0, 0, 64, 65, 74, 107, 67, 68, 69,
2453 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2454 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2455 0, 0, 0, 75, 76, 356, 0, 77, 0, 78,
2456 546, 0, 0, 0, 64, 65, 74, 107, 159, 160,
2457 161, 162, 163, 164, 73, 0, 1, 2, 0, 3,
2458 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2459 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2460 0, 155, 77, 0, 78, 0, 0, 74, 64, 65,
2461 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2462 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2463 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2464 475, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2465 65, 74, 107, 159, 160, 161, 162, 163, 164, 73,
2466 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2467 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2468 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2469 64, 65, 74, 107, 67, 68, 69, 70, 71, 72,
2470 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2472 0, 0, 597, 0, 75, 76, 0, 378, 77, 0,
2473 78, 0, 0, 74, 64, 65, 0, 66, 67, 68,
2474 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2475 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2476 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2477 0, 0, 77, 0, 78, 64, 65, 74, 107, 159,
2478 160, 161, 162, 163, 164, 73, 0, 1, 2, 0,
2479 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2480 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2481 76, 0, 481, 77, 0, 78, 64, 65, 74, 154,
2482 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2483 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2485 75, 76, 0, 0, 77, 0, 78, 0, 0, 74,
2486 64, 65, 0, 107, 67, 68, 69, 70, 71, 72,
2487 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2488 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2489 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2490 78, 64, 65, 74, 286, 67, 68, 69, 70, 71,
2491 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2492 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2493 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2494 0, 78, 64, 65, 74, 107, 159, 160, 161, 162,
2495 163, 164, 73, 0, 1, 2, 0, 3, 4, 5,
2496 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2497 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2498 77, 0, 78, 0, 0, 74, 64, 65, 0, 107,
2499 159, 160, 161, 162, 163, 164, 73, 0, 1, 2,
2500 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2501 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2502 75, 76, 0, 0, 77, 0, 78, 64, 65, 74,
2503 107, 67, 68, 69, 70, 71, 72, 605, 0, 1,
2504 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2505 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2506 0, 75, 76, 0, 0, 77, 0, 78, 64, 65,
2507 74, 107, 67, 68, 69, 70, 71, 72, 672, 175,
2508 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2509 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2510 176, 177, 75, 76, 0, 0, 77, 0, 381, 0,
2511 0, 74, 0, 178, 179, 180, 181, 182, 183, 184,
2512 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2513 195, 196, 197, 198, 199, 200, 201, 202, 0, 0,
2514 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2515 77, 0, 483, 0, 0, 0, 0, 0, 203, 204,
2516 205, 0, 0, 206, 207, 208, 209, 210, 211, 212,
2517 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
2518 223, 224, 225, 226, 227, 0, 0, 75, 76, 0,
2519 0, 77, 0, 78, 0, 0, 0, 0, 0, 0,
2520 0, 0, 0, 0, 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, 75, 76,
2526 static const yytype_int16 yycheck[] =
2528 0, 27, 167, 180, 129, 275, 276, 4, 11, 248,
2529 121, 0, 461, 476, 28, 11, 326, 17, 55, 55,
2530 155, 201, 21, 158, 55, 449, 450, 202, 17, 34,
2531 29, 42, 43, 44, 45, 46, 47, 48, 49, 55,
2532 51, 152, 168, 181, 11, 11, 55, 34, 165, 54,
2533 165, 165, 78, 665, 55, 165, 165, 174, 164, 174,
2534 174, 170, 7, 8, 174, 10, 11, 12, 13, 14,
2535 15, 16, 17, 685, 19, 20, 102, 22, 23, 24,
2536 106, 55, 205, 263, 59, 265, 112, 54, 54, 264,
2537 53, 266, 118, 93, 232, 41, 42, 220, 221, 222,
2538 223, 224, 48, 129, 55, 50, 69, 230, 54, 157,
2539 165, 381, 46, 165, 48, 170, 540, 143, 144, 167,
2540 55, 147, 174, 249, 250, 162, 162, 153, 165, 166,
2541 55, 162, 402, 403, 404, 598, 172, 165, 587, 170,
2542 165, 164, 605, 606, 172, 170, 162, 163, 159, 160,
2543 161, 7, 178, 162, 163, 142, 143, 144, 145, 173,
2544 147, 162, 54, 19, 151, 152, 22, 170, 24, 294,
2545 7, 8, 621, 18, 170, 174, 173, 203, 204, 205,
2546 206, 170, 19, 20, 11, 22, 23, 24, 162, 0,
2547 17, 165, 166, 219, 220, 221, 222, 223, 224, 225,
2548 226, 227, 228, 229, 230, 515, 669, 670, 164, 672,
2549 673, 162, 165, 483, 240, 166, 35, 342, 37, 172,
2550 164, 344, 167, 168, 164, 251, 171, 162, 173, 174,
2551 122, 123, 168, 168, 697, 698, 42, 162, 44, 287,
2552 22, 166, 290, 291, 21, 293, 165, 557, 22, 559,
2553 142, 143, 22, 145, 146, 174, 148, 149, 150, 22,
2554 371, 372, 373, 374, 375, 376, 377, 163, 294, 165,
2555 3, 4, 5, 6, 38, 386, 387, 388, 162, 305,
2556 328, 42, 43, 44, 32, 33, 47, 410, 336, 337,
2557 338, 339, 340, 26, 27, 4, 322, 323, 324, 20,
2558 4, 466, 23, 426, 543, 428, 429, 430, 3, 4,
2559 5, 6, 163, 623, 165, 37, 342, 343, 344, 7,
2560 8, 169, 10, 11, 12, 13, 14, 15, 16, 17,
2561 169, 19, 20, 162, 22, 23, 24, 159, 160, 161,
2562 166, 452, 453, 454, 455, 163, 4, 165, 290, 291,
2563 164, 293, 463, 22, 163, 381, 165, 165, 163, 163,
2564 165, 165, 50, 163, 390, 172, 414, 415, 416, 417,
2565 418, 118, 119, 156, 157, 4, 424, 163, 142, 143,
2566 144, 145, 162, 147, 410, 9, 328, 151, 152, 437,
2567 438, 133, 134, 9, 336, 337, 338, 339, 340, 9,
2568 426, 427, 428, 429, 430, 9, 645, 133, 134, 9,
2569 436, 650, 114, 115, 525, 526, 527, 528, 466, 530,
2570 133, 134, 9, 534, 535, 451, 142, 143, 144, 145,
2571 55, 147, 84, 85, 57, 151, 152, 560, 11, 163,
2572 563, 564, 565, 172, 162, 162, 22, 162, 496, 38,
2573 498, 162, 162, 501, 162, 162, 162, 483, 4, 162,
2574 165, 162, 162, 511, 512, 642, 577, 578, 579, 580,
2575 38, 165, 414, 415, 416, 417, 418, 162, 165, 167,
2576 168, 165, 424, 171, 510, 173, 174, 165, 165, 666,
2577 516, 165, 162, 165, 162, 437, 438, 162, 61, 22,
2578 38, 165, 550, 551, 165, 553, 554, 555, 556, 168,
2579 536, 165, 165, 561, 165, 165, 542, 628, 165, 630,
2580 631, 569, 165, 165, 165, 165, 552, 575, 165, 165,
2581 165, 165, 165, 172, 560, 163, 22, 563, 564, 565,
2582 19, 541, 17, 22, 17, 24, 572, 62, 63, 64,
2583 65, 66, 67, 68, 496, 162, 498, 165, 4, 501,
2584 165, 4, 165, 165, 165, 4, 165, 165, 616, 511,
2585 512, 165, 165, 7, 8, 54, 10, 11, 12, 13,
2586 14, 15, 16, 17, 165, 19, 20, 162, 22, 23,
2587 24, 165, 172, 165, 165, 643, 644, 22, 165, 165,
2588 26, 27, 4, 165, 165, 4, 54, 172, 550, 551,
2589 165, 553, 554, 555, 556, 663, 50, 165, 163, 561,
2590 646, 165, 163, 163, 22, 172, 165, 569, 170, 163,
2591 163, 168, 163, 575, 163, 54, 636, 17, 170, 163,
2592 4, 689, 690, 122, 123, 163, 163, 153, 696, 162,
2593 162, 22, 700, 154, 165, 17, 17, 162, 165, 17,
2594 74, 164, 710, 142, 143, 17, 145, 146, 716, 148,
2595 149, 150, 636, 93, 616, 101, 102, 103, 104, 105,
2596 106, 107, 108, 109, 110, 111, 112, 113, 114, 95,
2597 96, 97, 98, 99, 100, 101, 102, 103, 104, 714,
2598 599, 643, 644, 112, 240, 106, 3, 4, 5, 6,
2599 7, 8, 9, 17, 90, 57, 251, 134, 572, 456,
2600 -1, 663, 19, 20, 134, 22, 23, 24, 25, 26,
2601 27, -1, -1, 167, 168, -1, -1, 171, -1, 173,
2602 174, -1, -1, 40, 41, -1, -1, 689, 690, -1,
2603 -1, -1, -1, -1, 696, -1, -1, 54, 700, -1,
2604 -1, -1, 59, -1, -1, -1, -1, -1, 710, -1,
2605 -1, -1, -1, -1, 716, -1, -1, -1, -1, 76,
2606 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2607 87, 88, 89, 90, 91, 92, 93, 94, -1, 7,
2608 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2609 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2610 -1, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2611 127, 128, 129, 130, 131, 132, -1, 134, -1, 136,
2612 137, 138, 50, 140, 141, 142, 143, -1, 145, 146,
2613 -1, 148, 149, 150, -1, -1, -1, -1, -1, -1,
2614 -1, -1, -1, 3, 4, 5, 6, 7, 8, 9,
2615 -1, 168, 0, -1, 171, -1, 173, -1, 175, 19,
2616 20, -1, 22, 23, 24, 25, 26, 27, -1, -1,
2617 18, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2618 40, 41, 30, 31, -1, -1, -1, -1, -1, -1,
2619 -1, -1, -1, -1, -1, 55, -1, -1, -1, 59,
2620 -1, -1, -1, -1, 52, -1, -1, -1, 56, -1,
2621 -1, -1, 60, -1, -1, -1, 76, 77, 78, 79,
2622 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2623 90, 91, 92, 93, 94, -1, -1, -1, -1, 167,
2624 168, -1, -1, 171, -1, 173, 174, -1, -1, -1,
2625 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2626 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
2627 130, 131, 132, -1, 134, -1, 136, 137, 138, -1,
2628 140, 141, -1, -1, -1, -1, -1, -1, -1, -1,
2629 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2630 -1, -1, 162, -1, -1, -1, -1, -1, 168, -1,
2631 -1, 171, -1, 173, -1, 175, 3, 4, 5, 6,
2632 7, 8, 9, -1, -1, 0, -1, -1, -1, -1,
2633 -1, -1, 19, 20, -1, 22, 23, 24, 25, 26,
2634 27, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2635 -1, -1, -1, 40, 41, 30, 31, -1, -1, -1,
2636 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2637 -1, -1, 59, -1, -1, -1, -1, 52, -1, -1,
2638 -1, 56, -1, -1, -1, 60, -1, -1, -1, 76,
2639 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2640 87, 88, 89, 90, 91, 92, 93, 94, -1, -1,
2641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2642 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2643 -1, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2644 127, 128, 129, 130, 131, 132, -1, 134, -1, 136,
2645 137, 138, -1, 140, 141, 3, 4, 5, 6, -1,
2646 -1, 9, -1, -1, -1, -1, -1, -1, -1, -1,
2647 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
2648 -1, 168, -1, -1, 171, -1, 173, -1, 175, -1,
2649 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2650 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2651 -1, 59, -1, -1, -1, -1, -1, -1, -1, -1,
2652 -1, -1, -1, -1, -1, -1, -1, -1, 76, 77,
2653 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2654 88, 89, 90, 91, 92, 93, 94, -1, -1, -1,
2655 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2656 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2657 -1, -1, 120, 121, 122, 123, 124, 125, 126, 127,
2658 128, 129, 130, 131, 132, -1, 134, -1, 136, 137,
2659 138, -1, 140, 141, -1, 7, 8, -1, -1, -1,
2660 -1, -1, -1, -1, -1, -1, -1, 19, 20, -1,
2661 22, 23, 24, 25, -1, -1, -1, -1, -1, -1,
2662 168, -1, -1, 171, -1, 173, -1, 175, 40, 41,
2663 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2664 -1, -1, -1, 55, -1, -1, -1, -1, -1, -1,
2665 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2666 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
2667 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2668 92, 93, 94, -1, -1, -1, -1, -1, -1, -1,
2669 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2670 -1, -1, -1, -1, -1, -1, -1, -1, 120, 121,
2671 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2672 132, -1, 134, -1, 136, 137, 138, -1, 140, 141,
2673 -1, 7, 8, -1, -1, -1, -1, -1, -1, -1,
2674 -1, -1, -1, 19, 20, -1, 22, 23, 24, 25,
2675 162, -1, -1, -1, 166, -1, 168, -1, -1, 171,
2676 -1, 173, -1, 175, 40, 41, -1, -1, -1, -1,
2677 -1, -1, -1, -1, -1, -1, -1, 7, 8, 55,
2678 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2679 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2680 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2681 86, 87, 88, 89, 90, 91, 92, 93, 94, -1,
2682 50, -1, -1, 7, 8, -1, 10, 11, 12, 13,
2683 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2684 24, -1, -1, -1, 120, 121, 122, 123, 124, 125,
2685 126, 127, 128, 129, 130, 131, 132, -1, 134, -1,
2686 136, 137, 138, -1, 140, 141, 50, -1, 7, 8,
2687 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2688 19, 20, -1, 22, 23, 24, 162, -1, -1, -1,
2689 -1, -1, 168, -1, -1, 171, -1, 173, -1, 175,
2690 39, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2691 -1, 50, 7, 8, -1, 10, 11, 12, 13, 14,
2692 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2693 -1, -1, -1, -1, -1, -1, -1, 167, 168, -1,
2694 -1, 171, -1, 173, 174, -1, -1, -1, -1, -1,
2695 -1, -1, -1, 7, 8, 50, 10, 11, 12, 13,
2696 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2697 24, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2698 -1, -1, -1, 167, 168, 39, -1, 171, -1, 173,
2699 174, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2700 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2701 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2702 -1, -1, -1, -1, -1, -1, -1, -1, 167, 168,
2703 -1, 126, 171, -1, 173, -1, -1, 50, 7, 8,
2704 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2705 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2706 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2707 39, -1, 167, 168, -1, -1, 171, -1, 173, 7,
2708 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2709 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2710 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2711 -1, -1, -1, 167, 168, -1, -1, 171, -1, 173,
2712 7, 8, 50, 10, 11, 12, 13, 14, 15, 16,
2713 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2714 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2715 -1, -1, 39, -1, 167, 168, -1, 170, 171, -1,
2716 173, -1, -1, 50, 7, 8, -1, 10, 11, 12,
2717 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2718 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2719 -1, -1, -1, -1, -1, -1, -1, -1, 167, 168,
2720 -1, -1, 171, -1, 173, 7, 8, 50, 10, 11,
2721 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2722 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2723 -1, -1, -1, -1, -1, -1, -1, -1, -1, 167,
2724 168, -1, 170, 171, -1, 173, 7, 8, 50, 10,
2725 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2726 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2727 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2728 167, 168, -1, -1, 171, -1, 173, -1, -1, 50,
2729 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2730 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2731 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2732 -1, -1, -1, -1, 167, 168, -1, -1, 171, -1,
2733 173, 7, 8, 50, 10, 11, 12, 13, 14, 15,
2734 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2735 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2736 -1, -1, -1, -1, -1, 167, 168, -1, -1, 171,
2737 -1, 173, 7, 8, 50, 10, 11, 12, 13, 14,
2738 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2739 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2740 -1, -1, -1, -1, -1, -1, 167, 168, -1, -1,
2741 171, -1, 173, -1, -1, 50, 7, 8, -1, 10,
2742 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2743 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2744 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2745 167, 168, -1, -1, 171, -1, 173, 7, 8, 50,
2746 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2747 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2748 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2749 -1, 167, 168, -1, -1, 171, -1, 173, 7, 8,
2750 50, 10, 11, 12, 13, 14, 15, 16, 17, 36,
2751 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2752 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2753 57, 58, 167, 168, -1, -1, 171, -1, 173, -1,
2754 -1, 50, -1, 70, 71, 72, 73, 74, 75, 76,
2755 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2756 87, 88, 89, 90, 91, 92, 93, 94, -1, -1,
2757 -1, -1, -1, -1, -1, -1, 167, 168, -1, -1,
2758 171, -1, 173, -1, -1, -1, -1, -1, 115, 116,
2759 117, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2760 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2761 137, 138, 139, 140, 141, -1, -1, 167, 168, -1,
2762 -1, 171, -1, 173, -1, -1, -1, -1, -1, -1,
2763 -1, -1, -1, -1, -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, 167, 168,
2766 -1, -1, 171, -1, 173
2769 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2770 symbol of state STATE-NUM. */
2771 static const yytype_uint16 yystos[] =
2773 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2774 60, 184, 187, 189, 190, 191, 226, 227, 228, 230,
2775 229, 53, 69, 235, 164, 59, 164, 18, 164, 42,
2776 43, 44, 45, 46, 47, 48, 49, 51, 159, 160,
2777 161, 192, 193, 194, 0, 228, 46, 48, 195, 245,
2778 42, 43, 44, 47, 196, 242, 244, 252, 164, 164,
2779 168, 236, 22, 234, 7, 8, 10, 11, 12, 13,
2780 14, 15, 16, 17, 50, 167, 168, 171, 173, 184,
2781 189, 213, 214, 248, 194, 194, 35, 37, 224, 194,
2782 194, 21, 253, 254, 29, 174, 243, 253, 22, 22,
2783 22, 237, 162, 4, 4, 4, 173, 10, 174, 214,
2784 219, 55, 162, 186, 224, 224, 42, 44, 197, 32,
2785 33, 223, 62, 63, 64, 65, 66, 67, 68, 198,
2786 240, 240, 7, 187, 188, 257, 165, 170, 39, 214,
2787 215, 217, 218, 169, 169, 174, 219, 165, 174, 162,
2788 218, 166, 223, 223, 10, 126, 214, 216, 225, 11,
2789 12, 13, 14, 15, 16, 182, 183, 214, 220, 4,
2790 216, 28, 173, 241, 164, 36, 57, 58, 70, 71,
2791 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
2792 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2793 92, 93, 94, 115, 116, 117, 120, 121, 122, 123,
2794 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2795 134, 135, 136, 137, 138, 139, 140, 141, 177, 178,
2796 179, 255, 262, 263, 264, 265, 255, 263, 22, 200,
2797 165, 163, 214, 214, 172, 174, 214, 4, 163, 220,
2798 214, 162, 248, 26, 27, 3, 4, 5, 6, 9,
2799 25, 40, 41, 91, 92, 93, 94, 120, 134, 136,
2800 137, 138, 140, 141, 168, 171, 173, 175, 177, 178,
2801 179, 221, 248, 186, 189, 57, 10, 214, 250, 251,
2802 11, 17, 11, 182, 198, 95, 96, 97, 98, 99,
2803 100, 101, 102, 103, 104, 180, 26, 27, 101, 102,
2804 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
2805 113, 114, 181, 180, 181, 214, 214, 250, 214, 214,
2806 258, 250, 250, 250, 250, 250, 214, 214, 214, 214,
2807 214, 250, 198, 118, 119, 54, 122, 123, 142, 143,
2808 145, 146, 148, 149, 150, 199, 39, 215, 202, 170,
2809 172, 172, 163, 202, 186, 186, 225, 180, 181, 180,
2810 181, 162, 162, 162, 162, 162, 162, 162, 170, 220,
2811 222, 173, 222, 174, 222, 22, 162, 162, 162, 231,
2812 162, 3, 4, 5, 6, 9, 25, 26, 27, 40,
2813 41, 59, 168, 171, 173, 175, 221, 247, 248, 249,
2814 165, 249, 249, 249, 216, 214, 214, 214, 214, 165,
2815 208, 165, 208, 249, 168, 165, 165, 165, 165, 165,
2816 165, 249, 249, 249, 249, 249, 38, 216, 214, 250,
2817 4, 142, 143, 144, 145, 147, 151, 152, 201, 232,
2818 233, 38, 162, 162, 162, 162, 220, 220, 220, 220,
2819 220, 220, 220, 165, 170, 174, 214, 222, 172, 174,
2820 220, 220, 220, 165, 211, 39, 214, 238, 239, 61,
2821 246, 170, 222, 173, 222, 174, 222, 22, 250, 165,
2822 165, 249, 249, 249, 249, 249, 11, 54, 11, 260,
2823 249, 168, 250, 214, 250, 250, 250, 165, 165, 261,
2824 165, 165, 165, 214, 249, 249, 165, 211, 211, 214,
2825 220, 220, 220, 220, 260, 165, 165, 165, 165, 261,
2826 165, 220, 172, 174, 165, 165, 38, 34, 54, 209,
2827 212, 200, 165, 163, 22, 170, 174, 222, 172, 174,
2828 17, 17, 162, 165, 165, 165, 165, 249, 4, 249,
2829 165, 165, 249, 165, 165, 165, 4, 4, 165, 214,
2830 249, 249, 162, 165, 208, 214, 163, 165, 165, 165,
2831 165, 163, 220, 220, 220, 220, 163, 220, 172, 220,
2832 220, 214, 22, 4, 211, 184, 185, 39, 214, 202,
2833 165, 172, 174, 249, 249, 17, 214, 259, 249, 249,
2834 249, 249, 208, 208, 250, 249, 165, 250, 250, 250,
2835 4, 249, 259, 249, 220, 220, 220, 220, 165, 163,
2836 165, 165, 261, 163, 163, 163, 200, 209, 210, 22,
2837 172, 165, 168, 200, 200, 163, 165, 170, 249, 261,
2838 163, 208, 163, 163, 163, 163, 220, 220, 220, 163,
2839 185, 54, 207, 17, 170, 182, 256, 122, 123, 249,
2840 249, 202, 17, 214, 170, 202, 163, 163, 163, 4,
2841 153, 206, 249, 247, 170, 182, 200, 200, 38, 200,
2842 200, 22, 154, 205, 165, 247, 17, 249, 249, 162,
2843 17, 165, 249, 200, 200, 155, 158, 203, 204, 249,
2844 17, 74, 164, 163, 165, 249, 17, 156, 157, 204,
2848 #define yyerrok (yyerrstatus = 0)
2849 #define yyclearin (yychar = YYEMPTY)
2850 #define YYEMPTY (-2)
2853 #define YYACCEPT goto yyacceptlab
2854 #define YYABORT goto yyabortlab
2855 #define YYERROR goto yyerrorlab
2858 /* Like YYERROR except do call yyerror. This remains here temporarily
2859 to ease the transition to the new meaning of YYERROR, for GCC.
2860 Once GCC version 2 has supplanted version 1, this can go. */
2862 #define YYFAIL goto yyerrlab
2864 #define YYRECOVERING() (!!yyerrstatus)
2866 #define YYBACKUP(Token, Value) \
2868 if (yychar == YYEMPTY && yylen == 1) \
2872 yytoken = YYTRANSLATE (yychar); \
2878 yyerror (YY_("syntax error: cannot back up")); \
2885 #define YYERRCODE 256
2888 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2889 If N is 0, then set CURRENT to the empty location which ends
2890 the previous symbol: RHS[0] (always defined). */
2892 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2893 #ifndef YYLLOC_DEFAULT
2894 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2898 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2899 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2900 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2901 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2905 (Current).first_line = (Current).last_line = \
2906 YYRHSLOC (Rhs, 0).last_line; \
2907 (Current).first_column = (Current).last_column = \
2908 YYRHSLOC (Rhs, 0).last_column; \
2914 /* YY_LOCATION_PRINT -- Print the location on the stream.
2915 This macro was not mandated originally: define only if we know
2916 we won't break user code: when these are the locations we know. */
2918 #ifndef YY_LOCATION_PRINT
2919 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2920 # define YY_LOCATION_PRINT(File, Loc) \
2921 fprintf (File, "%d.%d-%d.%d", \
2922 (Loc).first_line, (Loc).first_column, \
2923 (Loc).last_line, (Loc).last_column)
2925 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2930 /* YYLEX -- calling `yylex' with the right arguments. */
2933 # define YYLEX yylex (YYLEX_PARAM)
2935 # define YYLEX yylex ()
2938 /* Enable debugging if requested. */
2942 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2943 # define YYFPRINTF fprintf
2946 # define YYDPRINTF(Args) \
2952 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2956 YYFPRINTF (stderr, "%s ", Title); \
2957 yy_symbol_print (stderr, \
2959 YYFPRINTF (stderr, "\n"); \
2964 /*--------------------------------.
2965 | Print this symbol on YYOUTPUT. |
2966 `--------------------------------*/
2969 #if (defined __STDC__ || defined __C99__FUNC__ \
2970 || defined __cplusplus || defined _MSC_VER)
2972 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2975 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2978 YYSTYPE const * const yyvaluep;
2984 if (yytype < YYNTOKENS)
2985 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2997 /*--------------------------------.
2998 | Print this symbol on YYOUTPUT. |
2999 `--------------------------------*/
3001 #if (defined __STDC__ || defined __C99__FUNC__ \
3002 || defined __cplusplus || defined _MSC_VER)
3004 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3007 yy_symbol_print (yyoutput, yytype, yyvaluep)
3010 YYSTYPE const * const yyvaluep;
3013 if (yytype < YYNTOKENS)
3014 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3016 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3018 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3019 YYFPRINTF (yyoutput, ")");
3022 /*------------------------------------------------------------------.
3023 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3025 `------------------------------------------------------------------*/
3027 #if (defined __STDC__ || defined __C99__FUNC__ \
3028 || defined __cplusplus || defined _MSC_VER)
3030 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3033 yy_stack_print (bottom, top)
3034 yytype_int16 *bottom;
3038 YYFPRINTF (stderr, "Stack now");
3039 for (; bottom <= top; ++bottom)
3040 YYFPRINTF (stderr, " %d", *bottom);
3041 YYFPRINTF (stderr, "\n");
3044 # define YY_STACK_PRINT(Bottom, Top) \
3047 yy_stack_print ((Bottom), (Top)); \
3051 /*------------------------------------------------.
3052 | Report that the YYRULE is going to be reduced. |
3053 `------------------------------------------------*/
3055 #if (defined __STDC__ || defined __C99__FUNC__ \
3056 || defined __cplusplus || defined _MSC_VER)
3058 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3061 yy_reduce_print (yyvsp, yyrule)
3066 int yynrhs = yyr2[yyrule];
3068 unsigned long int yylno = yyrline[yyrule];
3069 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3071 /* The symbols being reduced. */
3072 for (yyi = 0; yyi < yynrhs; yyi++)
3074 fprintf (stderr, " $%d = ", yyi + 1);
3075 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3076 &(yyvsp[(yyi + 1) - (yynrhs)])
3078 fprintf (stderr, "\n");
3082 # define YY_REDUCE_PRINT(Rule) \
3085 yy_reduce_print (yyvsp, Rule); \
3088 /* Nonzero means print parse trace. It is left uninitialized so that
3089 multiple parsers can coexist. */
3091 #else /* !YYDEBUG */
3092 # define YYDPRINTF(Args)
3093 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3094 # define YY_STACK_PRINT(Bottom, Top)
3095 # define YY_REDUCE_PRINT(Rule)
3096 #endif /* !YYDEBUG */
3099 /* YYINITDEPTH -- initial size of the parser's stacks. */
3101 # define YYINITDEPTH 200
3104 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3105 if the built-in stack extension method is used).
3107 Do not make this value too large; the results are undefined if
3108 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3109 evaluated with infinite-precision integer arithmetic. */
3112 # define YYMAXDEPTH 10000
3120 # if defined __GLIBC__ && defined _STRING_H
3121 # define yystrlen strlen
3123 /* Return the length of YYSTR. */
3124 #if (defined __STDC__ || defined __C99__FUNC__ \
3125 || defined __cplusplus || defined _MSC_VER)
3127 yystrlen (const char *yystr)
3135 for (yylen = 0; yystr[yylen]; yylen++)
3143 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3144 # define yystpcpy stpcpy
3146 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3148 #if (defined __STDC__ || defined __C99__FUNC__ \
3149 || defined __cplusplus || defined _MSC_VER)
3151 yystpcpy (char *yydest, const char *yysrc)
3154 yystpcpy (yydest, yysrc)
3160 const char *yys = yysrc;
3162 while ((*yyd++ = *yys++) != '\0')
3171 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3172 quotes and backslashes, so that it's suitable for yyerror. The
3173 heuristic is that double-quoting is unnecessary unless the string
3174 contains an apostrophe, a comma, or backslash (other than
3175 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3176 null, do not copy; instead, return the length of what the result
3179 yytnamerr (char *yyres, const char *yystr)
3184 char const *yyp = yystr;
3191 goto do_not_strip_quotes;
3195 goto do_not_strip_quotes;
3208 do_not_strip_quotes: ;
3212 return yystrlen (yystr);
3214 return yystpcpy (yyres, yystr) - yyres;
3218 /* Copy into YYRESULT an error message about the unexpected token
3219 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3220 including the terminating null byte. If YYRESULT is null, do not
3221 copy anything; just return the number of bytes that would be
3222 copied. As a special case, return 0 if an ordinary "syntax error"
3223 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3224 size calculation. */
3226 yysyntax_error (char *yyresult, int yystate, int yychar)
3228 int yyn = yypact[yystate];
3230 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3234 int yytype = YYTRANSLATE (yychar);
3235 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3236 YYSIZE_T yysize = yysize0;
3238 int yysize_overflow = 0;
3239 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3240 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3244 /* This is so xgettext sees the translatable formats that are
3245 constructed on the fly. */
3246 YY_("syntax error, unexpected %s");
3247 YY_("syntax error, unexpected %s, expecting %s");
3248 YY_("syntax error, unexpected %s, expecting %s or %s");
3249 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3250 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3254 static char const yyunexpected[] = "syntax error, unexpected %s";
3255 static char const yyexpecting[] = ", expecting %s";
3256 static char const yyor[] = " or %s";
3257 char yyformat[sizeof yyunexpected
3258 + sizeof yyexpecting - 1
3259 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3260 * (sizeof yyor - 1))];
3261 char const *yyprefix = yyexpecting;
3263 /* Start YYX at -YYN if negative to avoid negative indexes in
3265 int yyxbegin = yyn < 0 ? -yyn : 0;
3267 /* Stay within bounds of both yycheck and yytname. */
3268 int yychecklim = YYLAST - yyn + 1;
3269 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3272 yyarg[0] = yytname[yytype];
3273 yyfmt = yystpcpy (yyformat, yyunexpected);
3275 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3276 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3278 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3282 yyformat[sizeof yyunexpected - 1] = '\0';
3285 yyarg[yycount++] = yytname[yyx];
3286 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3287 yysize_overflow |= (yysize1 < yysize);
3289 yyfmt = yystpcpy (yyfmt, yyprefix);
3293 yyf = YY_(yyformat);
3294 yysize1 = yysize + yystrlen (yyf);
3295 yysize_overflow |= (yysize1 < yysize);
3298 if (yysize_overflow)
3299 return YYSIZE_MAXIMUM;
3303 /* Avoid sprintf, as that infringes on the user's name space.
3304 Don't have undefined behavior even if the translation
3305 produced a string with the wrong number of "%s"s. */
3306 char *yyp = yyresult;
3308 while ((*yyp = *yyf) != '\0')
3310 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3312 yyp += yytnamerr (yyp, yyarg[yyi++]);
3325 #endif /* YYERROR_VERBOSE */
3328 /*-----------------------------------------------.
3329 | Release the memory associated to this symbol. |
3330 `-----------------------------------------------*/
3333 #if (defined __STDC__ || defined __C99__FUNC__ \
3334 || defined __cplusplus || defined _MSC_VER)
3336 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3339 yydestruct (yymsg, yytype, yyvaluep)
3349 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3360 /* Prevent warnings from -Wmissing-prototypes. */
3362 #ifdef YYPARSE_PARAM
3363 #if defined __STDC__ || defined __cplusplus
3364 int yyparse (void *YYPARSE_PARAM);
3368 #else /* ! YYPARSE_PARAM */
3369 #if defined __STDC__ || defined __cplusplus
3374 #endif /* ! YYPARSE_PARAM */
3378 /* The look-ahead symbol. */
3381 /* The semantic value of the look-ahead symbol. */
3384 /* Number of syntax errors so far. */
3393 #ifdef YYPARSE_PARAM
3394 #if (defined __STDC__ || defined __C99__FUNC__ \
3395 || defined __cplusplus || defined _MSC_VER)
3397 yyparse (void *YYPARSE_PARAM)
3400 yyparse (YYPARSE_PARAM)
3401 void *YYPARSE_PARAM;
3403 #else /* ! YYPARSE_PARAM */
3404 #if (defined __STDC__ || defined __C99__FUNC__ \
3405 || defined __cplusplus || defined _MSC_VER)
3419 /* Number of tokens to shift before error messages enabled. */
3421 /* Look-ahead token as an internal (translated) token number. */
3424 /* Buffer for error messages, and its allocated size. */
3426 char *yymsg = yymsgbuf;
3427 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3430 /* Three stacks and their tools:
3431 `yyss': related to states,
3432 `yyvs': related to semantic values,
3433 `yyls': related to locations.
3435 Refer to the stacks thru separate pointers, to allow yyoverflow
3436 to reallocate them elsewhere. */
3438 /* The state stack. */
3439 yytype_int16 yyssa[YYINITDEPTH];
3440 yytype_int16 *yyss = yyssa;
3441 yytype_int16 *yyssp;
3443 /* The semantic value stack. */
3444 YYSTYPE yyvsa[YYINITDEPTH];
3445 YYSTYPE *yyvs = yyvsa;
3450 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3452 YYSIZE_T yystacksize = YYINITDEPTH;
3454 /* The variables used to return semantic value and location from the
3459 /* The number of symbols on the RHS of the reduced rule.
3460 Keep to zero when no symbol should be popped. */
3463 YYDPRINTF ((stderr, "Starting parse\n"));
3468 yychar = YYEMPTY; /* Cause a token to be read. */
3470 /* Initialize stack pointers.
3471 Waste one element of value and location stack
3472 so that they stay on the same level as the state stack.
3473 The wasted elements are never initialized. */
3480 /*------------------------------------------------------------.
3481 | yynewstate -- Push a new state, which is found in yystate. |
3482 `------------------------------------------------------------*/
3484 /* In all cases, when you get here, the value and location stacks
3485 have just been pushed. So pushing a state here evens the stacks. */
3491 if (yyss + yystacksize - 1 <= yyssp)
3493 /* Get the current used size of the three stacks, in elements. */
3494 YYSIZE_T yysize = yyssp - yyss + 1;
3498 /* Give user a chance to reallocate the stack. Use copies of
3499 these so that the &'s don't force the real ones into
3501 YYSTYPE *yyvs1 = yyvs;
3502 yytype_int16 *yyss1 = yyss;
3505 /* Each stack pointer address is followed by the size of the
3506 data in use in that stack, in bytes. This used to be a
3507 conditional around just the two extra args, but that might
3508 be undefined if yyoverflow is a macro. */
3509 yyoverflow (YY_("memory exhausted"),
3510 &yyss1, yysize * sizeof (*yyssp),
3511 &yyvs1, yysize * sizeof (*yyvsp),
3518 #else /* no yyoverflow */
3519 # ifndef YYSTACK_RELOCATE
3520 goto yyexhaustedlab;
3522 /* Extend the stack our own way. */
3523 if (YYMAXDEPTH <= yystacksize)
3524 goto yyexhaustedlab;
3526 if (YYMAXDEPTH < yystacksize)
3527 yystacksize = YYMAXDEPTH;
3530 yytype_int16 *yyss1 = yyss;
3531 union yyalloc *yyptr =
3532 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3534 goto yyexhaustedlab;
3535 YYSTACK_RELOCATE (yyss);
3536 YYSTACK_RELOCATE (yyvs);
3538 # undef YYSTACK_RELOCATE
3540 YYSTACK_FREE (yyss1);
3543 #endif /* no yyoverflow */
3545 yyssp = yyss + yysize - 1;
3546 yyvsp = yyvs + yysize - 1;
3549 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3550 (unsigned long int) yystacksize));
3552 if (yyss + yystacksize - 1 <= yyssp)
3556 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3565 /* Do appropriate processing given the current state. Read a
3566 look-ahead token if we need one and don't already have one. */
3568 /* First try to decide what to do without reference to look-ahead token. */
3569 yyn = yypact[yystate];
3570 if (yyn == YYPACT_NINF)
3573 /* Not known => get a look-ahead token if don't already have one. */
3575 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3576 if (yychar == YYEMPTY)
3578 YYDPRINTF ((stderr, "Reading a token: "));
3582 if (yychar <= YYEOF)
3584 yychar = yytoken = YYEOF;
3585 YYDPRINTF ((stderr, "Now at end of input.\n"));
3589 yytoken = YYTRANSLATE (yychar);
3590 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3593 /* If the proper action on seeing token YYTOKEN is to reduce or to
3594 detect an error, take that action. */
3596 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3601 if (yyn == 0 || yyn == YYTABLE_NINF)
3610 /* Count tokens shifted since error; after three, turn off error
3615 /* Shift the look-ahead token. */
3616 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3618 /* Discard the shifted token unless it is eof. */
3619 if (yychar != YYEOF)
3628 /*-----------------------------------------------------------.
3629 | yydefault -- do the default action for the current state. |
3630 `-----------------------------------------------------------*/
3632 yyn = yydefact[yystate];
3638 /*-----------------------------.
3639 | yyreduce -- Do a reduction. |
3640 `-----------------------------*/
3642 /* yyn is the number of a rule to reduce with. */
3645 /* If YYLEN is nonzero, implement the default value of the action:
3648 Otherwise, the following line sets YYVAL to garbage.
3649 This behavior is undocumented and Bison
3650 users should not rely upon it. Assigning to YYVAL
3651 unconditionally makes the parser a bit smaller, and it avoids a
3652 GCC warning that YYVAL may be used uninitialized. */
3653 yyval = yyvsp[1-yylen];
3656 YY_REDUCE_PRINT (yyn);
3660 #line 1147 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3661 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3665 #line 1147 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3666 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3670 #line 1148 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3671 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3675 #line 1148 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3676 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3680 #line 1149 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3681 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3685 #line 1149 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3686 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3690 #line 1150 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3691 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3695 #line 1150 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3696 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3700 #line 1151 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3701 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3705 #line 1151 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3706 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3710 #line 1155 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3711 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3715 #line 1155 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3716 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3720 #line 1156 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3721 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3725 #line 1156 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3726 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3730 #line 1157 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3731 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3735 #line 1157 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3736 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3740 #line 1158 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3741 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3745 #line 1158 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3746 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3750 #line 1159 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3751 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3755 #line 1159 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3756 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3760 #line 1160 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3761 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3765 #line 1160 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3766 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3770 #line 1161 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3771 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3775 #line 1161 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3776 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3780 #line 1162 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3781 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3785 #line 1163 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3786 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3790 #line 1172 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3791 { (yyval.StrVal) = 0; ;}
3795 #line 1174 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3796 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3800 #line 1175 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3801 { (yyval.UIntVal)=0; ;}
3805 #line 1179 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3807 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3813 #line 1183 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3821 #line 1188 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3823 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3829 #line 1197 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3837 #line 1202 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3839 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3845 #line 1208 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3846 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3850 #line 1209 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3851 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3855 #line 1210 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3856 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3860 #line 1211 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3861 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3865 #line 1212 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3866 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3870 #line 1213 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3871 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3875 #line 1217 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3876 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3880 #line 1218 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3881 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3885 #line 1219 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3886 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3890 #line 1223 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3891 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3895 #line 1224 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3896 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3900 #line 1225 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3901 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3905 #line 1226 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3906 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3910 #line 1230 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3911 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3915 #line 1231 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3916 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3920 #line 1232 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3921 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3925 #line 1236 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3926 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3930 #line 1237 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3931 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3935 #line 1238 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3936 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3940 #line 1239 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3941 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3945 #line 1240 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3946 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3950 #line 1244 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3951 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3955 #line 1245 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3956 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3960 #line 1246 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3961 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3965 #line 1249 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3966 { (yyval.UIntVal) = CallingConv::C; ;}
3970 #line 1250 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3971 { (yyval.UIntVal) = CallingConv::C; ;}
3975 #line 1251 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3976 { (yyval.UIntVal) = CallingConv::Fast; ;}
3980 #line 1252 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3981 { (yyval.UIntVal) = CallingConv::Cold; ;}
3985 #line 1253 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3986 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3990 #line 1254 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3991 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3995 #line 1255 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
3996 { (yyval.UIntVal) = CallingConv::X86_SSECall; ;}
4000 #line 1256 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4002 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
4003 GEN_ERROR("Calling conv too large");
4004 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4010 #line 1263 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4011 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4015 #line 1264 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4016 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4020 #line 1265 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4021 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4025 #line 1266 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4026 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4030 #line 1267 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4031 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
4035 #line 1268 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4036 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
4040 #line 1269 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4041 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
4045 #line 1270 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4046 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
4050 #line 1271 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4051 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
4055 #line 1272 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4056 { (yyval.ParamAttrs) =
4057 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4061 #line 1276 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4062 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4066 #line 1277 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4068 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4073 #line 1282 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4074 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4078 #line 1283 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4079 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4083 #line 1284 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4084 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
4088 #line 1285 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4089 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4093 #line 1286 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4094 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4098 #line 1287 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4099 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4103 #line 1288 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4104 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4108 #line 1291 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4109 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4113 #line 1292 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4115 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4120 #line 1297 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4121 { (yyval.ParamAttrs) = (yyvsp[(1) - (1)].ParamAttrs); ;}
4125 #line 1298 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4127 unsigned tmp = (yyvsp[(1) - (3)].ParamAttrs) | (yyvsp[(3) - (3)].ParamAttrs);
4128 if ((yyvsp[(3) - (3)].ParamAttrs) == FN_NOTE_NoInline
4129 && ((yyvsp[(1) - (3)].ParamAttrs) & FN_NOTE_AlwaysInline))
4130 GEN_ERROR("Function Notes may include only one inline notes!")
4131 if ((yyvsp[(3) - (3)].ParamAttrs) == FN_NOTE_AlwaysInline
4132 && ((yyvsp[(1) - (3)].ParamAttrs) & FN_NOTE_NoInline))
4133 GEN_ERROR("Function Notes may include only one inline notes!")
4134 (yyval.ParamAttrs) = tmp;
4140 #line 1311 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4141 { (yyval.ParamAttrs) = FN_NOTE_NoInline; ;}
4145 #line 1312 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4146 { (yyval.ParamAttrs) = FN_NOTE_AlwaysInline; ;}
4150 #line 1313 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4151 { (yyval.ParamAttrs) = FN_NOTE_OptimizeForSize; ;}
4155 #line 1316 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4156 { (yyval.ParamAttrs) = FN_NOTE_None; ;}
4160 #line 1317 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4162 (yyval.ParamAttrs) = (yyvsp[(3) - (4)].ParamAttrs);
4167 #line 1322 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4168 { (yyval.StrVal) = 0; ;}
4172 #line 1323 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4174 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4179 #line 1330 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4180 { (yyval.UIntVal) = 0; ;}
4184 #line 1331 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4186 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4187 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4188 GEN_ERROR("Alignment must be a power of two");
4194 #line 1337 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4195 { (yyval.UIntVal) = 0; ;}
4199 #line 1338 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4201 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4202 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4203 GEN_ERROR("Alignment must be a power of two");
4209 #line 1347 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4211 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4212 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4213 GEN_ERROR("Invalid character in section name");
4214 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4220 #line 1355 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4221 { (yyval.StrVal) = 0; ;}
4225 #line 1356 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4226 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4230 #line 1361 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4235 #line 1362 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4240 #line 1363 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4242 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4243 delete (yyvsp[(1) - (1)].StrVal);
4249 #line 1368 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4251 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4252 GEN_ERROR("Alignment must be a power of two");
4253 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4259 #line 1384 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4261 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4267 #line 1388 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4269 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4275 #line 1392 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4277 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4278 GEN_ERROR("Cannot form a pointer to a basic block");
4279 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4280 delete (yyvsp[(1) - (3)].TypeVal);
4286 #line 1399 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4287 { // Named types are also simple types...
4288 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4290 (yyval.TypeVal) = new PATypeHolder(tmp);
4295 #line 1404 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4296 { // Type UpReference
4297 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4298 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4299 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4300 (yyval.TypeVal) = new PATypeHolder(OT);
4301 UR_OUT("New Upreference!\n");
4307 #line 1412 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4309 // Allow but ignore attributes on function types; this permits auto-upgrade.
4310 // FIXME: remove in LLVM 3.0.
4311 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4312 if (!FunctionType::isValidReturnType(RetTy))
4313 GEN_ERROR("Invalid result type for LLVM function");
4315 std::vector<const Type*> Params;
4316 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4317 for (; I != E; ++I ) {
4318 const Type *Ty = I->Ty->get();
4319 Params.push_back(Ty);
4322 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4323 if (isVarArg) Params.pop_back();
4325 for (unsigned i = 0; i != Params.size(); ++i)
4326 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4327 GEN_ERROR("Function arguments must be value types!");
4331 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4332 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4333 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4334 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4340 #line 1441 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4342 // Allow but ignore attributes on function types; this permits auto-upgrade.
4343 // FIXME: remove in LLVM 3.0.
4344 std::vector<const Type*> Params;
4345 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4346 for ( ; I != E; ++I ) {
4347 const Type* Ty = I->Ty->get();
4348 Params.push_back(Ty);
4351 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4352 if (isVarArg) Params.pop_back();
4354 for (unsigned i = 0; i != Params.size(); ++i)
4355 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4356 GEN_ERROR("Function arguments must be value types!");
4360 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4361 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4362 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4368 #line 1466 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4369 { // Sized array type?
4370 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4371 delete (yyvsp[(4) - (5)].TypeVal);
4377 #line 1471 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4379 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4380 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4381 GEN_ERROR("Unsigned result not equal to signed result");
4382 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4383 GEN_ERROR("Element type of a VectorType must be primitive");
4384 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4385 delete (yyvsp[(4) - (5)].TypeVal);
4391 #line 1481 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4392 { // Structure type?
4393 std::vector<const Type*> Elements;
4394 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4395 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4396 Elements.push_back(*I);
4398 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4399 delete (yyvsp[(2) - (3)].TypeList);
4405 #line 1491 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4406 { // Empty structure type?
4407 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4413 #line 1495 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4415 std::vector<const Type*> Elements;
4416 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4417 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4418 Elements.push_back(*I);
4420 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4421 delete (yyvsp[(3) - (5)].TypeList);
4427 #line 1505 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4428 { // Empty structure type?
4429 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4435 #line 1512 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4437 // Allow but ignore attributes on function types; this permits auto-upgrade.
4438 // FIXME: remove in LLVM 3.0.
4439 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4440 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4445 #line 1521 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4447 if (!UpRefs.empty())
4448 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4449 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4450 GEN_ERROR("LLVM functions cannot return aggregate types");
4451 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4456 #line 1528 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4458 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4463 #line 1533 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4465 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4466 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4472 #line 1538 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4474 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4480 #line 1546 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4482 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4483 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4484 TWA.Ty = new PATypeHolder(Type::VoidTy);
4485 (yyval.TypeWithAttrsList)->push_back(TWA);
4491 #line 1553 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4493 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4494 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4495 TWA.Ty = new PATypeHolder(Type::VoidTy);
4496 (yyval.TypeWithAttrsList)->push_back(TWA);
4502 #line 1560 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4504 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4510 #line 1568 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4512 (yyval.TypeList) = new std::list<PATypeHolder>();
4513 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4514 delete (yyvsp[(1) - (1)].TypeVal);
4520 #line 1574 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4522 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4523 delete (yyvsp[(3) - (3)].TypeVal);
4529 #line 1586 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4530 { // Nonempty unsized arr
4531 if (!UpRefs.empty())
4532 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4533 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4535 GEN_ERROR("Cannot make array constant with type: '" +
4536 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4537 const Type *ETy = ATy->getElementType();
4538 uint64_t NumElements = ATy->getNumElements();
4540 // Verify that we have the correct size...
4541 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4542 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4543 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4544 utostr(NumElements) + "");
4546 // Verify all elements are correct type!
4547 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4548 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4549 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4550 ETy->getDescription() +"' as required!\nIt is of type '"+
4551 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4554 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4555 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4561 #line 1614 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4563 if (!UpRefs.empty())
4564 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4565 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4567 GEN_ERROR("Cannot make array constant with type: '" +
4568 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4570 uint64_t NumElements = ATy->getNumElements();
4571 if (NumElements != uint64_t(-1) && NumElements != 0)
4572 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4573 " arguments, but has size of " + utostr(NumElements) +"");
4574 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4575 delete (yyvsp[(1) - (3)].TypeVal);
4581 #line 1630 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4583 if (!UpRefs.empty())
4584 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4585 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4587 GEN_ERROR("Cannot make array constant with type: '" +
4588 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4590 uint64_t NumElements = ATy->getNumElements();
4591 const Type *ETy = ATy->getElementType();
4592 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4593 GEN_ERROR("Can't build string constant of size " +
4594 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4595 " when array has size " + utostr(NumElements) + "");
4596 std::vector<Constant*> Vals;
4597 if (ETy == Type::Int8Ty) {
4598 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4599 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4601 delete (yyvsp[(3) - (3)].StrVal);
4602 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4604 delete (yyvsp[(3) - (3)].StrVal);
4605 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4606 delete (yyvsp[(1) - (3)].TypeVal);
4612 #line 1657 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4613 { // Nonempty unsized arr
4614 if (!UpRefs.empty())
4615 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4616 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4618 GEN_ERROR("Cannot make packed constant with type: '" +
4619 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4620 const Type *ETy = PTy->getElementType();
4621 unsigned NumElements = PTy->getNumElements();
4623 // Verify that we have the correct size...
4624 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4625 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4626 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4627 utostr(NumElements) + "");
4629 // Verify all elements are correct type!
4630 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4631 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4632 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4633 ETy->getDescription() +"' as required!\nIt is of type '"+
4634 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4637 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4638 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4644 #line 1685 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4646 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4648 GEN_ERROR("Cannot make struct constant with type: '" +
4649 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4651 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4652 GEN_ERROR("Illegal number of initializers for structure type");
4654 // Check to ensure that constants are compatible with the type initializer!
4655 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4656 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4657 GEN_ERROR("Expected type '" +
4658 STy->getElementType(i)->getDescription() +
4659 "' for element #" + utostr(i) +
4660 " of structure initializer");
4662 // Check to ensure that Type is not packed
4663 if (STy->isPacked())
4664 GEN_ERROR("Unpacked Initializer to vector type '" +
4665 STy->getDescription() + "'");
4667 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4668 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4674 #line 1711 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4676 if (!UpRefs.empty())
4677 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4678 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4680 GEN_ERROR("Cannot make struct constant with type: '" +
4681 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4683 if (STy->getNumContainedTypes() != 0)
4684 GEN_ERROR("Illegal number of initializers for structure type");
4686 // Check to ensure that Type is not packed
4687 if (STy->isPacked())
4688 GEN_ERROR("Unpacked Initializer to vector type '" +
4689 STy->getDescription() + "'");
4691 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4692 delete (yyvsp[(1) - (3)].TypeVal);
4698 #line 1731 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4700 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4702 GEN_ERROR("Cannot make struct constant with type: '" +
4703 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4705 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4706 GEN_ERROR("Illegal number of initializers for structure type");
4708 // Check to ensure that constants are compatible with the type initializer!
4709 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4710 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4711 GEN_ERROR("Expected type '" +
4712 STy->getElementType(i)->getDescription() +
4713 "' for element #" + utostr(i) +
4714 " of structure initializer");
4716 // Check to ensure that Type is packed
4717 if (!STy->isPacked())
4718 GEN_ERROR("Vector initializer to non-vector type '" +
4719 STy->getDescription() + "'");
4721 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4722 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4728 #line 1757 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4730 if (!UpRefs.empty())
4731 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4732 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4734 GEN_ERROR("Cannot make struct constant with type: '" +
4735 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4737 if (STy->getNumContainedTypes() != 0)
4738 GEN_ERROR("Illegal number of initializers for structure type");
4740 // Check to ensure that Type is packed
4741 if (!STy->isPacked())
4742 GEN_ERROR("Vector initializer to non-vector type '" +
4743 STy->getDescription() + "'");
4745 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4746 delete (yyvsp[(1) - (5)].TypeVal);
4752 #line 1777 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4754 if (!UpRefs.empty())
4755 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4756 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4758 GEN_ERROR("Cannot make null pointer constant with type: '" +
4759 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4761 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4762 delete (yyvsp[(1) - (2)].TypeVal);
4768 #line 1789 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4770 if (!UpRefs.empty())
4771 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4772 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4773 delete (yyvsp[(1) - (2)].TypeVal);
4779 #line 1796 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4781 if (!UpRefs.empty())
4782 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4783 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4785 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4787 // ConstExprs can exist in the body of a function, thus creating
4788 // GlobalValues whenever they refer to a variable. Because we are in
4789 // the context of a function, getExistingVal will search the functions
4790 // symbol table instead of the module symbol table for the global symbol,
4791 // which throws things all off. To get around this, we just tell
4792 // getExistingVal that we are at global scope here.
4794 Function *SavedCurFn = CurFun.CurrentFunction;
4795 CurFun.CurrentFunction = 0;
4797 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4800 CurFun.CurrentFunction = SavedCurFn;
4802 // If this is an initializer for a constant pointer, which is referencing a
4803 // (currently) undefined variable, create a stub now that shall be replaced
4804 // in the future with the right type of variable.
4807 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4808 const PointerType *PT = cast<PointerType>(Ty);
4810 // First check to see if the forward references value is already created!
4811 PerModuleInfo::GlobalRefsType::iterator I =
4812 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4814 if (I != CurModule.GlobalRefs.end()) {
4815 V = I->second; // Placeholder already exists, use it...
4816 (yyvsp[(2) - (2)].ValIDVal).destroy();
4819 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4820 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4821 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4822 GEN_ERROR("Invalid reference to global");
4824 // Create the forward referenced global.
4826 if (const FunctionType *FTy =
4827 dyn_cast<FunctionType>(PT->getElementType())) {
4828 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4829 CurModule.CurrentModule);
4831 GV = new GlobalVariable(PT->getElementType(), false,
4832 GlobalValue::ExternalWeakLinkage, 0,
4833 Name, CurModule.CurrentModule);
4836 // Keep track of the fact that we have a forward ref to recycle it
4837 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4842 (yyval.ConstVal) = cast<GlobalValue>(V);
4843 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4849 #line 1862 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4851 if (!UpRefs.empty())
4852 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4853 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4854 GEN_ERROR("Mismatched types for constant expression: " +
4855 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4856 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4857 delete (yyvsp[(1) - (2)].TypeVal);
4863 #line 1872 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4865 if (!UpRefs.empty())
4866 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4867 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4868 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4869 GEN_ERROR("Cannot create a null initialized value of this type");
4870 (yyval.ConstVal) = Constant::getNullValue(Ty);
4871 delete (yyvsp[(1) - (2)].TypeVal);
4877 #line 1882 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4878 { // integral constants
4879 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4880 GEN_ERROR("Constant value doesn't fit in type");
4881 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4887 #line 1888 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4888 { // arbitrary precision integer constants
4889 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4890 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4891 GEN_ERROR("Constant value does not fit in type");
4893 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4894 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4895 delete (yyvsp[(2) - (2)].APIntVal);
4901 #line 1898 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4902 { // integral constants
4903 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4904 GEN_ERROR("Constant value doesn't fit in type");
4905 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4911 #line 1904 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4912 { // arbitrary precision integer constants
4913 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4914 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4915 GEN_ERROR("Constant value does not fit in type");
4917 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4918 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4919 delete (yyvsp[(2) - (2)].APIntVal);
4925 #line 1914 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4926 { // Boolean constants
4927 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4928 GEN_ERROR("Constant true must have type i1");
4929 (yyval.ConstVal) = ConstantInt::getTrue();
4935 #line 1920 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4936 { // Boolean constants
4937 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4938 GEN_ERROR("Constant false must have type i1");
4939 (yyval.ConstVal) = ConstantInt::getFalse();
4945 #line 1926 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4946 { // Floating point constants
4947 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4948 GEN_ERROR("Floating point constant invalid for type");
4949 // Lexer has no type info, so builds all float and double FP constants
4950 // as double. Fix this here. Long double is done right.
4951 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4952 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4953 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4954 delete (yyvsp[(2) - (2)].FPVal);
4960 #line 1939 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4962 if (!UpRefs.empty())
4963 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4964 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4965 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4966 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4967 GEN_ERROR("invalid cast opcode for cast from '" +
4968 Val->getType()->getDescription() + "' to '" +
4969 DestTy->getDescription() + "'");
4970 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4971 delete (yyvsp[(5) - (6)].TypeVal);
4976 #line 1951 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
4978 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4979 GEN_ERROR("GetElementPtr requires a pointer operand");
4982 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4984 GEN_ERROR("Index list invalid for constant getelementptr");
4986 SmallVector<Constant*, 8> IdxVec;
4987 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4988 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4989 IdxVec.push_back(C);
4991 GEN_ERROR("Indices to constant getelementptr must be constants");
4993 delete (yyvsp[(4) - (5)].ValueList);
4995 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5001 #line 1972 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5003 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5004 GEN_ERROR("Select condition must be of boolean type");
5005 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5006 GEN_ERROR("Select operand types must match");
5007 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5013 #line 1980 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5015 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5016 GEN_ERROR("Binary operator types must match");
5018 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5023 #line 1986 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5025 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5026 GEN_ERROR("Logical operator types must match");
5027 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5028 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5029 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5030 GEN_ERROR("Logical operator requires integral operands");
5032 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5038 #line 1997 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5040 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5041 GEN_ERROR("icmp operand types must match");
5042 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5047 #line 2002 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5049 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5050 GEN_ERROR("fcmp operand types must match");
5051 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5056 #line 2007 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5058 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5059 GEN_ERROR("vicmp operand types must match");
5060 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5065 #line 2012 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5067 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5068 GEN_ERROR("vfcmp operand types must match");
5069 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5074 #line 2017 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5076 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5077 GEN_ERROR("Invalid extractelement operands");
5078 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5084 #line 2023 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5086 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5087 GEN_ERROR("Invalid insertelement operands");
5088 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5094 #line 2029 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5096 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5097 GEN_ERROR("Invalid shufflevector operands");
5098 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5104 #line 2035 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5106 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5107 GEN_ERROR("ExtractValue requires an aggregate operand");
5109 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5110 delete (yyvsp[(4) - (5)].ConstantList);
5116 #line 2043 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5118 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5119 GEN_ERROR("InsertValue requires an aggregate operand");
5121 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5122 delete (yyvsp[(6) - (7)].ConstantList);
5128 #line 2054 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5130 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5136 #line 2058 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5138 (yyval.ConstVector) = new std::vector<Constant*>();
5139 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5145 #line 2066 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5146 { (yyval.BoolVal) = false; ;}
5150 #line 2066 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5151 { (yyval.BoolVal) = true; ;}
5155 #line 2069 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5156 { (yyval.BoolVal) = true; ;}
5160 #line 2069 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5161 { (yyval.BoolVal) = false; ;}
5165 #line 2072 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5167 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5168 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5170 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5172 GEN_ERROR("Aliases can be created only to global values");
5174 (yyval.ConstVal) = Aliasee;
5176 delete (yyvsp[(1) - (2)].TypeVal);
5181 #line 2084 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5183 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5184 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5185 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5186 GEN_ERROR("invalid cast opcode for cast from '" +
5187 Val->getType()->getDescription() + "' to '" +
5188 DestTy->getDescription() + "'");
5190 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5192 delete (yyvsp[(5) - (6)].TypeVal);
5197 #line 2105 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5199 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5200 CurModule.ModuleDone();
5206 #line 2110 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5208 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5209 CurModule.ModuleDone();
5215 #line 2123 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5216 { CurFun.isDeclare = false; ;}
5220 #line 2123 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5222 CurFun.FunctionDone();
5228 #line 2127 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5229 { CurFun.isDeclare = true; ;}
5233 #line 2127 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5240 #line 2130 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5247 #line 2133 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5249 if (!UpRefs.empty())
5250 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5251 // Eagerly resolve types. This is not an optimization, this is a
5252 // requirement that is due to the fact that we could have this:
5254 // %list = type { %list * }
5255 // %list = type { %list * } ; repeated type decl
5257 // If types are not resolved eagerly, then the two types will not be
5258 // determined to be the same type!
5260 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5262 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5264 // If this is a named type that is not a redefinition, add it to the slot
5266 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5269 delete (yyvsp[(3) - (3)].TypeVal);
5275 #line 2157 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5277 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5279 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5281 // If this is a named type that is not a redefinition, add it to the slot
5283 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5290 #line 2169 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5292 /* "Externally Visible" Linkage */
5293 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5294 GEN_ERROR("Global value initializer is not a constant");
5295 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5296 (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));
5302 #line 2176 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5309 #line 2180 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5311 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5312 GEN_ERROR("Global value initializer is not a constant");
5313 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));
5319 #line 2185 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5326 #line 2189 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5328 if (!UpRefs.empty())
5329 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5330 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));
5332 delete (yyvsp[(6) - (7)].TypeVal);
5337 #line 2195 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5345 #line 2199 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5348 if ((yyvsp[(1) - (5)].StrVal)) {
5349 Name = *(yyvsp[(1) - (5)].StrVal);
5350 delete (yyvsp[(1) - (5)].StrVal);
5353 GEN_ERROR("Alias name cannot be empty");
5355 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5357 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5359 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5360 CurModule.CurrentModule);
5361 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5362 InsertValue(GA, CurModule.Values);
5365 // If there was a forward reference of this alias, resolve it now.
5369 ID = ValID::createGlobalName(Name);
5371 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5373 if (GlobalValue *FWGV =
5374 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5375 // Replace uses of the fwdref with the actual alias.
5376 FWGV->replaceAllUsesWith(GA);
5377 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5378 GV->eraseFromParent();
5380 cast<Function>(FWGV)->eraseFromParent();
5389 #line 2239 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5396 #line 2242 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5403 #line 2248 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5405 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5406 if (AsmSoFar.empty())
5407 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5409 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5410 delete (yyvsp[(1) - (1)].StrVal);
5416 #line 2258 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5418 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5419 delete (yyvsp[(3) - (3)].StrVal);
5424 #line 2262 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5426 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5427 delete (yyvsp[(3) - (3)].StrVal);
5432 #line 2269 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5434 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5435 delete (yyvsp[(3) - (3)].StrVal);
5441 #line 2274 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5443 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5444 delete (yyvsp[(1) - (1)].StrVal);
5450 #line 2279 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5457 #line 2288 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5459 if (!UpRefs.empty())
5460 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5461 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5462 GEN_ERROR("Argument types must be first-class");
5463 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5464 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5465 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5471 #line 2298 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5473 if (!UpRefs.empty())
5474 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5475 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5476 GEN_ERROR("Argument types must be first-class");
5477 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5478 (yyval.ArgList) = new ArgListType;
5479 (yyval.ArgList)->push_back(E);
5485 #line 2309 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5487 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5493 #line 2313 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5495 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5496 struct ArgListEntry E;
5497 E.Ty = new PATypeHolder(Type::VoidTy);
5499 E.Attrs = ParamAttr::None;
5500 (yyval.ArgList)->push_back(E);
5506 #line 2322 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5508 (yyval.ArgList) = new ArgListType;
5509 struct ArgListEntry E;
5510 E.Ty = new PATypeHolder(Type::VoidTy);
5512 E.Attrs = ParamAttr::None;
5513 (yyval.ArgList)->push_back(E);
5519 #line 2331 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5521 (yyval.ArgList) = 0;
5527 #line 2337 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5529 std::string FunctionName(*(yyvsp[(3) - (11)].StrVal));
5530 delete (yyvsp[(3) - (11)].StrVal); // Free strdup'd memory!
5532 // Check the function result for abstractness if this is a define. We should
5533 // have no abstract types at this point
5534 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (11)].TypeVal)))
5535 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (11)].TypeVal)->get()->getDescription());
5537 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (11)].TypeVal)))
5538 GEN_ERROR("Invalid result type for LLVM function");
5540 std::vector<const Type*> ParamTypeList;
5541 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5542 if ((yyvsp[(7) - (11)].ParamAttrs) != ParamAttr::None)
5543 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (11)].ParamAttrs)));
5544 if ((yyvsp[(5) - (11)].ArgList)) { // If there are arguments...
5546 for (ArgListType::iterator I = (yyvsp[(5) - (11)].ArgList)->begin(); I != (yyvsp[(5) - (11)].ArgList)->end(); ++I, ++index) {
5547 const Type* Ty = I->Ty->get();
5548 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5549 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5550 ParamTypeList.push_back(Ty);
5551 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5552 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5556 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5557 if (isVarArg) ParamTypeList.pop_back();
5561 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5563 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (11)].TypeVal), ParamTypeList, isVarArg);
5564 const PointerType *PFT = PointerType::getUnqual(FT);
5565 delete (yyvsp[(2) - (11)].TypeVal);
5568 if (!FunctionName.empty()) {
5569 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5571 ID = ValID::createGlobalID(CurModule.Values.size());
5575 // See if this function was forward referenced. If so, recycle the object.
5576 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5577 // Move the function to the end of the list, from whereever it was
5578 // previously inserted.
5579 Fn = cast<Function>(FWRef);
5580 assert(Fn->getParamAttrs().isEmpty() &&
5581 "Forward reference has parameter attributes!");
5582 CurModule.CurrentModule->getFunctionList().remove(Fn);
5583 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5584 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5585 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5586 if (Fn->getFunctionType() != FT ) {
5587 // The existing function doesn't have the same type. This is an overload
5589 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5590 } else if (Fn->getParamAttrs() != PAL) {
5591 // The existing function doesn't have the same parameter attributes.
5592 // This is an overload error.
5593 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5594 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5595 // Neither the existing or the current function is a declaration and they
5596 // have the same name and same type. Clearly this is a redefinition.
5597 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5598 } else if (Fn->isDeclaration()) {
5599 // Make sure to strip off any argument names so we can't get conflicts.
5600 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5604 } else { // Not already defined?
5605 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5606 CurModule.CurrentModule);
5607 InsertValue(Fn, CurModule.Values);
5610 CurFun.FunctionStart(Fn);
5612 if (CurFun.isDeclare) {
5613 // If we have declaration, always overwrite linkage. This will allow us to
5614 // correctly handle cases, when pointer to function is passed as argument to
5615 // another function.
5616 Fn->setLinkage(CurFun.Linkage);
5617 Fn->setVisibility(CurFun.Visibility);
5619 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5620 Fn->setParamAttrs(PAL);
5621 Fn->setAlignment((yyvsp[(9) - (11)].UIntVal));
5622 if ((yyvsp[(8) - (11)].StrVal)) {
5623 Fn->setSection(*(yyvsp[(8) - (11)].StrVal));
5624 delete (yyvsp[(8) - (11)].StrVal);
5626 if ((yyvsp[(10) - (11)].StrVal)) {
5627 Fn->setGC((yyvsp[(10) - (11)].StrVal)->c_str());
5628 delete (yyvsp[(10) - (11)].StrVal);
5630 if ((yyvsp[(11) - (11)].ParamAttrs)) {
5631 Fn->setNotes((yyvsp[(11) - (11)].ParamAttrs));
5634 // Add all of the arguments we parsed to the function...
5635 if ((yyvsp[(5) - (11)].ArgList)) { // Is null if empty...
5636 if (isVarArg) { // Nuke the last entry
5637 assert((yyvsp[(5) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (11)].ArgList)->back().Name == 0 &&
5638 "Not a varargs marker!");
5639 delete (yyvsp[(5) - (11)].ArgList)->back().Ty;
5640 (yyvsp[(5) - (11)].ArgList)->pop_back(); // Delete the last entry
5642 Function::arg_iterator ArgIt = Fn->arg_begin();
5643 Function::arg_iterator ArgEnd = Fn->arg_end();
5645 for (ArgListType::iterator I = (yyvsp[(5) - (11)].ArgList)->begin();
5646 I != (yyvsp[(5) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5647 delete I->Ty; // Delete the typeholder...
5648 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5654 delete (yyvsp[(5) - (11)].ArgList); // We're now done with the argument list
5661 #line 2470 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5663 (yyval.FunctionVal) = CurFun.CurrentFunction;
5665 // Make sure that we keep track of the linkage type even if there was a
5666 // previous "declare".
5667 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5668 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5673 #line 2481 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5675 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5681 #line 2486 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5683 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5684 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5685 (yyval.FunctionVal) = CurFun.CurrentFunction;
5686 CurFun.FunctionDone();
5692 #line 2498 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5694 (yyval.BoolVal) = false;
5700 #line 2502 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5702 (yyval.BoolVal) = true;
5708 #line 2507 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5709 { // A reference to a direct constant
5710 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5716 #line 2511 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5718 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5724 #line 2515 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5725 { // arbitrary precision integer constants
5726 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5727 delete (yyvsp[(1) - (1)].APIntVal);
5733 #line 2520 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5734 { // arbitrary precision integer constants
5735 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5736 delete (yyvsp[(1) - (1)].APIntVal);
5742 #line 2525 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5743 { // Perhaps it's an FP constant?
5744 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5750 #line 2529 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5752 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5758 #line 2533 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5760 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5766 #line 2537 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5768 (yyval.ValIDVal) = ValID::createNull();
5774 #line 2541 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5776 (yyval.ValIDVal) = ValID::createUndef();
5782 #line 2545 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5783 { // A vector zero constant.
5784 (yyval.ValIDVal) = ValID::createZeroInit();
5790 #line 2549 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5791 { // Nonempty unsized packed vector
5792 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5793 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5795 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5796 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5798 VectorType* pt = VectorType::get(ETy, NumElements);
5799 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5801 // Verify all elements are correct type!
5802 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5803 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5804 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5805 ETy->getDescription() +"' as required!\nIt is of type '" +
5806 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5809 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5810 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5816 #line 2571 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5817 { // Nonempty unsized arr
5818 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5819 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5821 if (!ETy->isFirstClassType())
5822 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5824 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5825 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5827 // Verify all elements are correct type!
5828 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5829 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5830 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5831 ETy->getDescription() +"' as required!\nIt is of type '"+
5832 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5835 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5836 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5842 #line 2593 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5844 // Use undef instead of an array because it's inconvenient to determine
5845 // the element type at this point, there being no elements to examine.
5846 (yyval.ValIDVal) = ValID::createUndef();
5852 #line 2599 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5854 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5855 const Type *ETy = Type::Int8Ty;
5857 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5859 std::vector<Constant*> Vals;
5860 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5861 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5862 delete (yyvsp[(2) - (2)].StrVal);
5863 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5869 #line 2612 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5871 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5872 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5873 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5875 const StructType *STy = StructType::get(Elements);
5876 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5878 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5879 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5885 #line 2624 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5887 const StructType *STy = StructType::get(std::vector<const Type*>());
5888 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5894 #line 2629 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5896 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5897 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5898 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5900 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5901 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5903 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5904 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5910 #line 2641 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5912 const StructType *STy = StructType::get(std::vector<const Type*>(),
5914 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5920 #line 2647 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5922 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5928 #line 2651 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5930 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5931 delete (yyvsp[(3) - (5)].StrVal);
5932 delete (yyvsp[(5) - (5)].StrVal);
5938 #line 2661 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5939 { // Is it an integer reference...?
5940 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5946 #line 2665 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5948 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5954 #line 2669 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5955 { // Is it a named reference...?
5956 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5957 delete (yyvsp[(1) - (1)].StrVal);
5963 #line 2674 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5964 { // Is it a named reference...?
5965 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5966 delete (yyvsp[(1) - (1)].StrVal);
5972 #line 2687 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5974 if (!UpRefs.empty())
5975 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5976 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5977 delete (yyvsp[(1) - (2)].TypeVal);
5983 #line 2696 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5985 (yyval.ValueList) = new std::vector<Value *>();
5986 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5992 #line 2701 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
5994 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6000 #line 2706 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6002 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6008 #line 2710 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6009 { // Do not allow functions with 0 basic blocks
6010 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6016 #line 2719 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6018 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6020 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6021 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6022 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6028 #line 2728 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6031 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6032 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6033 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6034 " is incorrect, expected %" + utostr((unsigned)ValNum));
6036 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6037 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6043 #line 2741 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6045 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6046 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6047 if (CI2->getParent() == 0)
6048 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6049 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6050 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6056 #line 2750 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6057 { // Empty space between instruction lists
6058 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6064 #line 2754 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6065 { // Labelled (named) basic block
6066 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6067 delete (yyvsp[(1) - (1)].StrVal);
6074 #line 2762 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6075 { // Return with a result...
6076 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6077 assert(!VL.empty() && "Invalid ret operands!");
6078 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6079 if (VL.size() > 1 ||
6080 (isa<StructType>(ReturnType) &&
6081 (VL.empty() || VL[0]->getType() != ReturnType))) {
6082 Value *RV = UndefValue::get(ReturnType);
6083 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6084 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6085 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6088 (yyval.TermInstVal) = ReturnInst::Create(RV);
6090 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6092 delete (yyvsp[(2) - (2)].ValueList);
6098 #line 2782 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6099 { // Return with no result...
6100 (yyval.TermInstVal) = ReturnInst::Create();
6106 #line 2786 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6107 { // Unconditional Branch...
6108 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6110 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6115 #line 2791 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6117 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6118 GEN_ERROR("Branch condition must have type i1");
6119 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6121 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6123 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6125 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6130 #line 2802 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6132 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6134 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6136 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6137 (yyval.TermInstVal) = S;
6139 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6140 E = (yyvsp[(8) - (9)].JumpTable)->end();
6141 for (; I != E; ++I) {
6142 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6143 S->addCase(CI, I->second);
6145 GEN_ERROR("Switch case is constant, but not a simple integer");
6147 delete (yyvsp[(8) - (9)].JumpTable);
6153 #line 2821 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6155 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6157 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6159 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6160 (yyval.TermInstVal) = S;
6166 #line 2831 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6169 // Handle the short syntax
6170 const PointerType *PFTy = 0;
6171 const FunctionType *Ty = 0;
6172 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
6173 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6174 // Pull out the types of all of the arguments...
6175 std::vector<const Type*> ParamTypes;
6176 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6177 for (; I != E; ++I) {
6178 const Type *Ty = I->Val->getType();
6179 if (Ty == Type::VoidTy)
6180 GEN_ERROR("Short call syntax cannot be used with varargs");
6181 ParamTypes.push_back(Ty);
6184 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6185 GEN_ERROR("Invalid result type for LLVM function");
6187 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6188 PFTy = PointerType::getUnqual(Ty);
6191 delete (yyvsp[(3) - (14)].TypeVal);
6193 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
6195 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6197 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6200 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6201 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6202 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6204 // Check the arguments
6206 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
6207 // Make sure no arguments is a good thing!
6208 if (Ty->getNumParams() != 0)
6209 GEN_ERROR("No arguments passed to a function that "
6210 "expects arguments");
6211 } else { // Has arguments?
6212 // Loop through FunctionType's arguments and ensure they are specified
6214 FunctionType::param_iterator I = Ty->param_begin();
6215 FunctionType::param_iterator E = Ty->param_end();
6216 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6219 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6220 if (ArgI->Val->getType() != *I)
6221 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6222 (*I)->getDescription() + "'");
6223 Args.push_back(ArgI->Val);
6224 if (ArgI->Attrs != ParamAttr::None)
6225 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6228 if (Ty->isVarArg()) {
6230 for (; ArgI != ArgE; ++ArgI, ++index) {
6231 Args.push_back(ArgI->Val); // push the remaining varargs
6232 if (ArgI->Attrs != ParamAttr::None)
6233 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6235 } else if (I != E || ArgI != ArgE)
6236 GEN_ERROR("Invalid number of parameters detected");
6241 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6243 // Create the InvokeInst
6244 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6245 Args.begin(), Args.end());
6246 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6247 II->setParamAttrs(PAL);
6248 (yyval.TermInstVal) = II;
6249 delete (yyvsp[(6) - (14)].ParamList);
6255 #line 2916 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6257 (yyval.TermInstVal) = new UnwindInst();
6263 #line 2920 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6265 (yyval.TermInstVal) = new UnreachableInst();
6271 #line 2927 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6273 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6274 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6277 GEN_ERROR("May only switch on a constant pool value");
6279 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6281 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6286 #line 2938 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6288 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6289 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6293 GEN_ERROR("May only switch on a constant pool value");
6295 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6297 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6302 #line 2951 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6304 // Is this definition named?? if so, assign the name...
6305 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6307 InsertValue((yyvsp[(2) - (2)].InstVal));
6308 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6314 #line 2960 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6317 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6319 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6320 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6321 " is incorrect, expected %" + utostr((unsigned)ValNum));
6323 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6329 #line 2973 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6330 { // Used for PHI nodes
6331 if (!UpRefs.empty())
6332 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6333 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6334 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6336 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6338 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6339 delete (yyvsp[(1) - (6)].TypeVal);
6344 #line 2984 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6346 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6347 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6349 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6351 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6356 #line 2994 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6358 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6359 if (!UpRefs.empty())
6360 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6361 // Used for call and invoke instructions
6362 (yyval.ParamList) = new ParamList();
6363 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6364 (yyval.ParamList)->push_back(E);
6365 delete (yyvsp[(1) - (4)].TypeVal);
6371 #line 3005 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6373 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6374 // Labels are only valid in ASMs
6375 (yyval.ParamList) = new ParamList();
6376 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6377 (yyval.ParamList)->push_back(E);
6383 #line 3013 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6385 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6386 if (!UpRefs.empty())
6387 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6388 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6389 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6390 (yyval.ParamList)->push_back(E);
6391 delete (yyvsp[(3) - (6)].TypeVal);
6397 #line 3023 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6399 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6400 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6401 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6402 (yyval.ParamList)->push_back(E);
6408 #line 3030 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6409 { (yyval.ParamList) = new ParamList(); ;}
6413 #line 3033 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6414 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6418 #line 3034 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6420 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6421 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6427 #line 3042 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6429 (yyval.ConstantList) = new std::vector<unsigned>();
6430 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6431 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6432 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6437 #line 3048 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6439 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6440 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6441 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6442 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6448 #line 3057 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6450 (yyval.BoolVal) = true;
6456 #line 3061 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6458 (yyval.BoolVal) = false;
6464 #line 3066 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6466 if (!UpRefs.empty())
6467 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6468 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6469 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6471 "Arithmetic operator requires integer, FP, or packed operands");
6472 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6474 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6476 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6477 if ((yyval.InstVal) == 0)
6478 GEN_ERROR("binary operator returned null");
6479 delete (yyvsp[(2) - (5)].TypeVal);
6484 #line 3082 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6486 if (!UpRefs.empty())
6487 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6488 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6489 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6490 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6491 GEN_ERROR("Logical operator requires integral operands");
6493 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6495 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6497 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6498 if ((yyval.InstVal) == 0)
6499 GEN_ERROR("binary operator returned null");
6500 delete (yyvsp[(2) - (5)].TypeVal);
6505 #line 3099 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6507 if (!UpRefs.empty())
6508 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6509 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6511 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6513 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6514 if ((yyval.InstVal) == 0)
6515 GEN_ERROR("icmp operator returned null");
6516 delete (yyvsp[(3) - (6)].TypeVal);
6521 #line 3111 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6523 if (!UpRefs.empty())
6524 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6525 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6527 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6529 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6530 if ((yyval.InstVal) == 0)
6531 GEN_ERROR("fcmp operator returned null");
6532 delete (yyvsp[(3) - (6)].TypeVal);
6537 #line 3123 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6539 if (!UpRefs.empty())
6540 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6541 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6542 GEN_ERROR("Scalar types not supported by vicmp instruction");
6543 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6545 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6547 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6548 if ((yyval.InstVal) == 0)
6549 GEN_ERROR("vicmp operator returned null");
6550 delete (yyvsp[(3) - (6)].TypeVal);
6555 #line 3137 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6557 if (!UpRefs.empty())
6558 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6559 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6560 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6561 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6563 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6565 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6566 if ((yyval.InstVal) == 0)
6567 GEN_ERROR("vfcmp operator returned null");
6568 delete (yyvsp[(3) - (6)].TypeVal);
6573 #line 3151 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6575 if (!UpRefs.empty())
6576 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6577 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6578 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6579 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6580 GEN_ERROR("invalid cast opcode for cast from '" +
6581 Val->getType()->getDescription() + "' to '" +
6582 DestTy->getDescription() + "'");
6583 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6584 delete (yyvsp[(4) - (4)].TypeVal);
6589 #line 3163 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6591 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6593 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6594 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6595 GEN_ERROR("vector select value types must be vector types");
6596 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6597 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6598 if (cond_type->getElementType() != Type::Int1Ty)
6599 GEN_ERROR("vector select condition element type must be boolean");
6600 if (cond_type->getNumElements() != select_type->getNumElements())
6601 GEN_ERROR("vector select number of elements must be the same");
6603 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6604 GEN_ERROR("select condition must be boolean");
6606 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6607 GEN_ERROR("select value types must match");
6608 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6614 #line 3184 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6616 if (!UpRefs.empty())
6617 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6618 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6619 delete (yyvsp[(4) - (4)].TypeVal);
6625 #line 3191 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6627 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6628 GEN_ERROR("Invalid extractelement operands");
6629 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6635 #line 3197 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6637 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6638 GEN_ERROR("Invalid insertelement operands");
6639 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6645 #line 3203 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6647 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6648 GEN_ERROR("Invalid shufflevector operands");
6649 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6655 #line 3209 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6657 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6658 if (!Ty->isFirstClassType())
6659 GEN_ERROR("PHI node operands must be of first class type");
6660 (yyval.InstVal) = PHINode::Create(Ty);
6661 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6662 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6663 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6664 GEN_ERROR("All elements of a PHI node must be of the same type");
6665 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6666 (yyvsp[(2) - (2)].PHIList)->pop_front();
6668 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6674 #line 3225 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6677 // Handle the short syntax
6678 const PointerType *PFTy = 0;
6679 const FunctionType *Ty = 0;
6680 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6681 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6682 // Pull out the types of all of the arguments...
6683 std::vector<const Type*> ParamTypes;
6684 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6685 for (; I != E; ++I) {
6686 const Type *Ty = I->Val->getType();
6687 if (Ty == Type::VoidTy)
6688 GEN_ERROR("Short call syntax cannot be used with varargs");
6689 ParamTypes.push_back(Ty);
6692 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6693 GEN_ERROR("Invalid result type for LLVM function");
6695 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6696 PFTy = PointerType::getUnqual(Ty);
6699 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6702 // Check for call to invalid intrinsic to avoid crashing later.
6703 if (Function *theF = dyn_cast<Function>(V)) {
6704 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6705 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6706 !theF->getIntrinsicID(true))
6707 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6708 theF->getName() + "'");
6711 // Set up the ParamAttrs for the function
6712 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6713 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6714 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6715 // Check the arguments
6717 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6718 // Make sure no arguments is a good thing!
6719 if (Ty->getNumParams() != 0)
6720 GEN_ERROR("No arguments passed to a function that "
6721 "expects arguments");
6722 } else { // Has arguments?
6723 // Loop through FunctionType's arguments and ensure they are specified
6724 // correctly. Also, gather any parameter attributes.
6725 FunctionType::param_iterator I = Ty->param_begin();
6726 FunctionType::param_iterator E = Ty->param_end();
6727 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6730 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6731 if (ArgI->Val->getType() != *I)
6732 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6733 (*I)->getDescription() + "'");
6734 Args.push_back(ArgI->Val);
6735 if (ArgI->Attrs != ParamAttr::None)
6736 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6738 if (Ty->isVarArg()) {
6740 for (; ArgI != ArgE; ++ArgI, ++index) {
6741 Args.push_back(ArgI->Val); // push the remaining varargs
6742 if (ArgI->Attrs != ParamAttr::None)
6743 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6745 } else if (I != E || ArgI != ArgE)
6746 GEN_ERROR("Invalid number of parameters detected");
6749 // Finish off the ParamAttrs and check them
6752 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6754 // Create the call node
6755 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6756 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6757 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6758 CI->setParamAttrs(PAL);
6759 (yyval.InstVal) = CI;
6760 delete (yyvsp[(6) - (8)].ParamList);
6761 delete (yyvsp[(3) - (8)].TypeVal);
6767 #line 3314 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6769 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6775 #line 3319 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6777 (yyval.BoolVal) = true;
6783 #line 3323 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6785 (yyval.BoolVal) = false;
6791 #line 3330 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6793 if (!UpRefs.empty())
6794 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6795 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6796 delete (yyvsp[(2) - (3)].TypeVal);
6802 #line 3337 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6804 if (!UpRefs.empty())
6805 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6806 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6807 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6808 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6810 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6811 delete (yyvsp[(2) - (6)].TypeVal);
6816 #line 3347 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6818 if (!UpRefs.empty())
6819 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6820 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6821 delete (yyvsp[(2) - (3)].TypeVal);
6827 #line 3354 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6829 if (!UpRefs.empty())
6830 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6831 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6832 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6833 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6835 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6836 delete (yyvsp[(2) - (6)].TypeVal);
6841 #line 3364 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6843 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6844 GEN_ERROR("Trying to free nonpointer type " +
6845 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6846 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6852 #line 3372 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6854 if (!UpRefs.empty())
6855 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6856 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6857 GEN_ERROR("Can't load from nonpointer type: " +
6858 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6859 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6860 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6861 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6862 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6864 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6865 delete (yyvsp[(3) - (5)].TypeVal);
6870 #line 3386 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6872 if (!UpRefs.empty())
6873 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6874 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6876 GEN_ERROR("Can't store to a nonpointer type: " +
6877 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6878 const Type *ElTy = PT->getElementType();
6879 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6880 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6881 "' into space of type '" + ElTy->getDescription() + "'");
6883 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6885 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6886 delete (yyvsp[(5) - (7)].TypeVal);
6891 #line 3403 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6893 if (!UpRefs.empty())
6894 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6895 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6896 GEN_ERROR("getresult insn requires an aggregate operand");
6897 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6898 GEN_ERROR("Invalid getresult index for type '" +
6899 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6901 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6903 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6904 delete (yyvsp[(2) - (5)].TypeVal);
6909 #line 3417 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6911 if (!UpRefs.empty())
6912 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6913 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6914 GEN_ERROR("getelementptr insn requires pointer operand");
6916 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6917 GEN_ERROR("Invalid getelementptr indices for type '" +
6918 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6919 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6921 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6922 delete (yyvsp[(2) - (4)].TypeVal);
6923 delete (yyvsp[(4) - (4)].ValueList);
6928 #line 3432 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6930 if (!UpRefs.empty())
6931 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6932 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6933 GEN_ERROR("extractvalue insn requires an aggregate operand");
6935 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6936 GEN_ERROR("Invalid extractvalue indices for type '" +
6937 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6938 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6940 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6941 delete (yyvsp[(2) - (4)].TypeVal);
6942 delete (yyvsp[(4) - (4)].ConstantList);
6947 #line 3447 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
6949 if (!UpRefs.empty())
6950 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6951 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6952 GEN_ERROR("extractvalue insn requires an aggregate operand");
6954 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6955 GEN_ERROR("Invalid insertvalue indices for type '" +
6956 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6957 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6958 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6960 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6961 delete (yyvsp[(2) - (7)].TypeVal);
6962 delete (yyvsp[(5) - (7)].TypeVal);
6963 delete (yyvsp[(7) - (7)].ConstantList);
6968 /* Line 1267 of yacc.c. */
6969 #line 6970 "llvmAsmParser.tab.c"
6972 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6976 YY_STACK_PRINT (yyss, yyssp);
6981 /* Now `shift' the result of the reduction. Determine what state
6982 that goes to, based on the state we popped back to and the rule
6983 number reduced by. */
6987 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6988 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6989 yystate = yytable[yystate];
6991 yystate = yydefgoto[yyn - YYNTOKENS];
6996 /*------------------------------------.
6997 | yyerrlab -- here on detecting error |
6998 `------------------------------------*/
7000 /* If not already recovering from an error, report this error. */
7004 #if ! YYERROR_VERBOSE
7005 yyerror (YY_("syntax error"));
7008 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7009 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7011 YYSIZE_T yyalloc = 2 * yysize;
7012 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7013 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7014 if (yymsg != yymsgbuf)
7015 YYSTACK_FREE (yymsg);
7016 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7018 yymsg_alloc = yyalloc;
7022 yymsg_alloc = sizeof yymsgbuf;
7026 if (0 < yysize && yysize <= yymsg_alloc)
7028 (void) yysyntax_error (yymsg, yystate, yychar);
7033 yyerror (YY_("syntax error"));
7035 goto yyexhaustedlab;
7043 if (yyerrstatus == 3)
7045 /* If just tried and failed to reuse look-ahead token after an
7046 error, discard it. */
7048 if (yychar <= YYEOF)
7050 /* Return failure if at end of input. */
7051 if (yychar == YYEOF)
7056 yydestruct ("Error: discarding",
7062 /* Else will try to reuse look-ahead token after shifting the error
7067 /*---------------------------------------------------.
7068 | yyerrorlab -- error raised explicitly by YYERROR. |
7069 `---------------------------------------------------*/
7072 /* Pacify compilers like GCC when the user code never invokes
7073 YYERROR and the label yyerrorlab therefore never appears in user
7075 if (/*CONSTCOND*/ 0)
7078 /* Do not reclaim the symbols of the rule which action triggered
7082 YY_STACK_PRINT (yyss, yyssp);
7087 /*-------------------------------------------------------------.
7088 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7089 `-------------------------------------------------------------*/
7091 yyerrstatus = 3; /* Each real token shifted decrements this. */
7095 yyn = yypact[yystate];
7096 if (yyn != YYPACT_NINF)
7099 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7107 /* Pop the current state because it cannot handle the error token. */
7112 yydestruct ("Error: popping",
7113 yystos[yystate], yyvsp);
7116 YY_STACK_PRINT (yyss, yyssp);
7125 /* Shift the error token. */
7126 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7132 /*-------------------------------------.
7133 | yyacceptlab -- YYACCEPT comes here. |
7134 `-------------------------------------*/
7139 /*-----------------------------------.
7140 | yyabortlab -- YYABORT comes here. |
7141 `-----------------------------------*/
7147 /*-------------------------------------------------.
7148 | yyexhaustedlab -- memory exhaustion comes here. |
7149 `-------------------------------------------------*/
7151 yyerror (YY_("memory exhausted"));
7157 if (yychar != YYEOF && yychar != YYEMPTY)
7158 yydestruct ("Cleanup: discarding lookahead",
7160 /* Do not reclaim the symbols of the rule which action triggered
7161 this YYABORT or YYACCEPT. */
7163 YY_STACK_PRINT (yyss, yyssp);
7164 while (yyssp != yyss)
7166 yydestruct ("Cleanup: popping",
7167 yystos[*yyssp], yyvsp);
7172 YYSTACK_FREE (yyss);
7175 if (yymsg != yymsgbuf)
7176 YYSTACK_FREE (yymsg);
7178 /* Make sure YYID is used. */
7179 return YYID (yyresult);
7183 #line 3466 "/Volumes/Nanpura/mainline/llvm/lib/AsmParser/llvmAsmParser.y"
7186 // common code from the two 'RunVMAsmParser' functions
7187 static Module* RunParser(Module * M) {
7188 CurModule.CurrentModule = M;
7189 // Check to make sure the parser succeeded
7192 delete ParserResult;
7196 // Emit an error if there are any unresolved types left.
7197 if (!CurModule.LateResolveTypes.empty()) {
7198 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7199 if (DID.Type == ValID::LocalName) {
7200 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7202 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7205 delete ParserResult;
7209 // Emit an error if there are any unresolved values left.
7210 if (!CurModule.LateResolveValues.empty()) {
7211 Value *V = CurModule.LateResolveValues.back();
7212 std::map<Value*, std::pair<ValID, int> >::iterator I =
7213 CurModule.PlaceHolderInfo.find(V);
7215 if (I != CurModule.PlaceHolderInfo.end()) {
7216 ValID &DID = I->second.first;
7217 if (DID.Type == ValID::LocalName) {
7218 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7220 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7223 delete ParserResult;
7228 // Check to make sure that parsing produced a result
7232 // Reset ParserResult variable while saving its value for the result.
7233 Module *Result = ParserResult;
7239 void llvm::GenerateError(const std::string &message, int LineNo) {
7240 if (LineNo == -1) LineNo = LLLgetLineNo();
7241 // TODO: column number in exception
7243 TheParseError->setError(LLLgetFilename(), message, LineNo);
7247 int yyerror(const char *ErrorMsg) {
7248 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7249 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7250 if (yychar != YYEMPTY && yychar != 0) {
7251 errMsg += " while reading token: '";
7252 errMsg += std::string(LLLgetTokenStart(),
7253 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7255 GenerateError(errMsg);