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,
234 #define ESINT64VAL 258
235 #define EUINT64VAL 259
236 #define ESAPINTVAL 260
237 #define EUAPINTVAL 261
238 #define LOCALVAL_ID 262
239 #define GLOBALVAL_ID 263
247 #define PPC_FP128 271
251 #define GLOBALVAR 275
253 #define STRINGCONSTANT 277
254 #define ATSTRINGCONSTANT 278
255 #define PCTSTRINGCONSTANT 279
256 #define ZEROINITIALIZER 280
268 #define THREAD_LOCAL 292
270 #define DOTDOTDOT 294
276 #define APPENDING 300
277 #define DLLIMPORT 301
278 #define DLLEXPORT 302
279 #define EXTERN_WEAK 303
286 #define ADDRSPACE 310
292 #define SIDEEFFECT 316
295 #define FASTCC_TOK 319
296 #define COLDCC_TOK 320
297 #define X86_STDCALLCC_TOK 321
298 #define X86_FASTCALLCC_TOK 322
299 #define X86_SSECALLCC_TOK 323
300 #define DATALAYOUT 324
306 #define UNREACHABLE 330
351 #define GETELEMENTPTR 375
367 #define EXTRACTELEMENT 391
368 #define INSERTELEMENT 392
369 #define SHUFFLEVECTOR 393
370 #define GETRESULT 394
371 #define EXTRACTVALUE 395
372 #define INSERTVALUE 396
387 #define PROTECTED 411
392 /* Copy the first part of user declarations. */
393 #line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
395 #include "ParserInternals.h"
396 #include "llvm/CallingConv.h"
397 #include "llvm/InlineAsm.h"
398 #include "llvm/Instructions.h"
399 #include "llvm/Module.h"
400 #include "llvm/ValueSymbolTable.h"
401 #include "llvm/AutoUpgrade.h"
402 #include "llvm/Support/GetElementPtrTypeIterator.h"
403 #include "llvm/Support/CommandLine.h"
404 #include "llvm/ADT/SmallVector.h"
405 #include "llvm/ADT/STLExtras.h"
406 #include "llvm/Support/MathExtras.h"
407 #include "llvm/Support/Streams.h"
413 // The following is a gross hack. In order to rid the libAsmParser library of
414 // exceptions, we have to have a way of getting the yyparse function to go into
415 // an error situation. So, whenever we want an error to occur, the GenerateError
416 // function (see bottom of file) sets TriggerError. Then, at the end of each
417 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
418 // (a goto) to put YACC in error state. Furthermore, several calls to
419 // GenerateError are made from inside productions and they must simulate the
420 // previous exception behavior by exiting the production immediately. We have
421 // replaced these with the GEN_ERROR macro which calls GeneratError and then
422 // immediately invokes YYERROR. This would be so much cleaner if it was a
423 // recursive descent parser.
424 static bool TriggerError = false;
425 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
426 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
428 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
429 int yylex(); // declaration" of xxx warnings.
431 using namespace llvm;
433 static Module *ParserResult;
435 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
436 // relating to upreferences in the input stream.
438 //#define DEBUG_UPREFS 1
440 #define UR_OUT(X) cerr << X
445 #define YYERROR_VERBOSE 1
447 static GlobalVariable *CurGV;
450 // This contains info used when building the body of a function. It is
451 // destroyed when the function is completed.
453 typedef std::vector<Value *> ValueList; // Numbered defs
456 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
458 static struct PerModuleInfo {
459 Module *CurrentModule;
460 ValueList Values; // Module level numbered definitions
461 ValueList LateResolveValues;
462 std::vector<PATypeHolder> Types;
463 std::map<ValID, PATypeHolder> LateResolveTypes;
465 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
466 /// how they were referenced and on which line of the input they came from so
467 /// that we can resolve them later and print error messages as appropriate.
468 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
470 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
471 // references to global values. Global values may be referenced before they
472 // are defined, and if so, the temporary object that they represent is held
473 // here. This is used for forward references of GlobalValues.
475 typedef std::map<std::pair<const PointerType *,
476 ValID>, GlobalValue*> GlobalRefsType;
477 GlobalRefsType GlobalRefs;
480 // If we could not resolve some functions at function compilation time
481 // (calls to functions before they are defined), resolve them now... Types
482 // are resolved when the constant pool has been completely parsed.
484 ResolveDefinitions(LateResolveValues);
488 // Check to make sure that all global value forward references have been
491 if (!GlobalRefs.empty()) {
492 std::string UndefinedReferences = "Unresolved global references exist:\n";
494 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
496 UndefinedReferences += " " + I->first.first->getDescription() + " " +
497 I->first.second.getName() + "\n";
499 GenerateError(UndefinedReferences);
503 // Look for intrinsic functions and CallInst that need to be upgraded
504 for (Module::iterator FI = CurrentModule->begin(),
505 FE = CurrentModule->end(); FI != FE; )
506 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
508 Values.clear(); // Clear out function local definitions
513 // GetForwardRefForGlobal - Check to see if there is a forward reference
514 // for this global. If so, remove it from the GlobalRefs map and return it.
515 // If not, just return null.
516 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
517 // Check to see if there is a forward reference to this global variable...
518 // if there is, eliminate it and patch the reference to use the new def'n.
519 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
520 GlobalValue *Ret = 0;
521 if (I != GlobalRefs.end()) {
528 bool TypeIsUnresolved(PATypeHolder* PATy) {
529 // If it isn't abstract, its resolved
530 const Type* Ty = PATy->get();
531 if (!Ty->isAbstract())
533 // Traverse the type looking for abstract types. If it isn't abstract then
534 // we don't need to traverse that leg of the type.
535 std::vector<const Type*> WorkList, SeenList;
536 WorkList.push_back(Ty);
537 while (!WorkList.empty()) {
538 const Type* Ty = WorkList.back();
539 SeenList.push_back(Ty);
541 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
542 // Check to see if this is an unresolved type
543 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
544 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
545 for ( ; I != E; ++I) {
546 if (I->second.get() == OpTy)
549 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
550 const Type* TheTy = SeqTy->getElementType();
551 if (TheTy->isAbstract() && TheTy != Ty) {
552 std::vector<const Type*>::iterator I = SeenList.begin(),
558 WorkList.push_back(TheTy);
560 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
561 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
562 const Type* TheTy = StrTy->getElementType(i);
563 if (TheTy->isAbstract() && TheTy != Ty) {
564 std::vector<const Type*>::iterator I = SeenList.begin(),
570 WorkList.push_back(TheTy);
579 static struct PerFunctionInfo {
580 Function *CurrentFunction; // Pointer to current function being created
582 ValueList Values; // Keep track of #'d definitions
584 ValueList LateResolveValues;
585 bool isDeclare; // Is this function a forward declararation?
586 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
587 GlobalValue::VisibilityTypes Visibility;
589 /// BBForwardRefs - When we see forward references to basic blocks, keep
590 /// track of them here.
591 std::map<ValID, BasicBlock*> BBForwardRefs;
593 inline PerFunctionInfo() {
596 Linkage = GlobalValue::ExternalLinkage;
597 Visibility = GlobalValue::DefaultVisibility;
600 inline void FunctionStart(Function *M) {
605 void FunctionDone() {
606 // Any forward referenced blocks left?
607 if (!BBForwardRefs.empty()) {
608 GenerateError("Undefined reference to label " +
609 BBForwardRefs.begin()->second->getName());
613 // Resolve all forward references now.
614 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
616 Values.clear(); // Clear out function local definitions
617 BBForwardRefs.clear();
620 Linkage = GlobalValue::ExternalLinkage;
621 Visibility = GlobalValue::DefaultVisibility;
623 } CurFun; // Info for the current function...
625 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
628 //===----------------------------------------------------------------------===//
629 // Code to handle definitions of all the types
630 //===----------------------------------------------------------------------===//
632 /// InsertValue - Insert a value into the value table. If it is named, this
633 /// returns -1, otherwise it returns the slot number for the value.
634 static int InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
635 // Things that have names or are void typed don't get slot numbers
636 if (V->hasName() || (V->getType() == Type::VoidTy))
639 // In the case of function values, we have to allow for the forward reference
640 // of basic blocks, which are included in the numbering. Consequently, we keep
641 // track of the next insertion location with NextValNum. When a BB gets
642 // inserted, it could change the size of the CurFun.Values vector.
643 if (&ValueTab == &CurFun.Values) {
644 if (ValueTab.size() <= CurFun.NextValNum)
645 ValueTab.resize(CurFun.NextValNum+1);
646 ValueTab[CurFun.NextValNum++] = V;
647 return CurFun.NextValNum-1;
649 // For all other lists, its okay to just tack it on the back of the vector.
650 ValueTab.push_back(V);
651 return ValueTab.size()-1;
654 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
656 case ValID::LocalID: // Is it a numbered definition?
657 // Module constants occupy the lowest numbered slots...
658 if (D.Num < CurModule.Types.size())
659 return CurModule.Types[D.Num];
661 case ValID::LocalName: // Is it a named definition?
662 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
663 D.destroy(); // Free old strdup'd memory...
668 GenerateError("Internal parser error: Invalid symbol type reference");
672 // If we reached here, we referenced either a symbol that we don't know about
673 // or an id number that hasn't been read yet. We may be referencing something
674 // forward, so just create an entry to be resolved later and get to it...
676 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
679 if (inFunctionScope()) {
680 if (D.Type == ValID::LocalName) {
681 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
684 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
689 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
690 if (I != CurModule.LateResolveTypes.end())
693 Type *Typ = OpaqueType::get();
694 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
698 // getExistingVal - Look up the value specified by the provided type and
699 // the provided ValID. If the value exists and has already been defined, return
700 // it. Otherwise return null.
702 static Value *getExistingVal(const Type *Ty, const ValID &D) {
703 if (isa<FunctionType>(Ty)) {
704 GenerateError("Functions are not values and "
705 "must be referenced as pointers");
710 case ValID::LocalID: { // Is it a numbered definition?
711 // Check that the number is within bounds.
712 if (D.Num >= CurFun.Values.size())
714 Value *Result = CurFun.Values[D.Num];
715 if (Ty != Result->getType()) {
716 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
717 Result->getType()->getDescription() + "' does not match "
718 "expected type, '" + Ty->getDescription() + "'");
723 case ValID::GlobalID: { // Is it a numbered definition?
724 if (D.Num >= CurModule.Values.size())
726 Value *Result = CurModule.Values[D.Num];
727 if (Ty != Result->getType()) {
728 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
729 Result->getType()->getDescription() + "' does not match "
730 "expected type, '" + Ty->getDescription() + "'");
736 case ValID::LocalName: { // Is it a named definition?
737 if (!inFunctionScope())
739 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
740 Value *N = SymTab.lookup(D.getName());
743 if (N->getType() != Ty)
746 D.destroy(); // Free old strdup'd memory...
749 case ValID::GlobalName: { // Is it a named definition?
750 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
751 Value *N = SymTab.lookup(D.getName());
754 if (N->getType() != Ty)
757 D.destroy(); // Free old strdup'd memory...
761 // Check to make sure that "Ty" is an integral type, and that our
762 // value will fit into the specified type...
763 case ValID::ConstSIntVal: // Is it a constant pool reference??
764 if (!isa<IntegerType>(Ty) ||
765 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
766 GenerateError("Signed integral constant '" +
767 itostr(D.ConstPool64) + "' is invalid for type '" +
768 Ty->getDescription() + "'");
771 return ConstantInt::get(Ty, D.ConstPool64, true);
773 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
774 if (isa<IntegerType>(Ty) &&
775 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
776 return ConstantInt::get(Ty, D.UConstPool64);
778 if (!isa<IntegerType>(Ty) ||
779 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
780 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
781 "' is invalid or out of range for type '" +
782 Ty->getDescription() + "'");
785 // This is really a signed reference. Transmogrify.
786 return ConstantInt::get(Ty, D.ConstPool64, true);
788 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
789 if (!isa<IntegerType>(Ty)) {
790 GenerateError("Integral constant '" + D.getName() +
791 "' is invalid or out of range for type '" +
792 Ty->getDescription() + "'");
797 APSInt Tmp = *D.ConstPoolInt;
798 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
799 return ConstantInt::get(Tmp);
802 case ValID::ConstFPVal: // Is it a floating point const pool reference?
803 if (!Ty->isFloatingPoint() ||
804 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
805 GenerateError("FP constant invalid for type");
808 // Lexer has no type info, so builds all float and double FP constants
809 // as double. Fix this here. Long double does not need this.
810 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
812 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
813 return ConstantFP::get(*D.ConstPoolFP);
815 case ValID::ConstNullVal: // Is it a null value?
816 if (!isa<PointerType>(Ty)) {
817 GenerateError("Cannot create a a non pointer null");
820 return ConstantPointerNull::get(cast<PointerType>(Ty));
822 case ValID::ConstUndefVal: // Is it an undef value?
823 return UndefValue::get(Ty);
825 case ValID::ConstZeroVal: // Is it a zero value?
826 return Constant::getNullValue(Ty);
828 case ValID::ConstantVal: // Fully resolved constant?
829 if (D.ConstantValue->getType() != Ty) {
830 GenerateError("Constant expression type different from required type");
833 return D.ConstantValue;
835 case ValID::InlineAsmVal: { // Inline asm expression
836 const PointerType *PTy = dyn_cast<PointerType>(Ty);
837 const FunctionType *FTy =
838 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
839 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
840 GenerateError("Invalid type for asm constraint string");
843 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
844 D.IAD->HasSideEffects);
845 D.destroy(); // Free InlineAsmDescriptor.
849 assert(0 && "Unhandled case!");
853 assert(0 && "Unhandled case!");
857 // getVal - This function is identical to getExistingVal, except that if a
858 // value is not already defined, it "improvises" by creating a placeholder var
859 // that looks and acts just like the requested variable. When the value is
860 // defined later, all uses of the placeholder variable are replaced with the
863 static Value *getVal(const Type *Ty, const ValID &ID) {
864 if (Ty == Type::LabelTy) {
865 GenerateError("Cannot use a basic block here");
869 // See if the value has already been defined.
870 Value *V = getExistingVal(Ty, ID);
872 if (TriggerError) return 0;
874 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
875 GenerateError("Invalid use of a non-first-class type");
879 // If we reached here, we referenced either a symbol that we don't know about
880 // or an id number that hasn't been read yet. We may be referencing something
881 // forward, so just create an entry to be resolved later and get to it...
884 case ValID::GlobalName:
885 case ValID::GlobalID: {
886 const PointerType *PTy = dyn_cast<PointerType>(Ty);
888 GenerateError("Invalid type for reference to global" );
891 const Type* ElTy = PTy->getElementType();
892 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
893 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
895 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
896 (Module*)0, false, PTy->getAddressSpace());
900 V = new Argument(Ty);
903 // Remember where this forward reference came from. FIXME, shouldn't we try
904 // to recycle these things??
905 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
908 if (inFunctionScope())
909 InsertValue(V, CurFun.LateResolveValues);
911 InsertValue(V, CurModule.LateResolveValues);
915 /// defineBBVal - This is a definition of a new basic block with the specified
916 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
917 static BasicBlock *defineBBVal(const ValID &ID) {
918 assert(inFunctionScope() && "Can't get basic block at global scope!");
922 // First, see if this was forward referenced
924 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
925 if (BBI != CurFun.BBForwardRefs.end()) {
927 // The forward declaration could have been inserted anywhere in the
928 // function: insert it into the correct place now.
929 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
930 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
932 // We're about to erase the entry, save the key so we can clean it up.
933 ValID Tmp = BBI->first;
935 // Erase the forward ref from the map as its no longer "forward"
936 CurFun.BBForwardRefs.erase(ID);
938 // The key has been removed from the map but so we don't want to leave
939 // strdup'd memory around so destroy it too.
942 // If its a numbered definition, bump the number and set the BB value.
943 if (ID.Type == ValID::LocalID) {
944 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
948 // We haven't seen this BB before and its first mention is a definition.
949 // Just create it and return it.
950 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
951 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
952 if (ID.Type == ValID::LocalID) {
953 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
962 /// getBBVal - get an existing BB value or create a forward reference for it.
964 static BasicBlock *getBBVal(const ValID &ID) {
965 assert(inFunctionScope() && "Can't get basic block at global scope!");
969 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
970 if (BBI != CurFun.BBForwardRefs.end()) {
972 } if (ID.Type == ValID::LocalName) {
973 std::string Name = ID.getName();
974 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
976 if (N->getType()->getTypeID() == Type::LabelTyID)
977 BB = cast<BasicBlock>(N);
979 GenerateError("Reference to label '" + Name + "' is actually of type '"+
980 N->getType()->getDescription() + "'");
982 } else if (ID.Type == ValID::LocalID) {
983 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
984 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
985 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
987 GenerateError("Reference to label '%" + utostr(ID.Num) +
988 "' is actually of type '"+
989 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
992 GenerateError("Illegal label reference " + ID.getName());
996 // If its already been defined, return it now.
998 ID.destroy(); // Free strdup'd memory.
1002 // Otherwise, this block has not been seen before, create it.
1004 if (ID.Type == ValID::LocalName)
1005 Name = ID.getName();
1006 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1008 // Insert it in the forward refs map.
1009 CurFun.BBForwardRefs[ID] = BB;
1015 //===----------------------------------------------------------------------===//
1016 // Code to handle forward references in instructions
1017 //===----------------------------------------------------------------------===//
1019 // This code handles the late binding needed with statements that reference
1020 // values not defined yet... for example, a forward branch, or the PHI node for
1023 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1024 // and back patchs after we are done.
1027 // ResolveDefinitions - If we could not resolve some defs at parsing
1028 // time (forward branches, phi functions for loops, etc...) resolve the
1032 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1033 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1034 while (!LateResolvers.empty()) {
1035 Value *V = LateResolvers.back();
1036 LateResolvers.pop_back();
1038 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1039 CurModule.PlaceHolderInfo.find(V);
1040 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1042 ValID &DID = PHI->second.first;
1044 Value *TheRealValue = getExistingVal(V->getType(), DID);
1048 V->replaceAllUsesWith(TheRealValue);
1050 CurModule.PlaceHolderInfo.erase(PHI);
1051 } else if (FutureLateResolvers) {
1052 // Functions have their unresolved items forwarded to the module late
1054 InsertValue(V, *FutureLateResolvers);
1056 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1057 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1058 "' of type '" + V->getType()->getDescription() + "'",
1059 PHI->second.second);
1062 GenerateError("Reference to an invalid definition: #" +
1063 itostr(DID.Num) + " of type '" +
1064 V->getType()->getDescription() + "'",
1065 PHI->second.second);
1070 LateResolvers.clear();
1073 // ResolveTypeTo - A brand new type was just declared. This means that (if
1074 // name is not null) things referencing Name can be resolved. Otherwise, things
1075 // refering to the number can be resolved. Do this now.
1077 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1080 D = ValID::createLocalName(*Name);
1082 D = ValID::createLocalID(CurModule.Types.size());
1084 std::map<ValID, PATypeHolder>::iterator I =
1085 CurModule.LateResolveTypes.find(D);
1086 if (I != CurModule.LateResolveTypes.end()) {
1087 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1088 CurModule.LateResolveTypes.erase(I);
1092 // setValueName - Set the specified value to the name given. The name may be
1093 // null potentially, in which case this is a noop. The string passed in is
1094 // assumed to be a malloc'd string buffer, and is free'd by this function.
1096 static void setValueName(Value *V, std::string *NameStr) {
1097 if (!NameStr) return;
1098 std::string Name(*NameStr); // Copy string
1099 delete NameStr; // Free old string
1101 if (V->getType() == Type::VoidTy) {
1102 GenerateError("Can't assign name '" + Name+"' to value with void type");
1106 assert(inFunctionScope() && "Must be in function scope!");
1107 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1108 if (ST.lookup(Name)) {
1109 GenerateError("Redefinition of value '" + Name + "' of type '" +
1110 V->getType()->getDescription() + "'");
1118 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1119 /// this is a declaration, otherwise it is a definition.
1120 static GlobalVariable *
1121 ParseGlobalVariable(std::string *NameStr,
1122 GlobalValue::LinkageTypes Linkage,
1123 GlobalValue::VisibilityTypes Visibility,
1124 bool isConstantGlobal, const Type *Ty,
1125 Constant *Initializer, bool IsThreadLocal,
1126 unsigned AddressSpace = 0) {
1127 if (isa<FunctionType>(Ty)) {
1128 GenerateError("Cannot declare global vars of function type");
1131 if (Ty == Type::LabelTy) {
1132 GenerateError("Cannot declare global vars of label type");
1136 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1140 Name = *NameStr; // Copy string
1141 delete NameStr; // Free old string
1144 // See if this global value was forward referenced. If so, recycle the
1147 if (!Name.empty()) {
1148 ID = ValID::createGlobalName(Name);
1150 ID = ValID::createGlobalID(CurModule.Values.size());
1153 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1154 // Move the global to the end of the list, from whereever it was
1155 // previously inserted.
1156 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1157 CurModule.CurrentModule->getGlobalList().remove(GV);
1158 CurModule.CurrentModule->getGlobalList().push_back(GV);
1159 GV->setInitializer(Initializer);
1160 GV->setLinkage(Linkage);
1161 GV->setVisibility(Visibility);
1162 GV->setConstant(isConstantGlobal);
1163 GV->setThreadLocal(IsThreadLocal);
1164 InsertValue(GV, CurModule.Values);
1168 // If this global has a name
1169 if (!Name.empty()) {
1170 // if the global we're parsing has an initializer (is a definition) and
1171 // has external linkage.
1172 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1173 // If there is already a global with external linkage with this name
1174 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1175 // If we allow this GVar to get created, it will be renamed in the
1176 // symbol table because it conflicts with an existing GVar. We can't
1177 // allow redefinition of GVars whose linking indicates that their name
1178 // must stay the same. Issue the error.
1179 GenerateError("Redefinition of global variable named '" + Name +
1180 "' of type '" + Ty->getDescription() + "'");
1185 // Otherwise there is no existing GV to use, create one now.
1186 GlobalVariable *GV =
1187 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1188 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1189 GV->setVisibility(Visibility);
1190 InsertValue(GV, CurModule.Values);
1194 // setTypeName - Set the specified type to the name given. The name may be
1195 // null potentially, in which case this is a noop. The string passed in is
1196 // assumed to be a malloc'd string buffer, and is freed by this function.
1198 // This function returns true if the type has already been defined, but is
1199 // allowed to be redefined in the specified context. If the name is a new name
1200 // for the type plane, it is inserted and false is returned.
1201 static bool setTypeName(const Type *T, std::string *NameStr) {
1202 assert(!inFunctionScope() && "Can't give types function-local names!");
1203 if (NameStr == 0) return false;
1205 std::string Name(*NameStr); // Copy string
1206 delete NameStr; // Free old string
1208 // We don't allow assigning names to void type
1209 if (T == Type::VoidTy) {
1210 GenerateError("Can't assign name '" + Name + "' to the void type");
1214 // Set the type name, checking for conflicts as we do so.
1215 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1217 if (AlreadyExists) { // Inserting a name that is already defined???
1218 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1219 assert(Existing && "Conflict but no matching type?!");
1221 // There is only one case where this is allowed: when we are refining an
1222 // opaque type. In this case, Existing will be an opaque type.
1223 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1224 // We ARE replacing an opaque type!
1225 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1229 // Otherwise, this is an attempt to redefine a type. That's okay if
1230 // the redefinition is identical to the original. This will be so if
1231 // Existing and T point to the same Type object. In this one case we
1232 // allow the equivalent redefinition.
1233 if (Existing == T) return true; // Yes, it's equal.
1235 // Any other kind of (non-equivalent) redefinition is an error.
1236 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1237 T->getDescription() + "'");
1243 //===----------------------------------------------------------------------===//
1244 // Code for handling upreferences in type names...
1247 // TypeContains - Returns true if Ty directly contains E in it.
1249 static bool TypeContains(const Type *Ty, const Type *E) {
1250 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1251 E) != Ty->subtype_end();
1255 struct UpRefRecord {
1256 // NestingLevel - The number of nesting levels that need to be popped before
1257 // this type is resolved.
1258 unsigned NestingLevel;
1260 // LastContainedTy - This is the type at the current binding level for the
1261 // type. Every time we reduce the nesting level, this gets updated.
1262 const Type *LastContainedTy;
1264 // UpRefTy - This is the actual opaque type that the upreference is
1265 // represented with.
1266 OpaqueType *UpRefTy;
1268 UpRefRecord(unsigned NL, OpaqueType *URTy)
1269 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1273 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1274 static std::vector<UpRefRecord> UpRefs;
1276 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1277 /// called. It loops through the UpRefs vector, which is a list of the
1278 /// currently active types. For each type, if the up reference is contained in
1279 /// the newly completed type, we decrement the level count. When the level
1280 /// count reaches zero, the upreferenced type is the type that is passed in:
1281 /// thus we can complete the cycle.
1283 static PATypeHolder HandleUpRefs(const Type *ty) {
1284 // If Ty isn't abstract, or if there are no up-references in it, then there is
1285 // nothing to resolve here.
1286 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1288 PATypeHolder Ty(ty);
1289 UR_OUT("Type '" << Ty->getDescription() <<
1290 "' newly formed. Resolving upreferences.\n" <<
1291 UpRefs.size() << " upreferences active!\n");
1293 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1294 // to zero), we resolve them all together before we resolve them to Ty. At
1295 // the end of the loop, if there is anything to resolve to Ty, it will be in
1297 OpaqueType *TypeToResolve = 0;
1299 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1300 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1301 << UpRefs[i].second->getDescription() << ") = "
1302 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1303 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1304 // Decrement level of upreference
1305 unsigned Level = --UpRefs[i].NestingLevel;
1306 UpRefs[i].LastContainedTy = Ty;
1307 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1308 if (Level == 0) { // Upreference should be resolved!
1309 if (!TypeToResolve) {
1310 TypeToResolve = UpRefs[i].UpRefTy;
1312 UR_OUT(" * Resolving upreference for "
1313 << UpRefs[i].second->getDescription() << "\n";
1314 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1315 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1316 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1317 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1319 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1320 --i; // Do not skip the next element...
1325 if (TypeToResolve) {
1326 UR_OUT(" * Resolving upreference for "
1327 << UpRefs[i].second->getDescription() << "\n";
1328 std::string OldName = TypeToResolve->getDescription());
1329 TypeToResolve->refineAbstractTypeTo(Ty);
1335 //===----------------------------------------------------------------------===//
1336 // RunVMAsmParser - Define an interface to this parser
1337 //===----------------------------------------------------------------------===//
1339 static Module* RunParser(Module * M);
1341 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1343 Module *M = RunParser(new Module(LLLgetFilename()));
1350 /* Enabling traces. */
1355 /* Enabling verbose error messages. */
1356 #ifdef YYERROR_VERBOSE
1357 # undef YYERROR_VERBOSE
1358 # define YYERROR_VERBOSE 1
1360 # define YYERROR_VERBOSE 0
1363 /* Enabling the token table. */
1364 #ifndef YYTOKEN_TABLE
1365 # define YYTOKEN_TABLE 0
1368 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1369 typedef union YYSTYPE
1370 #line 970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
1372 llvm::Module *ModuleVal;
1373 llvm::Function *FunctionVal;
1374 llvm::BasicBlock *BasicBlockVal;
1375 llvm::TerminatorInst *TermInstVal;
1376 llvm::Instruction *InstVal;
1377 llvm::Constant *ConstVal;
1379 const llvm::Type *PrimType;
1380 std::list<llvm::PATypeHolder> *TypeList;
1381 llvm::PATypeHolder *TypeVal;
1382 llvm::Value *ValueVal;
1383 std::vector<llvm::Value*> *ValueList;
1384 std::vector<unsigned> *ConstantList;
1385 llvm::ArgListType *ArgList;
1386 llvm::TypeWithAttrs TypeWithAttrs;
1387 llvm::TypeWithAttrsList *TypeWithAttrsList;
1388 llvm::ParamList *ParamList;
1390 // Represent the RHS of PHI node
1391 std::list<std::pair<llvm::Value*,
1392 llvm::BasicBlock*> > *PHIList;
1393 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1394 std::vector<llvm::Constant*> *ConstVector;
1396 llvm::GlobalValue::LinkageTypes Linkage;
1397 llvm::GlobalValue::VisibilityTypes Visibility;
1398 llvm::ParameterAttributes ParamAttrs;
1399 llvm::APInt *APIntVal;
1404 llvm::APFloat *FPVal;
1407 std::string *StrVal; // This memory must be deleted
1408 llvm::ValID ValIDVal;
1410 llvm::Instruction::BinaryOps BinaryOpVal;
1411 llvm::Instruction::TermOps TermOpVal;
1412 llvm::Instruction::MemoryOps MemOpVal;
1413 llvm::Instruction::CastOps CastOpVal;
1414 llvm::Instruction::OtherOps OtherOpVal;
1415 llvm::ICmpInst::Predicate IPredicate;
1416 llvm::FCmpInst::Predicate FPredicate;
1418 /* Line 193 of yacc.c. */
1419 #line 1420 "llvmAsmParser.tab.c"
1421 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1422 # define YYSTYPE_IS_DECLARED 1
1423 # define YYSTYPE_IS_TRIVIAL 1
1428 /* Copy the second part of user declarations. */
1431 /* Line 216 of yacc.c. */
1432 #line 1433 "llvmAsmParser.tab.c"
1439 typedef YYTYPE_UINT8 yytype_uint8;
1441 typedef unsigned char yytype_uint8;
1445 typedef YYTYPE_INT8 yytype_int8;
1446 #elif (defined __STDC__ || defined __C99__FUNC__ \
1447 || defined __cplusplus || defined _MSC_VER)
1448 typedef signed char yytype_int8;
1450 typedef short int yytype_int8;
1453 #ifdef YYTYPE_UINT16
1454 typedef YYTYPE_UINT16 yytype_uint16;
1456 typedef unsigned short int yytype_uint16;
1460 typedef YYTYPE_INT16 yytype_int16;
1462 typedef short int yytype_int16;
1466 # ifdef __SIZE_TYPE__
1467 # define YYSIZE_T __SIZE_TYPE__
1468 # elif defined size_t
1469 # define YYSIZE_T size_t
1470 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1471 || defined __cplusplus || defined _MSC_VER)
1472 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1473 # define YYSIZE_T size_t
1475 # define YYSIZE_T unsigned int
1479 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1482 # if defined YYENABLE_NLS && YYENABLE_NLS
1484 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1485 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1489 # define YY_(msgid) msgid
1493 /* Suppress unused-variable warnings by "using" E. */
1494 #if ! defined lint || defined __GNUC__
1495 # define YYUSE(e) ((void) (e))
1497 # define YYUSE(e) /* empty */
1500 /* Identity function, used to suppress warnings about constant conditions. */
1502 # define YYID(n) (n)
1504 #if (defined __STDC__ || defined __C99__FUNC__ \
1505 || defined __cplusplus || defined _MSC_VER)
1518 #if ! defined yyoverflow || YYERROR_VERBOSE
1520 /* The parser invokes alloca or malloc; define the necessary symbols. */
1522 # ifdef YYSTACK_USE_ALLOCA
1523 # if YYSTACK_USE_ALLOCA
1525 # define YYSTACK_ALLOC __builtin_alloca
1526 # elif defined __BUILTIN_VA_ARG_INCR
1527 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1529 # define YYSTACK_ALLOC __alloca
1530 # elif defined _MSC_VER
1531 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1532 # define alloca _alloca
1534 # define YYSTACK_ALLOC alloca
1535 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1536 || defined __cplusplus || defined _MSC_VER)
1537 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1539 # define _STDLIB_H 1
1546 # ifdef YYSTACK_ALLOC
1547 /* Pacify GCC's `empty if-body' warning. */
1548 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1549 # ifndef YYSTACK_ALLOC_MAXIMUM
1550 /* The OS might guarantee only one guard page at the bottom of the stack,
1551 and a page size can be as small as 4096 bytes. So we cannot safely
1552 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1553 to allow for a few compiler-allocated temporary stack slots. */
1554 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1557 # define YYSTACK_ALLOC YYMALLOC
1558 # define YYSTACK_FREE YYFREE
1559 # ifndef YYSTACK_ALLOC_MAXIMUM
1560 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1562 # if (defined __cplusplus && ! defined _STDLIB_H \
1563 && ! ((defined YYMALLOC || defined malloc) \
1564 && (defined YYFREE || defined free)))
1565 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1567 # define _STDLIB_H 1
1571 # define YYMALLOC malloc
1572 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1573 || defined __cplusplus || defined _MSC_VER)
1574 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1578 # define YYFREE free
1579 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1580 || defined __cplusplus || defined _MSC_VER)
1581 void free (void *); /* INFRINGES ON USER NAME SPACE */
1585 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1588 #if (! defined yyoverflow \
1589 && (! defined __cplusplus \
1590 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1592 /* A type that is properly aligned for any stack member. */
1599 /* The size of the maximum gap between one aligned stack and the next. */
1600 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1602 /* The size of an array large to enough to hold all stacks, each with
1604 # define YYSTACK_BYTES(N) \
1605 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1606 + YYSTACK_GAP_MAXIMUM)
1608 /* Copy COUNT objects from FROM to TO. The source and destination do
1611 # if defined __GNUC__ && 1 < __GNUC__
1612 # define YYCOPY(To, From, Count) \
1613 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1615 # define YYCOPY(To, From, Count) \
1619 for (yyi = 0; yyi < (Count); yyi++) \
1620 (To)[yyi] = (From)[yyi]; \
1626 /* Relocate STACK from its old location to the new one. The
1627 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1628 elements in the stack, and YYPTR gives the new location of the
1629 stack. Advance YYPTR to a properly aligned location for the next
1631 # define YYSTACK_RELOCATE(Stack) \
1634 YYSIZE_T yynewbytes; \
1635 YYCOPY (&yyptr->Stack, Stack, yysize); \
1636 Stack = &yyptr->Stack; \
1637 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1638 yyptr += yynewbytes / sizeof (*yyptr); \
1644 /* YYFINAL -- State number of the termination state. */
1646 /* YYLAST -- Last index in YYTABLE. */
1649 /* YYNTOKENS -- Number of terminals. */
1650 #define YYNTOKENS 171
1651 /* YYNNTS -- Number of nonterminals. */
1653 /* YYNRULES -- Number of rules. */
1654 #define YYNRULES 346
1655 /* YYNRULES -- Number of states. */
1656 #define YYNSTATES 707
1658 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1659 #define YYUNDEFTOK 2
1660 #define YYMAXUTOK 411
1662 #define YYTRANSLATE(YYX) \
1663 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1665 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1666 static const yytype_uint8 yytranslate[] =
1668 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1669 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1671 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1672 157, 158, 161, 2, 160, 2, 2, 2, 2, 2,
1673 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1674 166, 159, 167, 2, 2, 2, 2, 2, 2, 2,
1675 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1676 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1677 2, 163, 162, 165, 2, 2, 2, 2, 2, 170,
1678 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1679 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1680 164, 2, 2, 168, 2, 169, 2, 2, 2, 2,
1681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1684 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
1694 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1695 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1696 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1697 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1698 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1699 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1700 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1701 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1702 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1703 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1704 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1705 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1706 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1707 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1708 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1713 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1715 static const yytype_uint16 yyprhs[] =
1717 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1718 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1719 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1720 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1721 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1722 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1723 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1724 140, 143, 145, 147, 149, 150, 153, 155, 157, 159,
1725 161, 163, 165, 167, 169, 171, 172, 174, 176, 178,
1726 179, 181, 183, 184, 186, 188, 190, 192, 193, 195,
1727 197, 198, 200, 202, 204, 206, 208, 210, 213, 215,
1728 217, 219, 221, 223, 225, 227, 229, 231, 234, 235,
1729 238, 240, 242, 244, 246, 248, 250, 251, 254, 255,
1730 258, 259, 262, 263, 267, 270, 271, 273, 274, 278,
1731 280, 283, 285, 287, 289, 291, 293, 295, 297, 299,
1732 301, 305, 307, 310, 316, 322, 328, 334, 338, 341,
1733 347, 352, 355, 357, 359, 361, 365, 367, 371, 373,
1734 374, 376, 380, 385, 389, 393, 398, 403, 407, 414,
1735 420, 423, 426, 429, 432, 435, 438, 441, 444, 447,
1736 450, 453, 456, 463, 469, 478, 485, 492, 500, 508,
1737 516, 524, 531, 540, 549, 555, 563, 567, 569, 571,
1738 573, 575, 576, 579, 586, 588, 589, 591, 594, 595,
1739 599, 600, 604, 608, 612, 616, 617, 626, 627, 637,
1740 638, 648, 654, 657, 661, 663, 667, 671, 675, 679,
1741 681, 682, 688, 692, 694, 698, 700, 701, 712, 714,
1742 716, 721, 723, 725, 728, 732, 733, 735, 737, 739,
1743 741, 743, 745, 747, 749, 751, 753, 755, 759, 763,
1744 766, 769, 773, 776, 782, 787, 789, 795, 797, 799,
1745 801, 803, 805, 807, 810, 812, 816, 819, 822, 826,
1746 830, 833, 834, 836, 839, 842, 846, 856, 866, 875,
1747 890, 892, 894, 901, 907, 910, 913, 920, 928, 933,
1748 938, 945, 952, 953, 954, 958, 961, 965, 968, 970,
1749 976, 982, 989, 996, 1003, 1010, 1015, 1022, 1027, 1032,
1750 1039, 1046, 1049, 1058, 1060, 1062, 1063, 1067, 1074, 1078,
1751 1085, 1088, 1094, 1102, 1108, 1113, 1118
1754 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1755 static const yytype_int16 yyrhs[] =
1757 218, 0, -1, 76, -1, 77, -1, 78, -1, 79,
1758 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1759 -1, 88, -1, 89, -1, 90, -1, 85, -1, 86,
1760 -1, 87, -1, 121, -1, 122, -1, 123, -1, 124,
1761 -1, 125, -1, 126, -1, 127, -1, 128, -1, 129,
1762 -1, 130, -1, 131, -1, 132, -1, 95, -1, 96,
1763 -1, 97, -1, 98, -1, 99, -1, 100, -1, 101,
1764 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1765 -1, 107, -1, 108, -1, 109, -1, 110, -1, 111,
1766 -1, 112, -1, 113, -1, 114, -1, 101, -1, 102,
1767 -1, 103, -1, 104, -1, 26, -1, 27, -1, 11,
1768 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1769 -1, 19, -1, 22, -1, 24, -1, 179, -1, -1,
1770 55, 157, 4, 158, -1, -1, 179, 159, -1, -1,
1771 7, 159, -1, 20, -1, 23, -1, 186, -1, -1,
1772 184, 159, -1, 42, -1, 44, -1, 43, -1, 45,
1773 -1, 47, -1, 49, -1, 46, -1, 48, -1, 51,
1774 -1, -1, 154, -1, 155, -1, 156, -1, -1, 46,
1775 -1, 48, -1, -1, 42, -1, 43, -1, 44, -1,
1776 47, -1, -1, 44, -1, 42, -1, -1, 63, -1,
1777 64, -1, 65, -1, 66, -1, 67, -1, 68, -1,
1778 62, 4, -1, 143, -1, 122, -1, 142, -1, 123,
1779 -1, 145, -1, 146, -1, 148, -1, 149, -1, 150,
1780 -1, 54, 4, -1, -1, 195, 194, -1, 144, -1,
1781 147, -1, 143, -1, 142, -1, 151, -1, 152, -1,
1782 -1, 197, 196, -1, -1, 153, 22, -1, -1, 54,
1783 4, -1, -1, 160, 54, 4, -1, 34, 22, -1,
1784 -1, 201, -1, -1, 160, 204, 203, -1, 201, -1,
1785 54, 4, -1, 11, -1, 12, -1, 13, -1, 16,
1786 -1, 15, -1, 14, -1, 17, -1, 50, -1, 205,
1787 -1, 206, 181, 161, -1, 240, -1, 162, 4, -1,
1788 206, 157, 210, 158, 197, -1, 10, 157, 210, 158,
1789 197, -1, 163, 4, 164, 206, 165, -1, 166, 4,
1790 164, 206, 167, -1, 168, 211, 169, -1, 168, 169,
1791 -1, 166, 168, 211, 169, 167, -1, 166, 168, 169,
1792 167, -1, 206, 195, -1, 206, -1, 10, -1, 207,
1793 -1, 209, 160, 207, -1, 209, -1, 209, 160, 39,
1794 -1, 39, -1, -1, 206, -1, 211, 160, 206, -1,
1795 206, 163, 214, 165, -1, 206, 163, 165, -1, 206,
1796 170, 22, -1, 206, 166, 214, 167, -1, 206, 168,
1797 214, 169, -1, 206, 168, 169, -1, 206, 166, 168,
1798 214, 169, 167, -1, 206, 166, 168, 169, 167, -1,
1799 206, 40, -1, 206, 41, -1, 206, 240, -1, 206,
1800 213, -1, 206, 25, -1, 177, 3, -1, 177, 5,
1801 -1, 177, 4, -1, 177, 6, -1, 11, 26, -1,
1802 11, 27, -1, 178, 9, -1, 174, 157, 212, 38,
1803 206, 158, -1, 120, 157, 212, 252, 158, -1, 134,
1804 157, 212, 160, 212, 160, 212, 158, -1, 172, 157,
1805 212, 160, 212, 158, -1, 173, 157, 212, 160, 212,
1806 158, -1, 91, 175, 157, 212, 160, 212, 158, -1,
1807 92, 176, 157, 212, 160, 212, 158, -1, 93, 175,
1808 157, 212, 160, 212, 158, -1, 94, 176, 157, 212,
1809 160, 212, 158, -1, 136, 157, 212, 160, 212, 158,
1810 -1, 137, 157, 212, 160, 212, 160, 212, 158, -1,
1811 138, 157, 212, 160, 212, 160, 212, 158, -1, 140,
1812 157, 212, 253, 158, -1, 141, 157, 212, 160, 212,
1813 253, 158, -1, 214, 160, 212, -1, 212, -1, 32,
1814 -1, 33, -1, 37, -1, -1, 208, 240, -1, 126,
1815 157, 217, 38, 206, 158, -1, 219, -1, -1, 220,
1816 -1, 219, 220, -1, -1, 31, 221, 236, -1, -1,
1817 30, 222, 237, -1, 60, 59, 226, -1, 182, 18,
1818 206, -1, 182, 18, 10, -1, -1, 185, 189, 216,
1819 215, 212, 181, 223, 203, -1, -1, 185, 187, 189,
1820 216, 215, 212, 181, 224, 203, -1, -1, 185, 188,
1821 189, 216, 215, 206, 181, 225, 203, -1, 185, 189,
1822 35, 192, 217, -1, 52, 227, -1, 56, 159, 228,
1823 -1, 22, -1, 53, 159, 22, -1, 69, 159, 22,
1824 -1, 163, 229, 165, -1, 229, 160, 22, -1, 22,
1825 -1, -1, 230, 160, 206, 195, 180, -1, 206, 195,
1826 180, -1, 230, -1, 230, 160, 39, -1, 39, -1,
1827 -1, 193, 208, 184, 157, 231, 158, 197, 202, 199,
1828 198, -1, 28, -1, 168, -1, 191, 189, 232, 233,
1829 -1, 29, -1, 169, -1, 244, 235, -1, 190, 189,
1830 232, -1, -1, 61, -1, 3, -1, 4, -1, 5,
1831 -1, 6, -1, 9, -1, 26, -1, 27, -1, 40,
1832 -1, 41, -1, 25, -1, 166, 214, 167, -1, 163,
1833 214, 165, -1, 163, 165, -1, 170, 22, -1, 168,
1834 214, 169, -1, 168, 169, -1, 166, 168, 214, 169,
1835 167, -1, 166, 168, 169, 167, -1, 213, -1, 59,
1836 238, 22, 160, 22, -1, 7, -1, 8, -1, 179,
1837 -1, 184, -1, 240, -1, 239, -1, 206, 241, -1,
1838 242, -1, 243, 160, 242, -1, 244, 245, -1, 234,
1839 245, -1, 246, 182, 247, -1, 246, 183, 247, -1,
1840 246, 249, -1, -1, 21, -1, 70, 243, -1, 70,
1841 10, -1, 71, 17, 241, -1, 71, 11, 241, 160,
1842 17, 241, 160, 17, 241, -1, 72, 177, 241, 160,
1843 17, 241, 163, 248, 165, -1, 72, 177, 241, 160,
1844 17, 241, 163, 165, -1, 73, 193, 208, 241, 157,
1845 251, 158, 197, 38, 17, 241, 74, 17, 241, -1,
1846 74, -1, 75, -1, 248, 177, 239, 160, 17, 241,
1847 -1, 177, 239, 160, 17, 241, -1, 182, 255, -1,
1848 183, 255, -1, 206, 163, 241, 160, 241, 165, -1,
1849 250, 160, 163, 241, 160, 241, 165, -1, 206, 195,
1850 241, 195, -1, 17, 195, 241, 195, -1, 251, 160,
1851 206, 195, 241, 195, -1, 251, 160, 17, 195, 241,
1852 195, -1, -1, -1, 252, 160, 242, -1, 160, 4,
1853 -1, 253, 160, 4, -1, 58, 57, -1, 57, -1,
1854 172, 206, 241, 160, 241, -1, 173, 206, 241, 160,
1855 241, -1, 91, 175, 206, 241, 160, 241, -1, 92,
1856 176, 206, 241, 160, 241, -1, 93, 175, 206, 241,
1857 160, 241, -1, 94, 176, 206, 241, 160, 241, -1,
1858 174, 242, 38, 206, -1, 134, 242, 160, 242, 160,
1859 242, -1, 135, 242, 160, 206, -1, 136, 242, 160,
1860 242, -1, 137, 242, 160, 242, 160, 242, -1, 138,
1861 242, 160, 242, 160, 242, -1, 133, 250, -1, 254,
1862 193, 208, 241, 157, 251, 158, 197, -1, 257, -1,
1863 36, -1, -1, 115, 206, 200, -1, 115, 206, 160,
1864 11, 241, 200, -1, 116, 206, 200, -1, 116, 206,
1865 160, 11, 241, 200, -1, 117, 242, -1, 256, 118,
1866 206, 241, 200, -1, 256, 119, 242, 160, 206, 241,
1867 200, -1, 139, 206, 241, 160, 4, -1, 120, 206,
1868 241, 252, -1, 140, 206, 241, 253, -1, 141, 206,
1869 241, 160, 206, 241, 253, -1
1872 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1873 static const yytype_uint16 yyrline[] =
1875 0, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136, 1136,
1876 1136, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1138, 1138,
1877 1138, 1138, 1138, 1139, 1139, 1139, 1139, 1139, 1139, 1142,
1878 1142, 1143, 1143, 1144, 1144, 1145, 1145, 1146, 1146, 1150,
1879 1150, 1151, 1151, 1152, 1152, 1153, 1153, 1154, 1154, 1155,
1880 1155, 1156, 1156, 1157, 1158, 1163, 1164, 1164, 1164, 1164,
1881 1164, 1166, 1166, 1166, 1167, 1167, 1169, 1170, 1174, 1178,
1882 1183, 1189, 1189, 1191, 1192, 1197, 1203, 1204, 1205, 1206,
1883 1207, 1208, 1212, 1213, 1214, 1218, 1219, 1220, 1221, 1225,
1884 1226, 1227, 1231, 1232, 1233, 1234, 1235, 1239, 1240, 1241,
1885 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1258, 1259,
1886 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1271, 1272,
1887 1277, 1278, 1279, 1280, 1281, 1282, 1285, 1286, 1291, 1292,
1888 1299, 1300, 1306, 1307, 1316, 1324, 1325, 1330, 1331, 1332,
1889 1337, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1353, 1357,
1890 1361, 1368, 1373, 1381, 1410, 1435, 1440, 1450, 1460, 1464,
1891 1474, 1481, 1490, 1497, 1502, 1507, 1514, 1515, 1522, 1529,
1892 1537, 1543, 1555, 1583, 1599, 1626, 1654, 1680, 1700, 1726,
1893 1746, 1758, 1765, 1831, 1841, 1851, 1857, 1867, 1873, 1883,
1894 1889, 1895, 1908, 1920, 1941, 1949, 1955, 1966, 1971, 1976,
1895 1981, 1986, 1992, 1998, 2004, 2012, 2023, 2027, 2035, 2035,
1896 2038, 2038, 2041, 2053, 2074, 2079, 2087, 2088, 2092, 2092,
1897 2096, 2096, 2099, 2102, 2126, 2138, 2137, 2149, 2148, 2158,
1898 2157, 2168, 2208, 2211, 2217, 2227, 2231, 2236, 2238, 2243,
1899 2248, 2257, 2267, 2278, 2282, 2291, 2300, 2305, 2434, 2434,
1900 2436, 2445, 2445, 2447, 2452, 2464, 2468, 2473, 2477, 2481,
1901 2486, 2491, 2495, 2499, 2503, 2507, 2511, 2515, 2537, 2559,
1902 2565, 2578, 2590, 2595, 2607, 2613, 2617, 2627, 2631, 2635,
1903 2640, 2647, 2647, 2653, 2662, 2667, 2672, 2676, 2685, 2694,
1904 2707, 2716, 2720, 2728, 2748, 2752, 2757, 2768, 2787, 2796,
1905 2882, 2886, 2893, 2904, 2917, 2926, 2939, 2950, 2960, 2971,
1906 2979, 2989, 2996, 2999, 3000, 3008, 3014, 3023, 3027, 3032,
1907 3048, 3065, 3079, 3093, 3107, 3121, 3133, 3141, 3148, 3154,
1908 3160, 3166, 3181, 3271, 3276, 3280, 3287, 3294, 3304, 3311,
1909 3321, 3329, 3343, 3360, 3374, 3389, 3404
1913 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1914 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1915 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1916 static const char *const yytname[] =
1918 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1919 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1920 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1921 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1922 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1923 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1924 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1925 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1926 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1927 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1928 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1929 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1930 "X86_SSECALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE",
1931 "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV",
1932 "UREM", "SREM", "FREM", "AND", "OR", "XOR", "SHL", "LSHR", "ASHR",
1933 "ICMP", "FCMP", "VICMP", "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1934 "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE",
1935 "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1936 "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST",
1937 "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT",
1938 "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT",
1939 "SHUFFLEVECTOR", "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT",
1940 "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL",
1941 "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED",
1942 "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'",
1943 "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps",
1944 "CastOps", "IPredicates", "FPredicates", "IntType", "FPType",
1945 "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign",
1946 "LocalNumber", "GlobalName", "OptGlobalAssign", "GlobalAssign",
1947 "GVInternalLinkage", "GVExternalLinkage", "GVVisibilityStyle",
1948 "FunctionDeclareLinkage", "FunctionDefineLinkage", "AliasLinkage",
1949 "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr",
1950 "OptFuncAttrs", "OptGC", "OptAlign", "OptCAlign", "SectionString",
1951 "OptSection", "GlobalVarAttributes", "GlobalVarAttribute", "PrimType",
1952 "Types", "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI",
1953 "TypeListI", "ConstVal", "ConstExpr", "ConstVector", "GlobalType",
1954 "ThreadLocal", "AliaseeRef", "Module", "DefinitionList", "Definition",
1955 "@1", "@2", "@3", "@4", "@5", "AsmBlock", "TargetDefinition",
1956 "LibrariesDefinition", "LibList", "ArgListH", "ArgList",
1957 "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", "Function",
1958 "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef",
1959 "ValueRef", "ResolvedVal", "ReturnedVal", "BasicBlockList", "BasicBlock",
1960 "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", "PHIList",
1961 "ParamList", "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1962 "OptVolatile", "MemoryInst", 0
1967 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1969 static const yytype_uint16 yytoknum[] =
1971 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1972 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1973 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1974 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1975 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1976 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1977 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1978 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1979 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1980 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1981 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1982 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1983 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1984 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1985 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1986 405, 406, 407, 408, 409, 410, 411, 40, 41, 61,
1987 44, 42, 92, 91, 120, 93, 60, 62, 123, 125,
1992 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1993 static const yytype_uint16 yyr1[] =
1995 0, 171, 172, 172, 172, 172, 172, 172, 172, 172,
1996 172, 173, 173, 173, 173, 173, 173, 174, 174, 174,
1997 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1998 175, 175, 175, 175, 175, 175, 175, 175, 175, 176,
1999 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
2000 176, 176, 176, 176, 176, 177, 178, 178, 178, 178,
2001 178, 179, 179, 179, 180, 180, 181, 181, 182, 182,
2002 183, 184, 184, 185, 185, 186, 187, 187, 187, 187,
2003 187, 187, 188, 188, 188, 189, 189, 189, 189, 190,
2004 190, 190, 191, 191, 191, 191, 191, 192, 192, 192,
2005 193, 193, 193, 193, 193, 193, 193, 193, 194, 194,
2006 194, 194, 194, 194, 194, 194, 194, 194, 195, 195,
2007 196, 196, 196, 196, 196, 196, 197, 197, 198, 198,
2008 199, 199, 200, 200, 201, 202, 202, 203, 203, 204,
2009 204, 205, 205, 205, 205, 205, 205, 205, 206, 206,
2010 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
2011 206, 207, 208, 208, 209, 209, 210, 210, 210, 210,
2012 211, 211, 212, 212, 212, 212, 212, 212, 212, 212,
2013 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
2014 212, 212, 213, 213, 213, 213, 213, 213, 213, 213,
2015 213, 213, 213, 213, 213, 213, 214, 214, 215, 215,
2016 216, 216, 217, 217, 218, 218, 219, 219, 221, 220,
2017 222, 220, 220, 220, 220, 223, 220, 224, 220, 225,
2018 220, 220, 220, 220, 226, 227, 227, 228, 229, 229,
2019 229, 230, 230, 231, 231, 231, 231, 232, 233, 233,
2020 234, 235, 235, 236, 237, 238, 238, 239, 239, 239,
2021 239, 239, 239, 239, 239, 239, 239, 239, 239, 239,
2022 239, 239, 239, 239, 239, 239, 239, 240, 240, 240,
2023 240, 241, 241, 242, 243, 243, 244, 244, 245, 245,
2024 246, 246, 246, 247, 247, 247, 247, 247, 247, 247,
2025 247, 247, 248, 248, 249, 249, 250, 250, 251, 251,
2026 251, 251, 251, 252, 252, 253, 253, 254, 254, 255,
2027 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2028 255, 255, 255, 255, 256, 256, 257, 257, 257, 257,
2029 257, 257, 257, 257, 257, 257, 257
2032 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2033 static const yytype_uint8 yyr2[] =
2035 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2036 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2037 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2038 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2039 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2040 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2041 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2042 2, 1, 1, 1, 0, 2, 1, 1, 1, 1,
2043 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
2044 1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
2045 0, 1, 1, 1, 1, 1, 1, 2, 1, 1,
2046 1, 1, 1, 1, 1, 1, 1, 2, 0, 2,
2047 1, 1, 1, 1, 1, 1, 0, 2, 0, 2,
2048 0, 2, 0, 3, 2, 0, 1, 0, 3, 1,
2049 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2050 3, 1, 2, 5, 5, 5, 5, 3, 2, 5,
2051 4, 2, 1, 1, 1, 3, 1, 3, 1, 0,
2052 1, 3, 4, 3, 3, 4, 4, 3, 6, 5,
2053 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2054 2, 2, 6, 5, 8, 6, 6, 7, 7, 7,
2055 7, 6, 8, 8, 5, 7, 3, 1, 1, 1,
2056 1, 0, 2, 6, 1, 0, 1, 2, 0, 3,
2057 0, 3, 3, 3, 3, 0, 8, 0, 9, 0,
2058 9, 5, 2, 3, 1, 3, 3, 3, 3, 1,
2059 0, 5, 3, 1, 3, 1, 0, 10, 1, 1,
2060 4, 1, 1, 2, 3, 0, 1, 1, 1, 1,
2061 1, 1, 1, 1, 1, 1, 1, 3, 3, 2,
2062 2, 3, 2, 5, 4, 1, 5, 1, 1, 1,
2063 1, 1, 1, 2, 1, 3, 2, 2, 3, 3,
2064 2, 0, 1, 2, 2, 3, 9, 9, 8, 14,
2065 1, 1, 6, 5, 2, 2, 6, 7, 4, 4,
2066 6, 6, 0, 0, 3, 2, 3, 2, 1, 5,
2067 5, 6, 6, 6, 6, 4, 6, 4, 4, 6,
2068 6, 2, 8, 1, 1, 0, 3, 6, 3, 6,
2072 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2073 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2074 means the default is an error. */
2075 static const yytype_uint16 yydefact[] =
2077 74, 61, 71, 62, 72, 63, 220, 218, 0, 0,
2078 0, 0, 0, 0, 85, 73, 0, 74, 216, 89,
2079 92, 0, 0, 232, 0, 0, 68, 0, 75, 76,
2080 78, 77, 79, 82, 80, 83, 81, 84, 86, 87,
2081 88, 85, 85, 211, 1, 217, 90, 91, 85, 221,
2082 93, 94, 95, 96, 85, 291, 219, 291, 0, 0,
2083 240, 233, 234, 222, 277, 278, 224, 141, 142, 143,
2084 146, 145, 144, 147, 148, 0, 0, 0, 0, 279,
2085 280, 149, 223, 151, 211, 211, 97, 210, 0, 100,
2086 100, 292, 287, 69, 251, 252, 253, 286, 235, 236,
2087 239, 0, 169, 152, 0, 0, 0, 0, 158, 170,
2088 0, 0, 169, 0, 0, 0, 99, 98, 0, 208,
2089 209, 0, 0, 101, 102, 103, 104, 105, 106, 0,
2090 254, 0, 0, 335, 335, 290, 0, 237, 168, 118,
2091 164, 166, 0, 0, 0, 0, 0, 0, 157, 0,
2092 0, 150, 0, 0, 163, 0, 162, 0, 231, 141,
2093 142, 143, 146, 145, 144, 0, 0, 67, 67, 107,
2094 0, 248, 249, 250, 70, 334, 318, 0, 0, 0,
2095 0, 100, 300, 301, 2, 3, 4, 5, 6, 7,
2096 8, 9, 10, 14, 15, 16, 11, 12, 13, 0,
2097 0, 0, 0, 0, 0, 0, 0, 17, 18, 19,
2098 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
2099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2100 0, 288, 100, 304, 0, 333, 289, 305, 238, 161,
2101 0, 126, 67, 67, 160, 0, 171, 0, 126, 67,
2102 67, 0, 212, 189, 190, 185, 187, 186, 188, 191,
2103 184, 180, 181, 0, 0, 0, 0, 0, 0, 0,
2104 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2105 0, 183, 182, 225, 0, 317, 294, 67, 284, 293,
2106 0, 0, 55, 0, 0, 29, 30, 31, 32, 33,
2107 34, 35, 36, 37, 38, 0, 53, 54, 49, 50,
2108 51, 52, 39, 40, 41, 42, 43, 44, 45, 46,
2109 47, 48, 0, 0, 0, 132, 132, 340, 67, 67,
2110 331, 0, 0, 0, 0, 0, 67, 67, 67, 67,
2111 67, 0, 0, 0, 0, 0, 109, 111, 110, 108,
2112 112, 113, 114, 115, 116, 119, 167, 165, 154, 155,
2113 156, 159, 66, 153, 227, 229, 0, 0, 0, 0,
2114 0, 0, 0, 0, 0, 0, 0, 0, 173, 207,
2115 0, 0, 0, 177, 0, 174, 0, 0, 0, 137,
2116 246, 257, 258, 259, 260, 261, 266, 262, 263, 264,
2117 265, 255, 0, 0, 0, 0, 275, 282, 281, 283,
2118 0, 0, 295, 0, 0, 67, 67, 67, 67, 0,
2119 336, 0, 338, 313, 0, 0, 0, 0, 0, 0,
2120 0, 0, 0, 0, 0, 0, 0, 0, 67, 0,
2121 117, 123, 122, 120, 121, 124, 125, 127, 137, 137,
2122 0, 0, 0, 0, 0, 313, 0, 0, 0, 0,
2123 0, 0, 0, 172, 158, 170, 0, 175, 176, 0,
2124 0, 0, 0, 226, 245, 118, 243, 0, 256, 0,
2125 269, 0, 0, 0, 272, 0, 270, 285, 0, 0,
2126 0, 0, 0, 0, 0, 0, 0, 0, 344, 0,
2127 0, 0, 327, 328, 0, 0, 0, 0, 345, 0,
2128 0, 0, 325, 0, 132, 0, 228, 230, 67, 0,
2129 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2130 206, 179, 0, 0, 0, 0, 0, 0, 139, 137,
2131 65, 0, 126, 0, 268, 158, 0, 267, 271, 0,
2132 0, 312, 0, 0, 0, 0, 132, 133, 132, 0,
2133 0, 0, 0, 0, 0, 343, 315, 0, 67, 319,
2134 320, 312, 0, 341, 67, 213, 0, 0, 0, 0,
2135 193, 0, 0, 0, 0, 204, 0, 178, 0, 0,
2136 67, 134, 140, 138, 64, 242, 244, 118, 135, 0,
2137 274, 0, 0, 0, 118, 118, 0, 321, 322, 323,
2138 324, 337, 339, 314, 0, 0, 326, 329, 330, 316,
2139 0, 0, 132, 0, 0, 0, 0, 0, 201, 0,
2140 0, 0, 195, 196, 192, 65, 136, 130, 276, 273,
2141 0, 0, 0, 0, 126, 0, 306, 0, 346, 126,
2142 342, 197, 198, 199, 200, 0, 0, 0, 205, 241,
2143 0, 128, 0, 298, 0, 0, 109, 111, 118, 118,
2144 0, 118, 118, 307, 332, 194, 202, 203, 131, 0,
2145 247, 296, 0, 297, 0, 309, 308, 0, 0, 0,
2146 129, 0, 0, 0, 118, 118, 0, 0, 0, 311,
2147 310, 303, 0, 0, 302, 0, 299
2150 /* YYDEFGOTO[NTERM-NUM]. */
2151 static const yytype_int16 yydefgoto[] =
2153 -1, 278, 279, 280, 305, 322, 165, 166, 79, 595,
2154 113, 12, 134, 80, 14, 15, 41, 42, 43, 48,
2155 54, 118, 129, 355, 239, 447, 358, 680, 661, 420,
2156 538, 637, 473, 539, 81, 167, 140, 157, 141, 142,
2157 110, 379, 406, 380, 121, 88, 158, 16, 17, 18,
2158 20, 19, 389, 448, 449, 63, 23, 61, 101, 476,
2159 477, 130, 173, 55, 96, 56, 49, 479, 407, 83,
2160 409, 288, 289, 57, 92, 93, 231, 665, 135, 330,
2161 606, 498, 508, 232, 233, 234, 235
2164 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2166 #define YYPACT_NINF -615
2167 static const yytype_int16 yypact[] =
2169 498, -615, -615, -615, -615, -615, -615, -615, 2, -101,
2170 46, -19, 101, -9, 227, -615, 168, 547, -615, 49,
2171 266, 22, 25, -615, 24, 170, -615, 1932, -615, -615,
2172 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2173 -615, -81, -81, 181, -615, -615, -615, -615, -81, -615,
2174 -615, -615, -615, -615, -81, 205, -615, -10, 197, 212,
2175 219, -615, -615, -615, -615, -615, 97, -615, -615, -615,
2176 -615, -615, -615, -615, -615, 259, 263, 3, 629, -615,
2177 -615, -615, -12, -615, 240, 240, 211, -615, 142, 387,
2178 387, -615, -615, 77, -615, -615, -615, -615, -615, -615,
2179 -615, -53, 1650, -615, 120, 143, 811, 97, -615, -12,
2180 -112, 173, 1650, 166, 142, 142, -615, -615, 1691, -615,
2181 -615, 1950, 335, -615, -615, -615, -615, -615, -615, 1979,
2182 -615, -8, 184, 2213, 2213, -615, 325, -615, -615, -12,
2183 -615, 193, 196, 1997, 1997, 189, -104, 1997, -615, 355,
2184 202, -615, 1950, 1997, 97, 204, -12, 242, -615, 41,
2185 353, 354, 361, 362, 366, 277, 368, 1514, 323, -615,
2186 141, -615, -615, -615, -615, -615, -615, 322, 2038, 72,
2187 369, 387, -615, -615, -615, -615, -615, -615, -615, -615,
2188 -615, -615, -615, -615, -615, -615, -615, -615, -615, 559,
2189 285, 559, 285, 1997, 1997, 1997, 1997, -615, -615, -615,
2190 -615, -615, -615, -615, -615, -615, -615, -615, -615, 1997,
2191 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997,
2192 1997, -615, 387, -615, 104, -615, -615, -615, -615, 183,
2193 1709, -615, -34, -41, -615, 238, -12, 249, -615, 323,
2194 -29, 1691, -615, -615, -615, -615, -615, -615, -615, -615,
2195 -615, -615, -615, 559, 285, 559, 285, 251, 252, 255,
2196 256, 257, 261, 262, 1750, 2056, 1131, 394, 264, 265,
2197 268, -615, -615, -615, 269, -615, 97, 913, -615, 272,
2198 1081, 1081, -615, 1081, 1979, -615, -615, -615, -615, -615,
2199 -615, -615, -615, -615, -615, 1997, -615, -615, -615, -615,
2200 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2201 -615, -615, 1997, 1997, 1997, -28, 67, -615, 913, -33,
2202 273, 274, 275, 276, 282, 284, 913, 913, 913, 913,
2203 913, 385, 1979, 1997, 1997, 423, -615, -615, -615, -615,
2204 -615, -615, -615, -615, -615, -615, -615, -615, 198, -615,
2205 -615, -615, -615, 198, -615, 166, 390, 280, 288, 289,
2206 300, 1950, 1950, 1950, 1950, 1950, 1950, 1950, -615, -615,
2207 -52, 1175, -107, -615, -79, -615, 1950, 1950, 1950, 298,
2208 1769, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2209 -615, 398, 1813, 2112, 1408, 407, -615, -615, -615, -615,
2210 1997, 301, -615, 302, 1081, 913, 913, 913, 913, 18,
2211 -615, 28, -615, -615, 1081, 297, 1997, 1997, 1997, 1997,
2212 1997, 306, 308, 311, 316, 317, 1997, 1081, 913, 318,
2213 -615, -615, -615, -615, -615, -615, -615, -615, 298, 298,
2214 1997, 1950, 1950, 1950, 1950, -615, 319, 321, 324, 326,
2215 308, 336, 1950, -615, 315, 1362, -58, -615, -615, 337,
2216 339, 447, 15, -615, -615, -12, 340, 343, -615, 473,
2217 -615, -40, 1454, -106, -615, -2, -615, -615, 486, 487,
2218 348, 346, 347, 359, 363, 1081, 504, 1081, 364, 367,
2219 1081, 370, -12, -615, 371, 372, 522, 530, 379, 1997,
2220 1081, 1081, -12, 389, 382, 1997, -615, -615, -14, 388,
2221 391, 392, 393, 134, 1950, 1950, 1950, 1950, 135, 1950,
2222 -615, -615, 397, 1950, 1950, 1997, 527, 551, -615, 298,
2223 40, 1871, -615, 396, -615, 401, 52, -615, -615, 1081,
2224 1081, 2159, 1081, 1081, 1081, 1081, 382, -615, 382, 1997,
2225 1081, 399, 1997, 1997, 1997, -615, -615, 553, 913, -615,
2226 -615, 2159, 506, -615, 913, -615, 1950, 1950, 1950, 1950,
2227 -615, 412, 403, 413, 414, -615, 308, -615, 417, 418,
2228 8, -615, -615, -615, -615, -615, -615, -12, 4, 557,
2229 -615, 416, 420, 421, -4, -12, 161, -615, -615, -615,
2230 -615, -615, -615, -615, 422, 1081, -615, -615, -615, -615,
2231 308, 162, 382, 427, 428, 435, 436, 1950, -615, 1950,
2232 1950, 188, -615, -615, -615, 40, -615, 541, -615, -615,
2233 564, 5, 761, 761, -615, 2218, -615, 431, 379, -615,
2234 -615, -615, -615, -615, -615, 439, 442, 443, -615, -615,
2235 598, 451, 1081, -615, 1227, 7, 448, 449, -615, -615,
2236 100, -4, -12, -615, 198, -615, -615, -615, -615, 588,
2237 -615, -615, 454, -615, 1227, 183, 183, 600, 761, 761,
2238 -615, 601, 455, 1081, -615, -615, 1081, 603, 549, 183,
2239 183, -615, 1081, 604, -615, 1081, -615
2242 /* YYPGOTO[NTERM-NUM]. */
2243 static const yytype_int16 yypgoto[] =
2245 -615, 96, 112, 190, -165, -160, -178, -615, 0, -11,
2246 -140, 533, -615, 6, -615, -615, -615, -615, 37, -615,
2247 -615, -615, -144, -615, -463, -615, -238, -615, -615, -323,
2248 29, -615, -424, -615, -615, -26, 410, -125, -615, 516,
2249 523, -86, -162, -267, 200, 267, 380, -615, -615, 613,
2250 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2251 -615, 542, -615, -615, -615, -615, -615, -615, -614, -80,
2252 174, -190, -615, -615, 576, -615, 500, -615, -615, -615,
2253 76, 209, -447, -615, 531, -615, -615
2256 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2257 positive, shift that token. If negative, reduce the rule which
2258 number is the opposite. If zero, do what YYDEFACT says.
2259 If YYTABLE_NINF, syntax error. */
2260 #define YYTABLE_NINF -216
2261 static const yytype_int16 yytable[] =
2263 11, 82, 293, 422, 170, 281, 13, 105, 382, 384,
2264 363, 91, 540, 528, 111, 327, 292, 11, 292, 94,
2265 171, 111, 111, 13, 516, 517, 111, 111, 283, 495,
2266 331, 332, 333, 334, 335, 168, 323, 294, 536, 497,
2267 341, 111, 324, 111, -55, -55, -55, -55, 147, 536,
2268 682, -147, 109, 462, 462, 21, 147, 148, 24, 1,
2269 467, 547, 3, 111, 5, 245, 249, 253, 254, 537,
2270 692, 22, 496, 38, 39, 40, 139, 252, 84, 85,
2271 109, 462, 496, 290, 132, 89, 139, 282, 342, 291,
2272 468, 90, 156, 11, 345, 46, 1, 47, 367, 3,
2273 369, 5, 462, 156, 368, 25, 370, 136, 462, 364,
2274 365, 532, 137, 463, 466, 593, 112, 242, 243, 27,
2275 462, 246, 111, 112, 112, 544, 360, 250, 112, 112,
2276 424, 359, 419, -67, 635, 481, 483, 485, 687, 631,
2277 26, 642, 643, 112, 575, 112, 441, 442, 443, -67,
2278 28, 444, 287, -147, 439, 445, 446, -147, 462, 95,
2279 172, 2, 346, 347, 4, 112, 634, 548, 44, 414,
2280 663, 106, 683, 648, 119, 120, 284, 325, 326, 287,
2281 328, 58, 348, 349, 59, 350, 351, 60, 352, 353,
2282 354, 573, 62, 329, 287, 287, 287, 287, 287, 336,
2283 337, 338, 339, 340, 287, 685, 686, 408, 688, 689,
2284 408, 408, 462, 408, 139, 546, 86, 437, 87, 98,
2285 487, 601, 343, 344, 112, 156, 91, 421, -67, 228,
2286 228, 699, 700, 611, 99, 612, 501, 345, 503, 504,
2287 505, 100, 441, 442, 443, 229, 229, 444, 408, 64,
2288 65, 445, 446, 116, 102, 117, 408, 408, 408, 408,
2289 408, 1, 2, 103, 3, 4, 5, 104, 156, 29,
2290 30, 31, 32, 33, 34, 35, 36, 87, 37, 415,
2291 255, 256, 257, 258, 143, 455, 456, 457, 458, 459,
2292 460, 461, 580, 585, 559, 567, 416, 417, 418, 650,
2293 469, 470, 471, 281, 598, 346, 347, 144, 50, 51,
2294 52, 306, 307, 53, 152, 153, 156, 438, 287, 644,
2295 649, 645, 645, 230, 230, 348, 349, 151, 350, 351,
2296 149, 352, 353, 354, 408, 408, 408, 408, 408, 169,
2297 441, 442, 443, 174, 408, 444, 658, 238, 567, 445,
2298 446, 114, 115, 240, 241, 465, 244, 408, 408, 247,
2299 248, 251, -56, -57, 475, 519, 520, 521, 522, 613,
2300 -60, -59, 616, 617, 618, -58, 530, 259, 111, 285,
2301 292, 38, 39, 40, 287, 282, 308, 309, 310, 311,
2302 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
2303 287, 502, 287, 287, 287, 361, 670, 362, 371, 372,
2304 512, 674, 373, 374, 375, 408, 385, 408, 376, 377,
2305 408, 386, 387, 436, 518, 388, 390, 440, 450, 486,
2306 408, 408, 410, 425, 426, 427, 428, 451, 581, 582,
2307 583, 584, 429, 586, 430, 452, 453, 588, 589, 122,
2308 123, 124, 125, 126, 127, 128, 465, 454, 472, 478,
2309 500, 488, 489, 664, 411, 412, 506, 413, 507, 408,
2310 408, 509, 408, 408, 408, 408, 510, 511, 515, 524,
2311 408, 525, 531, 568, 526, 535, 527, 684, 408, 574,
2312 623, 624, 625, 626, 408, 543, 529, 533, -215, 534,
2313 541, 542, 423, 549, 550, 551, 552, 553, 557, 590,
2314 431, 432, 433, 434, 435, 597, -69, 1, 2, 554,
2315 3, 4, 5, 555, 559, 605, 565, 560, 6, 7,
2316 562, 563, 564, 287, 566, 408, 287, 287, 287, 567,
2317 594, 655, 572, 656, 657, 605, 571, -214, 576, 591,
2318 8, 577, 578, 579, 9, 592, 599, 619, 10, 615,
2319 496, 628, 408, 408, 587, -69, 1, 2, 600, 3,
2320 4, 5, 627, 629, 630, 632, 633, 6, 7, 638,
2321 640, 662, 408, 639, 641, 651, 652, 646, 490, 491,
2322 492, 493, 494, 653, 654, 660, 673, 675, 499, 8,
2323 676, 677, 678, 9, 679, -18, -19, 10, 408, 408,
2324 690, 513, 514, 408, 691, 697, 408, 693, 696, 672,
2325 702, 705, 408, 703, 659, 408, 133, 636, 150, 146,
2326 45, 366, 131, 97, 236, 594, 64, 65, 0, 107,
2327 67, 68, 69, 70, 71, 72, 73, 621, 1, 2,
2328 357, 3, 4, 5, 295, 296, 297, 298, 299, 300,
2329 301, 302, 303, 304, 523, 237, 0, 0, 0, 556,
2330 0, 558, 0, 0, 561, 0, 0, 0, 0, 74,
2331 0, 0, 0, 0, 569, 570, 0, 0, 0, 0,
2332 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2333 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2334 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2335 0, 0, 0, 602, 603, 0, 607, 608, 609, 610,
2336 0, 0, 0, 0, 614, 0, 0, 0, 0, 0,
2337 0, 0, 620, 0, 0, 0, 0, 0, 622, 0,
2338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2339 0, 0, 0, 0, 391, 392, 393, 394, 64, 65,
2340 395, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2341 1, 2, 0, 3, 4, 5, 396, 397, 398, 647,
2342 0, 75, 76, 0, 0, 77, 0, 78, 108, 0,
2343 0, 399, 400, 0, 0, 0, 0, 0, 0, 0,
2344 0, 0, 0, 0, 0, 345, 668, 669, 64, 65,
2345 401, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2346 1, 2, 0, 3, 4, 5, 681, 184, 185, 186,
2347 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
2348 197, 198, 263, 264, 265, 266, 0, 0, 0, 0,
2349 0, 74, 694, 695, 0, 0, 0, 698, 0, 0,
2350 701, 0, 0, 0, 0, 0, 704, 0, 0, 706,
2351 0, 267, 207, 666, 667, 210, 211, 212, 213, 214,
2352 215, 216, 217, 218, 0, 268, 0, 269, 270, 271,
2353 0, 272, 273, 348, 349, 0, 350, 351, 0, 352,
2354 353, 354, 0, 0, 0, 0, 391, 392, 393, 394,
2355 64, 65, 395, 0, 402, 0, 0, 403, 0, 404,
2356 0, 405, 1, 2, 0, 3, 4, 5, 396, 397,
2357 398, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 399, 400, 0, 0, 0, 0, 0,
2359 0, 0, 0, 0, 0, 0, 0, 0, 111, 0,
2360 0, 0, 401, 75, 76, 0, 0, 77, 0, 78,
2361 145, 0, 0, 0, 0, 0, 0, 0, 0, 184,
2362 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2363 195, 196, 197, 198, 263, 264, 265, 266, 0, 0,
2364 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2365 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2366 0, 0, 0, 267, 207, 208, 209, 210, 211, 212,
2367 213, 214, 215, 216, 217, 218, 0, 268, 0, 269,
2368 270, 271, 0, 272, 273, 0, 0, 0, 0, 0,
2369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2370 112, 0, 0, 0, 0, 0, 402, 0, 0, 403,
2371 0, 404, 0, 405, 391, 392, 393, 394, 64, 65,
2372 395, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2373 1, 2, 0, 3, 4, 5, 396, 397, 398, 0,
2374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2375 0, 399, 400, 0, 0, 0, 0, 0, 0, 0,
2376 0, 0, 0, 0, 0, 0, 0, 0, 64, 65,
2377 401, 107, 159, 160, 161, 162, 163, 164, 73, 0,
2378 1, 2, 0, 3, 4, 5, 0, 184, 185, 186,
2379 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
2380 197, 198, 263, 264, 265, 266, 0, 0, 0, 0,
2381 0, 74, 64, 65, 0, 107, 159, 160, 161, 162,
2382 163, 164, 73, 0, 1, 2, 0, 3, 4, 5,
2383 0, 267, 207, 208, 209, 210, 211, 212, 213, 214,
2384 215, 216, 217, 218, 0, 268, 0, 269, 270, 271,
2385 0, 272, 273, 0, 0, 74, 0, 0, 0, 0,
2386 391, 392, 393, 394, 0, 0, 395, 0, 0, 0,
2387 0, 0, 0, 0, 402, 0, 0, 403, 0, 404,
2388 0, 405, 396, 397, 398, 0, 0, 0, 0, 0,
2389 0, 0, 0, 0, 0, 0, 0, 399, 400, 0,
2390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2391 0, 0, 0, 0, 0, 0, 401, 0, 0, 0,
2392 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2393 383, 0, 0, 184, 185, 186, 187, 188, 189, 190,
2394 191, 192, 193, 194, 195, 196, 197, 198, 263, 264,
2395 265, 266, 0, 0, 0, 0, 0, 0, 0, 0,
2396 0, 0, 0, 0, 0, 0, 0, 75, 76, 0,
2397 0, 77, 0, 78, 464, 0, 0, 267, 207, 208,
2398 209, 210, 211, 212, 213, 214, 215, 216, 217, 218,
2399 0, 268, 0, 269, 270, 271, 0, 272, 273, 64,
2400 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2401 0, 1, 2, 0, 3, 4, 5, 260, 0, 0,
2402 402, 0, 0, 403, 0, 404, 0, 405, 0, 0,
2403 0, 0, 261, 262, 0, 0, 0, 0, 0, 0,
2404 0, 0, 0, 0, 0, 64, 65, 111, 107, 159,
2405 160, 161, 162, 163, 164, 73, 0, 1, 2, 0,
2406 3, 4, 5, 0, 0, 0, 0, 0, 184, 185,
2407 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
2408 196, 197, 198, 263, 264, 265, 266, 0, 74, 0,
2409 0, 64, 65, 0, 107, 159, 160, 161, 162, 163,
2410 164, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2411 0, 0, 267, 207, 208, 209, 210, 211, 212, 213,
2412 214, 215, 216, 217, 218, 0, 268, 0, 269, 270,
2413 271, 0, 272, 273, 74, 0, 0, 0, 0, 0,
2414 0, 0, 0, 0, 0, 0, 0, 0, 0, 112,
2415 0, 64, 65, -67, 0, 274, 0, 0, 275, 0,
2416 276, 0, 277, 1, 2, 0, 3, 4, 5, 260,
2417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2418 0, 0, 0, 0, 261, 262, 0, 0, 0, 0,
2419 0, 0, 0, 0, 0, 0, 0, 0, 0, 111,
2420 75, 76, 0, 0, 77, 0, 78, 484, 0, 0,
2421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2422 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2423 194, 195, 196, 197, 198, 263, 264, 265, 266, 0,
2424 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2425 77, 0, 78, 545, 0, 0, 0, 0, 0, 0,
2426 0, 0, 0, 0, 267, 207, 208, 209, 210, 211,
2427 212, 213, 214, 215, 216, 217, 218, 0, 268, 0,
2428 269, 270, 271, 0, 272, 273, 0, 64, 65, 0,
2429 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2430 2, 112, 3, 4, 5, 0, 0, 274, 0, 0,
2431 275, 0, 276, 0, 277, 0, 0, 0, 0, 138,
2432 0, 0, 0, 0, 0, 0, 0, 0, 64, 65,
2433 74, 154, 67, 68, 69, 70, 71, 72, 73, 0,
2434 1, 2, 0, 3, 4, 5, 64, 65, 0, 107,
2435 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2436 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2437 0, 74, 0, 0, 0, 0, 0, 0, 356, 0,
2438 0, 0, 0, 0, 0, 0, 0, 64, 65, 74,
2439 107, 159, 160, 161, 162, 163, 164, 73, 0, 1,
2440 2, 0, 3, 4, 5, 0, 64, 65, 0, 107,
2441 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2442 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2443 74, 0, 0, 0, 0, 0, 0, 0, 474, 0,
2444 0, 0, 75, 76, 0, 0, 77, 155, 78, 74,
2445 64, 65, 0, 107, 159, 160, 161, 162, 163, 164,
2446 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2448 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2449 0, 0, 0, 74, 0, 0, 0, 0, 0, 0,
2450 0, 75, 76, 0, 0, 77, 0, 78, 64, 65,
2451 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2452 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2454 596, 0, 75, 76, 0, 378, 77, 0, 78, 0,
2455 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
2456 0, 75, 76, 0, 0, 77, 0, 78, 0, 64,
2457 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
2458 0, 1, 2, 0, 3, 4, 5, 64, 65, 0,
2459 107, 159, 160, 161, 162, 163, 164, 73, 0, 1,
2460 2, 0, 3, 4, 5, 75, 76, 0, 480, 77,
2461 0, 78, 74, 0, 0, 0, 64, 65, 0, 154,
2462 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2463 74, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2464 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2465 4, 5, 0, 0, 0, 0, 0, 0, 0, 74,
2466 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2467 0, 0, 0, 0, 0, 64, 65, 74, 286, 67,
2468 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2469 3, 4, 5, 64, 65, 0, 107, 159, 160, 161,
2470 162, 163, 164, 73, 0, 1, 2, 0, 3, 4,
2471 5, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2472 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2473 78, 0, 0, 0, 0, 0, 74, 0, 0, 0,
2474 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2475 65, 0, 107, 159, 160, 161, 162, 163, 164, 73,
2476 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2477 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2478 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2479 76, 0, 74, 77, 0, 78, 64, 65, 0, 107,
2480 67, 68, 69, 70, 71, 72, 604, 0, 1, 2,
2481 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2482 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2483 75, 76, 0, 0, 77, 0, 78, 0, 0, 74,
2484 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2485 0, 0, 77, 0, 381, 64, 65, 0, 107, 67,
2486 68, 69, 70, 71, 72, 671, 0, 1, 2, 0,
2487 3, 4, 5, 0, 0, 0, 0, 0, 0, 175,
2488 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2489 0, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2490 176, 177, 0, 0, 75, 76, 0, 0, 77, 0,
2491 482, 0, 0, 178, 179, 180, 181, 182, 183, 184,
2492 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2493 195, 196, 197, 198, 199, 200, 201, 202, 0, 0,
2494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2495 0, 75, 76, 0, 0, 77, 0, 78, 203, 204,
2496 205, 0, 0, 206, 207, 208, 209, 210, 211, 212,
2497 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
2498 223, 224, 225, 226, 227, 0, 0, 0, 0, 0,
2499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2500 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2501 75, 76, 0, 0, 77, 0, 78
2504 static const yytype_int16 yycheck[] =
2506 0, 27, 180, 326, 129, 167, 0, 4, 275, 276,
2507 248, 21, 475, 460, 55, 205, 11, 17, 11, 29,
2508 28, 55, 55, 17, 448, 449, 55, 55, 168, 11,
2509 220, 221, 222, 223, 224, 121, 201, 181, 34, 11,
2510 230, 55, 202, 55, 3, 4, 5, 6, 160, 34,
2511 664, 55, 78, 160, 160, 53, 160, 169, 159, 19,
2512 167, 167, 22, 55, 24, 169, 152, 26, 27, 54,
2513 684, 69, 54, 154, 155, 156, 102, 157, 41, 42,
2514 106, 160, 54, 11, 7, 48, 112, 167, 232, 17,
2515 169, 54, 118, 93, 54, 46, 19, 48, 263, 22,
2516 265, 24, 160, 129, 264, 59, 266, 160, 160, 249,
2517 250, 169, 165, 165, 381, 539, 157, 143, 144, 18,
2518 160, 147, 55, 157, 157, 165, 167, 153, 157, 157,
2519 163, 165, 160, 161, 597, 402, 403, 404, 38, 586,
2520 159, 604, 605, 157, 158, 157, 142, 143, 144, 161,
2521 159, 147, 178, 157, 344, 151, 152, 161, 160, 169,
2522 168, 20, 122, 123, 23, 157, 158, 169, 0, 294,
2523 165, 168, 165, 620, 32, 33, 170, 203, 204, 205,
2524 206, 159, 142, 143, 159, 145, 146, 163, 148, 149,
2525 150, 514, 22, 219, 220, 221, 222, 223, 224, 225,
2526 226, 227, 228, 229, 230, 668, 669, 287, 671, 672,
2527 290, 291, 160, 293, 240, 482, 35, 342, 37, 22,
2528 410, 169, 118, 119, 157, 251, 21, 160, 161, 133,
2529 134, 694, 695, 556, 22, 558, 426, 54, 428, 429,
2530 430, 22, 142, 143, 144, 133, 134, 147, 328, 7,
2531 8, 151, 152, 42, 157, 44, 336, 337, 338, 339,
2532 340, 19, 20, 4, 22, 23, 24, 4, 294, 42,
2533 43, 44, 45, 46, 47, 48, 49, 37, 51, 305,
2534 3, 4, 5, 6, 164, 371, 372, 373, 374, 375,
2535 376, 377, 158, 158, 160, 160, 322, 323, 324, 622,
2536 386, 387, 388, 465, 542, 122, 123, 164, 42, 43,
2537 44, 26, 27, 47, 114, 115, 342, 343, 344, 158,
2538 158, 160, 160, 133, 134, 142, 143, 161, 145, 146,
2539 157, 148, 149, 150, 414, 415, 416, 417, 418, 4,
2540 142, 143, 144, 159, 424, 147, 158, 22, 160, 151,
2541 152, 84, 85, 160, 158, 381, 167, 437, 438, 4,
2542 158, 157, 9, 9, 390, 451, 452, 453, 454, 559,
2543 9, 9, 562, 563, 564, 9, 462, 9, 55, 57,
2544 11, 154, 155, 156, 410, 465, 101, 102, 103, 104,
2545 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
2546 426, 427, 428, 429, 430, 167, 644, 158, 157, 157,
2547 436, 649, 157, 157, 157, 495, 22, 497, 157, 157,
2548 500, 157, 157, 38, 450, 157, 157, 4, 38, 22,
2549 510, 511, 160, 160, 160, 160, 160, 157, 524, 525,
2550 526, 527, 160, 529, 160, 157, 157, 533, 534, 62,
2551 63, 64, 65, 66, 67, 68, 482, 157, 160, 61,
2552 163, 160, 160, 641, 290, 291, 160, 293, 160, 549,
2553 550, 160, 552, 553, 554, 555, 160, 160, 160, 160,
2554 560, 160, 167, 509, 160, 38, 160, 665, 568, 515,
2555 576, 577, 578, 579, 574, 22, 160, 160, 0, 160,
2556 160, 158, 328, 17, 17, 157, 160, 160, 4, 535,
2557 336, 337, 338, 339, 340, 541, 18, 19, 20, 160,
2558 22, 23, 24, 160, 160, 551, 4, 160, 30, 31,
2559 160, 160, 160, 559, 4, 615, 562, 563, 564, 160,
2560 540, 627, 160, 629, 630, 571, 157, 0, 160, 22,
2561 52, 160, 160, 160, 56, 4, 160, 4, 60, 160,
2562 54, 158, 642, 643, 167, 18, 19, 20, 167, 22,
2563 23, 24, 160, 160, 160, 158, 158, 30, 31, 22,
2564 160, 17, 662, 167, 163, 158, 158, 165, 414, 415,
2565 416, 417, 418, 158, 158, 54, 165, 158, 424, 52,
2566 158, 158, 4, 56, 153, 157, 157, 60, 688, 689,
2567 22, 437, 438, 693, 160, 160, 696, 17, 17, 645,
2568 17, 17, 702, 74, 635, 705, 93, 598, 112, 106,
2569 17, 251, 90, 57, 134, 635, 7, 8, -1, 10,
2570 11, 12, 13, 14, 15, 16, 17, 571, 19, 20,
2571 240, 22, 23, 24, 95, 96, 97, 98, 99, 100,
2572 101, 102, 103, 104, 455, 134, -1, -1, -1, 495,
2573 -1, 497, -1, -1, 500, -1, -1, -1, -1, 50,
2574 -1, -1, -1, -1, 510, 511, -1, -1, -1, -1,
2575 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2576 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2577 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2578 -1, -1, -1, 549, 550, -1, 552, 553, 554, 555,
2579 -1, -1, -1, -1, 560, -1, -1, -1, -1, -1,
2580 -1, -1, 568, -1, -1, -1, -1, -1, 574, -1,
2581 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2582 -1, -1, -1, -1, 3, 4, 5, 6, 7, 8,
2583 9, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2584 19, 20, -1, 22, 23, 24, 25, 26, 27, 615,
2585 -1, 162, 163, -1, -1, 166, -1, 168, 169, -1,
2586 -1, 40, 41, -1, -1, -1, -1, -1, -1, -1,
2587 -1, -1, -1, -1, -1, 54, 642, 643, 7, 8,
2588 59, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2589 19, 20, -1, 22, 23, 24, 662, 76, 77, 78,
2590 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2591 89, 90, 91, 92, 93, 94, -1, -1, -1, -1,
2592 -1, 50, 688, 689, -1, -1, -1, 693, -1, -1,
2593 696, -1, -1, -1, -1, -1, 702, -1, -1, 705,
2594 -1, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2595 129, 130, 131, 132, -1, 134, -1, 136, 137, 138,
2596 -1, 140, 141, 142, 143, -1, 145, 146, -1, 148,
2597 149, 150, -1, -1, -1, -1, 3, 4, 5, 6,
2598 7, 8, 9, -1, 163, -1, -1, 166, -1, 168,
2599 -1, 170, 19, 20, -1, 22, 23, 24, 25, 26,
2600 27, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2601 -1, -1, -1, 40, 41, -1, -1, -1, -1, -1,
2602 -1, -1, -1, -1, -1, -1, -1, -1, 55, -1,
2603 -1, -1, 59, 162, 163, -1, -1, 166, -1, 168,
2604 169, -1, -1, -1, -1, -1, -1, -1, -1, 76,
2605 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2606 87, 88, 89, 90, 91, 92, 93, 94, -1, -1,
2607 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2608 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2609 -1, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2610 127, 128, 129, 130, 131, 132, -1, 134, -1, 136,
2611 137, 138, -1, 140, 141, -1, -1, -1, -1, -1,
2612 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2613 157, -1, -1, -1, -1, -1, 163, -1, -1, 166,
2614 -1, 168, -1, 170, 3, 4, 5, 6, 7, 8,
2615 9, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2616 19, 20, -1, 22, 23, 24, 25, 26, 27, -1,
2617 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2618 -1, 40, 41, -1, -1, -1, -1, -1, -1, -1,
2619 -1, -1, -1, -1, -1, -1, -1, -1, 7, 8,
2620 59, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2621 19, 20, -1, 22, 23, 24, -1, 76, 77, 78,
2622 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2623 89, 90, 91, 92, 93, 94, -1, -1, -1, -1,
2624 -1, 50, 7, 8, -1, 10, 11, 12, 13, 14,
2625 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2626 -1, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2627 129, 130, 131, 132, -1, 134, -1, 136, 137, 138,
2628 -1, 140, 141, -1, -1, 50, -1, -1, -1, -1,
2629 3, 4, 5, 6, -1, -1, 9, -1, -1, -1,
2630 -1, -1, -1, -1, 163, -1, -1, 166, -1, 168,
2631 -1, 170, 25, 26, 27, -1, -1, -1, -1, -1,
2632 -1, -1, -1, -1, -1, -1, -1, 40, 41, -1,
2633 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2634 -1, -1, -1, -1, -1, -1, 59, -1, -1, -1,
2635 -1, -1, -1, 162, 163, -1, -1, 166, -1, 168,
2636 169, -1, -1, 76, 77, 78, 79, 80, 81, 82,
2637 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2638 93, 94, -1, -1, -1, -1, -1, -1, -1, -1,
2639 -1, -1, -1, -1, -1, -1, -1, 162, 163, -1,
2640 -1, 166, -1, 168, 169, -1, -1, 120, 121, 122,
2641 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
2642 -1, 134, -1, 136, 137, 138, -1, 140, 141, 7,
2643 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2644 -1, 19, 20, -1, 22, 23, 24, 25, -1, -1,
2645 163, -1, -1, 166, -1, 168, -1, 170, -1, -1,
2646 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2647 -1, -1, -1, -1, -1, 7, 8, 55, 10, 11,
2648 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2649 22, 23, 24, -1, -1, -1, -1, -1, 76, 77,
2650 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2651 88, 89, 90, 91, 92, 93, 94, -1, 50, -1,
2652 -1, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2653 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2654 -1, -1, 120, 121, 122, 123, 124, 125, 126, 127,
2655 128, 129, 130, 131, 132, -1, 134, -1, 136, 137,
2656 138, -1, 140, 141, 50, -1, -1, -1, -1, -1,
2657 -1, -1, -1, -1, -1, -1, -1, -1, -1, 157,
2658 -1, 7, 8, 161, -1, 163, -1, -1, 166, -1,
2659 168, -1, 170, 19, 20, -1, 22, 23, 24, 25,
2660 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2661 -1, -1, -1, -1, 40, 41, -1, -1, -1, -1,
2662 -1, -1, -1, -1, -1, -1, -1, -1, -1, 55,
2663 162, 163, -1, -1, 166, -1, 168, 169, -1, -1,
2664 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2665 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2666 86, 87, 88, 89, 90, 91, 92, 93, 94, -1,
2667 -1, -1, -1, -1, -1, -1, 162, 163, -1, -1,
2668 166, -1, 168, 169, -1, -1, -1, -1, -1, -1,
2669 -1, -1, -1, -1, 120, 121, 122, 123, 124, 125,
2670 126, 127, 128, 129, 130, 131, 132, -1, 134, -1,
2671 136, 137, 138, -1, 140, 141, -1, 7, 8, -1,
2672 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2673 20, 157, 22, 23, 24, -1, -1, 163, -1, -1,
2674 166, -1, 168, -1, 170, -1, -1, -1, -1, 39,
2675 -1, -1, -1, -1, -1, -1, -1, -1, 7, 8,
2676 50, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2677 19, 20, -1, 22, 23, 24, 7, 8, -1, 10,
2678 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2679 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2680 -1, 50, -1, -1, -1, -1, -1, -1, 39, -1,
2681 -1, -1, -1, -1, -1, -1, -1, 7, 8, 50,
2682 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2683 20, -1, 22, 23, 24, -1, 7, 8, -1, 10,
2684 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2685 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2686 50, -1, -1, -1, -1, -1, -1, -1, 39, -1,
2687 -1, -1, 162, 163, -1, -1, 166, 126, 168, 50,
2688 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2689 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2690 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2691 -1, -1, -1, 162, 163, -1, -1, 166, -1, 168,
2692 -1, -1, -1, 50, -1, -1, -1, -1, -1, -1,
2693 -1, 162, 163, -1, -1, 166, -1, 168, 7, 8,
2694 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2695 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2697 39, -1, 162, 163, -1, 165, 166, -1, 168, -1,
2698 -1, 50, -1, -1, -1, -1, -1, -1, -1, -1,
2699 -1, 162, 163, -1, -1, 166, -1, 168, -1, 7,
2700 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2701 -1, 19, 20, -1, 22, 23, 24, 7, 8, -1,
2702 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2703 20, -1, 22, 23, 24, 162, 163, -1, 165, 166,
2704 -1, 168, 50, -1, -1, -1, 7, 8, -1, 10,
2705 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2706 50, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2707 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2708 23, 24, -1, -1, -1, -1, -1, -1, -1, 50,
2709 -1, -1, -1, 162, 163, -1, -1, 166, -1, 168,
2710 -1, -1, -1, -1, -1, 7, 8, 50, 10, 11,
2711 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2712 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
2713 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2714 24, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2715 -1, -1, -1, -1, 162, 163, -1, -1, 166, -1,
2716 168, -1, -1, -1, -1, -1, 50, -1, -1, -1,
2717 -1, -1, 162, 163, -1, -1, 166, -1, 168, 7,
2718 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2719 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2720 -1, 162, 163, -1, -1, 166, -1, 168, -1, -1,
2721 -1, -1, -1, -1, -1, -1, -1, -1, -1, 162,
2722 163, -1, 50, 166, -1, 168, 7, 8, -1, 10,
2723 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2724 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2725 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2726 162, 163, -1, -1, 166, -1, 168, -1, -1, 50,
2727 -1, -1, -1, -1, -1, -1, -1, -1, 162, 163,
2728 -1, -1, 166, -1, 168, 7, 8, -1, 10, 11,
2729 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2730 22, 23, 24, -1, -1, -1, -1, -1, -1, 36,
2731 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2732 -1, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2733 57, 58, -1, -1, 162, 163, -1, -1, 166, -1,
2734 168, -1, -1, 70, 71, 72, 73, 74, 75, 76,
2735 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2736 87, 88, 89, 90, 91, 92, 93, 94, -1, -1,
2737 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2738 -1, 162, 163, -1, -1, 166, -1, 168, 115, 116,
2739 117, -1, -1, 120, 121, 122, 123, 124, 125, 126,
2740 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2741 137, 138, 139, 140, 141, -1, -1, -1, -1, -1,
2742 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2743 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2744 162, 163, -1, -1, 166, -1, 168
2747 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2748 symbol of state STATE-NUM. */
2749 static const yytype_uint16 yystos[] =
2751 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2752 60, 179, 182, 184, 185, 186, 218, 219, 220, 222,
2753 221, 53, 69, 227, 159, 59, 159, 18, 159, 42,
2754 43, 44, 45, 46, 47, 48, 49, 51, 154, 155,
2755 156, 187, 188, 189, 0, 220, 46, 48, 190, 237,
2756 42, 43, 44, 47, 191, 234, 236, 244, 159, 159,
2757 163, 228, 22, 226, 7, 8, 10, 11, 12, 13,
2758 14, 15, 16, 17, 50, 162, 163, 166, 168, 179,
2759 184, 205, 206, 240, 189, 189, 35, 37, 216, 189,
2760 189, 21, 245, 246, 29, 169, 235, 245, 22, 22,
2761 22, 229, 157, 4, 4, 4, 168, 10, 169, 206,
2762 211, 55, 157, 181, 216, 216, 42, 44, 192, 32,
2763 33, 215, 62, 63, 64, 65, 66, 67, 68, 193,
2764 232, 232, 7, 182, 183, 249, 160, 165, 39, 206,
2765 207, 209, 210, 164, 164, 169, 211, 160, 169, 157,
2766 210, 161, 215, 215, 10, 126, 206, 208, 217, 11,
2767 12, 13, 14, 15, 16, 177, 178, 206, 212, 4,
2768 208, 28, 168, 233, 159, 36, 57, 58, 70, 71,
2769 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
2770 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2771 92, 93, 94, 115, 116, 117, 120, 121, 122, 123,
2772 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2773 134, 135, 136, 137, 138, 139, 140, 141, 172, 173,
2774 174, 247, 254, 255, 256, 257, 247, 255, 22, 195,
2775 160, 158, 206, 206, 167, 169, 206, 4, 158, 212,
2776 206, 157, 240, 26, 27, 3, 4, 5, 6, 9,
2777 25, 40, 41, 91, 92, 93, 94, 120, 134, 136,
2778 137, 138, 140, 141, 163, 166, 168, 170, 172, 173,
2779 174, 213, 240, 181, 184, 57, 10, 206, 242, 243,
2780 11, 17, 11, 177, 193, 95, 96, 97, 98, 99,
2781 100, 101, 102, 103, 104, 175, 26, 27, 101, 102,
2782 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
2783 113, 114, 176, 175, 176, 206, 206, 242, 206, 206,
2784 250, 242, 242, 242, 242, 242, 206, 206, 206, 206,
2785 206, 242, 193, 118, 119, 54, 122, 123, 142, 143,
2786 145, 146, 148, 149, 150, 194, 39, 207, 197, 165,
2787 167, 167, 158, 197, 181, 181, 217, 175, 176, 175,
2788 176, 157, 157, 157, 157, 157, 157, 157, 165, 212,
2789 214, 168, 214, 169, 214, 22, 157, 157, 157, 223,
2790 157, 3, 4, 5, 6, 9, 25, 26, 27, 40,
2791 41, 59, 163, 166, 168, 170, 213, 239, 240, 241,
2792 160, 241, 241, 241, 208, 206, 206, 206, 206, 160,
2793 200, 160, 200, 241, 163, 160, 160, 160, 160, 160,
2794 160, 241, 241, 241, 241, 241, 38, 208, 206, 242,
2795 4, 142, 143, 144, 147, 151, 152, 196, 224, 225,
2796 38, 157, 157, 157, 157, 212, 212, 212, 212, 212,
2797 212, 212, 160, 165, 169, 206, 214, 167, 169, 212,
2798 212, 212, 160, 203, 39, 206, 230, 231, 61, 238,
2799 165, 214, 168, 214, 169, 214, 22, 242, 160, 160,
2800 241, 241, 241, 241, 241, 11, 54, 11, 252, 241,
2801 163, 242, 206, 242, 242, 242, 160, 160, 253, 160,
2802 160, 160, 206, 241, 241, 160, 203, 203, 206, 212,
2803 212, 212, 212, 252, 160, 160, 160, 160, 253, 160,
2804 212, 167, 169, 160, 160, 38, 34, 54, 201, 204,
2805 195, 160, 158, 22, 165, 169, 214, 167, 169, 17,
2806 17, 157, 160, 160, 160, 160, 241, 4, 241, 160,
2807 160, 241, 160, 160, 160, 4, 4, 160, 206, 241,
2808 241, 157, 160, 200, 206, 158, 160, 160, 160, 160,
2809 158, 212, 212, 212, 212, 158, 212, 167, 212, 212,
2810 206, 22, 4, 203, 179, 180, 39, 206, 197, 160,
2811 167, 169, 241, 241, 17, 206, 251, 241, 241, 241,
2812 241, 200, 200, 242, 241, 160, 242, 242, 242, 4,
2813 241, 251, 241, 212, 212, 212, 212, 160, 158, 160,
2814 160, 253, 158, 158, 158, 195, 201, 202, 22, 167,
2815 160, 163, 195, 195, 158, 160, 165, 241, 253, 158,
2816 200, 158, 158, 158, 158, 212, 212, 212, 158, 180,
2817 54, 199, 17, 165, 177, 248, 122, 123, 241, 241,
2818 197, 17, 206, 165, 197, 158, 158, 158, 4, 153,
2819 198, 241, 239, 165, 177, 195, 195, 38, 195, 195,
2820 22, 160, 239, 17, 241, 241, 17, 160, 241, 195,
2821 195, 241, 17, 74, 241, 17, 241
2824 #define yyerrok (yyerrstatus = 0)
2825 #define yyclearin (yychar = YYEMPTY)
2826 #define YYEMPTY (-2)
2829 #define YYACCEPT goto yyacceptlab
2830 #define YYABORT goto yyabortlab
2831 #define YYERROR goto yyerrorlab
2834 /* Like YYERROR except do call yyerror. This remains here temporarily
2835 to ease the transition to the new meaning of YYERROR, for GCC.
2836 Once GCC version 2 has supplanted version 1, this can go. */
2838 #define YYFAIL goto yyerrlab
2840 #define YYRECOVERING() (!!yyerrstatus)
2842 #define YYBACKUP(Token, Value) \
2844 if (yychar == YYEMPTY && yylen == 1) \
2848 yytoken = YYTRANSLATE (yychar); \
2854 yyerror (YY_("syntax error: cannot back up")); \
2861 #define YYERRCODE 256
2864 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2865 If N is 0, then set CURRENT to the empty location which ends
2866 the previous symbol: RHS[0] (always defined). */
2868 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2869 #ifndef YYLLOC_DEFAULT
2870 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2874 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2875 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2876 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2877 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2881 (Current).first_line = (Current).last_line = \
2882 YYRHSLOC (Rhs, 0).last_line; \
2883 (Current).first_column = (Current).last_column = \
2884 YYRHSLOC (Rhs, 0).last_column; \
2890 /* YY_LOCATION_PRINT -- Print the location on the stream.
2891 This macro was not mandated originally: define only if we know
2892 we won't break user code: when these are the locations we know. */
2894 #ifndef YY_LOCATION_PRINT
2895 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2896 # define YY_LOCATION_PRINT(File, Loc) \
2897 fprintf (File, "%d.%d-%d.%d", \
2898 (Loc).first_line, (Loc).first_column, \
2899 (Loc).last_line, (Loc).last_column)
2901 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2906 /* YYLEX -- calling `yylex' with the right arguments. */
2909 # define YYLEX yylex (YYLEX_PARAM)
2911 # define YYLEX yylex ()
2914 /* Enable debugging if requested. */
2918 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2919 # define YYFPRINTF fprintf
2922 # define YYDPRINTF(Args) \
2928 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2932 YYFPRINTF (stderr, "%s ", Title); \
2933 yy_symbol_print (stderr, \
2935 YYFPRINTF (stderr, "\n"); \
2940 /*--------------------------------.
2941 | Print this symbol on YYOUTPUT. |
2942 `--------------------------------*/
2945 #if (defined __STDC__ || defined __C99__FUNC__ \
2946 || defined __cplusplus || defined _MSC_VER)
2948 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2951 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2954 YYSTYPE const * const yyvaluep;
2960 if (yytype < YYNTOKENS)
2961 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2973 /*--------------------------------.
2974 | Print this symbol on YYOUTPUT. |
2975 `--------------------------------*/
2977 #if (defined __STDC__ || defined __C99__FUNC__ \
2978 || defined __cplusplus || defined _MSC_VER)
2980 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2983 yy_symbol_print (yyoutput, yytype, yyvaluep)
2986 YYSTYPE const * const yyvaluep;
2989 if (yytype < YYNTOKENS)
2990 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2992 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2994 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2995 YYFPRINTF (yyoutput, ")");
2998 /*------------------------------------------------------------------.
2999 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3001 `------------------------------------------------------------------*/
3003 #if (defined __STDC__ || defined __C99__FUNC__ \
3004 || defined __cplusplus || defined _MSC_VER)
3006 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3009 yy_stack_print (bottom, top)
3010 yytype_int16 *bottom;
3014 YYFPRINTF (stderr, "Stack now");
3015 for (; bottom <= top; ++bottom)
3016 YYFPRINTF (stderr, " %d", *bottom);
3017 YYFPRINTF (stderr, "\n");
3020 # define YY_STACK_PRINT(Bottom, Top) \
3023 yy_stack_print ((Bottom), (Top)); \
3027 /*------------------------------------------------.
3028 | Report that the YYRULE is going to be reduced. |
3029 `------------------------------------------------*/
3031 #if (defined __STDC__ || defined __C99__FUNC__ \
3032 || defined __cplusplus || defined _MSC_VER)
3034 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3037 yy_reduce_print (yyvsp, yyrule)
3042 int yynrhs = yyr2[yyrule];
3044 unsigned long int yylno = yyrline[yyrule];
3045 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3047 /* The symbols being reduced. */
3048 for (yyi = 0; yyi < yynrhs; yyi++)
3050 fprintf (stderr, " $%d = ", yyi + 1);
3051 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3052 &(yyvsp[(yyi + 1) - (yynrhs)])
3054 fprintf (stderr, "\n");
3058 # define YY_REDUCE_PRINT(Rule) \
3061 yy_reduce_print (yyvsp, Rule); \
3064 /* Nonzero means print parse trace. It is left uninitialized so that
3065 multiple parsers can coexist. */
3067 #else /* !YYDEBUG */
3068 # define YYDPRINTF(Args)
3069 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3070 # define YY_STACK_PRINT(Bottom, Top)
3071 # define YY_REDUCE_PRINT(Rule)
3072 #endif /* !YYDEBUG */
3075 /* YYINITDEPTH -- initial size of the parser's stacks. */
3077 # define YYINITDEPTH 200
3080 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3081 if the built-in stack extension method is used).
3083 Do not make this value too large; the results are undefined if
3084 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3085 evaluated with infinite-precision integer arithmetic. */
3088 # define YYMAXDEPTH 10000
3096 # if defined __GLIBC__ && defined _STRING_H
3097 # define yystrlen strlen
3099 /* Return the length of YYSTR. */
3100 #if (defined __STDC__ || defined __C99__FUNC__ \
3101 || defined __cplusplus || defined _MSC_VER)
3103 yystrlen (const char *yystr)
3111 for (yylen = 0; yystr[yylen]; yylen++)
3119 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3120 # define yystpcpy stpcpy
3122 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3124 #if (defined __STDC__ || defined __C99__FUNC__ \
3125 || defined __cplusplus || defined _MSC_VER)
3127 yystpcpy (char *yydest, const char *yysrc)
3130 yystpcpy (yydest, yysrc)
3136 const char *yys = yysrc;
3138 while ((*yyd++ = *yys++) != '\0')
3147 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3148 quotes and backslashes, so that it's suitable for yyerror. The
3149 heuristic is that double-quoting is unnecessary unless the string
3150 contains an apostrophe, a comma, or backslash (other than
3151 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3152 null, do not copy; instead, return the length of what the result
3155 yytnamerr (char *yyres, const char *yystr)
3160 char const *yyp = yystr;
3167 goto do_not_strip_quotes;
3171 goto do_not_strip_quotes;
3184 do_not_strip_quotes: ;
3188 return yystrlen (yystr);
3190 return yystpcpy (yyres, yystr) - yyres;
3194 /* Copy into YYRESULT an error message about the unexpected token
3195 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3196 including the terminating null byte. If YYRESULT is null, do not
3197 copy anything; just return the number of bytes that would be
3198 copied. As a special case, return 0 if an ordinary "syntax error"
3199 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3200 size calculation. */
3202 yysyntax_error (char *yyresult, int yystate, int yychar)
3204 int yyn = yypact[yystate];
3206 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3210 int yytype = YYTRANSLATE (yychar);
3211 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3212 YYSIZE_T yysize = yysize0;
3214 int yysize_overflow = 0;
3215 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3216 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3220 /* This is so xgettext sees the translatable formats that are
3221 constructed on the fly. */
3222 YY_("syntax error, unexpected %s");
3223 YY_("syntax error, unexpected %s, expecting %s");
3224 YY_("syntax error, unexpected %s, expecting %s or %s");
3225 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3226 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3230 static char const yyunexpected[] = "syntax error, unexpected %s";
3231 static char const yyexpecting[] = ", expecting %s";
3232 static char const yyor[] = " or %s";
3233 char yyformat[sizeof yyunexpected
3234 + sizeof yyexpecting - 1
3235 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3236 * (sizeof yyor - 1))];
3237 char const *yyprefix = yyexpecting;
3239 /* Start YYX at -YYN if negative to avoid negative indexes in
3241 int yyxbegin = yyn < 0 ? -yyn : 0;
3243 /* Stay within bounds of both yycheck and yytname. */
3244 int yychecklim = YYLAST - yyn + 1;
3245 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3248 yyarg[0] = yytname[yytype];
3249 yyfmt = yystpcpy (yyformat, yyunexpected);
3251 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3252 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3254 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3258 yyformat[sizeof yyunexpected - 1] = '\0';
3261 yyarg[yycount++] = yytname[yyx];
3262 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3263 yysize_overflow |= (yysize1 < yysize);
3265 yyfmt = yystpcpy (yyfmt, yyprefix);
3269 yyf = YY_(yyformat);
3270 yysize1 = yysize + yystrlen (yyf);
3271 yysize_overflow |= (yysize1 < yysize);
3274 if (yysize_overflow)
3275 return YYSIZE_MAXIMUM;
3279 /* Avoid sprintf, as that infringes on the user's name space.
3280 Don't have undefined behavior even if the translation
3281 produced a string with the wrong number of "%s"s. */
3282 char *yyp = yyresult;
3284 while ((*yyp = *yyf) != '\0')
3286 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3288 yyp += yytnamerr (yyp, yyarg[yyi++]);
3301 #endif /* YYERROR_VERBOSE */
3304 /*-----------------------------------------------.
3305 | Release the memory associated to this symbol. |
3306 `-----------------------------------------------*/
3309 #if (defined __STDC__ || defined __C99__FUNC__ \
3310 || defined __cplusplus || defined _MSC_VER)
3312 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3315 yydestruct (yymsg, yytype, yyvaluep)
3325 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3336 /* Prevent warnings from -Wmissing-prototypes. */
3338 #ifdef YYPARSE_PARAM
3339 #if defined __STDC__ || defined __cplusplus
3340 int yyparse (void *YYPARSE_PARAM);
3344 #else /* ! YYPARSE_PARAM */
3345 #if defined __STDC__ || defined __cplusplus
3350 #endif /* ! YYPARSE_PARAM */
3354 /* The look-ahead symbol. */
3357 /* The semantic value of the look-ahead symbol. */
3360 /* Number of syntax errors so far. */
3369 #ifdef YYPARSE_PARAM
3370 #if (defined __STDC__ || defined __C99__FUNC__ \
3371 || defined __cplusplus || defined _MSC_VER)
3373 yyparse (void *YYPARSE_PARAM)
3376 yyparse (YYPARSE_PARAM)
3377 void *YYPARSE_PARAM;
3379 #else /* ! YYPARSE_PARAM */
3380 #if (defined __STDC__ || defined __C99__FUNC__ \
3381 || defined __cplusplus || defined _MSC_VER)
3395 /* Number of tokens to shift before error messages enabled. */
3397 /* Look-ahead token as an internal (translated) token number. */
3400 /* Buffer for error messages, and its allocated size. */
3402 char *yymsg = yymsgbuf;
3403 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3406 /* Three stacks and their tools:
3407 `yyss': related to states,
3408 `yyvs': related to semantic values,
3409 `yyls': related to locations.
3411 Refer to the stacks thru separate pointers, to allow yyoverflow
3412 to reallocate them elsewhere. */
3414 /* The state stack. */
3415 yytype_int16 yyssa[YYINITDEPTH];
3416 yytype_int16 *yyss = yyssa;
3417 yytype_int16 *yyssp;
3419 /* The semantic value stack. */
3420 YYSTYPE yyvsa[YYINITDEPTH];
3421 YYSTYPE *yyvs = yyvsa;
3426 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3428 YYSIZE_T yystacksize = YYINITDEPTH;
3430 /* The variables used to return semantic value and location from the
3435 /* The number of symbols on the RHS of the reduced rule.
3436 Keep to zero when no symbol should be popped. */
3439 YYDPRINTF ((stderr, "Starting parse\n"));
3444 yychar = YYEMPTY; /* Cause a token to be read. */
3446 /* Initialize stack pointers.
3447 Waste one element of value and location stack
3448 so that they stay on the same level as the state stack.
3449 The wasted elements are never initialized. */
3456 /*------------------------------------------------------------.
3457 | yynewstate -- Push a new state, which is found in yystate. |
3458 `------------------------------------------------------------*/
3460 /* In all cases, when you get here, the value and location stacks
3461 have just been pushed. So pushing a state here evens the stacks. */
3467 if (yyss + yystacksize - 1 <= yyssp)
3469 /* Get the current used size of the three stacks, in elements. */
3470 YYSIZE_T yysize = yyssp - yyss + 1;
3474 /* Give user a chance to reallocate the stack. Use copies of
3475 these so that the &'s don't force the real ones into
3477 YYSTYPE *yyvs1 = yyvs;
3478 yytype_int16 *yyss1 = yyss;
3481 /* Each stack pointer address is followed by the size of the
3482 data in use in that stack, in bytes. This used to be a
3483 conditional around just the two extra args, but that might
3484 be undefined if yyoverflow is a macro. */
3485 yyoverflow (YY_("memory exhausted"),
3486 &yyss1, yysize * sizeof (*yyssp),
3487 &yyvs1, yysize * sizeof (*yyvsp),
3494 #else /* no yyoverflow */
3495 # ifndef YYSTACK_RELOCATE
3496 goto yyexhaustedlab;
3498 /* Extend the stack our own way. */
3499 if (YYMAXDEPTH <= yystacksize)
3500 goto yyexhaustedlab;
3502 if (YYMAXDEPTH < yystacksize)
3503 yystacksize = YYMAXDEPTH;
3506 yytype_int16 *yyss1 = yyss;
3507 union yyalloc *yyptr =
3508 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3510 goto yyexhaustedlab;
3511 YYSTACK_RELOCATE (yyss);
3512 YYSTACK_RELOCATE (yyvs);
3514 # undef YYSTACK_RELOCATE
3516 YYSTACK_FREE (yyss1);
3519 #endif /* no yyoverflow */
3521 yyssp = yyss + yysize - 1;
3522 yyvsp = yyvs + yysize - 1;
3525 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3526 (unsigned long int) yystacksize));
3528 if (yyss + yystacksize - 1 <= yyssp)
3532 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3541 /* Do appropriate processing given the current state. Read a
3542 look-ahead token if we need one and don't already have one. */
3544 /* First try to decide what to do without reference to look-ahead token. */
3545 yyn = yypact[yystate];
3546 if (yyn == YYPACT_NINF)
3549 /* Not known => get a look-ahead token if don't already have one. */
3551 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3552 if (yychar == YYEMPTY)
3554 YYDPRINTF ((stderr, "Reading a token: "));
3558 if (yychar <= YYEOF)
3560 yychar = yytoken = YYEOF;
3561 YYDPRINTF ((stderr, "Now at end of input.\n"));
3565 yytoken = YYTRANSLATE (yychar);
3566 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3569 /* If the proper action on seeing token YYTOKEN is to reduce or to
3570 detect an error, take that action. */
3572 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3577 if (yyn == 0 || yyn == YYTABLE_NINF)
3586 /* Count tokens shifted since error; after three, turn off error
3591 /* Shift the look-ahead token. */
3592 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3594 /* Discard the shifted token unless it is eof. */
3595 if (yychar != YYEOF)
3604 /*-----------------------------------------------------------.
3605 | yydefault -- do the default action for the current state. |
3606 `-----------------------------------------------------------*/
3608 yyn = yydefact[yystate];
3614 /*-----------------------------.
3615 | yyreduce -- Do a reduction. |
3616 `-----------------------------*/
3618 /* yyn is the number of a rule to reduce with. */
3621 /* If YYLEN is nonzero, implement the default value of the action:
3624 Otherwise, the following line sets YYVAL to garbage.
3625 This behavior is undocumented and Bison
3626 users should not rely upon it. Assigning to YYVAL
3627 unconditionally makes the parser a bit smaller, and it avoids a
3628 GCC warning that YYVAL may be used uninitialized. */
3629 yyval = yyvsp[1-yylen];
3632 YY_REDUCE_PRINT (yyn);
3636 #line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3637 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3641 #line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3642 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3646 #line 1143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3647 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3651 #line 1143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3652 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3656 #line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3657 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3661 #line 1144 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3662 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3666 #line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3667 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3671 #line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3672 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3676 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3677 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3681 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3682 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3686 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3687 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3691 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3692 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3696 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3697 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3701 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3702 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3706 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3707 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3711 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3712 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3716 #line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3717 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3721 #line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3722 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3726 #line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3727 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3731 #line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3732 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3736 #line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3737 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3741 #line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3746 #line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3747 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3751 #line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3752 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3756 #line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3757 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3761 #line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3762 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3766 #line 1167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3767 { (yyval.StrVal) = 0; ;}
3771 #line 1169 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3772 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3776 #line 1170 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3777 { (yyval.UIntVal)=0; ;}
3781 #line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3783 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3789 #line 1178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3797 #line 1183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3799 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3805 #line 1192 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3813 #line 1197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3815 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3821 #line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3822 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3826 #line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3827 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3831 #line 1205 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3832 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3836 #line 1206 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3837 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3841 #line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3842 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3846 #line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3847 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3851 #line 1212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3852 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3856 #line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3857 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3861 #line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3866 #line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3871 #line 1219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3876 #line 1220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3881 #line 1221 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3886 #line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3891 #line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3892 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3896 #line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3897 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3901 #line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3906 #line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3907 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3911 #line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3912 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3916 #line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3917 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3921 #line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3922 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3926 #line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3931 #line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3932 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3936 #line 1241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3937 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3941 #line 1244 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.UIntVal) = CallingConv::C; ;}
3946 #line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3947 { (yyval.UIntVal) = CallingConv::C; ;}
3951 #line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3952 { (yyval.UIntVal) = CallingConv::Fast; ;}
3956 #line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3957 { (yyval.UIntVal) = CallingConv::Cold; ;}
3961 #line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3962 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3966 #line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3967 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3971 #line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3972 { (yyval.UIntVal) = CallingConv::X86_SSECall; ;}
3976 #line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3978 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3979 GEN_ERROR("Calling conv too large");
3980 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3986 #line 1258 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3987 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3991 #line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3992 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3996 #line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3997 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4001 #line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4002 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4006 #line 1262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4007 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
4011 #line 1263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4012 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
4016 #line 1264 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4017 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
4021 #line 1265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4022 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
4026 #line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4027 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
4031 #line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4032 { (yyval.ParamAttrs) =
4033 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4037 #line 1271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4038 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4042 #line 1272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4044 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4049 #line 1277 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4050 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4054 #line 1278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4055 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4059 #line 1279 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4060 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4064 #line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4065 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4069 #line 1281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4070 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4074 #line 1282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4075 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4079 #line 1285 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4080 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4084 #line 1286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4086 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4091 #line 1291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4092 { (yyval.StrVal) = 0; ;}
4096 #line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4098 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4103 #line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4104 { (yyval.UIntVal) = 0; ;}
4108 #line 1300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4110 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4111 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4112 GEN_ERROR("Alignment must be a power of two");
4118 #line 1306 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4119 { (yyval.UIntVal) = 0; ;}
4123 #line 1307 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4125 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4126 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4127 GEN_ERROR("Alignment must be a power of two");
4133 #line 1316 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4135 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4136 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4137 GEN_ERROR("Invalid character in section name");
4138 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4144 #line 1324 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4145 { (yyval.StrVal) = 0; ;}
4149 #line 1325 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4150 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4154 #line 1330 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4159 #line 1331 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4164 #line 1332 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4166 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4167 delete (yyvsp[(1) - (1)].StrVal);
4173 #line 1337 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4175 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4176 GEN_ERROR("Alignment must be a power of two");
4177 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4183 #line 1353 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4185 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4191 #line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4193 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4199 #line 1361 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4201 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4202 GEN_ERROR("Cannot form a pointer to a basic block");
4203 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4204 delete (yyvsp[(1) - (3)].TypeVal);
4210 #line 1368 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4211 { // Named types are also simple types...
4212 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4214 (yyval.TypeVal) = new PATypeHolder(tmp);
4219 #line 1373 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4220 { // Type UpReference
4221 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4222 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4223 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4224 (yyval.TypeVal) = new PATypeHolder(OT);
4225 UR_OUT("New Upreference!\n");
4231 #line 1381 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4233 // Allow but ignore attributes on function types; this permits auto-upgrade.
4234 // FIXME: remove in LLVM 3.0.
4235 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4236 if (!FunctionType::isValidReturnType(RetTy))
4237 GEN_ERROR("Invalid result type for LLVM function");
4239 std::vector<const Type*> Params;
4240 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4241 for (; I != E; ++I ) {
4242 const Type *Ty = I->Ty->get();
4243 Params.push_back(Ty);
4246 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4247 if (isVarArg) Params.pop_back();
4249 for (unsigned i = 0; i != Params.size(); ++i)
4250 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4251 GEN_ERROR("Function arguments must be value types!");
4255 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4256 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4257 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4258 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4264 #line 1410 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4266 // Allow but ignore attributes on function types; this permits auto-upgrade.
4267 // FIXME: remove in LLVM 3.0.
4268 std::vector<const Type*> Params;
4269 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4270 for ( ; I != E; ++I ) {
4271 const Type* Ty = I->Ty->get();
4272 Params.push_back(Ty);
4275 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4276 if (isVarArg) Params.pop_back();
4278 for (unsigned i = 0; i != Params.size(); ++i)
4279 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4280 GEN_ERROR("Function arguments must be value types!");
4284 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4285 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4286 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4292 #line 1435 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4293 { // Sized array type?
4294 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4295 delete (yyvsp[(4) - (5)].TypeVal);
4301 #line 1440 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4303 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4304 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4305 GEN_ERROR("Unsigned result not equal to signed result");
4306 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4307 GEN_ERROR("Element type of a VectorType must be primitive");
4308 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4309 delete (yyvsp[(4) - (5)].TypeVal);
4315 #line 1450 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4316 { // Structure type?
4317 std::vector<const Type*> Elements;
4318 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4319 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4320 Elements.push_back(*I);
4322 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4323 delete (yyvsp[(2) - (3)].TypeList);
4329 #line 1460 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4330 { // Empty structure type?
4331 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4337 #line 1464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4339 std::vector<const Type*> Elements;
4340 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4341 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4342 Elements.push_back(*I);
4344 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4345 delete (yyvsp[(3) - (5)].TypeList);
4351 #line 1474 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4352 { // Empty structure type?
4353 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4359 #line 1481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4361 // Allow but ignore attributes on function types; this permits auto-upgrade.
4362 // FIXME: remove in LLVM 3.0.
4363 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4364 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4369 #line 1490 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4371 if (!UpRefs.empty())
4372 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4373 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4374 GEN_ERROR("LLVM functions cannot return aggregate types");
4375 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4380 #line 1497 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4382 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4387 #line 1502 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4389 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4390 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4396 #line 1507 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4398 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4404 #line 1515 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4406 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4407 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4408 TWA.Ty = new PATypeHolder(Type::VoidTy);
4409 (yyval.TypeWithAttrsList)->push_back(TWA);
4415 #line 1522 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4417 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4418 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4419 TWA.Ty = new PATypeHolder(Type::VoidTy);
4420 (yyval.TypeWithAttrsList)->push_back(TWA);
4426 #line 1529 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4428 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4434 #line 1537 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4436 (yyval.TypeList) = new std::list<PATypeHolder>();
4437 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4438 delete (yyvsp[(1) - (1)].TypeVal);
4444 #line 1543 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4446 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4447 delete (yyvsp[(3) - (3)].TypeVal);
4453 #line 1555 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4454 { // Nonempty unsized arr
4455 if (!UpRefs.empty())
4456 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4457 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4459 GEN_ERROR("Cannot make array constant with type: '" +
4460 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4461 const Type *ETy = ATy->getElementType();
4462 uint64_t NumElements = ATy->getNumElements();
4464 // Verify that we have the correct size...
4465 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4466 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4467 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4468 utostr(NumElements) + "");
4470 // Verify all elements are correct type!
4471 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4472 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4473 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4474 ETy->getDescription() +"' as required!\nIt is of type '"+
4475 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4478 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4479 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4485 #line 1583 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4487 if (!UpRefs.empty())
4488 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4489 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4491 GEN_ERROR("Cannot make array constant with type: '" +
4492 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4494 uint64_t NumElements = ATy->getNumElements();
4495 if (NumElements != uint64_t(-1) && NumElements != 0)
4496 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4497 " arguments, but has size of " + utostr(NumElements) +"");
4498 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4499 delete (yyvsp[(1) - (3)].TypeVal);
4505 #line 1599 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4507 if (!UpRefs.empty())
4508 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4509 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4511 GEN_ERROR("Cannot make array constant with type: '" +
4512 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4514 uint64_t NumElements = ATy->getNumElements();
4515 const Type *ETy = ATy->getElementType();
4516 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4517 GEN_ERROR("Can't build string constant of size " +
4518 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4519 " when array has size " + utostr(NumElements) + "");
4520 std::vector<Constant*> Vals;
4521 if (ETy == Type::Int8Ty) {
4522 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4523 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4525 delete (yyvsp[(3) - (3)].StrVal);
4526 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4528 delete (yyvsp[(3) - (3)].StrVal);
4529 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4530 delete (yyvsp[(1) - (3)].TypeVal);
4536 #line 1626 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4537 { // Nonempty unsized arr
4538 if (!UpRefs.empty())
4539 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4540 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4542 GEN_ERROR("Cannot make packed constant with type: '" +
4543 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4544 const Type *ETy = PTy->getElementType();
4545 unsigned NumElements = PTy->getNumElements();
4547 // Verify that we have the correct size...
4548 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4549 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4550 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4551 utostr(NumElements) + "");
4553 // Verify all elements are correct type!
4554 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4555 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4556 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4557 ETy->getDescription() +"' as required!\nIt is of type '"+
4558 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4561 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4562 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4568 #line 1654 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4570 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4572 GEN_ERROR("Cannot make struct constant with type: '" +
4573 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4575 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4576 GEN_ERROR("Illegal number of initializers for structure type");
4578 // Check to ensure that constants are compatible with the type initializer!
4579 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4580 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4581 GEN_ERROR("Expected type '" +
4582 STy->getElementType(i)->getDescription() +
4583 "' for element #" + utostr(i) +
4584 " of structure initializer");
4586 // Check to ensure that Type is not packed
4587 if (STy->isPacked())
4588 GEN_ERROR("Unpacked Initializer to vector type '" +
4589 STy->getDescription() + "'");
4591 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4592 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4598 #line 1680 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4600 if (!UpRefs.empty())
4601 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4602 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4604 GEN_ERROR("Cannot make struct constant with type: '" +
4605 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4607 if (STy->getNumContainedTypes() != 0)
4608 GEN_ERROR("Illegal number of initializers for structure type");
4610 // Check to ensure that Type is not packed
4611 if (STy->isPacked())
4612 GEN_ERROR("Unpacked Initializer to vector type '" +
4613 STy->getDescription() + "'");
4615 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4616 delete (yyvsp[(1) - (3)].TypeVal);
4622 #line 1700 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4624 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4626 GEN_ERROR("Cannot make struct constant with type: '" +
4627 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4629 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4630 GEN_ERROR("Illegal number of initializers for structure type");
4632 // Check to ensure that constants are compatible with the type initializer!
4633 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4634 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4635 GEN_ERROR("Expected type '" +
4636 STy->getElementType(i)->getDescription() +
4637 "' for element #" + utostr(i) +
4638 " of structure initializer");
4640 // Check to ensure that Type is packed
4641 if (!STy->isPacked())
4642 GEN_ERROR("Vector initializer to non-vector type '" +
4643 STy->getDescription() + "'");
4645 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4646 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4652 #line 1726 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4654 if (!UpRefs.empty())
4655 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4656 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4658 GEN_ERROR("Cannot make struct constant with type: '" +
4659 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4661 if (STy->getNumContainedTypes() != 0)
4662 GEN_ERROR("Illegal number of initializers for structure type");
4664 // Check to ensure that Type is packed
4665 if (!STy->isPacked())
4666 GEN_ERROR("Vector initializer to non-vector type '" +
4667 STy->getDescription() + "'");
4669 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4670 delete (yyvsp[(1) - (5)].TypeVal);
4676 #line 1746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4678 if (!UpRefs.empty())
4679 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4680 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4682 GEN_ERROR("Cannot make null pointer constant with type: '" +
4683 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4685 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4686 delete (yyvsp[(1) - (2)].TypeVal);
4692 #line 1758 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4694 if (!UpRefs.empty())
4695 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4696 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4697 delete (yyvsp[(1) - (2)].TypeVal);
4703 #line 1765 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4705 if (!UpRefs.empty())
4706 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4707 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4709 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4711 // ConstExprs can exist in the body of a function, thus creating
4712 // GlobalValues whenever they refer to a variable. Because we are in
4713 // the context of a function, getExistingVal will search the functions
4714 // symbol table instead of the module symbol table for the global symbol,
4715 // which throws things all off. To get around this, we just tell
4716 // getExistingVal that we are at global scope here.
4718 Function *SavedCurFn = CurFun.CurrentFunction;
4719 CurFun.CurrentFunction = 0;
4721 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4724 CurFun.CurrentFunction = SavedCurFn;
4726 // If this is an initializer for a constant pointer, which is referencing a
4727 // (currently) undefined variable, create a stub now that shall be replaced
4728 // in the future with the right type of variable.
4731 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4732 const PointerType *PT = cast<PointerType>(Ty);
4734 // First check to see if the forward references value is already created!
4735 PerModuleInfo::GlobalRefsType::iterator I =
4736 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4738 if (I != CurModule.GlobalRefs.end()) {
4739 V = I->second; // Placeholder already exists, use it...
4740 (yyvsp[(2) - (2)].ValIDVal).destroy();
4743 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4744 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4745 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4746 GEN_ERROR("Invalid reference to global");
4748 // Create the forward referenced global.
4750 if (const FunctionType *FTy =
4751 dyn_cast<FunctionType>(PT->getElementType())) {
4752 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4753 CurModule.CurrentModule);
4755 GV = new GlobalVariable(PT->getElementType(), false,
4756 GlobalValue::ExternalWeakLinkage, 0,
4757 Name, CurModule.CurrentModule);
4760 // Keep track of the fact that we have a forward ref to recycle it
4761 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4766 (yyval.ConstVal) = cast<GlobalValue>(V);
4767 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4773 #line 1831 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4775 if (!UpRefs.empty())
4776 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4777 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4778 GEN_ERROR("Mismatched types for constant expression: " +
4779 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4780 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4781 delete (yyvsp[(1) - (2)].TypeVal);
4787 #line 1841 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4789 if (!UpRefs.empty())
4790 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4791 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4792 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4793 GEN_ERROR("Cannot create a null initialized value of this type");
4794 (yyval.ConstVal) = Constant::getNullValue(Ty);
4795 delete (yyvsp[(1) - (2)].TypeVal);
4801 #line 1851 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4802 { // integral constants
4803 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4804 GEN_ERROR("Constant value doesn't fit in type");
4805 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4811 #line 1857 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4812 { // arbitrary precision integer constants
4813 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4814 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4815 GEN_ERROR("Constant value does not fit in type");
4817 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4818 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4819 delete (yyvsp[(2) - (2)].APIntVal);
4825 #line 1867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4826 { // integral constants
4827 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4828 GEN_ERROR("Constant value doesn't fit in type");
4829 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4835 #line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4836 { // arbitrary precision integer constants
4837 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4838 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4839 GEN_ERROR("Constant value does not fit in type");
4841 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4842 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4843 delete (yyvsp[(2) - (2)].APIntVal);
4849 #line 1883 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4850 { // Boolean constants
4851 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4852 GEN_ERROR("Constant true must have type i1");
4853 (yyval.ConstVal) = ConstantInt::getTrue();
4859 #line 1889 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4860 { // Boolean constants
4861 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4862 GEN_ERROR("Constant false must have type i1");
4863 (yyval.ConstVal) = ConstantInt::getFalse();
4869 #line 1895 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4870 { // Floating point constants
4871 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4872 GEN_ERROR("Floating point constant invalid for type");
4873 // Lexer has no type info, so builds all float and double FP constants
4874 // as double. Fix this here. Long double is done right.
4875 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4876 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4877 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4878 delete (yyvsp[(2) - (2)].FPVal);
4884 #line 1908 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4886 if (!UpRefs.empty())
4887 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4888 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4889 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4890 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4891 GEN_ERROR("invalid cast opcode for cast from '" +
4892 Val->getType()->getDescription() + "' to '" +
4893 DestTy->getDescription() + "'");
4894 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4895 delete (yyvsp[(5) - (6)].TypeVal);
4900 #line 1920 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4902 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4903 GEN_ERROR("GetElementPtr requires a pointer operand");
4906 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4908 GEN_ERROR("Index list invalid for constant getelementptr");
4910 SmallVector<Constant*, 8> IdxVec;
4911 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4912 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4913 IdxVec.push_back(C);
4915 GEN_ERROR("Indices to constant getelementptr must be constants");
4917 delete (yyvsp[(4) - (5)].ValueList);
4919 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4925 #line 1941 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4927 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4928 GEN_ERROR("Select condition must be of boolean type");
4929 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4930 GEN_ERROR("Select operand types must match");
4931 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4937 #line 1949 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4939 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4940 GEN_ERROR("Binary operator types must match");
4942 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4947 #line 1955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4949 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4950 GEN_ERROR("Logical operator types must match");
4951 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4952 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4953 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4954 GEN_ERROR("Logical operator requires integral operands");
4956 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4962 #line 1966 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4964 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4965 GEN_ERROR("icmp operand types must match");
4966 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4971 #line 1971 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4973 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4974 GEN_ERROR("fcmp operand types must match");
4975 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4980 #line 1976 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4982 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4983 GEN_ERROR("vicmp operand types must match");
4984 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4989 #line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4991 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4992 GEN_ERROR("vfcmp operand types must match");
4993 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4998 #line 1986 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5000 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5001 GEN_ERROR("Invalid extractelement operands");
5002 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5008 #line 1992 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5010 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5011 GEN_ERROR("Invalid insertelement operands");
5012 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5018 #line 1998 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5020 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5021 GEN_ERROR("Invalid shufflevector operands");
5022 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5028 #line 2004 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5030 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5031 GEN_ERROR("ExtractValue requires an aggregate operand");
5033 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5034 delete (yyvsp[(4) - (5)].ConstantList);
5040 #line 2012 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5042 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5043 GEN_ERROR("InsertValue requires an aggregate operand");
5045 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5046 delete (yyvsp[(6) - (7)].ConstantList);
5052 #line 2023 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5054 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5060 #line 2027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5062 (yyval.ConstVector) = new std::vector<Constant*>();
5063 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5069 #line 2035 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5070 { (yyval.BoolVal) = false; ;}
5074 #line 2035 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5075 { (yyval.BoolVal) = true; ;}
5079 #line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5080 { (yyval.BoolVal) = true; ;}
5084 #line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5085 { (yyval.BoolVal) = false; ;}
5089 #line 2041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5091 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5092 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5094 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5096 GEN_ERROR("Aliases can be created only to global values");
5098 (yyval.ConstVal) = Aliasee;
5100 delete (yyvsp[(1) - (2)].TypeVal);
5105 #line 2053 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5107 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5108 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5109 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5110 GEN_ERROR("invalid cast opcode for cast from '" +
5111 Val->getType()->getDescription() + "' to '" +
5112 DestTy->getDescription() + "'");
5114 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5116 delete (yyvsp[(5) - (6)].TypeVal);
5121 #line 2074 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5123 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5124 CurModule.ModuleDone();
5130 #line 2079 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5132 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5133 CurModule.ModuleDone();
5139 #line 2092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5140 { CurFun.isDeclare = false; ;}
5144 #line 2092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5146 CurFun.FunctionDone();
5152 #line 2096 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5153 { CurFun.isDeclare = true; ;}
5157 #line 2096 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5164 #line 2099 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5171 #line 2102 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5173 if (!UpRefs.empty())
5174 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5175 // Eagerly resolve types. This is not an optimization, this is a
5176 // requirement that is due to the fact that we could have this:
5178 // %list = type { %list * }
5179 // %list = type { %list * } ; repeated type decl
5181 // If types are not resolved eagerly, then the two types will not be
5182 // determined to be the same type!
5184 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5186 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5188 // If this is a named type that is not a redefinition, add it to the slot
5190 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5193 delete (yyvsp[(3) - (3)].TypeVal);
5199 #line 2126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5201 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5203 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5205 // If this is a named type that is not a redefinition, add it to the slot
5207 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5214 #line 2138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5216 /* "Externally Visible" Linkage */
5217 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5218 GEN_ERROR("Global value initializer is not a constant");
5219 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5220 (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));
5226 #line 2145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5233 #line 2149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5235 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5236 GEN_ERROR("Global value initializer is not a constant");
5237 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));
5243 #line 2154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5250 #line 2158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5252 if (!UpRefs.empty())
5253 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5254 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));
5256 delete (yyvsp[(6) - (7)].TypeVal);
5261 #line 2164 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5269 #line 2168 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5272 if ((yyvsp[(1) - (5)].StrVal)) {
5273 Name = *(yyvsp[(1) - (5)].StrVal);
5274 delete (yyvsp[(1) - (5)].StrVal);
5277 GEN_ERROR("Alias name cannot be empty");
5279 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5281 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5283 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5284 CurModule.CurrentModule);
5285 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5286 InsertValue(GA, CurModule.Values);
5289 // If there was a forward reference of this alias, resolve it now.
5293 ID = ValID::createGlobalName(Name);
5295 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5297 if (GlobalValue *FWGV =
5298 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5299 // Replace uses of the fwdref with the actual alias.
5300 FWGV->replaceAllUsesWith(GA);
5301 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5302 GV->eraseFromParent();
5304 cast<Function>(FWGV)->eraseFromParent();
5313 #line 2208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5320 #line 2211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5327 #line 2217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5329 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5330 if (AsmSoFar.empty())
5331 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5333 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5334 delete (yyvsp[(1) - (1)].StrVal);
5340 #line 2227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5342 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5343 delete (yyvsp[(3) - (3)].StrVal);
5348 #line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5350 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5351 delete (yyvsp[(3) - (3)].StrVal);
5356 #line 2238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5358 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5359 delete (yyvsp[(3) - (3)].StrVal);
5365 #line 2243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5367 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5368 delete (yyvsp[(1) - (1)].StrVal);
5374 #line 2248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5381 #line 2257 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5383 if (!UpRefs.empty())
5384 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5385 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5386 GEN_ERROR("Argument types must be first-class");
5387 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5388 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5389 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5395 #line 2267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5397 if (!UpRefs.empty())
5398 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5399 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5400 GEN_ERROR("Argument types must be first-class");
5401 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5402 (yyval.ArgList) = new ArgListType;
5403 (yyval.ArgList)->push_back(E);
5409 #line 2278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5411 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5417 #line 2282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5419 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5420 struct ArgListEntry E;
5421 E.Ty = new PATypeHolder(Type::VoidTy);
5423 E.Attrs = ParamAttr::None;
5424 (yyval.ArgList)->push_back(E);
5430 #line 2291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5432 (yyval.ArgList) = new ArgListType;
5433 struct ArgListEntry E;
5434 E.Ty = new PATypeHolder(Type::VoidTy);
5436 E.Attrs = ParamAttr::None;
5437 (yyval.ArgList)->push_back(E);
5443 #line 2300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5445 (yyval.ArgList) = 0;
5451 #line 2306 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5453 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5454 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5456 // Check the function result for abstractness if this is a define. We should
5457 // have no abstract types at this point
5458 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5459 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5461 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
5462 GEN_ERROR("Invalid result type for LLVM function");
5464 std::vector<const Type*> ParamTypeList;
5465 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5466 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5467 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
5468 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5470 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5471 const Type* Ty = I->Ty->get();
5472 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5473 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5474 ParamTypeList.push_back(Ty);
5475 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5476 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5480 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5481 if (isVarArg) ParamTypeList.pop_back();
5485 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5487 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5488 const PointerType *PFT = PointerType::getUnqual(FT);
5489 delete (yyvsp[(2) - (10)].TypeVal);
5492 if (!FunctionName.empty()) {
5493 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5495 ID = ValID::createGlobalID(CurModule.Values.size());
5499 // See if this function was forward referenced. If so, recycle the object.
5500 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5501 // Move the function to the end of the list, from whereever it was
5502 // previously inserted.
5503 Fn = cast<Function>(FWRef);
5504 assert(Fn->getParamAttrs().isEmpty() &&
5505 "Forward reference has parameter attributes!");
5506 CurModule.CurrentModule->getFunctionList().remove(Fn);
5507 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5508 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5509 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5510 if (Fn->getFunctionType() != FT ) {
5511 // The existing function doesn't have the same type. This is an overload
5513 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5514 } else if (Fn->getParamAttrs() != PAL) {
5515 // The existing function doesn't have the same parameter attributes.
5516 // This is an overload error.
5517 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5518 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5519 // Neither the existing or the current function is a declaration and they
5520 // have the same name and same type. Clearly this is a redefinition.
5521 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5522 } else if (Fn->isDeclaration()) {
5523 // Make sure to strip off any argument names so we can't get conflicts.
5524 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5528 } else { // Not already defined?
5529 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5530 CurModule.CurrentModule);
5531 InsertValue(Fn, CurModule.Values);
5534 CurFun.FunctionStart(Fn);
5536 if (CurFun.isDeclare) {
5537 // If we have declaration, always overwrite linkage. This will allow us to
5538 // correctly handle cases, when pointer to function is passed as argument to
5539 // another function.
5540 Fn->setLinkage(CurFun.Linkage);
5541 Fn->setVisibility(CurFun.Visibility);
5543 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5544 Fn->setParamAttrs(PAL);
5545 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5546 if ((yyvsp[(8) - (10)].StrVal)) {
5547 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5548 delete (yyvsp[(8) - (10)].StrVal);
5550 if ((yyvsp[(10) - (10)].StrVal)) {
5551 Fn->setGC((yyvsp[(10) - (10)].StrVal)->c_str());
5552 delete (yyvsp[(10) - (10)].StrVal);
5555 // Add all of the arguments we parsed to the function...
5556 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5557 if (isVarArg) { // Nuke the last entry
5558 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5559 "Not a varargs marker!");
5560 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5561 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5563 Function::arg_iterator ArgIt = Fn->arg_begin();
5564 Function::arg_iterator ArgEnd = Fn->arg_end();
5566 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5567 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5568 delete I->Ty; // Delete the typeholder...
5569 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5575 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5582 #line 2436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5584 (yyval.FunctionVal) = CurFun.CurrentFunction;
5586 // Make sure that we keep track of the linkage type even if there was a
5587 // previous "declare".
5588 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5589 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5594 #line 2447 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5596 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5602 #line 2452 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5604 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5605 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5606 (yyval.FunctionVal) = CurFun.CurrentFunction;
5607 CurFun.FunctionDone();
5613 #line 2464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5615 (yyval.BoolVal) = false;
5621 #line 2468 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5623 (yyval.BoolVal) = true;
5629 #line 2473 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5630 { // A reference to a direct constant
5631 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5637 #line 2477 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5639 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5645 #line 2481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5646 { // arbitrary precision integer constants
5647 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5648 delete (yyvsp[(1) - (1)].APIntVal);
5654 #line 2486 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5655 { // arbitrary precision integer constants
5656 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5657 delete (yyvsp[(1) - (1)].APIntVal);
5663 #line 2491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5664 { // Perhaps it's an FP constant?
5665 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5671 #line 2495 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5673 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5679 #line 2499 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5681 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5687 #line 2503 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5689 (yyval.ValIDVal) = ValID::createNull();
5695 #line 2507 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5697 (yyval.ValIDVal) = ValID::createUndef();
5703 #line 2511 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5704 { // A vector zero constant.
5705 (yyval.ValIDVal) = ValID::createZeroInit();
5711 #line 2515 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5712 { // Nonempty unsized packed vector
5713 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5714 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5716 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5717 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5719 VectorType* pt = VectorType::get(ETy, NumElements);
5720 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5722 // Verify all elements are correct type!
5723 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5724 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5725 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5726 ETy->getDescription() +"' as required!\nIt is of type '" +
5727 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5730 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5731 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5737 #line 2537 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5738 { // Nonempty unsized arr
5739 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5740 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5742 if (!ETy->isFirstClassType())
5743 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5745 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5746 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5748 // Verify all elements are correct type!
5749 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5750 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5751 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5752 ETy->getDescription() +"' as required!\nIt is of type '"+
5753 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5756 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5757 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5763 #line 2559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5765 // Use undef instead of an array because it's inconvenient to determine
5766 // the element type at this point, there being no elements to examine.
5767 (yyval.ValIDVal) = ValID::createUndef();
5773 #line 2565 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5775 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5776 const Type *ETy = Type::Int8Ty;
5778 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5780 std::vector<Constant*> Vals;
5781 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5782 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5783 delete (yyvsp[(2) - (2)].StrVal);
5784 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5790 #line 2578 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5792 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5793 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5794 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5796 const StructType *STy = StructType::get(Elements);
5797 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5799 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5800 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5806 #line 2590 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5808 const StructType *STy = StructType::get(std::vector<const Type*>());
5809 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5815 #line 2595 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5817 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5818 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5819 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5821 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5822 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5824 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5825 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5831 #line 2607 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5833 const StructType *STy = StructType::get(std::vector<const Type*>(),
5835 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5841 #line 2613 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5843 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5849 #line 2617 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5851 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5852 delete (yyvsp[(3) - (5)].StrVal);
5853 delete (yyvsp[(5) - (5)].StrVal);
5859 #line 2627 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5860 { // Is it an integer reference...?
5861 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5867 #line 2631 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5869 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5875 #line 2635 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5876 { // Is it a named reference...?
5877 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5878 delete (yyvsp[(1) - (1)].StrVal);
5884 #line 2640 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5885 { // Is it a named reference...?
5886 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5887 delete (yyvsp[(1) - (1)].StrVal);
5893 #line 2653 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5895 if (!UpRefs.empty())
5896 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5897 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5898 delete (yyvsp[(1) - (2)].TypeVal);
5904 #line 2662 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5906 (yyval.ValueList) = new std::vector<Value *>();
5907 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5913 #line 2667 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5915 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
5921 #line 2672 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5923 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5929 #line 2676 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5930 { // Do not allow functions with 0 basic blocks
5931 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5937 #line 2685 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5939 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5941 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5942 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5943 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5949 #line 2694 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5952 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
5953 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
5954 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
5955 " is incorrect, expected %" + utostr((unsigned)ValNum));
5957 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5958 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5964 #line 2707 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5966 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5967 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5968 if (CI2->getParent() == 0)
5969 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5970 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5971 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5977 #line 2716 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5978 { // Empty space between instruction lists
5979 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5985 #line 2720 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5986 { // Labelled (named) basic block
5987 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5988 delete (yyvsp[(1) - (1)].StrVal);
5995 #line 2728 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5996 { // Return with a result...
5997 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
5998 assert(!VL.empty() && "Invalid ret operands!");
5999 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6000 if (VL.size() > 1 ||
6001 (isa<StructType>(ReturnType) &&
6002 (VL.empty() || VL[0]->getType() != ReturnType))) {
6003 Value *RV = UndefValue::get(ReturnType);
6004 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6005 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6006 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6009 (yyval.TermInstVal) = ReturnInst::Create(RV);
6011 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6013 delete (yyvsp[(2) - (2)].ValueList);
6019 #line 2748 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6020 { // Return with no result...
6021 (yyval.TermInstVal) = ReturnInst::Create();
6027 #line 2752 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6028 { // Unconditional Branch...
6029 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6031 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6036 #line 2757 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6038 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6039 GEN_ERROR("Branch condition must have type i1");
6040 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6042 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6044 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6046 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6051 #line 2768 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6053 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6055 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6057 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6058 (yyval.TermInstVal) = S;
6060 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6061 E = (yyvsp[(8) - (9)].JumpTable)->end();
6062 for (; I != E; ++I) {
6063 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6064 S->addCase(CI, I->second);
6066 GEN_ERROR("Switch case is constant, but not a simple integer");
6068 delete (yyvsp[(8) - (9)].JumpTable);
6074 #line 2787 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6076 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6078 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6080 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6081 (yyval.TermInstVal) = S;
6087 #line 2797 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6090 // Handle the short syntax
6091 const PointerType *PFTy = 0;
6092 const FunctionType *Ty = 0;
6093 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
6094 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6095 // Pull out the types of all of the arguments...
6096 std::vector<const Type*> ParamTypes;
6097 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6098 for (; I != E; ++I) {
6099 const Type *Ty = I->Val->getType();
6100 if (Ty == Type::VoidTy)
6101 GEN_ERROR("Short call syntax cannot be used with varargs");
6102 ParamTypes.push_back(Ty);
6105 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6106 GEN_ERROR("Invalid result type for LLVM function");
6108 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6109 PFTy = PointerType::getUnqual(Ty);
6112 delete (yyvsp[(3) - (14)].TypeVal);
6114 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
6116 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6118 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6121 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6122 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6123 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6125 // Check the arguments
6127 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
6128 // Make sure no arguments is a good thing!
6129 if (Ty->getNumParams() != 0)
6130 GEN_ERROR("No arguments passed to a function that "
6131 "expects arguments");
6132 } else { // Has arguments?
6133 // Loop through FunctionType's arguments and ensure they are specified
6135 FunctionType::param_iterator I = Ty->param_begin();
6136 FunctionType::param_iterator E = Ty->param_end();
6137 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6140 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6141 if (ArgI->Val->getType() != *I)
6142 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6143 (*I)->getDescription() + "'");
6144 Args.push_back(ArgI->Val);
6145 if (ArgI->Attrs != ParamAttr::None)
6146 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6149 if (Ty->isVarArg()) {
6151 for (; ArgI != ArgE; ++ArgI, ++index) {
6152 Args.push_back(ArgI->Val); // push the remaining varargs
6153 if (ArgI->Attrs != ParamAttr::None)
6154 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6156 } else if (I != E || ArgI != ArgE)
6157 GEN_ERROR("Invalid number of parameters detected");
6162 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6164 // Create the InvokeInst
6165 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6166 Args.begin(), Args.end());
6167 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6168 II->setParamAttrs(PAL);
6169 (yyval.TermInstVal) = II;
6170 delete (yyvsp[(6) - (14)].ParamList);
6176 #line 2882 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6178 (yyval.TermInstVal) = new UnwindInst();
6184 #line 2886 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6186 (yyval.TermInstVal) = new UnreachableInst();
6192 #line 2893 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6194 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6195 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6198 GEN_ERROR("May only switch on a constant pool value");
6200 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6202 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6207 #line 2904 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6209 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6210 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6214 GEN_ERROR("May only switch on a constant pool value");
6216 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6218 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6223 #line 2917 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6225 // Is this definition named?? if so, assign the name...
6226 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6228 InsertValue((yyvsp[(2) - (2)].InstVal));
6229 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6235 #line 2926 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6238 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6240 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6241 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6242 " is incorrect, expected %" + utostr((unsigned)ValNum));
6244 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6250 #line 2939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6251 { // Used for PHI nodes
6252 if (!UpRefs.empty())
6253 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6254 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6255 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6257 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6259 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6260 delete (yyvsp[(1) - (6)].TypeVal);
6265 #line 2950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6267 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6268 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6270 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6272 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6277 #line 2960 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6279 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6280 if (!UpRefs.empty())
6281 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6282 // Used for call and invoke instructions
6283 (yyval.ParamList) = new ParamList();
6284 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6285 (yyval.ParamList)->push_back(E);
6286 delete (yyvsp[(1) - (4)].TypeVal);
6292 #line 2971 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6294 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6295 // Labels are only valid in ASMs
6296 (yyval.ParamList) = new ParamList();
6297 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6298 (yyval.ParamList)->push_back(E);
6304 #line 2979 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6306 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6307 if (!UpRefs.empty())
6308 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6309 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6310 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6311 (yyval.ParamList)->push_back(E);
6312 delete (yyvsp[(3) - (6)].TypeVal);
6318 #line 2989 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6320 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6321 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6322 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6323 (yyval.ParamList)->push_back(E);
6329 #line 2996 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6330 { (yyval.ParamList) = new ParamList(); ;}
6334 #line 2999 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6335 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6339 #line 3000 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6341 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6342 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6348 #line 3008 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6350 (yyval.ConstantList) = new std::vector<unsigned>();
6351 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6352 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6353 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6358 #line 3014 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6360 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6361 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6362 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6363 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6369 #line 3023 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6371 (yyval.BoolVal) = true;
6377 #line 3027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6379 (yyval.BoolVal) = false;
6385 #line 3032 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6387 if (!UpRefs.empty())
6388 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6389 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6390 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6392 "Arithmetic operator requires integer, FP, or packed operands");
6393 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6395 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6397 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6398 if ((yyval.InstVal) == 0)
6399 GEN_ERROR("binary operator returned null");
6400 delete (yyvsp[(2) - (5)].TypeVal);
6405 #line 3048 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6407 if (!UpRefs.empty())
6408 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6409 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6410 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6411 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6412 GEN_ERROR("Logical operator requires integral operands");
6414 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6416 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6418 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6419 if ((yyval.InstVal) == 0)
6420 GEN_ERROR("binary operator returned null");
6421 delete (yyvsp[(2) - (5)].TypeVal);
6426 #line 3065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6428 if (!UpRefs.empty())
6429 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6430 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6431 GEN_ERROR("Vector types not supported by icmp instruction");
6432 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6434 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6436 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6437 if ((yyval.InstVal) == 0)
6438 GEN_ERROR("icmp operator returned null");
6439 delete (yyvsp[(3) - (6)].TypeVal);
6444 #line 3079 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6446 if (!UpRefs.empty())
6447 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6448 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6449 GEN_ERROR("Vector types not supported by fcmp instruction");
6450 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6452 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6454 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6455 if ((yyval.InstVal) == 0)
6456 GEN_ERROR("fcmp operator returned null");
6457 delete (yyvsp[(3) - (6)].TypeVal);
6462 #line 3093 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6464 if (!UpRefs.empty())
6465 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6466 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6467 GEN_ERROR("Scalar types not supported by vicmp instruction");
6468 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6470 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6472 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6473 if ((yyval.InstVal) == 0)
6474 GEN_ERROR("icmp operator returned null");
6475 delete (yyvsp[(3) - (6)].TypeVal);
6480 #line 3107 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6482 if (!UpRefs.empty())
6483 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6484 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6485 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6486 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6488 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6490 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6491 if ((yyval.InstVal) == 0)
6492 GEN_ERROR("fcmp operator returned null");
6493 delete (yyvsp[(3) - (6)].TypeVal);
6498 #line 3121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6500 if (!UpRefs.empty())
6501 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6502 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6503 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6504 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6505 GEN_ERROR("invalid cast opcode for cast from '" +
6506 Val->getType()->getDescription() + "' to '" +
6507 DestTy->getDescription() + "'");
6508 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6509 delete (yyvsp[(4) - (4)].TypeVal);
6514 #line 3133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6516 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6517 GEN_ERROR("select condition must be boolean");
6518 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6519 GEN_ERROR("select value types should match");
6520 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6526 #line 3141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6528 if (!UpRefs.empty())
6529 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6530 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6531 delete (yyvsp[(4) - (4)].TypeVal);
6537 #line 3148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6539 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6540 GEN_ERROR("Invalid extractelement operands");
6541 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6547 #line 3154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6549 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6550 GEN_ERROR("Invalid insertelement operands");
6551 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6557 #line 3160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6559 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6560 GEN_ERROR("Invalid shufflevector operands");
6561 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6567 #line 3166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6569 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6570 if (!Ty->isFirstClassType())
6571 GEN_ERROR("PHI node operands must be of first class type");
6572 (yyval.InstVal) = PHINode::Create(Ty);
6573 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6574 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6575 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6576 GEN_ERROR("All elements of a PHI node must be of the same type");
6577 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6578 (yyvsp[(2) - (2)].PHIList)->pop_front();
6580 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6586 #line 3182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6589 // Handle the short syntax
6590 const PointerType *PFTy = 0;
6591 const FunctionType *Ty = 0;
6592 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6593 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6594 // Pull out the types of all of the arguments...
6595 std::vector<const Type*> ParamTypes;
6596 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6597 for (; I != E; ++I) {
6598 const Type *Ty = I->Val->getType();
6599 if (Ty == Type::VoidTy)
6600 GEN_ERROR("Short call syntax cannot be used with varargs");
6601 ParamTypes.push_back(Ty);
6604 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6605 GEN_ERROR("Invalid result type for LLVM function");
6607 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6608 PFTy = PointerType::getUnqual(Ty);
6611 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6614 // Check for call to invalid intrinsic to avoid crashing later.
6615 if (Function *theF = dyn_cast<Function>(V)) {
6616 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6617 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6618 !theF->getIntrinsicID(true))
6619 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6620 theF->getName() + "'");
6623 // Set up the ParamAttrs for the function
6624 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6625 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6626 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6627 // Check the arguments
6629 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6630 // Make sure no arguments is a good thing!
6631 if (Ty->getNumParams() != 0)
6632 GEN_ERROR("No arguments passed to a function that "
6633 "expects arguments");
6634 } else { // Has arguments?
6635 // Loop through FunctionType's arguments and ensure they are specified
6636 // correctly. Also, gather any parameter attributes.
6637 FunctionType::param_iterator I = Ty->param_begin();
6638 FunctionType::param_iterator E = Ty->param_end();
6639 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6642 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6643 if (ArgI->Val->getType() != *I)
6644 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6645 (*I)->getDescription() + "'");
6646 Args.push_back(ArgI->Val);
6647 if (ArgI->Attrs != ParamAttr::None)
6648 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6650 if (Ty->isVarArg()) {
6652 for (; ArgI != ArgE; ++ArgI, ++index) {
6653 Args.push_back(ArgI->Val); // push the remaining varargs
6654 if (ArgI->Attrs != ParamAttr::None)
6655 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6657 } else if (I != E || ArgI != ArgE)
6658 GEN_ERROR("Invalid number of parameters detected");
6661 // Finish off the ParamAttrs and check them
6664 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6666 // Create the call node
6667 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6668 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6669 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6670 CI->setParamAttrs(PAL);
6671 (yyval.InstVal) = CI;
6672 delete (yyvsp[(6) - (8)].ParamList);
6673 delete (yyvsp[(3) - (8)].TypeVal);
6679 #line 3271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6681 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6687 #line 3276 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6689 (yyval.BoolVal) = true;
6695 #line 3280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6697 (yyval.BoolVal) = false;
6703 #line 3287 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6705 if (!UpRefs.empty())
6706 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6707 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6708 delete (yyvsp[(2) - (3)].TypeVal);
6714 #line 3294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6716 if (!UpRefs.empty())
6717 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6718 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6719 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6720 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6722 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6723 delete (yyvsp[(2) - (6)].TypeVal);
6728 #line 3304 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6730 if (!UpRefs.empty())
6731 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6732 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6733 delete (yyvsp[(2) - (3)].TypeVal);
6739 #line 3311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6741 if (!UpRefs.empty())
6742 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6743 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6744 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6745 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6747 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6748 delete (yyvsp[(2) - (6)].TypeVal);
6753 #line 3321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6755 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6756 GEN_ERROR("Trying to free nonpointer type " +
6757 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6758 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6764 #line 3329 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6766 if (!UpRefs.empty())
6767 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6768 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6769 GEN_ERROR("Can't load from nonpointer type: " +
6770 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6771 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6772 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6773 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6774 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6776 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6777 delete (yyvsp[(3) - (5)].TypeVal);
6782 #line 3343 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6784 if (!UpRefs.empty())
6785 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6786 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6788 GEN_ERROR("Can't store to a nonpointer type: " +
6789 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6790 const Type *ElTy = PT->getElementType();
6791 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6792 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6793 "' into space of type '" + ElTy->getDescription() + "'");
6795 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6797 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6798 delete (yyvsp[(5) - (7)].TypeVal);
6803 #line 3360 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6805 if (!UpRefs.empty())
6806 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6807 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6808 GEN_ERROR("getresult insn requires an aggregate operand");
6809 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6810 GEN_ERROR("Invalid getresult index for type '" +
6811 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6813 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6815 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6816 delete (yyvsp[(2) - (5)].TypeVal);
6821 #line 3374 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6823 if (!UpRefs.empty())
6824 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6825 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6826 GEN_ERROR("getelementptr insn requires pointer operand");
6828 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6829 GEN_ERROR("Invalid getelementptr indices for type '" +
6830 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6831 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6833 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6834 delete (yyvsp[(2) - (4)].TypeVal);
6835 delete (yyvsp[(4) - (4)].ValueList);
6840 #line 3389 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6842 if (!UpRefs.empty())
6843 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6844 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6845 GEN_ERROR("extractvalue insn requires an aggregate operand");
6847 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6848 GEN_ERROR("Invalid extractvalue indices for type '" +
6849 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6850 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6852 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6853 delete (yyvsp[(2) - (4)].TypeVal);
6854 delete (yyvsp[(4) - (4)].ConstantList);
6859 #line 3404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6861 if (!UpRefs.empty())
6862 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6863 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6864 GEN_ERROR("extractvalue insn requires an aggregate operand");
6866 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6867 GEN_ERROR("Invalid insertvalue indices for type '" +
6868 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6869 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6870 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6872 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6873 delete (yyvsp[(2) - (7)].TypeVal);
6874 delete (yyvsp[(5) - (7)].TypeVal);
6875 delete (yyvsp[(7) - (7)].ConstantList);
6880 /* Line 1267 of yacc.c. */
6881 #line 6882 "llvmAsmParser.tab.c"
6884 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6888 YY_STACK_PRINT (yyss, yyssp);
6893 /* Now `shift' the result of the reduction. Determine what state
6894 that goes to, based on the state we popped back to and the rule
6895 number reduced by. */
6899 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6900 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6901 yystate = yytable[yystate];
6903 yystate = yydefgoto[yyn - YYNTOKENS];
6908 /*------------------------------------.
6909 | yyerrlab -- here on detecting error |
6910 `------------------------------------*/
6912 /* If not already recovering from an error, report this error. */
6916 #if ! YYERROR_VERBOSE
6917 yyerror (YY_("syntax error"));
6920 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6921 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6923 YYSIZE_T yyalloc = 2 * yysize;
6924 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6925 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6926 if (yymsg != yymsgbuf)
6927 YYSTACK_FREE (yymsg);
6928 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6930 yymsg_alloc = yyalloc;
6934 yymsg_alloc = sizeof yymsgbuf;
6938 if (0 < yysize && yysize <= yymsg_alloc)
6940 (void) yysyntax_error (yymsg, yystate, yychar);
6945 yyerror (YY_("syntax error"));
6947 goto yyexhaustedlab;
6955 if (yyerrstatus == 3)
6957 /* If just tried and failed to reuse look-ahead token after an
6958 error, discard it. */
6960 if (yychar <= YYEOF)
6962 /* Return failure if at end of input. */
6963 if (yychar == YYEOF)
6968 yydestruct ("Error: discarding",
6974 /* Else will try to reuse look-ahead token after shifting the error
6979 /*---------------------------------------------------.
6980 | yyerrorlab -- error raised explicitly by YYERROR. |
6981 `---------------------------------------------------*/
6984 /* Pacify compilers like GCC when the user code never invokes
6985 YYERROR and the label yyerrorlab therefore never appears in user
6987 if (/*CONSTCOND*/ 0)
6990 /* Do not reclaim the symbols of the rule which action triggered
6994 YY_STACK_PRINT (yyss, yyssp);
6999 /*-------------------------------------------------------------.
7000 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7001 `-------------------------------------------------------------*/
7003 yyerrstatus = 3; /* Each real token shifted decrements this. */
7007 yyn = yypact[yystate];
7008 if (yyn != YYPACT_NINF)
7011 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7019 /* Pop the current state because it cannot handle the error token. */
7024 yydestruct ("Error: popping",
7025 yystos[yystate], yyvsp);
7028 YY_STACK_PRINT (yyss, yyssp);
7037 /* Shift the error token. */
7038 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7044 /*-------------------------------------.
7045 | yyacceptlab -- YYACCEPT comes here. |
7046 `-------------------------------------*/
7051 /*-----------------------------------.
7052 | yyabortlab -- YYABORT comes here. |
7053 `-----------------------------------*/
7059 /*-------------------------------------------------.
7060 | yyexhaustedlab -- memory exhaustion comes here. |
7061 `-------------------------------------------------*/
7063 yyerror (YY_("memory exhausted"));
7069 if (yychar != YYEOF && yychar != YYEMPTY)
7070 yydestruct ("Cleanup: discarding lookahead",
7072 /* Do not reclaim the symbols of the rule which action triggered
7073 this YYABORT or YYACCEPT. */
7075 YY_STACK_PRINT (yyss, yyssp);
7076 while (yyssp != yyss)
7078 yydestruct ("Cleanup: popping",
7079 yystos[*yyssp], yyvsp);
7084 YYSTACK_FREE (yyss);
7087 if (yymsg != yymsgbuf)
7088 YYSTACK_FREE (yymsg);
7090 /* Make sure YYID is used. */
7091 return YYID (yyresult);
7095 #line 3423 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
7098 // common code from the two 'RunVMAsmParser' functions
7099 static Module* RunParser(Module * M) {
7100 CurModule.CurrentModule = M;
7101 // Check to make sure the parser succeeded
7104 delete ParserResult;
7108 // Emit an error if there are any unresolved types left.
7109 if (!CurModule.LateResolveTypes.empty()) {
7110 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7111 if (DID.Type == ValID::LocalName) {
7112 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7114 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7117 delete ParserResult;
7121 // Emit an error if there are any unresolved values left.
7122 if (!CurModule.LateResolveValues.empty()) {
7123 Value *V = CurModule.LateResolveValues.back();
7124 std::map<Value*, std::pair<ValID, int> >::iterator I =
7125 CurModule.PlaceHolderInfo.find(V);
7127 if (I != CurModule.PlaceHolderInfo.end()) {
7128 ValID &DID = I->second.first;
7129 if (DID.Type == ValID::LocalName) {
7130 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7132 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7135 delete ParserResult;
7140 // Check to make sure that parsing produced a result
7144 // Reset ParserResult variable while saving its value for the result.
7145 Module *Result = ParserResult;
7151 void llvm::GenerateError(const std::string &message, int LineNo) {
7152 if (LineNo == -1) LineNo = LLLgetLineNo();
7153 // TODO: column number in exception
7155 TheParseError->setError(LLLgetFilename(), message, LineNo);
7159 int yyerror(const char *ErrorMsg) {
7160 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7161 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7162 if (yychar != YYEMPTY && yychar != 0) {
7163 errMsg += " while reading token: '";
7164 errMsg += std::string(LLLgetTokenStart(),
7165 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7167 GenerateError(errMsg);