1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse llvmAsmparse
63 #define yylex llvmAsmlex
64 #define yyerror llvmAsmerror
65 #define yylval llvmAsmlval
66 #define yychar llvmAsmchar
67 #define yydebug llvmAsmdebug
68 #define yynerrs llvmAsmnerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
97 ATSTRINGCONSTANT = 278,
98 PCTSTRINGCONSTANT = 279,
99 ZEROINITIALIZER = 280,
140 X86_STDCALLCC_TOK = 321,
141 X86_FASTCALLCC_TOK = 322,
209 EXTRACTELEMENT = 390,
233 #define ESINT64VAL 258
234 #define EUINT64VAL 259
235 #define ESAPINTVAL 260
236 #define EUAPINTVAL 261
237 #define LOCALVAL_ID 262
238 #define GLOBALVAL_ID 263
246 #define PPC_FP128 271
250 #define GLOBALVAR 275
252 #define STRINGCONSTANT 277
253 #define ATSTRINGCONSTANT 278
254 #define PCTSTRINGCONSTANT 279
255 #define ZEROINITIALIZER 280
267 #define THREAD_LOCAL 292
269 #define DOTDOTDOT 294
275 #define APPENDING 300
276 #define DLLIMPORT 301
277 #define DLLEXPORT 302
278 #define EXTERN_WEAK 303
285 #define ADDRSPACE 310
291 #define SIDEEFFECT 316
294 #define FASTCC_TOK 319
295 #define COLDCC_TOK 320
296 #define X86_STDCALLCC_TOK 321
297 #define X86_FASTCALLCC_TOK 322
298 #define DATALAYOUT 323
304 #define UNREACHABLE 329
349 #define GETELEMENTPTR 374
365 #define EXTRACTELEMENT 390
366 #define INSERTELEMENT 391
367 #define SHUFFLEVECTOR 392
368 #define GETRESULT 393
369 #define EXTRACTVALUE 394
370 #define INSERTVALUE 395
385 #define PROTECTED 410
390 /* Copy the first part of user declarations. */
391 #line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
393 #include "ParserInternals.h"
394 #include "llvm/CallingConv.h"
395 #include "llvm/InlineAsm.h"
396 #include "llvm/Instructions.h"
397 #include "llvm/Module.h"
398 #include "llvm/ValueSymbolTable.h"
399 #include "llvm/AutoUpgrade.h"
400 #include "llvm/Support/GetElementPtrTypeIterator.h"
401 #include "llvm/Support/CommandLine.h"
402 #include "llvm/ADT/SmallVector.h"
403 #include "llvm/ADT/STLExtras.h"
404 #include "llvm/Support/MathExtras.h"
405 #include "llvm/Support/Streams.h"
411 // The following is a gross hack. In order to rid the libAsmParser library of
412 // exceptions, we have to have a way of getting the yyparse function to go into
413 // an error situation. So, whenever we want an error to occur, the GenerateError
414 // function (see bottom of file) sets TriggerError. Then, at the end of each
415 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
416 // (a goto) to put YACC in error state. Furthermore, several calls to
417 // GenerateError are made from inside productions and they must simulate the
418 // previous exception behavior by exiting the production immediately. We have
419 // replaced these with the GEN_ERROR macro which calls GeneratError and then
420 // immediately invokes YYERROR. This would be so much cleaner if it was a
421 // recursive descent parser.
422 static bool TriggerError = false;
423 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
424 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
426 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
427 int yylex(); // declaration" of xxx warnings.
429 using namespace llvm;
431 static Module *ParserResult;
433 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
434 // relating to upreferences in the input stream.
436 //#define DEBUG_UPREFS 1
438 #define UR_OUT(X) cerr << X
443 #define YYERROR_VERBOSE 1
445 static GlobalVariable *CurGV;
448 // This contains info used when building the body of a function. It is
449 // destroyed when the function is completed.
451 typedef std::vector<Value *> ValueList; // Numbered defs
454 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
456 static struct PerModuleInfo {
457 Module *CurrentModule;
458 ValueList Values; // Module level numbered definitions
459 ValueList LateResolveValues;
460 std::vector<PATypeHolder> Types;
461 std::map<ValID, PATypeHolder> LateResolveTypes;
463 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
464 /// how they were referenced and on which line of the input they came from so
465 /// that we can resolve them later and print error messages as appropriate.
466 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
468 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
469 // references to global values. Global values may be referenced before they
470 // are defined, and if so, the temporary object that they represent is held
471 // here. This is used for forward references of GlobalValues.
473 typedef std::map<std::pair<const PointerType *,
474 ValID>, GlobalValue*> GlobalRefsType;
475 GlobalRefsType GlobalRefs;
478 // If we could not resolve some functions at function compilation time
479 // (calls to functions before they are defined), resolve them now... Types
480 // are resolved when the constant pool has been completely parsed.
482 ResolveDefinitions(LateResolveValues);
486 // Check to make sure that all global value forward references have been
489 if (!GlobalRefs.empty()) {
490 std::string UndefinedReferences = "Unresolved global references exist:\n";
492 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
494 UndefinedReferences += " " + I->first.first->getDescription() + " " +
495 I->first.second.getName() + "\n";
497 GenerateError(UndefinedReferences);
501 // Look for intrinsic functions and CallInst that need to be upgraded
502 for (Module::iterator FI = CurrentModule->begin(),
503 FE = CurrentModule->end(); FI != FE; )
504 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
506 Values.clear(); // Clear out function local definitions
511 // GetForwardRefForGlobal - Check to see if there is a forward reference
512 // for this global. If so, remove it from the GlobalRefs map and return it.
513 // If not, just return null.
514 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
515 // Check to see if there is a forward reference to this global variable...
516 // if there is, eliminate it and patch the reference to use the new def'n.
517 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
518 GlobalValue *Ret = 0;
519 if (I != GlobalRefs.end()) {
526 bool TypeIsUnresolved(PATypeHolder* PATy) {
527 // If it isn't abstract, its resolved
528 const Type* Ty = PATy->get();
529 if (!Ty->isAbstract())
531 // Traverse the type looking for abstract types. If it isn't abstract then
532 // we don't need to traverse that leg of the type.
533 std::vector<const Type*> WorkList, SeenList;
534 WorkList.push_back(Ty);
535 while (!WorkList.empty()) {
536 const Type* Ty = WorkList.back();
537 SeenList.push_back(Ty);
539 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
540 // Check to see if this is an unresolved type
541 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
542 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
543 for ( ; I != E; ++I) {
544 if (I->second.get() == OpTy)
547 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
548 const Type* TheTy = SeqTy->getElementType();
549 if (TheTy->isAbstract() && TheTy != Ty) {
550 std::vector<const Type*>::iterator I = SeenList.begin(),
556 WorkList.push_back(TheTy);
558 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
559 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
560 const Type* TheTy = StrTy->getElementType(i);
561 if (TheTy->isAbstract() && TheTy != Ty) {
562 std::vector<const Type*>::iterator I = SeenList.begin(),
568 WorkList.push_back(TheTy);
577 static struct PerFunctionInfo {
578 Function *CurrentFunction; // Pointer to current function being created
580 ValueList Values; // Keep track of #'d definitions
582 ValueList LateResolveValues;
583 bool isDeclare; // Is this function a forward declararation?
584 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
585 GlobalValue::VisibilityTypes Visibility;
587 /// BBForwardRefs - When we see forward references to basic blocks, keep
588 /// track of them here.
589 std::map<ValID, BasicBlock*> BBForwardRefs;
591 inline PerFunctionInfo() {
594 Linkage = GlobalValue::ExternalLinkage;
595 Visibility = GlobalValue::DefaultVisibility;
598 inline void FunctionStart(Function *M) {
603 void FunctionDone() {
604 // Any forward referenced blocks left?
605 if (!BBForwardRefs.empty()) {
606 GenerateError("Undefined reference to label " +
607 BBForwardRefs.begin()->second->getName());
611 // Resolve all forward references now.
612 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
614 Values.clear(); // Clear out function local definitions
615 BBForwardRefs.clear();
618 Linkage = GlobalValue::ExternalLinkage;
619 Visibility = GlobalValue::DefaultVisibility;
621 } CurFun; // Info for the current function...
623 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
626 //===----------------------------------------------------------------------===//
627 // Code to handle definitions of all the types
628 //===----------------------------------------------------------------------===//
630 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
631 // Things that have names or are void typed don't get slot numbers
632 if (V->hasName() || (V->getType() == Type::VoidTy))
635 // In the case of function values, we have to allow for the forward reference
636 // of basic blocks, which are included in the numbering. Consequently, we keep
637 // track of the next insertion location with NextValNum. When a BB gets
638 // inserted, it could change the size of the CurFun.Values vector.
639 if (&ValueTab == &CurFun.Values) {
640 if (ValueTab.size() <= CurFun.NextValNum)
641 ValueTab.resize(CurFun.NextValNum+1);
642 ValueTab[CurFun.NextValNum++] = V;
645 // For all other lists, its okay to just tack it on the back of the vector.
646 ValueTab.push_back(V);
649 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
651 case ValID::LocalID: // Is it a numbered definition?
652 // Module constants occupy the lowest numbered slots...
653 if (D.Num < CurModule.Types.size())
654 return CurModule.Types[D.Num];
656 case ValID::LocalName: // Is it a named definition?
657 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
658 D.destroy(); // Free old strdup'd memory...
663 GenerateError("Internal parser error: Invalid symbol type reference");
667 // If we reached here, we referenced either a symbol that we don't know about
668 // or an id number that hasn't been read yet. We may be referencing something
669 // forward, so just create an entry to be resolved later and get to it...
671 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
674 if (inFunctionScope()) {
675 if (D.Type == ValID::LocalName) {
676 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
679 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
684 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
685 if (I != CurModule.LateResolveTypes.end())
688 Type *Typ = OpaqueType::get();
689 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
693 // getExistingVal - Look up the value specified by the provided type and
694 // the provided ValID. If the value exists and has already been defined, return
695 // it. Otherwise return null.
697 static Value *getExistingVal(const Type *Ty, const ValID &D) {
698 if (isa<FunctionType>(Ty)) {
699 GenerateError("Functions are not values and "
700 "must be referenced as pointers");
705 case ValID::LocalID: { // Is it a numbered definition?
706 // Check that the number is within bounds.
707 if (D.Num >= CurFun.Values.size())
709 Value *Result = CurFun.Values[D.Num];
710 if (Ty != Result->getType()) {
711 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
712 Result->getType()->getDescription() + "' does not match "
713 "expected type, '" + Ty->getDescription() + "'");
718 case ValID::GlobalID: { // Is it a numbered definition?
719 if (D.Num >= CurModule.Values.size())
721 Value *Result = CurModule.Values[D.Num];
722 if (Ty != Result->getType()) {
723 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
724 Result->getType()->getDescription() + "' does not match "
725 "expected type, '" + Ty->getDescription() + "'");
731 case ValID::LocalName: { // Is it a named definition?
732 if (!inFunctionScope())
734 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
735 Value *N = SymTab.lookup(D.getName());
738 if (N->getType() != Ty)
741 D.destroy(); // Free old strdup'd memory...
744 case ValID::GlobalName: { // Is it a named definition?
745 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
746 Value *N = SymTab.lookup(D.getName());
749 if (N->getType() != Ty)
752 D.destroy(); // Free old strdup'd memory...
756 // Check to make sure that "Ty" is an integral type, and that our
757 // value will fit into the specified type...
758 case ValID::ConstSIntVal: // Is it a constant pool reference??
759 if (!isa<IntegerType>(Ty) ||
760 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
761 GenerateError("Signed integral constant '" +
762 itostr(D.ConstPool64) + "' is invalid for type '" +
763 Ty->getDescription() + "'");
766 return ConstantInt::get(Ty, D.ConstPool64, true);
768 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
769 if (isa<IntegerType>(Ty) &&
770 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
771 return ConstantInt::get(Ty, D.UConstPool64);
773 if (!isa<IntegerType>(Ty) ||
774 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
775 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
776 "' is invalid or out of range for type '" +
777 Ty->getDescription() + "'");
780 // This is really a signed reference. Transmogrify.
781 return ConstantInt::get(Ty, D.ConstPool64, true);
783 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
784 if (!isa<IntegerType>(Ty)) {
785 GenerateError("Integral constant '" + D.getName() +
786 "' is invalid or out of range for type '" +
787 Ty->getDescription() + "'");
792 APSInt Tmp = *D.ConstPoolInt;
793 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
794 return ConstantInt::get(Tmp);
797 case ValID::ConstFPVal: // Is it a floating point const pool reference?
798 if (!Ty->isFloatingPoint() ||
799 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
800 GenerateError("FP constant invalid for type");
803 // Lexer has no type info, so builds all float and double FP constants
804 // as double. Fix this here. Long double does not need this.
805 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
807 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
808 return ConstantFP::get(*D.ConstPoolFP);
810 case ValID::ConstNullVal: // Is it a null value?
811 if (!isa<PointerType>(Ty)) {
812 GenerateError("Cannot create a a non pointer null");
815 return ConstantPointerNull::get(cast<PointerType>(Ty));
817 case ValID::ConstUndefVal: // Is it an undef value?
818 return UndefValue::get(Ty);
820 case ValID::ConstZeroVal: // Is it a zero value?
821 return Constant::getNullValue(Ty);
823 case ValID::ConstantVal: // Fully resolved constant?
824 if (D.ConstantValue->getType() != Ty) {
825 GenerateError("Constant expression type different from required type");
828 return D.ConstantValue;
830 case ValID::InlineAsmVal: { // Inline asm expression
831 const PointerType *PTy = dyn_cast<PointerType>(Ty);
832 const FunctionType *FTy =
833 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
834 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
835 GenerateError("Invalid type for asm constraint string");
838 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
839 D.IAD->HasSideEffects);
840 D.destroy(); // Free InlineAsmDescriptor.
844 assert(0 && "Unhandled case!");
848 assert(0 && "Unhandled case!");
852 // getVal - This function is identical to getExistingVal, except that if a
853 // value is not already defined, it "improvises" by creating a placeholder var
854 // that looks and acts just like the requested variable. When the value is
855 // defined later, all uses of the placeholder variable are replaced with the
858 static Value *getVal(const Type *Ty, const ValID &ID) {
859 if (Ty == Type::LabelTy) {
860 GenerateError("Cannot use a basic block here");
864 // See if the value has already been defined.
865 Value *V = getExistingVal(Ty, ID);
867 if (TriggerError) return 0;
869 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
870 GenerateError("Invalid use of a non-first-class type");
874 // If we reached here, we referenced either a symbol that we don't know about
875 // or an id number that hasn't been read yet. We may be referencing something
876 // forward, so just create an entry to be resolved later and get to it...
879 case ValID::GlobalName:
880 case ValID::GlobalID: {
881 const PointerType *PTy = dyn_cast<PointerType>(Ty);
883 GenerateError("Invalid type for reference to global" );
886 const Type* ElTy = PTy->getElementType();
887 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
888 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
890 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
891 (Module*)0, false, PTy->getAddressSpace());
895 V = new Argument(Ty);
898 // Remember where this forward reference came from. FIXME, shouldn't we try
899 // to recycle these things??
900 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
903 if (inFunctionScope())
904 InsertValue(V, CurFun.LateResolveValues);
906 InsertValue(V, CurModule.LateResolveValues);
910 /// defineBBVal - This is a definition of a new basic block with the specified
911 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
912 static BasicBlock *defineBBVal(const ValID &ID) {
913 assert(inFunctionScope() && "Can't get basic block at global scope!");
917 // First, see if this was forward referenced
919 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
920 if (BBI != CurFun.BBForwardRefs.end()) {
922 // The forward declaration could have been inserted anywhere in the
923 // function: insert it into the correct place now.
924 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
925 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
927 // We're about to erase the entry, save the key so we can clean it up.
928 ValID Tmp = BBI->first;
930 // Erase the forward ref from the map as its no longer "forward"
931 CurFun.BBForwardRefs.erase(ID);
933 // The key has been removed from the map but so we don't want to leave
934 // strdup'd memory around so destroy it too.
937 // If its a numbered definition, bump the number and set the BB value.
938 if (ID.Type == ValID::LocalID) {
939 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
943 // We haven't seen this BB before and its first mention is a definition.
944 // Just create it and return it.
945 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
946 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
947 if (ID.Type == ValID::LocalID) {
948 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
957 /// getBBVal - get an existing BB value or create a forward reference for it.
959 static BasicBlock *getBBVal(const ValID &ID) {
960 assert(inFunctionScope() && "Can't get basic block at global scope!");
964 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
965 if (BBI != CurFun.BBForwardRefs.end()) {
967 } if (ID.Type == ValID::LocalName) {
968 std::string Name = ID.getName();
969 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
971 if (N->getType()->getTypeID() == Type::LabelTyID)
972 BB = cast<BasicBlock>(N);
974 GenerateError("Reference to label '" + Name + "' is actually of type '"+
975 N->getType()->getDescription() + "'");
977 } else if (ID.Type == ValID::LocalID) {
978 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
979 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
980 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
982 GenerateError("Reference to label '%" + utostr(ID.Num) +
983 "' is actually of type '"+
984 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
987 GenerateError("Illegal label reference " + ID.getName());
991 // If its already been defined, return it now.
993 ID.destroy(); // Free strdup'd memory.
997 // Otherwise, this block has not been seen before, create it.
999 if (ID.Type == ValID::LocalName)
1000 Name = ID.getName();
1001 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1003 // Insert it in the forward refs map.
1004 CurFun.BBForwardRefs[ID] = BB;
1010 //===----------------------------------------------------------------------===//
1011 // Code to handle forward references in instructions
1012 //===----------------------------------------------------------------------===//
1014 // This code handles the late binding needed with statements that reference
1015 // values not defined yet... for example, a forward branch, or the PHI node for
1018 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1019 // and back patchs after we are done.
1022 // ResolveDefinitions - If we could not resolve some defs at parsing
1023 // time (forward branches, phi functions for loops, etc...) resolve the
1027 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1028 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1029 while (!LateResolvers.empty()) {
1030 Value *V = LateResolvers.back();
1031 LateResolvers.pop_back();
1033 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1034 CurModule.PlaceHolderInfo.find(V);
1035 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1037 ValID &DID = PHI->second.first;
1039 Value *TheRealValue = getExistingVal(V->getType(), DID);
1043 V->replaceAllUsesWith(TheRealValue);
1045 CurModule.PlaceHolderInfo.erase(PHI);
1046 } else if (FutureLateResolvers) {
1047 // Functions have their unresolved items forwarded to the module late
1049 InsertValue(V, *FutureLateResolvers);
1051 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1052 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1053 "' of type '" + V->getType()->getDescription() + "'",
1054 PHI->second.second);
1057 GenerateError("Reference to an invalid definition: #" +
1058 itostr(DID.Num) + " of type '" +
1059 V->getType()->getDescription() + "'",
1060 PHI->second.second);
1065 LateResolvers.clear();
1068 // ResolveTypeTo - A brand new type was just declared. This means that (if
1069 // name is not null) things referencing Name can be resolved. Otherwise, things
1070 // refering to the number can be resolved. Do this now.
1072 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1075 D = ValID::createLocalName(*Name);
1077 D = ValID::createLocalID(CurModule.Types.size());
1079 std::map<ValID, PATypeHolder>::iterator I =
1080 CurModule.LateResolveTypes.find(D);
1081 if (I != CurModule.LateResolveTypes.end()) {
1082 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1083 CurModule.LateResolveTypes.erase(I);
1087 // setValueName - Set the specified value to the name given. The name may be
1088 // null potentially, in which case this is a noop. The string passed in is
1089 // assumed to be a malloc'd string buffer, and is free'd by this function.
1091 static void setValueName(Value *V, std::string *NameStr) {
1092 if (!NameStr) return;
1093 std::string Name(*NameStr); // Copy string
1094 delete NameStr; // Free old string
1096 if (V->getType() == Type::VoidTy) {
1097 GenerateError("Can't assign name '" + Name+"' to value with void type");
1101 assert(inFunctionScope() && "Must be in function scope!");
1102 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1103 if (ST.lookup(Name)) {
1104 GenerateError("Redefinition of value '" + Name + "' of type '" +
1105 V->getType()->getDescription() + "'");
1113 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1114 /// this is a declaration, otherwise it is a definition.
1115 static GlobalVariable *
1116 ParseGlobalVariable(std::string *NameStr,
1117 GlobalValue::LinkageTypes Linkage,
1118 GlobalValue::VisibilityTypes Visibility,
1119 bool isConstantGlobal, const Type *Ty,
1120 Constant *Initializer, bool IsThreadLocal,
1121 unsigned AddressSpace = 0) {
1122 if (isa<FunctionType>(Ty)) {
1123 GenerateError("Cannot declare global vars of function type");
1126 if (Ty == Type::LabelTy) {
1127 GenerateError("Cannot declare global vars of label type");
1131 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1135 Name = *NameStr; // Copy string
1136 delete NameStr; // Free old string
1139 // See if this global value was forward referenced. If so, recycle the
1142 if (!Name.empty()) {
1143 ID = ValID::createGlobalName(Name);
1145 ID = ValID::createGlobalID(CurModule.Values.size());
1148 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1149 // Move the global to the end of the list, from whereever it was
1150 // previously inserted.
1151 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1152 CurModule.CurrentModule->getGlobalList().remove(GV);
1153 CurModule.CurrentModule->getGlobalList().push_back(GV);
1154 GV->setInitializer(Initializer);
1155 GV->setLinkage(Linkage);
1156 GV->setVisibility(Visibility);
1157 GV->setConstant(isConstantGlobal);
1158 GV->setThreadLocal(IsThreadLocal);
1159 InsertValue(GV, CurModule.Values);
1163 // If this global has a name
1164 if (!Name.empty()) {
1165 // if the global we're parsing has an initializer (is a definition) and
1166 // has external linkage.
1167 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1168 // If there is already a global with external linkage with this name
1169 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1170 // If we allow this GVar to get created, it will be renamed in the
1171 // symbol table because it conflicts with an existing GVar. We can't
1172 // allow redefinition of GVars whose linking indicates that their name
1173 // must stay the same. Issue the error.
1174 GenerateError("Redefinition of global variable named '" + Name +
1175 "' of type '" + Ty->getDescription() + "'");
1180 // Otherwise there is no existing GV to use, create one now.
1181 GlobalVariable *GV =
1182 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1183 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1184 GV->setVisibility(Visibility);
1185 InsertValue(GV, CurModule.Values);
1189 // setTypeName - Set the specified type to the name given. The name may be
1190 // null potentially, in which case this is a noop. The string passed in is
1191 // assumed to be a malloc'd string buffer, and is freed by this function.
1193 // This function returns true if the type has already been defined, but is
1194 // allowed to be redefined in the specified context. If the name is a new name
1195 // for the type plane, it is inserted and false is returned.
1196 static bool setTypeName(const Type *T, std::string *NameStr) {
1197 assert(!inFunctionScope() && "Can't give types function-local names!");
1198 if (NameStr == 0) return false;
1200 std::string Name(*NameStr); // Copy string
1201 delete NameStr; // Free old string
1203 // We don't allow assigning names to void type
1204 if (T == Type::VoidTy) {
1205 GenerateError("Can't assign name '" + Name + "' to the void type");
1209 // Set the type name, checking for conflicts as we do so.
1210 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1212 if (AlreadyExists) { // Inserting a name that is already defined???
1213 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1214 assert(Existing && "Conflict but no matching type?!");
1216 // There is only one case where this is allowed: when we are refining an
1217 // opaque type. In this case, Existing will be an opaque type.
1218 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1219 // We ARE replacing an opaque type!
1220 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1224 // Otherwise, this is an attempt to redefine a type. That's okay if
1225 // the redefinition is identical to the original. This will be so if
1226 // Existing and T point to the same Type object. In this one case we
1227 // allow the equivalent redefinition.
1228 if (Existing == T) return true; // Yes, it's equal.
1230 // Any other kind of (non-equivalent) redefinition is an error.
1231 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1232 T->getDescription() + "'");
1238 //===----------------------------------------------------------------------===//
1239 // Code for handling upreferences in type names...
1242 // TypeContains - Returns true if Ty directly contains E in it.
1244 static bool TypeContains(const Type *Ty, const Type *E) {
1245 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1246 E) != Ty->subtype_end();
1250 struct UpRefRecord {
1251 // NestingLevel - The number of nesting levels that need to be popped before
1252 // this type is resolved.
1253 unsigned NestingLevel;
1255 // LastContainedTy - This is the type at the current binding level for the
1256 // type. Every time we reduce the nesting level, this gets updated.
1257 const Type *LastContainedTy;
1259 // UpRefTy - This is the actual opaque type that the upreference is
1260 // represented with.
1261 OpaqueType *UpRefTy;
1263 UpRefRecord(unsigned NL, OpaqueType *URTy)
1264 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1268 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1269 static std::vector<UpRefRecord> UpRefs;
1271 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1272 /// called. It loops through the UpRefs vector, which is a list of the
1273 /// currently active types. For each type, if the up reference is contained in
1274 /// the newly completed type, we decrement the level count. When the level
1275 /// count reaches zero, the upreferenced type is the type that is passed in:
1276 /// thus we can complete the cycle.
1278 static PATypeHolder HandleUpRefs(const Type *ty) {
1279 // If Ty isn't abstract, or if there are no up-references in it, then there is
1280 // nothing to resolve here.
1281 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1283 PATypeHolder Ty(ty);
1284 UR_OUT("Type '" << Ty->getDescription() <<
1285 "' newly formed. Resolving upreferences.\n" <<
1286 UpRefs.size() << " upreferences active!\n");
1288 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1289 // to zero), we resolve them all together before we resolve them to Ty. At
1290 // the end of the loop, if there is anything to resolve to Ty, it will be in
1292 OpaqueType *TypeToResolve = 0;
1294 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1295 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1296 << UpRefs[i].second->getDescription() << ") = "
1297 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1298 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1299 // Decrement level of upreference
1300 unsigned Level = --UpRefs[i].NestingLevel;
1301 UpRefs[i].LastContainedTy = Ty;
1302 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1303 if (Level == 0) { // Upreference should be resolved!
1304 if (!TypeToResolve) {
1305 TypeToResolve = UpRefs[i].UpRefTy;
1307 UR_OUT(" * Resolving upreference for "
1308 << UpRefs[i].second->getDescription() << "\n";
1309 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1310 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1311 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1312 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1314 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1315 --i; // Do not skip the next element...
1320 if (TypeToResolve) {
1321 UR_OUT(" * Resolving upreference for "
1322 << UpRefs[i].second->getDescription() << "\n";
1323 std::string OldName = TypeToResolve->getDescription());
1324 TypeToResolve->refineAbstractTypeTo(Ty);
1330 //===----------------------------------------------------------------------===//
1331 // RunVMAsmParser - Define an interface to this parser
1332 //===----------------------------------------------------------------------===//
1334 static Module* RunParser(Module * M);
1336 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1338 Module *M = RunParser(new Module(LLLgetFilename()));
1345 /* Enabling traces. */
1350 /* Enabling verbose error messages. */
1351 #ifdef YYERROR_VERBOSE
1352 # undef YYERROR_VERBOSE
1353 # define YYERROR_VERBOSE 1
1355 # define YYERROR_VERBOSE 0
1358 /* Enabling the token table. */
1359 #ifndef YYTOKEN_TABLE
1360 # define YYTOKEN_TABLE 0
1363 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1364 typedef union YYSTYPE
1365 #line 967 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
1367 llvm::Module *ModuleVal;
1368 llvm::Function *FunctionVal;
1369 llvm::BasicBlock *BasicBlockVal;
1370 llvm::TerminatorInst *TermInstVal;
1371 llvm::Instruction *InstVal;
1372 llvm::Constant *ConstVal;
1374 const llvm::Type *PrimType;
1375 std::list<llvm::PATypeHolder> *TypeList;
1376 llvm::PATypeHolder *TypeVal;
1377 llvm::Value *ValueVal;
1378 std::vector<llvm::Value*> *ValueList;
1379 std::vector<unsigned> *ConstantList;
1380 llvm::ArgListType *ArgList;
1381 llvm::TypeWithAttrs TypeWithAttrs;
1382 llvm::TypeWithAttrsList *TypeWithAttrsList;
1383 llvm::ParamList *ParamList;
1385 // Represent the RHS of PHI node
1386 std::list<std::pair<llvm::Value*,
1387 llvm::BasicBlock*> > *PHIList;
1388 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1389 std::vector<llvm::Constant*> *ConstVector;
1391 llvm::GlobalValue::LinkageTypes Linkage;
1392 llvm::GlobalValue::VisibilityTypes Visibility;
1393 llvm::ParameterAttributes ParamAttrs;
1394 llvm::APInt *APIntVal;
1399 llvm::APFloat *FPVal;
1402 std::string *StrVal; // This memory must be deleted
1403 llvm::ValID ValIDVal;
1405 llvm::Instruction::BinaryOps BinaryOpVal;
1406 llvm::Instruction::TermOps TermOpVal;
1407 llvm::Instruction::MemoryOps MemOpVal;
1408 llvm::Instruction::CastOps CastOpVal;
1409 llvm::Instruction::OtherOps OtherOpVal;
1410 llvm::ICmpInst::Predicate IPredicate;
1411 llvm::FCmpInst::Predicate FPredicate;
1413 /* Line 193 of yacc.c. */
1414 #line 1415 "llvmAsmParser.tab.c"
1416 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1417 # define YYSTYPE_IS_DECLARED 1
1418 # define YYSTYPE_IS_TRIVIAL 1
1423 /* Copy the second part of user declarations. */
1426 /* Line 216 of yacc.c. */
1427 #line 1428 "llvmAsmParser.tab.c"
1434 typedef YYTYPE_UINT8 yytype_uint8;
1436 typedef unsigned char yytype_uint8;
1440 typedef YYTYPE_INT8 yytype_int8;
1441 #elif (defined __STDC__ || defined __C99__FUNC__ \
1442 || defined __cplusplus || defined _MSC_VER)
1443 typedef signed char yytype_int8;
1445 typedef short int yytype_int8;
1448 #ifdef YYTYPE_UINT16
1449 typedef YYTYPE_UINT16 yytype_uint16;
1451 typedef unsigned short int yytype_uint16;
1455 typedef YYTYPE_INT16 yytype_int16;
1457 typedef short int yytype_int16;
1461 # ifdef __SIZE_TYPE__
1462 # define YYSIZE_T __SIZE_TYPE__
1463 # elif defined size_t
1464 # define YYSIZE_T size_t
1465 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1466 || defined __cplusplus || defined _MSC_VER)
1467 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1468 # define YYSIZE_T size_t
1470 # define YYSIZE_T unsigned int
1474 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1477 # if defined YYENABLE_NLS && YYENABLE_NLS
1479 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1480 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1484 # define YY_(msgid) msgid
1488 /* Suppress unused-variable warnings by "using" E. */
1489 #if ! defined lint || defined __GNUC__
1490 # define YYUSE(e) ((void) (e))
1492 # define YYUSE(e) /* empty */
1495 /* Identity function, used to suppress warnings about constant conditions. */
1497 # define YYID(n) (n)
1499 #if (defined __STDC__ || defined __C99__FUNC__ \
1500 || defined __cplusplus || defined _MSC_VER)
1513 #if ! defined yyoverflow || YYERROR_VERBOSE
1515 /* The parser invokes alloca or malloc; define the necessary symbols. */
1517 # ifdef YYSTACK_USE_ALLOCA
1518 # if YYSTACK_USE_ALLOCA
1520 # define YYSTACK_ALLOC __builtin_alloca
1521 # elif defined __BUILTIN_VA_ARG_INCR
1522 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1524 # define YYSTACK_ALLOC __alloca
1525 # elif defined _MSC_VER
1526 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1527 # define alloca _alloca
1529 # define YYSTACK_ALLOC alloca
1530 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1531 || defined __cplusplus || defined _MSC_VER)
1532 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1534 # define _STDLIB_H 1
1541 # ifdef YYSTACK_ALLOC
1542 /* Pacify GCC's `empty if-body' warning. */
1543 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1544 # ifndef YYSTACK_ALLOC_MAXIMUM
1545 /* The OS might guarantee only one guard page at the bottom of the stack,
1546 and a page size can be as small as 4096 bytes. So we cannot safely
1547 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1548 to allow for a few compiler-allocated temporary stack slots. */
1549 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1552 # define YYSTACK_ALLOC YYMALLOC
1553 # define YYSTACK_FREE YYFREE
1554 # ifndef YYSTACK_ALLOC_MAXIMUM
1555 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1557 # if (defined __cplusplus && ! defined _STDLIB_H \
1558 && ! ((defined YYMALLOC || defined malloc) \
1559 && (defined YYFREE || defined free)))
1560 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1562 # define _STDLIB_H 1
1566 # define YYMALLOC malloc
1567 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1568 || defined __cplusplus || defined _MSC_VER)
1569 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1573 # define YYFREE free
1574 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1575 || defined __cplusplus || defined _MSC_VER)
1576 void free (void *); /* INFRINGES ON USER NAME SPACE */
1580 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1583 #if (! defined yyoverflow \
1584 && (! defined __cplusplus \
1585 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1587 /* A type that is properly aligned for any stack member. */
1594 /* The size of the maximum gap between one aligned stack and the next. */
1595 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1597 /* The size of an array large to enough to hold all stacks, each with
1599 # define YYSTACK_BYTES(N) \
1600 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1601 + YYSTACK_GAP_MAXIMUM)
1603 /* Copy COUNT objects from FROM to TO. The source and destination do
1606 # if defined __GNUC__ && 1 < __GNUC__
1607 # define YYCOPY(To, From, Count) \
1608 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1610 # define YYCOPY(To, From, Count) \
1614 for (yyi = 0; yyi < (Count); yyi++) \
1615 (To)[yyi] = (From)[yyi]; \
1621 /* Relocate STACK from its old location to the new one. The
1622 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1623 elements in the stack, and YYPTR gives the new location of the
1624 stack. Advance YYPTR to a properly aligned location for the next
1626 # define YYSTACK_RELOCATE(Stack) \
1629 YYSIZE_T yynewbytes; \
1630 YYCOPY (&yyptr->Stack, Stack, yysize); \
1631 Stack = &yyptr->Stack; \
1632 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1633 yyptr += yynewbytes / sizeof (*yyptr); \
1639 /* YYFINAL -- State number of the termination state. */
1641 /* YYLAST -- Last index in YYTABLE. */
1644 /* YYNTOKENS -- Number of terminals. */
1645 #define YYNTOKENS 170
1646 /* YYNNTS -- Number of nonterminals. */
1648 /* YYNRULES -- Number of rules. */
1649 #define YYNRULES 342
1650 /* YYNRULES -- Number of states. */
1651 #define YYNSTATES 701
1653 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1654 #define YYUNDEFTOK 2
1655 #define YYMAXUTOK 410
1657 #define YYTRANSLATE(YYX) \
1658 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1660 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1661 static const yytype_uint8 yytranslate[] =
1663 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1664 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1665 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1666 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1667 156, 157, 160, 2, 159, 2, 2, 2, 2, 2,
1668 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1669 165, 158, 166, 2, 2, 2, 2, 2, 2, 2,
1670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1671 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1672 2, 162, 161, 164, 2, 2, 2, 2, 2, 169,
1673 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1674 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1675 163, 2, 2, 167, 2, 168, 2, 2, 2, 2,
1676 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1677 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1678 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1679 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1682 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, 1, 2, 3, 4,
1689 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1690 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1691 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1692 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1693 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1694 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1695 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1696 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1697 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1698 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1699 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1700 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1701 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1702 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1703 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1708 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1710 static const yytype_uint16 yyprhs[] =
1712 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1713 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1714 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1715 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1716 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1717 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1718 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1719 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1720 160, 162, 164, 166, 168, 169, 171, 173, 175, 176,
1721 178, 180, 181, 183, 185, 187, 189, 190, 192, 194,
1722 195, 197, 199, 201, 203, 205, 208, 210, 212, 214,
1723 216, 218, 220, 222, 224, 226, 229, 230, 233, 235,
1724 237, 239, 241, 243, 245, 246, 249, 250, 253, 254,
1725 257, 258, 262, 265, 266, 268, 269, 273, 275, 278,
1726 280, 282, 284, 286, 288, 290, 292, 294, 296, 300,
1727 302, 305, 311, 317, 323, 329, 333, 336, 342, 347,
1728 350, 352, 354, 356, 360, 362, 366, 368, 369, 371,
1729 375, 380, 384, 388, 393, 398, 402, 409, 415, 418,
1730 421, 424, 427, 430, 433, 436, 439, 442, 445, 448,
1731 451, 458, 464, 473, 480, 487, 495, 503, 511, 519,
1732 526, 535, 544, 550, 558, 562, 564, 566, 568, 570,
1733 571, 574, 581, 583, 584, 586, 589, 590, 594, 595,
1734 599, 603, 607, 611, 612, 621, 622, 632, 633, 643,
1735 649, 652, 656, 658, 662, 666, 670, 674, 676, 677,
1736 683, 687, 689, 693, 695, 696, 707, 709, 711, 716,
1737 718, 720, 723, 727, 728, 730, 732, 734, 736, 738,
1738 740, 742, 744, 746, 748, 750, 754, 758, 761, 764,
1739 768, 771, 777, 782, 784, 790, 792, 794, 796, 798,
1740 800, 802, 805, 807, 811, 814, 817, 821, 824, 825,
1741 827, 830, 833, 837, 847, 857, 866, 881, 883, 885,
1742 892, 898, 901, 908, 916, 921, 926, 933, 940, 941,
1743 942, 946, 949, 953, 956, 958, 964, 970, 977, 984,
1744 991, 998, 1003, 1010, 1015, 1020, 1027, 1034, 1037, 1046,
1745 1048, 1050, 1051, 1055, 1062, 1066, 1073, 1076, 1082, 1090,
1749 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1750 static const yytype_int16 yyrhs[] =
1752 216, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1753 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1754 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1755 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1756 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1757 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1758 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1759 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1760 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1761 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1762 -1, 102, -1, 103, -1, 26, -1, 27, -1, 11,
1763 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1764 -1, 19, -1, 22, -1, 24, -1, 178, -1, -1,
1765 55, 156, 4, 157, -1, -1, 178, 158, -1, -1,
1766 20, -1, 23, -1, 184, -1, -1, 182, 158, -1,
1767 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1768 49, -1, 46, -1, 48, -1, 51, -1, -1, 153,
1769 -1, 154, -1, 155, -1, -1, 46, -1, 48, -1,
1770 -1, 42, -1, 43, -1, 44, -1, 47, -1, -1,
1771 44, -1, 42, -1, -1, 63, -1, 64, -1, 65,
1772 -1, 66, -1, 67, -1, 62, 4, -1, 142, -1,
1773 121, -1, 141, -1, 122, -1, 144, -1, 145, -1,
1774 147, -1, 148, -1, 149, -1, 54, 4, -1, -1,
1775 193, 192, -1, 143, -1, 146, -1, 142, -1, 141,
1776 -1, 150, -1, 151, -1, -1, 195, 194, -1, -1,
1777 152, 22, -1, -1, 54, 4, -1, -1, 159, 54,
1778 4, -1, 34, 22, -1, -1, 199, -1, -1, 159,
1779 202, 201, -1, 199, -1, 54, 4, -1, 11, -1,
1780 12, -1, 13, -1, 16, -1, 15, -1, 14, -1,
1781 17, -1, 50, -1, 203, -1, 204, 180, 160, -1,
1782 238, -1, 161, 4, -1, 204, 156, 208, 157, 195,
1783 -1, 10, 156, 208, 157, 195, -1, 162, 4, 163,
1784 204, 164, -1, 165, 4, 163, 204, 166, -1, 167,
1785 209, 168, -1, 167, 168, -1, 165, 167, 209, 168,
1786 166, -1, 165, 167, 168, 166, -1, 204, 193, -1,
1787 204, -1, 10, -1, 205, -1, 207, 159, 205, -1,
1788 207, -1, 207, 159, 39, -1, 39, -1, -1, 204,
1789 -1, 209, 159, 204, -1, 204, 162, 212, 164, -1,
1790 204, 162, 164, -1, 204, 169, 22, -1, 204, 165,
1791 212, 166, -1, 204, 167, 212, 168, -1, 204, 167,
1792 168, -1, 204, 165, 167, 212, 168, 166, -1, 204,
1793 165, 167, 168, 166, -1, 204, 40, -1, 204, 41,
1794 -1, 204, 238, -1, 204, 211, -1, 204, 25, -1,
1795 176, 3, -1, 176, 5, -1, 176, 4, -1, 176,
1796 6, -1, 11, 26, -1, 11, 27, -1, 177, 9,
1797 -1, 173, 156, 210, 38, 204, 157, -1, 119, 156,
1798 210, 250, 157, -1, 133, 156, 210, 159, 210, 159,
1799 210, 157, -1, 171, 156, 210, 159, 210, 157, -1,
1800 172, 156, 210, 159, 210, 157, -1, 90, 174, 156,
1801 210, 159, 210, 157, -1, 91, 175, 156, 210, 159,
1802 210, 157, -1, 92, 174, 156, 210, 159, 210, 157,
1803 -1, 93, 175, 156, 210, 159, 210, 157, -1, 135,
1804 156, 210, 159, 210, 157, -1, 136, 156, 210, 159,
1805 210, 159, 210, 157, -1, 137, 156, 210, 159, 210,
1806 159, 210, 157, -1, 139, 156, 210, 251, 157, -1,
1807 140, 156, 210, 159, 210, 251, 157, -1, 212, 159,
1808 210, -1, 210, -1, 32, -1, 33, -1, 37, -1,
1809 -1, 206, 238, -1, 125, 156, 215, 38, 204, 157,
1810 -1, 217, -1, -1, 218, -1, 217, 218, -1, -1,
1811 31, 219, 234, -1, -1, 30, 220, 235, -1, 60,
1812 59, 224, -1, 181, 18, 204, -1, 181, 18, 10,
1813 -1, -1, 183, 187, 214, 213, 210, 180, 221, 201,
1814 -1, -1, 183, 185, 187, 214, 213, 210, 180, 222,
1815 201, -1, -1, 183, 186, 187, 214, 213, 204, 180,
1816 223, 201, -1, 183, 187, 35, 190, 215, -1, 52,
1817 225, -1, 56, 158, 226, -1, 22, -1, 53, 158,
1818 22, -1, 68, 158, 22, -1, 162, 227, 164, -1,
1819 227, 159, 22, -1, 22, -1, -1, 228, 159, 204,
1820 193, 179, -1, 204, 193, 179, -1, 228, -1, 228,
1821 159, 39, -1, 39, -1, -1, 191, 206, 182, 156,
1822 229, 157, 195, 200, 197, 196, -1, 28, -1, 167,
1823 -1, 189, 187, 230, 231, -1, 29, -1, 168, -1,
1824 242, 233, -1, 188, 187, 230, -1, -1, 61, -1,
1825 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1826 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1827 165, 212, 166, -1, 162, 212, 164, -1, 162, 164,
1828 -1, 169, 22, -1, 167, 212, 168, -1, 167, 168,
1829 -1, 165, 167, 212, 168, 166, -1, 165, 167, 168,
1830 166, -1, 211, -1, 59, 236, 22, 159, 22, -1,
1831 7, -1, 8, -1, 178, -1, 182, -1, 238, -1,
1832 237, -1, 204, 239, -1, 240, -1, 241, 159, 240,
1833 -1, 242, 243, -1, 232, 243, -1, 244, 181, 245,
1834 -1, 244, 247, -1, -1, 21, -1, 69, 241, -1,
1835 69, 10, -1, 70, 17, 239, -1, 70, 11, 239,
1836 159, 17, 239, 159, 17, 239, -1, 71, 176, 239,
1837 159, 17, 239, 162, 246, 164, -1, 71, 176, 239,
1838 159, 17, 239, 162, 164, -1, 72, 191, 206, 239,
1839 156, 249, 157, 195, 38, 17, 239, 73, 17, 239,
1840 -1, 73, -1, 74, -1, 246, 176, 237, 159, 17,
1841 239, -1, 176, 237, 159, 17, 239, -1, 181, 253,
1842 -1, 204, 162, 239, 159, 239, 164, -1, 248, 159,
1843 162, 239, 159, 239, 164, -1, 204, 193, 239, 193,
1844 -1, 17, 193, 239, 193, -1, 249, 159, 204, 193,
1845 239, 193, -1, 249, 159, 17, 193, 239, 193, -1,
1846 -1, -1, 250, 159, 240, -1, 159, 4, -1, 251,
1847 159, 4, -1, 58, 57, -1, 57, -1, 171, 204,
1848 239, 159, 239, -1, 172, 204, 239, 159, 239, -1,
1849 90, 174, 204, 239, 159, 239, -1, 91, 175, 204,
1850 239, 159, 239, -1, 92, 174, 204, 239, 159, 239,
1851 -1, 93, 175, 204, 239, 159, 239, -1, 173, 240,
1852 38, 204, -1, 133, 240, 159, 240, 159, 240, -1,
1853 134, 240, 159, 204, -1, 135, 240, 159, 240, -1,
1854 136, 240, 159, 240, 159, 240, -1, 137, 240, 159,
1855 240, 159, 240, -1, 132, 248, -1, 252, 191, 206,
1856 239, 156, 249, 157, 195, -1, 255, -1, 36, -1,
1857 -1, 114, 204, 198, -1, 114, 204, 159, 11, 239,
1858 198, -1, 115, 204, 198, -1, 115, 204, 159, 11,
1859 239, 198, -1, 116, 240, -1, 254, 117, 204, 239,
1860 198, -1, 254, 118, 240, 159, 204, 239, 198, -1,
1861 138, 204, 239, 159, 4, -1, 119, 204, 239, 250,
1862 -1, 139, 204, 239, 251, -1, 140, 204, 239, 159,
1866 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1867 static const yytype_uint16 yyrline[] =
1869 0, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132,
1870 1132, 1133, 1133, 1133, 1133, 1133, 1133, 1134, 1134, 1134,
1871 1134, 1134, 1134, 1135, 1135, 1135, 1135, 1135, 1135, 1138,
1872 1138, 1139, 1139, 1140, 1140, 1141, 1141, 1142, 1142, 1146,
1873 1146, 1147, 1147, 1148, 1148, 1149, 1149, 1150, 1150, 1151,
1874 1151, 1152, 1152, 1153, 1154, 1159, 1160, 1160, 1160, 1160,
1875 1160, 1162, 1162, 1162, 1163, 1163, 1165, 1166, 1170, 1174,
1876 1179, 1179, 1181, 1182, 1187, 1193, 1194, 1195, 1196, 1197,
1877 1198, 1202, 1203, 1204, 1208, 1209, 1210, 1211, 1215, 1216,
1878 1217, 1221, 1222, 1223, 1224, 1225, 1229, 1230, 1231, 1234,
1879 1235, 1236, 1237, 1238, 1239, 1240, 1247, 1248, 1249, 1250,
1880 1251, 1252, 1253, 1254, 1255, 1256, 1260, 1261, 1266, 1267,
1881 1268, 1269, 1270, 1271, 1274, 1275, 1280, 1281, 1288, 1289,
1882 1295, 1296, 1305, 1313, 1314, 1319, 1320, 1321, 1326, 1339,
1883 1339, 1339, 1339, 1339, 1339, 1339, 1342, 1346, 1350, 1357,
1884 1362, 1370, 1399, 1424, 1429, 1439, 1449, 1453, 1463, 1470,
1885 1479, 1486, 1491, 1496, 1503, 1504, 1511, 1518, 1526, 1532,
1886 1544, 1572, 1588, 1615, 1643, 1669, 1689, 1715, 1735, 1747,
1887 1754, 1820, 1830, 1840, 1846, 1856, 1862, 1872, 1878, 1884,
1888 1897, 1909, 1930, 1938, 1944, 1955, 1960, 1965, 1970, 1975,
1889 1981, 1987, 1993, 2001, 2012, 2016, 2024, 2024, 2027, 2027,
1890 2030, 2042, 2063, 2068, 2076, 2077, 2081, 2081, 2085, 2085,
1891 2088, 2091, 2115, 2127, 2126, 2138, 2137, 2147, 2146, 2157,
1892 2197, 2200, 2206, 2216, 2220, 2225, 2227, 2232, 2237, 2246,
1893 2256, 2267, 2271, 2280, 2289, 2294, 2423, 2423, 2425, 2434,
1894 2434, 2436, 2441, 2453, 2457, 2462, 2466, 2470, 2475, 2480,
1895 2484, 2488, 2492, 2496, 2500, 2504, 2526, 2548, 2554, 2567,
1896 2579, 2584, 2596, 2602, 2606, 2616, 2620, 2624, 2629, 2636,
1897 2636, 2642, 2651, 2656, 2661, 2665, 2674, 2683, 2692, 2696,
1898 2704, 2711, 2715, 2720, 2731, 2750, 2759, 2845, 2849, 2856,
1899 2867, 2880, 2890, 2901, 2911, 2922, 2930, 2940, 2947, 2950,
1900 2951, 2959, 2965, 2974, 2978, 2983, 2999, 3016, 3030, 3044,
1901 3058, 3072, 3084, 3092, 3099, 3105, 3111, 3117, 3132, 3222,
1902 3227, 3231, 3238, 3245, 3255, 3262, 3272, 3280, 3294, 3311,
1907 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1908 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1909 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1910 static const char *const yytname[] =
1912 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1913 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1914 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1915 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1916 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1917 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1918 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1919 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1920 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1921 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1922 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1923 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1924 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1925 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1926 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1927 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1928 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1929 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1930 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1931 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1932 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1933 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1934 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1935 "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1936 "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1937 "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1938 "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1939 "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName",
1940 "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1941 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1942 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1943 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1944 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1945 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1946 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1947 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1948 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1949 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1950 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1951 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1952 "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1953 "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1954 "JumpTable", "Inst", "PHIList", "ParamList", "IndexList",
1955 "ConstantIndexList", "OptTailCall", "InstVal", "OptVolatile",
1961 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1963 static const yytype_uint16 yytoknum[] =
1965 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1966 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1967 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1968 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1969 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1970 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1971 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1972 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1973 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1974 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1975 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1976 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1977 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1978 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1979 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1980 405, 406, 407, 408, 409, 410, 40, 41, 61, 44,
1981 42, 92, 91, 120, 93, 60, 62, 123, 125, 99
1985 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1986 static const yytype_uint8 yyr1[] =
1988 0, 170, 171, 171, 171, 171, 171, 171, 171, 171,
1989 171, 172, 172, 172, 172, 172, 172, 173, 173, 173,
1990 173, 173, 173, 173, 173, 173, 173, 173, 173, 174,
1991 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1992 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
1993 175, 175, 175, 175, 175, 176, 177, 177, 177, 177,
1994 177, 178, 178, 178, 179, 179, 180, 180, 181, 181,
1995 182, 182, 183, 183, 184, 185, 185, 185, 185, 185,
1996 185, 186, 186, 186, 187, 187, 187, 187, 188, 188,
1997 188, 189, 189, 189, 189, 189, 190, 190, 190, 191,
1998 191, 191, 191, 191, 191, 191, 192, 192, 192, 192,
1999 192, 192, 192, 192, 192, 192, 193, 193, 194, 194,
2000 194, 194, 194, 194, 195, 195, 196, 196, 197, 197,
2001 198, 198, 199, 200, 200, 201, 201, 202, 202, 203,
2002 203, 203, 203, 203, 203, 203, 204, 204, 204, 204,
2003 204, 204, 204, 204, 204, 204, 204, 204, 204, 205,
2004 206, 206, 207, 207, 208, 208, 208, 208, 209, 209,
2005 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
2006 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
2007 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
2008 211, 211, 211, 211, 212, 212, 213, 213, 214, 214,
2009 215, 215, 216, 216, 217, 217, 219, 218, 220, 218,
2010 218, 218, 218, 221, 218, 222, 218, 223, 218, 218,
2011 218, 218, 224, 225, 225, 226, 227, 227, 227, 228,
2012 228, 229, 229, 229, 229, 230, 231, 231, 232, 233,
2013 233, 234, 235, 236, 236, 237, 237, 237, 237, 237,
2014 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
2015 237, 237, 237, 237, 237, 238, 238, 238, 238, 239,
2016 239, 240, 241, 241, 242, 242, 243, 244, 244, 244,
2017 245, 245, 245, 245, 245, 245, 245, 245, 245, 246,
2018 246, 247, 248, 248, 249, 249, 249, 249, 249, 250,
2019 250, 251, 251, 252, 252, 253, 253, 253, 253, 253,
2020 253, 253, 253, 253, 253, 253, 253, 253, 253, 253,
2021 254, 254, 255, 255, 255, 255, 255, 255, 255, 255,
2025 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2026 static const yytype_uint8 yyr2[] =
2028 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2029 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2030 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2031 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2032 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2033 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2034 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2035 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
2036 1, 1, 1, 1, 0, 1, 1, 1, 0, 1,
2037 1, 0, 1, 1, 1, 1, 0, 1, 1, 0,
2038 1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
2039 1, 1, 1, 1, 1, 2, 0, 2, 1, 1,
2040 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2041 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
2042 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2043 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
2044 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
2045 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
2046 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2047 6, 5, 8, 6, 6, 7, 7, 7, 7, 6,
2048 8, 8, 5, 7, 3, 1, 1, 1, 1, 0,
2049 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
2050 3, 3, 3, 0, 8, 0, 9, 0, 9, 5,
2051 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
2052 3, 1, 3, 1, 0, 10, 1, 1, 4, 1,
2053 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
2054 1, 1, 1, 1, 1, 3, 3, 2, 2, 3,
2055 2, 5, 4, 1, 5, 1, 1, 1, 1, 1,
2056 1, 2, 1, 3, 2, 2, 3, 2, 0, 1,
2057 2, 2, 3, 9, 9, 8, 14, 1, 1, 6,
2058 5, 2, 6, 7, 4, 4, 6, 6, 0, 0,
2059 3, 2, 3, 2, 1, 5, 5, 6, 6, 6,
2060 6, 4, 6, 4, 4, 6, 6, 2, 8, 1,
2061 1, 0, 3, 6, 3, 6, 2, 5, 7, 5,
2065 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2066 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2067 means the default is an error. */
2068 static const yytype_uint16 yydefact[] =
2070 73, 61, 70, 62, 71, 63, 218, 216, 0, 0,
2071 0, 0, 0, 0, 84, 72, 0, 73, 214, 88,
2072 91, 0, 0, 230, 0, 0, 68, 0, 74, 75,
2073 77, 76, 78, 81, 79, 82, 80, 83, 85, 86,
2074 87, 84, 84, 209, 1, 215, 89, 90, 84, 219,
2075 92, 93, 94, 95, 84, 288, 217, 288, 0, 0,
2076 238, 231, 232, 220, 275, 276, 222, 139, 140, 141,
2077 144, 143, 142, 145, 146, 0, 0, 0, 0, 277,
2078 278, 147, 221, 149, 209, 209, 96, 208, 0, 99,
2079 99, 289, 285, 69, 249, 250, 251, 284, 233, 234,
2080 237, 0, 167, 150, 0, 0, 0, 0, 156, 168,
2081 0, 0, 167, 0, 0, 0, 98, 97, 0, 206,
2082 207, 0, 0, 100, 101, 102, 103, 104, 0, 252,
2083 0, 331, 287, 0, 235, 166, 116, 162, 164, 0,
2084 0, 0, 0, 0, 0, 155, 0, 0, 148, 0,
2085 0, 161, 0, 160, 0, 229, 139, 140, 141, 144,
2086 143, 142, 0, 0, 67, 67, 105, 0, 246, 247,
2087 248, 330, 314, 0, 0, 0, 0, 99, 297, 298,
2088 2, 3, 4, 5, 6, 7, 8, 9, 10, 14,
2089 15, 16, 11, 12, 13, 0, 0, 0, 0, 0,
2090 0, 0, 0, 17, 18, 19, 20, 21, 22, 23,
2091 24, 25, 26, 27, 28, 0, 0, 0, 0, 0,
2092 0, 0, 0, 0, 0, 0, 0, 286, 99, 301,
2093 0, 329, 236, 159, 0, 124, 67, 67, 158, 0,
2094 169, 0, 124, 67, 67, 0, 210, 187, 188, 183,
2095 185, 184, 186, 189, 182, 178, 179, 0, 0, 0,
2096 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2097 0, 0, 0, 0, 0, 181, 180, 223, 0, 313,
2098 291, 67, 282, 290, 0, 0, 55, 0, 0, 29,
2099 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2100 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2101 43, 44, 45, 46, 47, 48, 0, 0, 0, 130,
2102 130, 336, 67, 67, 327, 0, 0, 0, 0, 0,
2103 67, 67, 67, 67, 67, 0, 0, 0, 0, 0,
2104 107, 109, 108, 106, 110, 111, 112, 113, 114, 117,
2105 165, 163, 152, 153, 154, 157, 66, 151, 225, 227,
2106 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2107 0, 0, 171, 205, 0, 0, 0, 175, 0, 172,
2108 0, 0, 0, 135, 244, 255, 256, 257, 258, 259,
2109 264, 260, 261, 262, 263, 253, 0, 0, 0, 0,
2110 273, 280, 279, 281, 0, 0, 292, 0, 0, 67,
2111 67, 67, 67, 0, 332, 0, 334, 309, 0, 0,
2112 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2113 0, 0, 67, 0, 115, 121, 120, 118, 119, 122,
2114 123, 125, 135, 135, 0, 0, 0, 0, 0, 309,
2115 0, 0, 0, 0, 0, 0, 0, 170, 156, 168,
2116 0, 173, 174, 0, 0, 0, 0, 224, 243, 116,
2117 241, 0, 254, 0, 267, 0, 0, 0, 270, 0,
2118 268, 283, 0, 0, 0, 0, 0, 0, 0, 0,
2119 0, 0, 340, 0, 0, 0, 323, 324, 0, 0,
2120 0, 0, 341, 0, 0, 0, 321, 0, 130, 0,
2121 226, 228, 67, 0, 0, 0, 0, 0, 0, 0,
2122 0, 0, 0, 0, 204, 177, 0, 0, 0, 0,
2123 0, 0, 137, 135, 65, 0, 124, 0, 266, 156,
2124 0, 265, 269, 0, 0, 308, 0, 0, 0, 0,
2125 130, 131, 130, 0, 0, 0, 0, 0, 0, 339,
2126 311, 0, 67, 315, 316, 308, 0, 337, 67, 211,
2127 0, 0, 0, 0, 191, 0, 0, 0, 0, 202,
2128 0, 176, 0, 0, 67, 132, 138, 136, 64, 240,
2129 242, 116, 133, 0, 272, 0, 0, 0, 116, 116,
2130 0, 317, 318, 319, 320, 333, 335, 310, 0, 0,
2131 322, 325, 326, 312, 0, 0, 130, 0, 0, 0,
2132 0, 0, 199, 0, 0, 0, 193, 194, 190, 65,
2133 134, 128, 274, 271, 0, 0, 0, 0, 124, 0,
2134 302, 0, 342, 124, 338, 195, 196, 197, 198, 0,
2135 0, 0, 203, 239, 0, 126, 0, 295, 0, 0,
2136 107, 109, 116, 116, 0, 116, 116, 303, 328, 192,
2137 200, 201, 129, 0, 245, 293, 0, 294, 0, 305,
2138 304, 0, 0, 0, 127, 0, 0, 0, 116, 116,
2139 0, 0, 0, 307, 306, 300, 0, 0, 299, 0,
2143 /* YYDEFGOTO[NTERM-NUM]. */
2144 static const yytype_int16 yydefgoto[] =
2146 -1, 272, 273, 274, 299, 316, 162, 163, 79, 589,
2147 113, 12, 80, 14, 15, 41, 42, 43, 48, 54,
2148 118, 128, 349, 233, 441, 352, 674, 655, 414, 532,
2149 631, 467, 533, 81, 164, 137, 154, 138, 139, 110,
2150 373, 400, 374, 121, 88, 155, 16, 17, 18, 20,
2151 19, 383, 442, 443, 63, 23, 61, 101, 470, 471,
2152 129, 170, 55, 96, 56, 49, 473, 401, 83, 403,
2153 282, 283, 57, 92, 93, 227, 659, 132, 324, 600,
2154 492, 502, 228, 229, 230, 231
2157 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2159 #define YYPACT_NINF -608
2160 static const yytype_int16 yypact[] =
2162 492, -608, -608, -608, -608, -608, -608, -608, 1, -93,
2163 14, -48, 39, -39, -3, -608, 132, 926, -608, 61,
2164 261, -14, 6, -608, -15, 148, -608, 1840, -608, -608,
2165 -608, -608, -608, -608, -608, -608, -608, -608, -608, -608,
2166 -608, 69, 69, 88, -608, -608, -608, -608, 69, -608,
2167 -608, -608, -608, -608, 69, 120, -608, -11, 158, 166,
2168 184, -608, -608, -608, -608, -608, 53, -608, -608, -608,
2169 -608, -608, -608, -608, -608, 212, 222, 10, 812, -608,
2170 -608, -608, 9, -608, 201, 201, 168, -608, 56, 253,
2171 253, -608, -608, 323, -608, -608, -608, -608, -608, -608,
2172 -608, 66, 1570, -608, 85, 93, 1260, 53, -608, 9,
2173 -101, 121, 1570, 133, 56, 56, -608, -608, 1588, -608,
2174 -608, 1869, 305, -608, -608, -608, -608, -608, 1915, -608,
2175 -12, 2220, -608, 303, -608, -608, 9, -608, 176, 170,
2176 2001, 2001, 177, -91, 2001, -608, 344, 193, -608, 1869,
2177 2001, 53, 199, 9, 432, -608, 296, 347, 348, 354,
2178 356, 357, 283, 362, 1365, 317, -608, 55, -608, -608,
2179 -608, -608, -608, 316, 2033, 94, 363, 253, -608, -608,
2180 -608, -608, -608, -608, -608, -608, -608, -608, -608, -608,
2181 -608, -608, -608, -608, -608, 464, 280, 464, 280, 2001,
2182 2001, 2001, 2001, -608, -608, -608, -608, -608, -608, -608,
2183 -608, -608, -608, -608, -608, 2001, 2001, 2001, 2001, 2001,
2184 2001, 2001, 2001, 2001, 2001, 2001, 2001, -608, 253, -608,
2185 43, -608, -608, 192, 1620, -608, -35, -40, -608, 209,
2186 9, 219, -608, 317, -23, 1588, -608, -608, -608, -608,
2187 -608, -608, -608, -608, -608, -608, -608, 464, 280, 464,
2188 280, 221, 243, 245, 246, 247, 250, 251, 1749, 2051,
2189 1305, 386, 254, 256, 257, -608, -608, -608, 259, -608,
2190 53, 913, -608, 258, 1080, 1080, -608, 1080, 1915, -608,
2191 -608, -608, -608, -608, -608, -608, -608, -608, -608, 2001,
2192 -608, -608, -608, -608, -608, -608, -608, -608, -608, -608,
2193 -608, -608, -608, -608, -608, -608, 2001, 2001, 2001, -29,
2194 -17, -608, 913, -34, 260, 262, 263, 264, 267, 268,
2195 913, 913, 913, 913, 913, 378, 1915, 2001, 2001, 416,
2196 -608, -608, -608, -608, -608, -608, -608, -608, -608, -608,
2197 -608, -608, 124, -608, -608, -608, -608, 124, -608, 133,
2198 390, 273, 274, 275, 282, 1869, 1869, 1869, 1869, 1869,
2199 1869, 1869, -608, -608, 81, 1500, -104, -608, -89, -608,
2200 1869, 1869, 1869, 277, 1781, -608, -608, -608, -608, -608,
2201 -608, -608, -608, -608, -608, 382, 1799, 2080, 1529, 422,
2202 -608, -608, -608, -608, 2001, 286, -608, 287, 1080, 913,
2203 913, 913, 913, 36, -608, 49, -608, -608, 1080, 285,
2204 2001, 2001, 2001, 2001, 2001, 289, 290, 294, 298, 301,
2205 2001, 1080, 913, 311, -608, -608, -608, -608, -608, -608,
2206 -608, -608, 277, 277, 2001, 1869, 1869, 1869, 1869, -608,
2207 312, 313, 314, 319, 290, 320, 1869, -608, 309, 1214,
2208 -87, -608, -608, 321, 322, 424, -1, -608, -608, 9,
2209 331, 334, -608, 454, -608, 99, 1547, -21, -608, -64,
2210 -608, -608, 476, 477, 339, 338, 340, 341, 342, 1080,
2211 494, 1080, 343, 358, 1080, 359, 9, -608, 361, 365,
2212 509, 517, 366, 2001, 1080, 1080, 9, 370, 369, 2001,
2213 -608, -608, 11, 374, 377, 381, 383, 82, 1869, 1869,
2214 1869, 1869, 90, 1869, -608, -608, 375, 1869, 1869, 2001,
2215 521, 541, -608, 277, 37, 1822, -608, 387, -608, 384,
2216 -51, -608, -608, 1080, 1080, 2098, 1080, 1080, 1080, 1080,
2217 369, -608, 369, 2001, 1080, 388, 2001, 2001, 2001, -608,
2218 -608, 545, 913, -608, -608, 2098, 497, -608, 913, -608,
2219 1869, 1869, 1869, 1869, -608, 394, 397, 396, 409, -608,
2220 290, -608, 412, 413, 46, -608, -608, -608, -608, -608,
2221 -608, 9, 86, 553, -608, 414, 419, 417, 27, 9,
2222 119, -608, -608, -608, -608, -608, -608, -608, 423, 1080,
2223 -608, -608, -608, -608, 290, 167, 369, 431, 433, 434,
2224 439, 1869, -608, 1869, 1869, 187, -608, -608, -608, 37,
2225 -608, 527, -608, -608, 572, -2, 762, 762, -608, 2121,
2226 -608, 435, 366, -608, -608, -608, -608, -608, -608, 440,
2227 441, 443, -608, -608, 597, 452, 1080, -608, 568, 2,
2228 455, 456, -608, -608, 118, 27, 9, -608, 124, -608,
2229 -608, -608, -608, 592, -608, -608, 458, -608, 568, 192,
2230 192, 598, 762, 762, -608, 601, 461, 1080, -608, -608,
2231 1080, 604, 549, 192, 192, -608, 1080, 606, -608, 1080,
2235 /* YYPGOTO[NTERM-NUM]. */
2236 static const yytype_int16 yypgoto[] =
2238 -608, 493, 495, 499, -174, -164, -170, -608, 0, -4,
2239 -146, 535, 5, -608, -608, -608, -608, 58, -608, -608,
2240 -608, -141, -608, -445, -608, -238, -608, -608, -295, 40,
2241 -608, -393, -608, -608, -26, 399, -125, -608, 519, 528,
2242 -86, -162, -262, 157, 269, 391, -608, -608, 618, -608,
2243 -608, -608, -608, -608, -608, -608, -608, -608, -608, -608,
2244 547, -608, -608, -608, -608, -608, -608, -607, -80, 174,
2245 -189, -608, -608, 581, -608, -608, -608, -608, -608, 74,
2246 191, -443, -608, -608, -608, -608
2249 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2250 positive, shift that token. If negative, reduce the rule which
2251 number is the opposite. If zero, do what YYDEFACT says.
2252 If YYTABLE_NINF, syntax error. */
2253 #define YYTABLE_NINF -214
2254 static const yytype_int16 yytable[] =
2256 11, 82, 275, 167, 357, 13, 287, 376, 378, 286,
2257 91, 522, 321, 286, 105, 111, 168, 11, 94, 277,
2258 111, 111, 13, 317, 534, 416, 111, 325, 326, 327,
2259 328, 329, 111, 530, 318, 165, 288, 335, 111, 29,
2260 30, 31, 32, 33, 34, 35, 36, 489, 37, 510,
2261 511, 676, 109, 531, 21, 456, 1, 27, 144, 3,
2262 491, 5, 461, 243, 111, 24, 111, 145, 144, 22,
2263 456, 686, 456, 25, 246, 2, 136, 239, 4, 462,
2264 109, 526, -145, 361, 276, 363, 136, 336, 119, 120,
2265 490, 339, 153, 11, 362, 456, 364, 358, 359, 84,
2266 85, 111, 153, 490, 542, 284, 89, 46, 456, 47,
2267 26, 285, 90, 460, 236, 237, 112, 595, 240, 28,
2268 530, 112, 112, 86, 244, 87, 354, 112, 418, 353,
2269 413, -67, 44, 112, 475, 477, 479, 625, 456, 112,
2270 587, 91, 415, -67, 58, 541, 629, 60, 281, 433,
2271 38, 39, 40, 636, 637, 169, 681, 95, 340, 341,
2272 337, 338, 657, 408, 59, 112, 677, 112, 569, -67,
2273 62, 642, 278, 319, 320, 281, 322, 106, 342, 343,
2274 98, 344, 345, -145, 346, 347, 348, -145, 99, 323,
2275 281, 281, 281, 281, 281, 330, 331, 332, 333, 334,
2276 281, 402, 112, 628, 402, 402, 100, 402, 136, 102,
2277 116, 431, 117, 567, 540, 481, 103, 679, 680, 153,
2278 682, 683, 38, 39, 40, 133, 104, 435, 436, 437,
2279 134, 495, 438, 497, 498, 499, 439, 440, 87, 574,
2280 456, 553, 402, 693, 694, 457, 339, 579, 140, 561,
2281 402, 402, 402, 402, 402, 605, 141, 606, 456, 435,
2282 436, 437, 153, 538, 438, 435, 436, 437, 439, 440,
2283 438, 149, 150, 409, 439, 440, 638, 146, 639, 449,
2284 450, 451, 452, 453, 454, 455, 249, 250, 251, 252,
2285 410, 411, 412, 148, 463, 464, 465, 275, 592, -55,
2286 -55, -55, -55, 50, 51, 52, 300, 301, 53, 166,
2287 153, 432, 281, 340, 341, 122, 123, 124, 125, 126,
2288 127, 644, 247, 248, 643, 232, 639, 235, 402, 402,
2289 402, 402, 402, 342, 343, 234, 344, 345, 402, 346,
2290 347, 348, 1, 238, 652, 3, 561, 5, 241, 459,
2291 242, 402, 402, 114, 115, 245, -56, -57, 469, 513,
2292 514, 515, 516, -60, 607, -59, -58, 610, 611, 612,
2293 524, 253, 111, 279, 286, 355, 356, 365, 281, 276,
2294 302, 303, 304, 305, 306, 307, 308, 309, 310, 311,
2295 312, 313, 314, 315, 281, 496, 281, 281, 281, 366,
2296 664, 367, 368, 369, 506, 668, 370, 371, 379, 402,
2297 380, 402, 381, 382, 402, 384, 430, 404, 512, 419,
2298 434, 420, 421, 422, 402, 402, 423, 424, 444, 445,
2299 446, 447, 575, 576, 577, 578, 466, 580, 448, 64,
2300 65, 582, 583, 472, 480, 482, 483, 494, 500, 501,
2301 459, 1, 2, 503, 3, 4, 5, 504, 405, 406,
2302 505, 407, 529, 402, 402, 658, 402, 402, 402, 402,
2303 509, 518, 519, 520, 402, 525, 537, 562, 521, 523,
2304 527, 528, 402, 568, 617, 618, 619, 620, 402, 678,
2305 535, 536, -213, 543, 544, 545, 417, 546, 551, 547,
2306 548, 549, 553, 584, 425, 426, 427, 428, 429, 591,
2307 -69, 1, 2, 559, 3, 4, 5, 554, 556, 599,
2308 557, 560, 6, 7, 558, 561, 565, 281, 566, 402,
2309 281, 281, 281, 570, 588, 649, 571, 650, 651, 599,
2310 572, 581, 573, 585, 8, 586, 593, 609, 9, 613,
2311 594, 490, 10, 621, 622, 623, 402, 402, 289, 290,
2312 291, 292, 293, 294, 295, 296, 297, 298, 624, 626,
2313 627, 385, 386, 387, 388, 632, 402, 389, 634, 635,
2314 633, 654, 484, 485, 486, 487, 488, 640, 645, 656,
2315 646, 647, 493, 390, 391, 392, 648, 669, 670, 667,
2316 671, 672, 402, 402, 673, 507, 508, 402, 393, 394,
2317 402, -18, -19, 666, 684, 687, 402, 685, 690, 402,
2318 691, 696, 697, 699, 224, 653, 225, 395, 131, 588,
2319 226, 147, 630, 351, 143, 45, 360, 130, 97, 615,
2320 517, 0, 0, 180, 181, 182, 183, 184, 185, 186,
2321 187, 188, 189, 190, 191, 192, 193, 194, 257, 258,
2322 259, 260, 0, 550, 0, 552, 0, 0, 555, 0,
2323 0, 0, 0, 0, 0, 0, 0, 0, 563, 564,
2324 0, 0, 0, 0, 0, 0, 0, 261, 203, 204,
2325 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
2326 0, 262, 0, 263, 264, 265, 0, 266, 267, 0,
2327 0, 0, 0, 0, 0, 0, 0, 596, 597, 0,
2328 601, 602, 603, 604, 0, 0, 0, 0, 608, 0,
2329 396, 0, 0, 397, 0, 398, 614, 399, 0, 0,
2330 0, 0, 616, 0, 0, 0, 0, 0, 0, 0,
2331 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2332 0, 0, 0, 0, 0, 385, 386, 387, 388, 64,
2333 65, 389, 0, 0, 0, 0, 0, 0, 0, 0,
2334 0, 1, 2, 641, 3, 4, 5, 390, 391, 392,
2335 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2336 0, 0, 393, 394, 0, 0, 0, 0, 0, 0,
2337 662, 663, 0, 0, 0, 0, 339, 0, 0, 64,
2338 65, 395, 107, 67, 68, 69, 70, 71, 72, 73,
2339 675, 1, 2, 0, 3, 4, 5, 180, 181, 182,
2340 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2341 193, 194, 257, 258, 259, 260, 688, 689, 0, 0,
2342 0, 692, 74, 0, 695, 0, 0, 0, 0, 0,
2343 698, 0, 0, 700, 0, 0, 0, 0, 0, 0,
2344 0, 261, 203, 660, 661, 206, 207, 208, 209, 210,
2345 211, 212, 213, 214, 0, 262, 0, 263, 264, 265,
2346 0, 266, 267, 342, 343, 0, 344, 345, 0, 346,
2347 347, 348, 0, 0, 0, 0, 385, 386, 387, 388,
2348 64, 65, 389, 0, 396, 0, -212, 397, 0, 398,
2349 0, 399, 1, 2, 0, 3, 4, 5, 390, 391,
2350 392, 0, 0, 0, -69, 1, 2, 0, 3, 4,
2351 5, 0, 0, 393, 394, 0, 6, 7, 0, 0,
2352 0, 0, 0, 0, 0, 0, 0, 0, 111, 0,
2353 0, 0, 395, 75, 76, 0, 0, 77, 8, 78,
2354 108, 0, 9, 0, 0, 0, 10, 0, 180, 181,
2355 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
2356 192, 193, 194, 257, 258, 259, 260, 0, 0, 0,
2357 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2359 0, 0, 261, 203, 204, 205, 206, 207, 208, 209,
2360 210, 211, 212, 213, 214, 0, 262, 0, 263, 264,
2361 265, 0, 266, 267, 0, 0, 0, 0, 0, 0,
2362 0, 0, 0, 0, 0, 0, 0, 0, 0, 112,
2363 0, 0, 0, 0, 0, 396, 0, 0, 397, 0,
2364 398, 0, 399, 385, 386, 387, 388, 64, 65, 389,
2365 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
2366 2, 0, 3, 4, 5, 390, 391, 392, 0, 0,
2367 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2368 393, 394, 0, 0, 0, 0, 0, 0, 0, 0,
2369 0, 0, 0, 0, 0, 0, 0, 0, 0, 395,
2370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2371 0, 0, 0, 0, 0, 180, 181, 182, 183, 184,
2372 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2373 257, 258, 259, 260, 0, 0, 0, 0, 0, 0,
2374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2375 0, 0, 0, 0, 0, 0, 0, 0, 0, 261,
2376 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
2377 213, 214, 0, 262, 0, 263, 264, 265, 0, 266,
2378 267, 64, 65, 0, 0, 0, 0, 0, 0, 0,
2379 0, 0, 0, 1, 2, 0, 3, 4, 5, 254,
2380 0, 0, 396, 0, 0, 397, 0, 398, 0, 399,
2381 0, 0, 0, 0, 255, 256, 0, 0, 0, 0,
2382 0, 0, 0, 0, 0, 0, 0, 64, 65, 111,
2383 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2384 2, 0, 3, 4, 5, 0, 0, 0, 0, 180,
2385 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
2386 191, 192, 193, 194, 257, 258, 259, 260, 0, 0,
2387 74, 0, 64, 65, 0, 107, 156, 157, 158, 159,
2388 160, 161, 73, 0, 1, 2, 0, 3, 4, 5,
2389 0, 0, 0, 261, 203, 204, 205, 206, 207, 208,
2390 209, 210, 211, 212, 213, 214, 0, 262, 0, 263,
2391 264, 265, 0, 266, 267, 74, 0, 0, 0, 0,
2392 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2393 112, 0, 64, 65, -67, 0, 268, 0, 0, 269,
2394 0, 270, 0, 271, 1, 2, 0, 3, 4, 5,
2395 254, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2396 0, 0, 0, 0, 0, 255, 256, 0, 0, 0,
2397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2398 111, 75, 76, 0, 0, 77, 0, 78, 142, 0,
2399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2400 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2401 190, 191, 192, 193, 194, 257, 258, 259, 260, 0,
2402 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2403 77, 0, 78, 377, 0, 0, 0, 0, 0, 0,
2404 0, 0, 0, 0, 261, 203, 204, 205, 206, 207,
2405 208, 209, 210, 211, 212, 213, 214, 0, 262, 0,
2406 263, 264, 265, 0, 266, 267, 0, 64, 65, 0,
2407 107, 156, 157, 158, 159, 160, 161, 73, 0, 1,
2408 2, 112, 3, 4, 5, 0, 0, 268, 0, 0,
2409 269, 0, 270, 0, 271, 0, 64, 65, 0, 107,
2410 156, 157, 158, 159, 160, 161, 73, 0, 1, 2,
2411 74, 3, 4, 5, 64, 65, 0, 107, 156, 157,
2412 158, 159, 160, 161, 73, 0, 1, 2, 0, 3,
2413 4, 5, 0, 0, 0, 0, 0, 64, 65, 74,
2414 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2415 2, 0, 3, 4, 5, 64, 65, 74, 151, 67,
2416 68, 69, 70, 71, 72, 73, 0, 1, 2, 135,
2417 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2418 74, 0, 0, 0, 0, 0, 0, 64, 65, 0,
2419 107, 67, 68, 69, 70, 71, 72, 73, 74, 1,
2420 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2421 0, 0, 0, 0, 0, 0, 0, 0, 0, 350,
2422 0, 75, 76, 0, 0, 77, 0, 78, 458, 0,
2423 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2425 75, 76, 0, 0, 77, 0, 78, 478, 0, 0,
2426 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2427 0, 0, 77, 152, 78, 539, 0, 0, 0, 0,
2428 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2429 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2430 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2431 76, 0, 0, 77, 0, 78, 64, 65, 0, 107,
2432 156, 157, 158, 159, 160, 161, 73, 0, 1, 2,
2433 0, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2434 0, 75, 76, 0, 0, 77, 0, 78, 64, 65,
2435 0, 107, 67, 68, 69, 70, 71, 72, 73, 74,
2436 1, 2, 0, 3, 4, 5, 64, 65, 0, 107,
2437 156, 157, 158, 159, 160, 161, 73, 0, 1, 2,
2438 468, 3, 4, 5, 0, 0, 0, 0, 0, 64,
2439 65, 74, 107, 67, 68, 69, 70, 71, 72, 73,
2440 0, 1, 2, 0, 3, 4, 5, 64, 65, 74,
2441 66, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2442 2, 590, 3, 4, 5, 0, 0, 0, 0, 0,
2443 0, 0, 74, 0, 0, 0, 64, 65, 0, 107,
2444 156, 157, 158, 159, 160, 161, 73, 0, 1, 2,
2445 74, 3, 4, 5, 0, 0, 0, 0, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2447 75, 76, 0, 372, 77, 0, 78, 0, 0, 74,
2448 0, 0, 64, 65, 0, 151, 67, 68, 69, 70,
2449 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2450 0, 0, 75, 76, 0, 0, 77, 0, 78, 0,
2451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2452 75, 76, 0, 474, 77, 74, 78, 0, 0, 0,
2453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2454 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2455 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2456 0, 75, 76, 0, 0, 77, 0, 78, 64, 65,
2457 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2458 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2459 75, 76, 0, 0, 77, 0, 78, 0, 0, 0,
2460 64, 65, 0, 280, 67, 68, 69, 70, 71, 72,
2461 73, 74, 1, 2, 0, 3, 4, 5, 64, 65,
2462 0, 107, 156, 157, 158, 159, 160, 161, 73, 0,
2463 1, 2, 0, 3, 4, 5, 75, 76, 0, 0,
2464 77, 0, 78, 74, 0, 0, 0, 64, 65, 0,
2465 107, 156, 157, 158, 159, 160, 161, 73, 0, 1,
2466 2, 74, 3, 4, 5, 64, 65, 0, 107, 67,
2467 68, 69, 70, 71, 72, 598, 0, 1, 2, 0,
2468 3, 4, 5, 0, 0, 0, 0, 0, 64, 65,
2469 74, 107, 67, 68, 69, 70, 71, 72, 665, 0,
2470 1, 2, 0, 3, 4, 5, 0, 0, 74, 0,
2471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2472 0, 0, 75, 76, 0, 0, 77, 0, 78, 0,
2473 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
2474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2475 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2476 78, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2477 0, 0, 75, 76, 0, 0, 77, 0, 375, 0,
2478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2480 0, 75, 76, 0, 0, 77, 0, 476, 0, 0,
2481 0, 0, 0, 0, 0, 0, 171, 0, 0, 75,
2482 76, 0, 0, 77, 0, 78, 0, 0, 0, 0,
2483 0, 0, 0, 0, 0, 0, 0, 172, 173, 0,
2484 0, 0, 75, 76, 0, 0, 77, 0, 78, 174,
2485 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
2486 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
2487 195, 196, 197, 198, 0, 0, 0, 0, 0, 0,
2488 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2489 0, 0, 0, 0, 199, 200, 201, 0, 0, 202,
2490 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
2491 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
2495 static const yytype_int16 yycheck[] =
2497 0, 27, 164, 128, 242, 0, 176, 269, 270, 11,
2498 21, 454, 201, 11, 4, 55, 28, 17, 29, 165,
2499 55, 55, 17, 197, 469, 320, 55, 216, 217, 218,
2500 219, 220, 55, 34, 198, 121, 177, 226, 55, 42,
2501 43, 44, 45, 46, 47, 48, 49, 11, 51, 442,
2502 443, 658, 78, 54, 53, 159, 19, 18, 159, 22,
2503 11, 24, 166, 149, 55, 158, 55, 168, 159, 68,
2504 159, 678, 159, 59, 154, 20, 102, 168, 23, 168,
2505 106, 168, 55, 257, 164, 259, 112, 228, 32, 33,
2506 54, 54, 118, 93, 258, 159, 260, 243, 244, 41,
2507 42, 55, 128, 54, 168, 11, 48, 46, 159, 48,
2508 158, 17, 54, 375, 140, 141, 156, 168, 144, 158,
2509 34, 156, 156, 35, 150, 37, 166, 156, 162, 164,
2510 159, 160, 0, 156, 396, 397, 398, 580, 159, 156,
2511 533, 21, 159, 160, 158, 166, 591, 162, 174, 338,
2512 153, 154, 155, 598, 599, 167, 38, 168, 121, 122,
2513 117, 118, 164, 288, 158, 156, 164, 156, 157, 160,
2514 22, 614, 167, 199, 200, 201, 202, 167, 141, 142,
2515 22, 144, 145, 156, 147, 148, 149, 160, 22, 215,
2516 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
2517 226, 281, 156, 157, 284, 285, 22, 287, 234, 156,
2518 42, 336, 44, 508, 476, 404, 4, 662, 663, 245,
2519 665, 666, 153, 154, 155, 159, 4, 141, 142, 143,
2520 164, 420, 146, 422, 423, 424, 150, 151, 37, 157,
2521 159, 159, 322, 688, 689, 164, 54, 157, 163, 159,
2522 330, 331, 332, 333, 334, 550, 163, 552, 159, 141,
2523 142, 143, 288, 164, 146, 141, 142, 143, 150, 151,
2524 146, 114, 115, 299, 150, 151, 157, 156, 159, 365,
2525 366, 367, 368, 369, 370, 371, 3, 4, 5, 6,
2526 316, 317, 318, 160, 380, 381, 382, 459, 536, 3,
2527 4, 5, 6, 42, 43, 44, 26, 27, 47, 4,
2528 336, 337, 338, 121, 122, 62, 63, 64, 65, 66,
2529 67, 616, 26, 27, 157, 22, 159, 157, 408, 409,
2530 410, 411, 412, 141, 142, 159, 144, 145, 418, 147,
2531 148, 149, 19, 166, 157, 22, 159, 24, 4, 375,
2532 157, 431, 432, 84, 85, 156, 9, 9, 384, 445,
2533 446, 447, 448, 9, 553, 9, 9, 556, 557, 558,
2534 456, 9, 55, 57, 11, 166, 157, 156, 404, 459,
2535 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
2536 110, 111, 112, 113, 420, 421, 422, 423, 424, 156,
2537 638, 156, 156, 156, 430, 643, 156, 156, 22, 489,
2538 156, 491, 156, 156, 494, 156, 38, 159, 444, 159,
2539 4, 159, 159, 159, 504, 505, 159, 159, 38, 156,
2540 156, 156, 518, 519, 520, 521, 159, 523, 156, 7,
2541 8, 527, 528, 61, 22, 159, 159, 162, 159, 159,
2542 476, 19, 20, 159, 22, 23, 24, 159, 284, 285,
2543 159, 287, 38, 543, 544, 635, 546, 547, 548, 549,
2544 159, 159, 159, 159, 554, 166, 22, 503, 159, 159,
2545 159, 159, 562, 509, 570, 571, 572, 573, 568, 659,
2546 159, 157, 0, 17, 17, 156, 322, 159, 4, 159,
2547 159, 159, 159, 529, 330, 331, 332, 333, 334, 535,
2548 18, 19, 20, 4, 22, 23, 24, 159, 159, 545,
2549 159, 4, 30, 31, 159, 159, 156, 553, 159, 609,
2550 556, 557, 558, 159, 534, 621, 159, 623, 624, 565,
2551 159, 166, 159, 22, 52, 4, 159, 159, 56, 4,
2552 166, 54, 60, 159, 157, 159, 636, 637, 94, 95,
2553 96, 97, 98, 99, 100, 101, 102, 103, 159, 157,
2554 157, 3, 4, 5, 6, 22, 656, 9, 159, 162,
2555 166, 54, 408, 409, 410, 411, 412, 164, 157, 17,
2556 157, 157, 418, 25, 26, 27, 157, 157, 157, 164,
2557 157, 4, 682, 683, 152, 431, 432, 687, 40, 41,
2558 690, 156, 156, 639, 22, 17, 696, 159, 17, 699,
2559 159, 17, 73, 17, 131, 629, 131, 59, 93, 629,
2560 131, 112, 592, 234, 106, 17, 245, 90, 57, 565,
2561 449, -1, -1, 75, 76, 77, 78, 79, 80, 81,
2562 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2563 92, 93, -1, 489, -1, 491, -1, -1, 494, -1,
2564 -1, -1, -1, -1, -1, -1, -1, -1, 504, 505,
2565 -1, -1, -1, -1, -1, -1, -1, 119, 120, 121,
2566 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2567 -1, 133, -1, 135, 136, 137, -1, 139, 140, -1,
2568 -1, -1, -1, -1, -1, -1, -1, 543, 544, -1,
2569 546, 547, 548, 549, -1, -1, -1, -1, 554, -1,
2570 162, -1, -1, 165, -1, 167, 562, 169, -1, -1,
2571 -1, -1, 568, -1, -1, -1, -1, -1, -1, -1,
2572 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2573 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
2574 8, 9, -1, -1, -1, -1, -1, -1, -1, -1,
2575 -1, 19, 20, 609, 22, 23, 24, 25, 26, 27,
2576 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2577 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2578 636, 637, -1, -1, -1, -1, 54, -1, -1, 7,
2579 8, 59, 10, 11, 12, 13, 14, 15, 16, 17,
2580 656, 19, 20, -1, 22, 23, 24, 75, 76, 77,
2581 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2582 88, 89, 90, 91, 92, 93, 682, 683, -1, -1,
2583 -1, 687, 50, -1, 690, -1, -1, -1, -1, -1,
2584 696, -1, -1, 699, -1, -1, -1, -1, -1, -1,
2585 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2586 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2587 -1, 139, 140, 141, 142, -1, 144, 145, -1, 147,
2588 148, 149, -1, -1, -1, -1, 3, 4, 5, 6,
2589 7, 8, 9, -1, 162, -1, 0, 165, -1, 167,
2590 -1, 169, 19, 20, -1, 22, 23, 24, 25, 26,
2591 27, -1, -1, -1, 18, 19, 20, -1, 22, 23,
2592 24, -1, -1, 40, 41, -1, 30, 31, -1, -1,
2593 -1, -1, -1, -1, -1, -1, -1, -1, 55, -1,
2594 -1, -1, 59, 161, 162, -1, -1, 165, 52, 167,
2595 168, -1, 56, -1, -1, -1, 60, -1, 75, 76,
2596 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2597 87, 88, 89, 90, 91, 92, 93, -1, -1, -1,
2598 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2599 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2600 -1, -1, 119, 120, 121, 122, 123, 124, 125, 126,
2601 127, 128, 129, 130, 131, -1, 133, -1, 135, 136,
2602 137, -1, 139, 140, -1, -1, -1, -1, -1, -1,
2603 -1, -1, -1, -1, -1, -1, -1, -1, -1, 156,
2604 -1, -1, -1, -1, -1, 162, -1, -1, 165, -1,
2605 167, -1, 169, 3, 4, 5, 6, 7, 8, 9,
2606 -1, -1, -1, -1, -1, -1, -1, -1, -1, 19,
2607 20, -1, 22, 23, 24, 25, 26, 27, -1, -1,
2608 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2609 40, 41, -1, -1, -1, -1, -1, -1, -1, -1,
2610 -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
2611 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2612 -1, -1, -1, -1, -1, 75, 76, 77, 78, 79,
2613 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2614 90, 91, 92, 93, -1, -1, -1, -1, -1, -1,
2615 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2616 -1, -1, -1, -1, -1, -1, -1, -1, -1, 119,
2617 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
2618 130, 131, -1, 133, -1, 135, 136, 137, -1, 139,
2619 140, 7, 8, -1, -1, -1, -1, -1, -1, -1,
2620 -1, -1, -1, 19, 20, -1, 22, 23, 24, 25,
2621 -1, -1, 162, -1, -1, 165, -1, 167, -1, 169,
2622 -1, -1, -1, -1, 40, 41, -1, -1, -1, -1,
2623 -1, -1, -1, -1, -1, -1, -1, 7, 8, 55,
2624 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2625 20, -1, 22, 23, 24, -1, -1, -1, -1, 75,
2626 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2627 86, 87, 88, 89, 90, 91, 92, 93, -1, -1,
2628 50, -1, 7, 8, -1, 10, 11, 12, 13, 14,
2629 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2630 -1, -1, -1, 119, 120, 121, 122, 123, 124, 125,
2631 126, 127, 128, 129, 130, 131, -1, 133, -1, 135,
2632 136, 137, -1, 139, 140, 50, -1, -1, -1, -1,
2633 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2634 156, -1, 7, 8, 160, -1, 162, -1, -1, 165,
2635 -1, 167, -1, 169, 19, 20, -1, 22, 23, 24,
2636 25, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2637 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2638 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2639 55, 161, 162, -1, -1, 165, -1, 167, 168, -1,
2640 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2641 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2642 85, 86, 87, 88, 89, 90, 91, 92, 93, -1,
2643 -1, -1, -1, -1, -1, -1, 161, 162, -1, -1,
2644 165, -1, 167, 168, -1, -1, -1, -1, -1, -1,
2645 -1, -1, -1, -1, 119, 120, 121, 122, 123, 124,
2646 125, 126, 127, 128, 129, 130, 131, -1, 133, -1,
2647 135, 136, 137, -1, 139, 140, -1, 7, 8, -1,
2648 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2649 20, 156, 22, 23, 24, -1, -1, 162, -1, -1,
2650 165, -1, 167, -1, 169, -1, 7, 8, -1, 10,
2651 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2652 50, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2653 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2654 23, 24, -1, -1, -1, -1, -1, 7, 8, 50,
2655 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2656 20, -1, 22, 23, 24, 7, 8, 50, 10, 11,
2657 12, 13, 14, 15, 16, 17, -1, 19, 20, 39,
2658 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2659 50, -1, -1, -1, -1, -1, -1, 7, 8, -1,
2660 10, 11, 12, 13, 14, 15, 16, 17, 50, 19,
2661 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2662 -1, -1, -1, -1, -1, -1, -1, -1, -1, 39,
2663 -1, 161, 162, -1, -1, 165, -1, 167, 168, -1,
2664 50, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2665 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2666 161, 162, -1, -1, 165, -1, 167, 168, -1, -1,
2667 -1, -1, -1, -1, -1, -1, -1, -1, 161, 162,
2668 -1, -1, 165, 125, 167, 168, -1, -1, -1, -1,
2669 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2670 -1, 161, 162, -1, -1, 165, -1, 167, -1, -1,
2671 -1, -1, -1, -1, -1, -1, -1, -1, -1, 161,
2672 162, -1, -1, 165, -1, 167, 7, 8, -1, 10,
2673 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2674 -1, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2675 -1, 161, 162, -1, -1, 165, -1, 167, 7, 8,
2676 -1, 10, 11, 12, 13, 14, 15, 16, 17, 50,
2677 19, 20, -1, 22, 23, 24, 7, 8, -1, 10,
2678 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2679 39, 22, 23, 24, -1, -1, -1, -1, -1, 7,
2680 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2681 -1, 19, 20, -1, 22, 23, 24, 7, 8, 50,
2682 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2683 20, 39, 22, 23, 24, -1, -1, -1, -1, -1,
2684 -1, -1, 50, -1, -1, -1, 7, 8, -1, 10,
2685 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2686 50, 22, 23, 24, -1, -1, -1, -1, -1, -1,
2687 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2688 161, 162, -1, 164, 165, -1, 167, -1, -1, 50,
2689 -1, -1, 7, 8, -1, 10, 11, 12, 13, 14,
2690 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2691 -1, -1, 161, 162, -1, -1, 165, -1, 167, -1,
2692 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2693 161, 162, -1, 164, 165, 50, 167, -1, -1, -1,
2694 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2695 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2697 -1, 161, 162, -1, -1, 165, -1, 167, 7, 8,
2698 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2699 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2700 161, 162, -1, -1, 165, -1, 167, -1, -1, -1,
2701 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2702 17, 50, 19, 20, -1, 22, 23, 24, 7, 8,
2703 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2704 19, 20, -1, 22, 23, 24, 161, 162, -1, -1,
2705 165, -1, 167, 50, -1, -1, -1, 7, 8, -1,
2706 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2707 20, 50, 22, 23, 24, 7, 8, -1, 10, 11,
2708 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2709 22, 23, 24, -1, -1, -1, -1, -1, 7, 8,
2710 50, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2711 19, 20, -1, 22, 23, 24, -1, -1, 50, -1,
2712 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2713 -1, -1, 161, 162, -1, -1, 165, -1, 167, -1,
2714 -1, 50, -1, -1, -1, -1, -1, -1, -1, -1,
2715 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2716 -1, -1, -1, -1, 161, 162, -1, -1, 165, -1,
2717 167, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2718 -1, -1, 161, 162, -1, -1, 165, -1, 167, -1,
2719 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2720 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2721 -1, 161, 162, -1, -1, 165, -1, 167, -1, -1,
2722 -1, -1, -1, -1, -1, -1, 36, -1, -1, 161,
2723 162, -1, -1, 165, -1, 167, -1, -1, -1, -1,
2724 -1, -1, -1, -1, -1, -1, -1, 57, 58, -1,
2725 -1, -1, 161, 162, -1, -1, 165, -1, 167, 69,
2726 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2727 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2728 90, 91, 92, 93, -1, -1, -1, -1, -1, -1,
2729 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2730 -1, -1, -1, -1, 114, 115, 116, -1, -1, 119,
2731 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
2732 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
2736 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2737 symbol of state STATE-NUM. */
2738 static const yytype_uint8 yystos[] =
2740 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2741 60, 178, 181, 182, 183, 184, 216, 217, 218, 220,
2742 219, 53, 68, 225, 158, 59, 158, 18, 158, 42,
2743 43, 44, 45, 46, 47, 48, 49, 51, 153, 154,
2744 155, 185, 186, 187, 0, 218, 46, 48, 188, 235,
2745 42, 43, 44, 47, 189, 232, 234, 242, 158, 158,
2746 162, 226, 22, 224, 7, 8, 10, 11, 12, 13,
2747 14, 15, 16, 17, 50, 161, 162, 165, 167, 178,
2748 182, 203, 204, 238, 187, 187, 35, 37, 214, 187,
2749 187, 21, 243, 244, 29, 168, 233, 243, 22, 22,
2750 22, 227, 156, 4, 4, 4, 167, 10, 168, 204,
2751 209, 55, 156, 180, 214, 214, 42, 44, 190, 32,
2752 33, 213, 62, 63, 64, 65, 66, 67, 191, 230,
2753 230, 181, 247, 159, 164, 39, 204, 205, 207, 208,
2754 163, 163, 168, 209, 159, 168, 156, 208, 160, 213,
2755 213, 10, 125, 204, 206, 215, 11, 12, 13, 14,
2756 15, 16, 176, 177, 204, 210, 4, 206, 28, 167,
2757 231, 36, 57, 58, 69, 70, 71, 72, 73, 74,
2758 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2759 85, 86, 87, 88, 89, 90, 91, 92, 93, 114,
2760 115, 116, 119, 120, 121, 122, 123, 124, 125, 126,
2761 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2762 137, 138, 139, 140, 171, 172, 173, 245, 252, 253,
2763 254, 255, 22, 193, 159, 157, 204, 204, 166, 168,
2764 204, 4, 157, 210, 204, 156, 238, 26, 27, 3,
2765 4, 5, 6, 9, 25, 40, 41, 90, 91, 92,
2766 93, 119, 133, 135, 136, 137, 139, 140, 162, 165,
2767 167, 169, 171, 172, 173, 211, 238, 180, 182, 57,
2768 10, 204, 240, 241, 11, 17, 11, 176, 191, 94,
2769 95, 96, 97, 98, 99, 100, 101, 102, 103, 174,
2770 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2771 108, 109, 110, 111, 112, 113, 175, 174, 175, 204,
2772 204, 240, 204, 204, 248, 240, 240, 240, 240, 240,
2773 204, 204, 204, 204, 204, 240, 191, 117, 118, 54,
2774 121, 122, 141, 142, 144, 145, 147, 148, 149, 192,
2775 39, 205, 195, 164, 166, 166, 157, 195, 180, 180,
2776 215, 174, 175, 174, 175, 156, 156, 156, 156, 156,
2777 156, 156, 164, 210, 212, 167, 212, 168, 212, 22,
2778 156, 156, 156, 221, 156, 3, 4, 5, 6, 9,
2779 25, 26, 27, 40, 41, 59, 162, 165, 167, 169,
2780 211, 237, 238, 239, 159, 239, 239, 239, 206, 204,
2781 204, 204, 204, 159, 198, 159, 198, 239, 162, 159,
2782 159, 159, 159, 159, 159, 239, 239, 239, 239, 239,
2783 38, 206, 204, 240, 4, 141, 142, 143, 146, 150,
2784 151, 194, 222, 223, 38, 156, 156, 156, 156, 210,
2785 210, 210, 210, 210, 210, 210, 159, 164, 168, 204,
2786 212, 166, 168, 210, 210, 210, 159, 201, 39, 204,
2787 228, 229, 61, 236, 164, 212, 167, 212, 168, 212,
2788 22, 240, 159, 159, 239, 239, 239, 239, 239, 11,
2789 54, 11, 250, 239, 162, 240, 204, 240, 240, 240,
2790 159, 159, 251, 159, 159, 159, 204, 239, 239, 159,
2791 201, 201, 204, 210, 210, 210, 210, 250, 159, 159,
2792 159, 159, 251, 159, 210, 166, 168, 159, 159, 38,
2793 34, 54, 199, 202, 193, 159, 157, 22, 164, 168,
2794 212, 166, 168, 17, 17, 156, 159, 159, 159, 159,
2795 239, 4, 239, 159, 159, 239, 159, 159, 159, 4,
2796 4, 159, 204, 239, 239, 156, 159, 198, 204, 157,
2797 159, 159, 159, 159, 157, 210, 210, 210, 210, 157,
2798 210, 166, 210, 210, 204, 22, 4, 201, 178, 179,
2799 39, 204, 195, 159, 166, 168, 239, 239, 17, 204,
2800 249, 239, 239, 239, 239, 198, 198, 240, 239, 159,
2801 240, 240, 240, 4, 239, 249, 239, 210, 210, 210,
2802 210, 159, 157, 159, 159, 251, 157, 157, 157, 193,
2803 199, 200, 22, 166, 159, 162, 193, 193, 157, 159,
2804 164, 239, 251, 157, 198, 157, 157, 157, 157, 210,
2805 210, 210, 157, 179, 54, 197, 17, 164, 176, 246,
2806 121, 122, 239, 239, 195, 17, 204, 164, 195, 157,
2807 157, 157, 4, 152, 196, 239, 237, 164, 176, 193,
2808 193, 38, 193, 193, 22, 159, 237, 17, 239, 239,
2809 17, 159, 239, 193, 193, 239, 17, 73, 239, 17,
2813 #define yyerrok (yyerrstatus = 0)
2814 #define yyclearin (yychar = YYEMPTY)
2815 #define YYEMPTY (-2)
2818 #define YYACCEPT goto yyacceptlab
2819 #define YYABORT goto yyabortlab
2820 #define YYERROR goto yyerrorlab
2823 /* Like YYERROR except do call yyerror. This remains here temporarily
2824 to ease the transition to the new meaning of YYERROR, for GCC.
2825 Once GCC version 2 has supplanted version 1, this can go. */
2827 #define YYFAIL goto yyerrlab
2829 #define YYRECOVERING() (!!yyerrstatus)
2831 #define YYBACKUP(Token, Value) \
2833 if (yychar == YYEMPTY && yylen == 1) \
2837 yytoken = YYTRANSLATE (yychar); \
2843 yyerror (YY_("syntax error: cannot back up")); \
2850 #define YYERRCODE 256
2853 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2854 If N is 0, then set CURRENT to the empty location which ends
2855 the previous symbol: RHS[0] (always defined). */
2857 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2858 #ifndef YYLLOC_DEFAULT
2859 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2863 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2864 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2865 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2866 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2870 (Current).first_line = (Current).last_line = \
2871 YYRHSLOC (Rhs, 0).last_line; \
2872 (Current).first_column = (Current).last_column = \
2873 YYRHSLOC (Rhs, 0).last_column; \
2879 /* YY_LOCATION_PRINT -- Print the location on the stream.
2880 This macro was not mandated originally: define only if we know
2881 we won't break user code: when these are the locations we know. */
2883 #ifndef YY_LOCATION_PRINT
2884 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2885 # define YY_LOCATION_PRINT(File, Loc) \
2886 fprintf (File, "%d.%d-%d.%d", \
2887 (Loc).first_line, (Loc).first_column, \
2888 (Loc).last_line, (Loc).last_column)
2890 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2895 /* YYLEX -- calling `yylex' with the right arguments. */
2898 # define YYLEX yylex (YYLEX_PARAM)
2900 # define YYLEX yylex ()
2903 /* Enable debugging if requested. */
2907 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2908 # define YYFPRINTF fprintf
2911 # define YYDPRINTF(Args) \
2917 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2921 YYFPRINTF (stderr, "%s ", Title); \
2922 yy_symbol_print (stderr, \
2924 YYFPRINTF (stderr, "\n"); \
2929 /*--------------------------------.
2930 | Print this symbol on YYOUTPUT. |
2931 `--------------------------------*/
2934 #if (defined __STDC__ || defined __C99__FUNC__ \
2935 || defined __cplusplus || defined _MSC_VER)
2937 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2940 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2943 YYSTYPE const * const yyvaluep;
2949 if (yytype < YYNTOKENS)
2950 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2962 /*--------------------------------.
2963 | Print this symbol on YYOUTPUT. |
2964 `--------------------------------*/
2966 #if (defined __STDC__ || defined __C99__FUNC__ \
2967 || defined __cplusplus || defined _MSC_VER)
2969 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2972 yy_symbol_print (yyoutput, yytype, yyvaluep)
2975 YYSTYPE const * const yyvaluep;
2978 if (yytype < YYNTOKENS)
2979 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2981 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2983 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2984 YYFPRINTF (yyoutput, ")");
2987 /*------------------------------------------------------------------.
2988 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2990 `------------------------------------------------------------------*/
2992 #if (defined __STDC__ || defined __C99__FUNC__ \
2993 || defined __cplusplus || defined _MSC_VER)
2995 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2998 yy_stack_print (bottom, top)
2999 yytype_int16 *bottom;
3003 YYFPRINTF (stderr, "Stack now");
3004 for (; bottom <= top; ++bottom)
3005 YYFPRINTF (stderr, " %d", *bottom);
3006 YYFPRINTF (stderr, "\n");
3009 # define YY_STACK_PRINT(Bottom, Top) \
3012 yy_stack_print ((Bottom), (Top)); \
3016 /*------------------------------------------------.
3017 | Report that the YYRULE is going to be reduced. |
3018 `------------------------------------------------*/
3020 #if (defined __STDC__ || defined __C99__FUNC__ \
3021 || defined __cplusplus || defined _MSC_VER)
3023 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3026 yy_reduce_print (yyvsp, yyrule)
3031 int yynrhs = yyr2[yyrule];
3033 unsigned long int yylno = yyrline[yyrule];
3034 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3036 /* The symbols being reduced. */
3037 for (yyi = 0; yyi < yynrhs; yyi++)
3039 fprintf (stderr, " $%d = ", yyi + 1);
3040 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3041 &(yyvsp[(yyi + 1) - (yynrhs)])
3043 fprintf (stderr, "\n");
3047 # define YY_REDUCE_PRINT(Rule) \
3050 yy_reduce_print (yyvsp, Rule); \
3053 /* Nonzero means print parse trace. It is left uninitialized so that
3054 multiple parsers can coexist. */
3056 #else /* !YYDEBUG */
3057 # define YYDPRINTF(Args)
3058 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3059 # define YY_STACK_PRINT(Bottom, Top)
3060 # define YY_REDUCE_PRINT(Rule)
3061 #endif /* !YYDEBUG */
3064 /* YYINITDEPTH -- initial size of the parser's stacks. */
3066 # define YYINITDEPTH 200
3069 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3070 if the built-in stack extension method is used).
3072 Do not make this value too large; the results are undefined if
3073 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3074 evaluated with infinite-precision integer arithmetic. */
3077 # define YYMAXDEPTH 10000
3085 # if defined __GLIBC__ && defined _STRING_H
3086 # define yystrlen strlen
3088 /* Return the length of YYSTR. */
3089 #if (defined __STDC__ || defined __C99__FUNC__ \
3090 || defined __cplusplus || defined _MSC_VER)
3092 yystrlen (const char *yystr)
3100 for (yylen = 0; yystr[yylen]; yylen++)
3108 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3109 # define yystpcpy stpcpy
3111 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3113 #if (defined __STDC__ || defined __C99__FUNC__ \
3114 || defined __cplusplus || defined _MSC_VER)
3116 yystpcpy (char *yydest, const char *yysrc)
3119 yystpcpy (yydest, yysrc)
3125 const char *yys = yysrc;
3127 while ((*yyd++ = *yys++) != '\0')
3136 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3137 quotes and backslashes, so that it's suitable for yyerror. The
3138 heuristic is that double-quoting is unnecessary unless the string
3139 contains an apostrophe, a comma, or backslash (other than
3140 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3141 null, do not copy; instead, return the length of what the result
3144 yytnamerr (char *yyres, const char *yystr)
3149 char const *yyp = yystr;
3156 goto do_not_strip_quotes;
3160 goto do_not_strip_quotes;
3173 do_not_strip_quotes: ;
3177 return yystrlen (yystr);
3179 return yystpcpy (yyres, yystr) - yyres;
3183 /* Copy into YYRESULT an error message about the unexpected token
3184 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3185 including the terminating null byte. If YYRESULT is null, do not
3186 copy anything; just return the number of bytes that would be
3187 copied. As a special case, return 0 if an ordinary "syntax error"
3188 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3189 size calculation. */
3191 yysyntax_error (char *yyresult, int yystate, int yychar)
3193 int yyn = yypact[yystate];
3195 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3199 int yytype = YYTRANSLATE (yychar);
3200 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3201 YYSIZE_T yysize = yysize0;
3203 int yysize_overflow = 0;
3204 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3205 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3209 /* This is so xgettext sees the translatable formats that are
3210 constructed on the fly. */
3211 YY_("syntax error, unexpected %s");
3212 YY_("syntax error, unexpected %s, expecting %s");
3213 YY_("syntax error, unexpected %s, expecting %s or %s");
3214 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3215 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3219 static char const yyunexpected[] = "syntax error, unexpected %s";
3220 static char const yyexpecting[] = ", expecting %s";
3221 static char const yyor[] = " or %s";
3222 char yyformat[sizeof yyunexpected
3223 + sizeof yyexpecting - 1
3224 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3225 * (sizeof yyor - 1))];
3226 char const *yyprefix = yyexpecting;
3228 /* Start YYX at -YYN if negative to avoid negative indexes in
3230 int yyxbegin = yyn < 0 ? -yyn : 0;
3232 /* Stay within bounds of both yycheck and yytname. */
3233 int yychecklim = YYLAST - yyn + 1;
3234 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3237 yyarg[0] = yytname[yytype];
3238 yyfmt = yystpcpy (yyformat, yyunexpected);
3240 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3241 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3243 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3247 yyformat[sizeof yyunexpected - 1] = '\0';
3250 yyarg[yycount++] = yytname[yyx];
3251 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3252 yysize_overflow |= (yysize1 < yysize);
3254 yyfmt = yystpcpy (yyfmt, yyprefix);
3258 yyf = YY_(yyformat);
3259 yysize1 = yysize + yystrlen (yyf);
3260 yysize_overflow |= (yysize1 < yysize);
3263 if (yysize_overflow)
3264 return YYSIZE_MAXIMUM;
3268 /* Avoid sprintf, as that infringes on the user's name space.
3269 Don't have undefined behavior even if the translation
3270 produced a string with the wrong number of "%s"s. */
3271 char *yyp = yyresult;
3273 while ((*yyp = *yyf) != '\0')
3275 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3277 yyp += yytnamerr (yyp, yyarg[yyi++]);
3290 #endif /* YYERROR_VERBOSE */
3293 /*-----------------------------------------------.
3294 | Release the memory associated to this symbol. |
3295 `-----------------------------------------------*/
3298 #if (defined __STDC__ || defined __C99__FUNC__ \
3299 || defined __cplusplus || defined _MSC_VER)
3301 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3304 yydestruct (yymsg, yytype, yyvaluep)
3314 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3325 /* Prevent warnings from -Wmissing-prototypes. */
3327 #ifdef YYPARSE_PARAM
3328 #if defined __STDC__ || defined __cplusplus
3329 int yyparse (void *YYPARSE_PARAM);
3333 #else /* ! YYPARSE_PARAM */
3334 #if defined __STDC__ || defined __cplusplus
3339 #endif /* ! YYPARSE_PARAM */
3343 /* The look-ahead symbol. */
3346 /* The semantic value of the look-ahead symbol. */
3349 /* Number of syntax errors so far. */
3358 #ifdef YYPARSE_PARAM
3359 #if (defined __STDC__ || defined __C99__FUNC__ \
3360 || defined __cplusplus || defined _MSC_VER)
3362 yyparse (void *YYPARSE_PARAM)
3365 yyparse (YYPARSE_PARAM)
3366 void *YYPARSE_PARAM;
3368 #else /* ! YYPARSE_PARAM */
3369 #if (defined __STDC__ || defined __C99__FUNC__ \
3370 || defined __cplusplus || defined _MSC_VER)
3384 /* Number of tokens to shift before error messages enabled. */
3386 /* Look-ahead token as an internal (translated) token number. */
3389 /* Buffer for error messages, and its allocated size. */
3391 char *yymsg = yymsgbuf;
3392 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3395 /* Three stacks and their tools:
3396 `yyss': related to states,
3397 `yyvs': related to semantic values,
3398 `yyls': related to locations.
3400 Refer to the stacks thru separate pointers, to allow yyoverflow
3401 to reallocate them elsewhere. */
3403 /* The state stack. */
3404 yytype_int16 yyssa[YYINITDEPTH];
3405 yytype_int16 *yyss = yyssa;
3406 yytype_int16 *yyssp;
3408 /* The semantic value stack. */
3409 YYSTYPE yyvsa[YYINITDEPTH];
3410 YYSTYPE *yyvs = yyvsa;
3415 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3417 YYSIZE_T yystacksize = YYINITDEPTH;
3419 /* The variables used to return semantic value and location from the
3424 /* The number of symbols on the RHS of the reduced rule.
3425 Keep to zero when no symbol should be popped. */
3428 YYDPRINTF ((stderr, "Starting parse\n"));
3433 yychar = YYEMPTY; /* Cause a token to be read. */
3435 /* Initialize stack pointers.
3436 Waste one element of value and location stack
3437 so that they stay on the same level as the state stack.
3438 The wasted elements are never initialized. */
3445 /*------------------------------------------------------------.
3446 | yynewstate -- Push a new state, which is found in yystate. |
3447 `------------------------------------------------------------*/
3449 /* In all cases, when you get here, the value and location stacks
3450 have just been pushed. So pushing a state here evens the stacks. */
3456 if (yyss + yystacksize - 1 <= yyssp)
3458 /* Get the current used size of the three stacks, in elements. */
3459 YYSIZE_T yysize = yyssp - yyss + 1;
3463 /* Give user a chance to reallocate the stack. Use copies of
3464 these so that the &'s don't force the real ones into
3466 YYSTYPE *yyvs1 = yyvs;
3467 yytype_int16 *yyss1 = yyss;
3470 /* Each stack pointer address is followed by the size of the
3471 data in use in that stack, in bytes. This used to be a
3472 conditional around just the two extra args, but that might
3473 be undefined if yyoverflow is a macro. */
3474 yyoverflow (YY_("memory exhausted"),
3475 &yyss1, yysize * sizeof (*yyssp),
3476 &yyvs1, yysize * sizeof (*yyvsp),
3483 #else /* no yyoverflow */
3484 # ifndef YYSTACK_RELOCATE
3485 goto yyexhaustedlab;
3487 /* Extend the stack our own way. */
3488 if (YYMAXDEPTH <= yystacksize)
3489 goto yyexhaustedlab;
3491 if (YYMAXDEPTH < yystacksize)
3492 yystacksize = YYMAXDEPTH;
3495 yytype_int16 *yyss1 = yyss;
3496 union yyalloc *yyptr =
3497 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3499 goto yyexhaustedlab;
3500 YYSTACK_RELOCATE (yyss);
3501 YYSTACK_RELOCATE (yyvs);
3503 # undef YYSTACK_RELOCATE
3505 YYSTACK_FREE (yyss1);
3508 #endif /* no yyoverflow */
3510 yyssp = yyss + yysize - 1;
3511 yyvsp = yyvs + yysize - 1;
3514 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3515 (unsigned long int) yystacksize));
3517 if (yyss + yystacksize - 1 <= yyssp)
3521 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3530 /* Do appropriate processing given the current state. Read a
3531 look-ahead token if we need one and don't already have one. */
3533 /* First try to decide what to do without reference to look-ahead token. */
3534 yyn = yypact[yystate];
3535 if (yyn == YYPACT_NINF)
3538 /* Not known => get a look-ahead token if don't already have one. */
3540 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3541 if (yychar == YYEMPTY)
3543 YYDPRINTF ((stderr, "Reading a token: "));
3547 if (yychar <= YYEOF)
3549 yychar = yytoken = YYEOF;
3550 YYDPRINTF ((stderr, "Now at end of input.\n"));
3554 yytoken = YYTRANSLATE (yychar);
3555 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3558 /* If the proper action on seeing token YYTOKEN is to reduce or to
3559 detect an error, take that action. */
3561 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3566 if (yyn == 0 || yyn == YYTABLE_NINF)
3575 /* Count tokens shifted since error; after three, turn off error
3580 /* Shift the look-ahead token. */
3581 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3583 /* Discard the shifted token unless it is eof. */
3584 if (yychar != YYEOF)
3593 /*-----------------------------------------------------------.
3594 | yydefault -- do the default action for the current state. |
3595 `-----------------------------------------------------------*/
3597 yyn = yydefact[yystate];
3603 /*-----------------------------.
3604 | yyreduce -- Do a reduction. |
3605 `-----------------------------*/
3607 /* yyn is the number of a rule to reduce with. */
3610 /* If YYLEN is nonzero, implement the default value of the action:
3613 Otherwise, the following line sets YYVAL to garbage.
3614 This behavior is undocumented and Bison
3615 users should not rely upon it. Assigning to YYVAL
3616 unconditionally makes the parser a bit smaller, and it avoids a
3617 GCC warning that YYVAL may be used uninitialized. */
3618 yyval = yyvsp[1-yylen];
3621 YY_REDUCE_PRINT (yyn);
3625 #line 1138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3626 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3630 #line 1138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3631 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3635 #line 1139 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3636 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3640 #line 1139 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3641 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3645 #line 1140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3646 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3650 #line 1140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3651 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3655 #line 1141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3656 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3660 #line 1141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3661 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3665 #line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3666 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3670 #line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3671 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3675 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3676 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3680 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3681 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3685 #line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3686 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3690 #line 1147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3691 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3695 #line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3696 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3700 #line 1148 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3701 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3705 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3706 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3710 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3711 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3715 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3716 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3720 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3721 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3725 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3726 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3730 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3731 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3735 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3736 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3740 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3741 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3745 #line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3746 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3750 #line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3751 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3755 #line 1163 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3756 { (yyval.StrVal) = 0; ;}
3760 #line 1165 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3761 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3765 #line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3766 { (yyval.UIntVal)=0; ;}
3770 #line 1170 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3772 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3778 #line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3786 #line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3794 #line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3796 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3802 #line 1193 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3803 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3807 #line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3808 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3812 #line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3813 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3817 #line 1196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3818 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3822 #line 1197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3823 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3827 #line 1198 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3828 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3832 #line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3833 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3837 #line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3838 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3842 #line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3843 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3847 #line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3848 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3852 #line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3853 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3857 #line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3858 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3862 #line 1211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3863 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3867 #line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3868 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3872 #line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3873 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3877 #line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3878 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3882 #line 1221 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3883 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3887 #line 1222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3888 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3892 #line 1223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3893 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3897 #line 1224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3898 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3902 #line 1225 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3903 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3907 #line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3908 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3912 #line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3913 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3917 #line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3918 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3922 #line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3923 { (yyval.UIntVal) = CallingConv::C; ;}
3927 #line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3928 { (yyval.UIntVal) = CallingConv::C; ;}
3932 #line 1236 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3933 { (yyval.UIntVal) = CallingConv::Fast; ;}
3937 #line 1237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3938 { (yyval.UIntVal) = CallingConv::Cold; ;}
3942 #line 1238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3943 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3947 #line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3948 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3952 #line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3954 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3955 GEN_ERROR("Calling conv too large");
3956 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3962 #line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3963 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3967 #line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3968 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3972 #line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3973 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3977 #line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3978 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3982 #line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3983 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3987 #line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3988 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3992 #line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3993 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
3997 #line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3998 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
4002 #line 1255 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4003 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
4007 #line 1256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4008 { (yyval.ParamAttrs) =
4009 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4013 #line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4014 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4018 #line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4020 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4025 #line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4026 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4030 #line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4031 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4035 #line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4036 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4040 #line 1269 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4041 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4045 #line 1270 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4046 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4050 #line 1271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4051 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4055 #line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4056 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4060 #line 1275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4062 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4067 #line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4068 { (yyval.StrVal) = 0; ;}
4072 #line 1281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4074 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4079 #line 1288 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4080 { (yyval.UIntVal) = 0; ;}
4084 #line 1289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4086 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4087 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4088 GEN_ERROR("Alignment must be a power of two");
4094 #line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4095 { (yyval.UIntVal) = 0; ;}
4099 #line 1296 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4101 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4102 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4103 GEN_ERROR("Alignment must be a power of two");
4109 #line 1305 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4111 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4112 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4113 GEN_ERROR("Invalid character in section name");
4114 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4120 #line 1313 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4121 { (yyval.StrVal) = 0; ;}
4125 #line 1314 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4126 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4130 #line 1319 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4135 #line 1320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4140 #line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4142 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4143 delete (yyvsp[(1) - (1)].StrVal);
4149 #line 1326 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4151 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4152 GEN_ERROR("Alignment must be a power of two");
4153 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4159 #line 1342 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4161 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4167 #line 1346 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4169 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4175 #line 1350 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4177 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4178 GEN_ERROR("Cannot form a pointer to a basic block");
4179 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4180 delete (yyvsp[(1) - (3)].TypeVal);
4186 #line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4187 { // Named types are also simple types...
4188 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4190 (yyval.TypeVal) = new PATypeHolder(tmp);
4195 #line 1362 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4196 { // Type UpReference
4197 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4198 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4199 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4200 (yyval.TypeVal) = new PATypeHolder(OT);
4201 UR_OUT("New Upreference!\n");
4207 #line 1370 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4209 // Allow but ignore attributes on function types; this permits auto-upgrade.
4210 // FIXME: remove in LLVM 3.0.
4211 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4212 if (!FunctionType::isValidReturnType(RetTy))
4213 GEN_ERROR("Invalid result type for LLVM function");
4215 std::vector<const Type*> Params;
4216 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4217 for (; I != E; ++I ) {
4218 const Type *Ty = I->Ty->get();
4219 Params.push_back(Ty);
4222 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4223 if (isVarArg) Params.pop_back();
4225 for (unsigned i = 0; i != Params.size(); ++i)
4226 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4227 GEN_ERROR("Function arguments must be value types!");
4231 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4232 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4233 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4234 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4240 #line 1399 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4242 // Allow but ignore attributes on function types; this permits auto-upgrade.
4243 // FIXME: remove in LLVM 3.0.
4244 std::vector<const Type*> Params;
4245 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4246 for ( ; I != E; ++I ) {
4247 const Type* Ty = I->Ty->get();
4248 Params.push_back(Ty);
4251 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4252 if (isVarArg) Params.pop_back();
4254 for (unsigned i = 0; i != Params.size(); ++i)
4255 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4256 GEN_ERROR("Function arguments must be value types!");
4260 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4261 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4262 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4268 #line 1424 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4269 { // Sized array type?
4270 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4271 delete (yyvsp[(4) - (5)].TypeVal);
4277 #line 1429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4279 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4280 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4281 GEN_ERROR("Unsigned result not equal to signed result");
4282 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4283 GEN_ERROR("Element type of a VectorType must be primitive");
4284 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4285 delete (yyvsp[(4) - (5)].TypeVal);
4291 #line 1439 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4292 { // Structure type?
4293 std::vector<const Type*> Elements;
4294 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4295 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4296 Elements.push_back(*I);
4298 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4299 delete (yyvsp[(2) - (3)].TypeList);
4305 #line 1449 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4306 { // Empty structure type?
4307 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4313 #line 1453 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4315 std::vector<const Type*> Elements;
4316 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4317 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4318 Elements.push_back(*I);
4320 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4321 delete (yyvsp[(3) - (5)].TypeList);
4327 #line 1463 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4328 { // Empty structure type?
4329 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4335 #line 1470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4337 // Allow but ignore attributes on function types; this permits auto-upgrade.
4338 // FIXME: remove in LLVM 3.0.
4339 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4340 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4345 #line 1479 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4347 if (!UpRefs.empty())
4348 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4349 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4350 GEN_ERROR("LLVM functions cannot return aggregate types");
4351 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4356 #line 1486 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4358 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4363 #line 1491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4365 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4366 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4372 #line 1496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4374 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4380 #line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4382 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4383 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4384 TWA.Ty = new PATypeHolder(Type::VoidTy);
4385 (yyval.TypeWithAttrsList)->push_back(TWA);
4391 #line 1511 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4393 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4394 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4395 TWA.Ty = new PATypeHolder(Type::VoidTy);
4396 (yyval.TypeWithAttrsList)->push_back(TWA);
4402 #line 1518 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4404 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4410 #line 1526 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4412 (yyval.TypeList) = new std::list<PATypeHolder>();
4413 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4414 delete (yyvsp[(1) - (1)].TypeVal);
4420 #line 1532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4422 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4423 delete (yyvsp[(3) - (3)].TypeVal);
4429 #line 1544 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4430 { // Nonempty unsized arr
4431 if (!UpRefs.empty())
4432 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4433 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4435 GEN_ERROR("Cannot make array constant with type: '" +
4436 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4437 const Type *ETy = ATy->getElementType();
4438 uint64_t NumElements = ATy->getNumElements();
4440 // Verify that we have the correct size...
4441 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4442 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4443 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4444 utostr(NumElements) + "");
4446 // Verify all elements are correct type!
4447 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4448 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4449 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4450 ETy->getDescription() +"' as required!\nIt is of type '"+
4451 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4454 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4455 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4461 #line 1572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4463 if (!UpRefs.empty())
4464 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4465 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4467 GEN_ERROR("Cannot make array constant with type: '" +
4468 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4470 uint64_t NumElements = ATy->getNumElements();
4471 if (NumElements != uint64_t(-1) && NumElements != 0)
4472 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4473 " arguments, but has size of " + utostr(NumElements) +"");
4474 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4475 delete (yyvsp[(1) - (3)].TypeVal);
4481 #line 1588 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4483 if (!UpRefs.empty())
4484 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4485 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4487 GEN_ERROR("Cannot make array constant with type: '" +
4488 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4490 uint64_t NumElements = ATy->getNumElements();
4491 const Type *ETy = ATy->getElementType();
4492 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4493 GEN_ERROR("Can't build string constant of size " +
4494 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4495 " when array has size " + utostr(NumElements) + "");
4496 std::vector<Constant*> Vals;
4497 if (ETy == Type::Int8Ty) {
4498 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4499 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4501 delete (yyvsp[(3) - (3)].StrVal);
4502 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4504 delete (yyvsp[(3) - (3)].StrVal);
4505 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4506 delete (yyvsp[(1) - (3)].TypeVal);
4512 #line 1615 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4513 { // Nonempty unsized arr
4514 if (!UpRefs.empty())
4515 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4516 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4518 GEN_ERROR("Cannot make packed constant with type: '" +
4519 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4520 const Type *ETy = PTy->getElementType();
4521 unsigned NumElements = PTy->getNumElements();
4523 // Verify that we have the correct size...
4524 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4525 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4526 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4527 utostr(NumElements) + "");
4529 // Verify all elements are correct type!
4530 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4531 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4532 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4533 ETy->getDescription() +"' as required!\nIt is of type '"+
4534 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4537 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4538 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4544 #line 1643 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4546 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4548 GEN_ERROR("Cannot make struct constant with type: '" +
4549 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4551 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4552 GEN_ERROR("Illegal number of initializers for structure type");
4554 // Check to ensure that constants are compatible with the type initializer!
4555 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4556 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4557 GEN_ERROR("Expected type '" +
4558 STy->getElementType(i)->getDescription() +
4559 "' for element #" + utostr(i) +
4560 " of structure initializer");
4562 // Check to ensure that Type is not packed
4563 if (STy->isPacked())
4564 GEN_ERROR("Unpacked Initializer to vector type '" +
4565 STy->getDescription() + "'");
4567 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4568 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4574 #line 1669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4576 if (!UpRefs.empty())
4577 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4578 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4580 GEN_ERROR("Cannot make struct constant with type: '" +
4581 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4583 if (STy->getNumContainedTypes() != 0)
4584 GEN_ERROR("Illegal number of initializers for structure type");
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, std::vector<Constant*>());
4592 delete (yyvsp[(1) - (3)].TypeVal);
4598 #line 1689 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4600 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4602 GEN_ERROR("Cannot make struct constant with type: '" +
4603 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4605 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4606 GEN_ERROR("Illegal number of initializers for structure type");
4608 // Check to ensure that constants are compatible with the type initializer!
4609 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4610 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4611 GEN_ERROR("Expected type '" +
4612 STy->getElementType(i)->getDescription() +
4613 "' for element #" + utostr(i) +
4614 " of structure initializer");
4616 // Check to ensure that Type is packed
4617 if (!STy->isPacked())
4618 GEN_ERROR("Vector initializer to non-vector type '" +
4619 STy->getDescription() + "'");
4621 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4622 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4628 #line 1715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4630 if (!UpRefs.empty())
4631 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4632 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4634 GEN_ERROR("Cannot make struct constant with type: '" +
4635 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4637 if (STy->getNumContainedTypes() != 0)
4638 GEN_ERROR("Illegal number of initializers for structure type");
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, std::vector<Constant*>());
4646 delete (yyvsp[(1) - (5)].TypeVal);
4652 #line 1735 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4654 if (!UpRefs.empty())
4655 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4656 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4658 GEN_ERROR("Cannot make null pointer constant with type: '" +
4659 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4661 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4662 delete (yyvsp[(1) - (2)].TypeVal);
4668 #line 1747 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4670 if (!UpRefs.empty())
4671 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4672 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4673 delete (yyvsp[(1) - (2)].TypeVal);
4679 #line 1754 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4681 if (!UpRefs.empty())
4682 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4683 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4685 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4687 // ConstExprs can exist in the body of a function, thus creating
4688 // GlobalValues whenever they refer to a variable. Because we are in
4689 // the context of a function, getExistingVal will search the functions
4690 // symbol table instead of the module symbol table for the global symbol,
4691 // which throws things all off. To get around this, we just tell
4692 // getExistingVal that we are at global scope here.
4694 Function *SavedCurFn = CurFun.CurrentFunction;
4695 CurFun.CurrentFunction = 0;
4697 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4700 CurFun.CurrentFunction = SavedCurFn;
4702 // If this is an initializer for a constant pointer, which is referencing a
4703 // (currently) undefined variable, create a stub now that shall be replaced
4704 // in the future with the right type of variable.
4707 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4708 const PointerType *PT = cast<PointerType>(Ty);
4710 // First check to see if the forward references value is already created!
4711 PerModuleInfo::GlobalRefsType::iterator I =
4712 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4714 if (I != CurModule.GlobalRefs.end()) {
4715 V = I->second; // Placeholder already exists, use it...
4716 (yyvsp[(2) - (2)].ValIDVal).destroy();
4719 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4720 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4721 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4722 GEN_ERROR("Invalid reference to global");
4724 // Create the forward referenced global.
4726 if (const FunctionType *FTy =
4727 dyn_cast<FunctionType>(PT->getElementType())) {
4728 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4729 CurModule.CurrentModule);
4731 GV = new GlobalVariable(PT->getElementType(), false,
4732 GlobalValue::ExternalWeakLinkage, 0,
4733 Name, CurModule.CurrentModule);
4736 // Keep track of the fact that we have a forward ref to recycle it
4737 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4742 (yyval.ConstVal) = cast<GlobalValue>(V);
4743 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4749 #line 1820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4751 if (!UpRefs.empty())
4752 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4753 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4754 GEN_ERROR("Mismatched types for constant expression: " +
4755 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4756 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4757 delete (yyvsp[(1) - (2)].TypeVal);
4763 #line 1830 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4765 if (!UpRefs.empty())
4766 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4767 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4768 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4769 GEN_ERROR("Cannot create a null initialized value of this type");
4770 (yyval.ConstVal) = Constant::getNullValue(Ty);
4771 delete (yyvsp[(1) - (2)].TypeVal);
4777 #line 1840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4778 { // integral constants
4779 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4780 GEN_ERROR("Constant value doesn't fit in type");
4781 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4787 #line 1846 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4788 { // arbitrary precision integer constants
4789 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4790 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4791 GEN_ERROR("Constant value does not fit in type");
4793 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4794 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4795 delete (yyvsp[(2) - (2)].APIntVal);
4801 #line 1856 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4802 { // integral constants
4803 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4804 GEN_ERROR("Constant value doesn't fit in type");
4805 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4811 #line 1862 "/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)->zextOrTrunc(BitWidth);
4818 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4819 delete (yyvsp[(2) - (2)].APIntVal);
4825 #line 1872 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4826 { // Boolean constants
4827 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4828 GEN_ERROR("Constant true must have type i1");
4829 (yyval.ConstVal) = ConstantInt::getTrue();
4835 #line 1878 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4836 { // Boolean constants
4837 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4838 GEN_ERROR("Constant false must have type i1");
4839 (yyval.ConstVal) = ConstantInt::getFalse();
4845 #line 1884 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4846 { // Floating point constants
4847 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4848 GEN_ERROR("Floating point constant invalid for type");
4849 // Lexer has no type info, so builds all float and double FP constants
4850 // as double. Fix this here. Long double is done right.
4851 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4852 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4853 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4854 delete (yyvsp[(2) - (2)].FPVal);
4860 #line 1897 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4862 if (!UpRefs.empty())
4863 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4864 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4865 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4866 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4867 GEN_ERROR("invalid cast opcode for cast from '" +
4868 Val->getType()->getDescription() + "' to '" +
4869 DestTy->getDescription() + "'");
4870 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4871 delete (yyvsp[(5) - (6)].TypeVal);
4876 #line 1909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4878 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4879 GEN_ERROR("GetElementPtr requires a pointer operand");
4882 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4884 GEN_ERROR("Index list invalid for constant getelementptr");
4886 SmallVector<Constant*, 8> IdxVec;
4887 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4888 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4889 IdxVec.push_back(C);
4891 GEN_ERROR("Indices to constant getelementptr must be constants");
4893 delete (yyvsp[(4) - (5)].ValueList);
4895 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4901 #line 1930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4903 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4904 GEN_ERROR("Select condition must be of boolean type");
4905 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4906 GEN_ERROR("Select operand types must match");
4907 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4913 #line 1938 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4915 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4916 GEN_ERROR("Binary operator types must match");
4918 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4923 #line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4925 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4926 GEN_ERROR("Logical operator types must match");
4927 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4928 if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4929 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4930 GEN_ERROR("Logical operator requires integral operands");
4932 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4938 #line 1955 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4940 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4941 GEN_ERROR("icmp operand types must match");
4942 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4947 #line 1960 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4949 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4950 GEN_ERROR("fcmp operand types must match");
4951 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4956 #line 1965 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4958 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4959 GEN_ERROR("vicmp operand types must match");
4960 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4965 #line 1970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4967 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4968 GEN_ERROR("vfcmp operand types must match");
4969 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4974 #line 1975 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4976 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4977 GEN_ERROR("Invalid extractelement operands");
4978 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4984 #line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4986 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4987 GEN_ERROR("Invalid insertelement operands");
4988 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4994 #line 1987 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4996 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4997 GEN_ERROR("Invalid shufflevector operands");
4998 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5004 #line 1993 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5006 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5007 GEN_ERROR("ExtractValue requires an aggregate operand");
5009 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5010 delete (yyvsp[(4) - (5)].ConstantList);
5016 #line 2001 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5018 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5019 GEN_ERROR("InsertValue requires an aggregate operand");
5021 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5022 delete (yyvsp[(6) - (7)].ConstantList);
5028 #line 2012 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5030 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5036 #line 2016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5038 (yyval.ConstVector) = new std::vector<Constant*>();
5039 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5045 #line 2024 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5046 { (yyval.BoolVal) = false; ;}
5050 #line 2024 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5051 { (yyval.BoolVal) = true; ;}
5055 #line 2027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5056 { (yyval.BoolVal) = true; ;}
5060 #line 2027 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5061 { (yyval.BoolVal) = false; ;}
5065 #line 2030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5067 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5068 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5070 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5072 GEN_ERROR("Aliases can be created only to global values");
5074 (yyval.ConstVal) = Aliasee;
5076 delete (yyvsp[(1) - (2)].TypeVal);
5081 #line 2042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5083 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5084 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5085 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5086 GEN_ERROR("invalid cast opcode for cast from '" +
5087 Val->getType()->getDescription() + "' to '" +
5088 DestTy->getDescription() + "'");
5090 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5092 delete (yyvsp[(5) - (6)].TypeVal);
5097 #line 2063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5099 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5100 CurModule.ModuleDone();
5106 #line 2068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5108 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5109 CurModule.ModuleDone();
5115 #line 2081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5116 { CurFun.isDeclare = false; ;}
5120 #line 2081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5122 CurFun.FunctionDone();
5128 #line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5129 { CurFun.isDeclare = true; ;}
5133 #line 2085 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5140 #line 2088 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5147 #line 2091 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5149 if (!UpRefs.empty())
5150 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5151 // Eagerly resolve types. This is not an optimization, this is a
5152 // requirement that is due to the fact that we could have this:
5154 // %list = type { %list * }
5155 // %list = type { %list * } ; repeated type decl
5157 // If types are not resolved eagerly, then the two types will not be
5158 // determined to be the same type!
5160 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5162 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5164 // If this is a named type that is not a redefinition, add it to the slot
5166 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5169 delete (yyvsp[(3) - (3)].TypeVal);
5175 #line 2115 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5177 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5179 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5181 // If this is a named type that is not a redefinition, add it to the slot
5183 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5190 #line 2127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5192 /* "Externally Visible" Linkage */
5193 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5194 GEN_ERROR("Global value initializer is not a constant");
5195 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5196 (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));
5202 #line 2134 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5209 #line 2138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5211 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5212 GEN_ERROR("Global value initializer is not a constant");
5213 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));
5219 #line 2143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5226 #line 2147 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5228 if (!UpRefs.empty())
5229 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5230 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));
5232 delete (yyvsp[(6) - (7)].TypeVal);
5237 #line 2153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5245 #line 2157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5248 if ((yyvsp[(1) - (5)].StrVal)) {
5249 Name = *(yyvsp[(1) - (5)].StrVal);
5250 delete (yyvsp[(1) - (5)].StrVal);
5253 GEN_ERROR("Alias name cannot be empty");
5255 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5257 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5259 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5260 CurModule.CurrentModule);
5261 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5262 InsertValue(GA, CurModule.Values);
5265 // If there was a forward reference of this alias, resolve it now.
5269 ID = ValID::createGlobalName(Name);
5271 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5273 if (GlobalValue *FWGV =
5274 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5275 // Replace uses of the fwdref with the actual alias.
5276 FWGV->replaceAllUsesWith(GA);
5277 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5278 GV->eraseFromParent();
5280 cast<Function>(FWGV)->eraseFromParent();
5289 #line 2197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5296 #line 2200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5303 #line 2206 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5305 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5306 if (AsmSoFar.empty())
5307 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5309 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5310 delete (yyvsp[(1) - (1)].StrVal);
5316 #line 2216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5318 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5319 delete (yyvsp[(3) - (3)].StrVal);
5324 #line 2220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5326 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5327 delete (yyvsp[(3) - (3)].StrVal);
5332 #line 2227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5334 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5335 delete (yyvsp[(3) - (3)].StrVal);
5341 #line 2232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5343 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5344 delete (yyvsp[(1) - (1)].StrVal);
5350 #line 2237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5357 #line 2246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5359 if (!UpRefs.empty())
5360 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5361 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5362 GEN_ERROR("Argument types must be first-class");
5363 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5364 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5365 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5371 #line 2256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5373 if (!UpRefs.empty())
5374 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5375 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5376 GEN_ERROR("Argument types must be first-class");
5377 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5378 (yyval.ArgList) = new ArgListType;
5379 (yyval.ArgList)->push_back(E);
5385 #line 2267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5387 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5393 #line 2271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5395 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5396 struct ArgListEntry E;
5397 E.Ty = new PATypeHolder(Type::VoidTy);
5399 E.Attrs = ParamAttr::None;
5400 (yyval.ArgList)->push_back(E);
5406 #line 2280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5408 (yyval.ArgList) = new ArgListType;
5409 struct ArgListEntry E;
5410 E.Ty = new PATypeHolder(Type::VoidTy);
5412 E.Attrs = ParamAttr::None;
5413 (yyval.ArgList)->push_back(E);
5419 #line 2289 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5421 (yyval.ArgList) = 0;
5427 #line 2295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5429 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5430 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5432 // Check the function result for abstractness if this is a define. We should
5433 // have no abstract types at this point
5434 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5435 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5437 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
5438 GEN_ERROR("Invalid result type for LLVM function");
5440 std::vector<const Type*> ParamTypeList;
5441 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5442 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5443 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
5444 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5446 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5447 const Type* Ty = I->Ty->get();
5448 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5449 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5450 ParamTypeList.push_back(Ty);
5451 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5452 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5456 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5457 if (isVarArg) ParamTypeList.pop_back();
5461 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5463 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5464 const PointerType *PFT = PointerType::getUnqual(FT);
5465 delete (yyvsp[(2) - (10)].TypeVal);
5468 if (!FunctionName.empty()) {
5469 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5471 ID = ValID::createGlobalID(CurModule.Values.size());
5475 // See if this function was forward referenced. If so, recycle the object.
5476 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5477 // Move the function to the end of the list, from whereever it was
5478 // previously inserted.
5479 Fn = cast<Function>(FWRef);
5480 assert(Fn->getParamAttrs().isEmpty() &&
5481 "Forward reference has parameter attributes!");
5482 CurModule.CurrentModule->getFunctionList().remove(Fn);
5483 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5484 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5485 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5486 if (Fn->getFunctionType() != FT ) {
5487 // The existing function doesn't have the same type. This is an overload
5489 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5490 } else if (Fn->getParamAttrs() != PAL) {
5491 // The existing function doesn't have the same parameter attributes.
5492 // This is an overload error.
5493 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5494 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5495 // Neither the existing or the current function is a declaration and they
5496 // have the same name and same type. Clearly this is a redefinition.
5497 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5498 } else if (Fn->isDeclaration()) {
5499 // Make sure to strip off any argument names so we can't get conflicts.
5500 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5504 } else { // Not already defined?
5505 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5506 CurModule.CurrentModule);
5507 InsertValue(Fn, CurModule.Values);
5510 CurFun.FunctionStart(Fn);
5512 if (CurFun.isDeclare) {
5513 // If we have declaration, always overwrite linkage. This will allow us to
5514 // correctly handle cases, when pointer to function is passed as argument to
5515 // another function.
5516 Fn->setLinkage(CurFun.Linkage);
5517 Fn->setVisibility(CurFun.Visibility);
5519 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5520 Fn->setParamAttrs(PAL);
5521 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5522 if ((yyvsp[(8) - (10)].StrVal)) {
5523 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5524 delete (yyvsp[(8) - (10)].StrVal);
5526 if ((yyvsp[(10) - (10)].StrVal)) {
5527 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5528 delete (yyvsp[(10) - (10)].StrVal);
5531 // Add all of the arguments we parsed to the function...
5532 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5533 if (isVarArg) { // Nuke the last entry
5534 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5535 "Not a varargs marker!");
5536 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5537 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5539 Function::arg_iterator ArgIt = Fn->arg_begin();
5540 Function::arg_iterator ArgEnd = Fn->arg_end();
5542 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5543 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5544 delete I->Ty; // Delete the typeholder...
5545 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5551 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5558 #line 2425 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5560 (yyval.FunctionVal) = CurFun.CurrentFunction;
5562 // Make sure that we keep track of the linkage type even if there was a
5563 // previous "declare".
5564 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5565 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5570 #line 2436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5572 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5578 #line 2441 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5580 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5581 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5582 (yyval.FunctionVal) = CurFun.CurrentFunction;
5583 CurFun.FunctionDone();
5589 #line 2453 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5591 (yyval.BoolVal) = false;
5597 #line 2457 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5599 (yyval.BoolVal) = true;
5605 #line 2462 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5606 { // A reference to a direct constant
5607 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5613 #line 2466 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5615 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5621 #line 2470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5622 { // arbitrary precision integer constants
5623 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5624 delete (yyvsp[(1) - (1)].APIntVal);
5630 #line 2475 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5631 { // arbitrary precision integer constants
5632 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5633 delete (yyvsp[(1) - (1)].APIntVal);
5639 #line 2480 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5640 { // Perhaps it's an FP constant?
5641 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5647 #line 2484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5649 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5655 #line 2488 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5657 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5663 #line 2492 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5665 (yyval.ValIDVal) = ValID::createNull();
5671 #line 2496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5673 (yyval.ValIDVal) = ValID::createUndef();
5679 #line 2500 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5680 { // A vector zero constant.
5681 (yyval.ValIDVal) = ValID::createZeroInit();
5687 #line 2504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5688 { // Nonempty unsized packed vector
5689 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5690 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5692 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5693 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5695 VectorType* pt = VectorType::get(ETy, NumElements);
5696 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5698 // Verify all elements are correct type!
5699 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5700 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5701 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5702 ETy->getDescription() +"' as required!\nIt is of type '" +
5703 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5706 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5707 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5713 #line 2526 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5714 { // Nonempty unsized arr
5715 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5716 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5718 if (!ETy->isFirstClassType())
5719 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5721 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5722 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5724 // Verify all elements are correct type!
5725 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5726 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5727 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5728 ETy->getDescription() +"' as required!\nIt is of type '"+
5729 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5732 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5733 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5739 #line 2548 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5741 // Use undef instead of an array because it's inconvenient to determine
5742 // the element type at this point, there being no elements to examine.
5743 (yyval.ValIDVal) = ValID::createUndef();
5749 #line 2554 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5751 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5752 const Type *ETy = Type::Int8Ty;
5754 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5756 std::vector<Constant*> Vals;
5757 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5758 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5759 delete (yyvsp[(2) - (2)].StrVal);
5760 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5766 #line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5768 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5769 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5770 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5772 const StructType *STy = StructType::get(Elements);
5773 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5775 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5776 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5782 #line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5784 const StructType *STy = StructType::get(std::vector<const Type*>());
5785 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5791 #line 2584 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5793 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5794 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5795 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5797 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5798 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5800 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5801 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5807 #line 2596 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5809 const StructType *STy = StructType::get(std::vector<const Type*>(),
5811 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5817 #line 2602 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5819 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5825 #line 2606 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5827 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5828 delete (yyvsp[(3) - (5)].StrVal);
5829 delete (yyvsp[(5) - (5)].StrVal);
5835 #line 2616 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5836 { // Is it an integer reference...?
5837 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5843 #line 2620 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5845 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5851 #line 2624 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5852 { // Is it a named reference...?
5853 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5854 delete (yyvsp[(1) - (1)].StrVal);
5860 #line 2629 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5861 { // Is it a named reference...?
5862 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5863 delete (yyvsp[(1) - (1)].StrVal);
5869 #line 2642 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5871 if (!UpRefs.empty())
5872 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5873 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5874 delete (yyvsp[(1) - (2)].TypeVal);
5880 #line 2651 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5882 (yyval.ValueList) = new std::vector<Value *>();
5883 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5889 #line 2656 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5891 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
5897 #line 2661 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5899 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5905 #line 2665 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5906 { // Do not allow functions with 0 basic blocks
5907 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5913 #line 2674 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5915 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5917 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5918 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5919 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5925 #line 2683 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5927 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5928 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5929 if (CI2->getParent() == 0)
5930 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5931 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5932 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5938 #line 2692 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5939 { // Empty space between instruction lists
5940 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5946 #line 2696 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5947 { // Labelled (named) basic block
5948 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5949 delete (yyvsp[(1) - (1)].StrVal);
5956 #line 2704 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5957 { // Return with a result...
5958 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
5959 assert(!VL.empty() && "Invalid ret operands!");
5960 (yyval.TermInstVal) = ReturnInst::Create(&VL[0], VL.size());
5961 delete (yyvsp[(2) - (2)].ValueList);
5967 #line 2711 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5968 { // Return with no result...
5969 (yyval.TermInstVal) = ReturnInst::Create();
5975 #line 2715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5976 { // Unconditional Branch...
5977 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5979 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
5984 #line 2720 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5986 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
5987 GEN_ERROR("Branch condition must have type i1");
5988 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5990 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5992 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5994 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
5999 #line 2731 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6001 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6003 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6005 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6006 (yyval.TermInstVal) = S;
6008 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6009 E = (yyvsp[(8) - (9)].JumpTable)->end();
6010 for (; I != E; ++I) {
6011 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6012 S->addCase(CI, I->second);
6014 GEN_ERROR("Switch case is constant, but not a simple integer");
6016 delete (yyvsp[(8) - (9)].JumpTable);
6022 #line 2750 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6024 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6026 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6028 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6029 (yyval.TermInstVal) = S;
6035 #line 2760 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6038 // Handle the short syntax
6039 const PointerType *PFTy = 0;
6040 const FunctionType *Ty = 0;
6041 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
6042 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6043 // Pull out the types of all of the arguments...
6044 std::vector<const Type*> ParamTypes;
6045 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6046 for (; I != E; ++I) {
6047 const Type *Ty = I->Val->getType();
6048 if (Ty == Type::VoidTy)
6049 GEN_ERROR("Short call syntax cannot be used with varargs");
6050 ParamTypes.push_back(Ty);
6053 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6054 GEN_ERROR("Invalid result type for LLVM function");
6056 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6057 PFTy = PointerType::getUnqual(Ty);
6060 delete (yyvsp[(3) - (14)].TypeVal);
6062 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
6064 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6066 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6069 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6070 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6071 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6073 // Check the arguments
6075 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
6076 // Make sure no arguments is a good thing!
6077 if (Ty->getNumParams() != 0)
6078 GEN_ERROR("No arguments passed to a function that "
6079 "expects arguments");
6080 } else { // Has arguments?
6081 // Loop through FunctionType's arguments and ensure they are specified
6083 FunctionType::param_iterator I = Ty->param_begin();
6084 FunctionType::param_iterator E = Ty->param_end();
6085 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6088 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6089 if (ArgI->Val->getType() != *I)
6090 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6091 (*I)->getDescription() + "'");
6092 Args.push_back(ArgI->Val);
6093 if (ArgI->Attrs != ParamAttr::None)
6094 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6097 if (Ty->isVarArg()) {
6099 for (; ArgI != ArgE; ++ArgI, ++index) {
6100 Args.push_back(ArgI->Val); // push the remaining varargs
6101 if (ArgI->Attrs != ParamAttr::None)
6102 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6104 } else if (I != E || ArgI != ArgE)
6105 GEN_ERROR("Invalid number of parameters detected");
6110 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6112 // Create the InvokeInst
6113 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6114 Args.begin(), Args.end());
6115 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6116 II->setParamAttrs(PAL);
6117 (yyval.TermInstVal) = II;
6118 delete (yyvsp[(6) - (14)].ParamList);
6124 #line 2845 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6126 (yyval.TermInstVal) = new UnwindInst();
6132 #line 2849 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6134 (yyval.TermInstVal) = new UnreachableInst();
6140 #line 2856 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6142 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6143 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6146 GEN_ERROR("May only switch on a constant pool value");
6148 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6150 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6155 #line 2867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6157 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6158 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6162 GEN_ERROR("May only switch on a constant pool value");
6164 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6166 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6171 #line 2880 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6173 // Is this definition named?? if so, assign the name...
6174 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6176 InsertValue((yyvsp[(2) - (2)].InstVal));
6177 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6183 #line 2890 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6184 { // Used for PHI nodes
6185 if (!UpRefs.empty())
6186 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6187 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6188 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6190 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6192 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6193 delete (yyvsp[(1) - (6)].TypeVal);
6198 #line 2901 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6200 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6201 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6203 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6205 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6210 #line 2911 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6212 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6213 if (!UpRefs.empty())
6214 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6215 // Used for call and invoke instructions
6216 (yyval.ParamList) = new ParamList();
6217 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6218 (yyval.ParamList)->push_back(E);
6219 delete (yyvsp[(1) - (4)].TypeVal);
6225 #line 2922 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6227 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6228 // Labels are only valid in ASMs
6229 (yyval.ParamList) = new ParamList();
6230 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6231 (yyval.ParamList)->push_back(E);
6237 #line 2930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6239 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6240 if (!UpRefs.empty())
6241 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6242 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6243 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6244 (yyval.ParamList)->push_back(E);
6245 delete (yyvsp[(3) - (6)].TypeVal);
6251 #line 2940 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6253 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6254 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6255 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6256 (yyval.ParamList)->push_back(E);
6262 #line 2947 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6263 { (yyval.ParamList) = new ParamList(); ;}
6267 #line 2950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6268 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6272 #line 2951 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6274 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6275 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6281 #line 2959 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6283 (yyval.ConstantList) = new std::vector<unsigned>();
6284 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6285 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6286 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6291 #line 2965 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6293 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6294 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6295 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6296 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6302 #line 2974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6304 (yyval.BoolVal) = true;
6310 #line 2978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6312 (yyval.BoolVal) = false;
6318 #line 2983 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6320 if (!UpRefs.empty())
6321 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6322 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6323 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6325 "Arithmetic operator requires integer, FP, or packed operands");
6326 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6328 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6330 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6331 if ((yyval.InstVal) == 0)
6332 GEN_ERROR("binary operator returned null");
6333 delete (yyvsp[(2) - (5)].TypeVal);
6338 #line 2999 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6340 if (!UpRefs.empty())
6341 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6342 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6343 if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6344 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6345 GEN_ERROR("Logical operator requires integral operands");
6347 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6349 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6351 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6352 if ((yyval.InstVal) == 0)
6353 GEN_ERROR("binary operator returned null");
6354 delete (yyvsp[(2) - (5)].TypeVal);
6359 #line 3016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6361 if (!UpRefs.empty())
6362 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6363 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6364 GEN_ERROR("Vector types not supported by icmp instruction");
6365 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6367 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6369 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6370 if ((yyval.InstVal) == 0)
6371 GEN_ERROR("icmp operator returned null");
6372 delete (yyvsp[(3) - (6)].TypeVal);
6377 #line 3030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6379 if (!UpRefs.empty())
6380 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6381 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6382 GEN_ERROR("Vector types not supported by fcmp instruction");
6383 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6385 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6387 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6388 if ((yyval.InstVal) == 0)
6389 GEN_ERROR("fcmp operator returned null");
6390 delete (yyvsp[(3) - (6)].TypeVal);
6395 #line 3044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6397 if (!UpRefs.empty())
6398 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6399 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6400 GEN_ERROR("Scalar types not supported by vicmp instruction");
6401 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6403 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6405 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6406 if ((yyval.InstVal) == 0)
6407 GEN_ERROR("icmp operator returned null");
6408 delete (yyvsp[(3) - (6)].TypeVal);
6413 #line 3058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6415 if (!UpRefs.empty())
6416 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6417 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6418 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6419 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6421 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6423 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6424 if ((yyval.InstVal) == 0)
6425 GEN_ERROR("fcmp operator returned null");
6426 delete (yyvsp[(3) - (6)].TypeVal);
6431 #line 3072 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6433 if (!UpRefs.empty())
6434 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6435 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6436 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6437 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6438 GEN_ERROR("invalid cast opcode for cast from '" +
6439 Val->getType()->getDescription() + "' to '" +
6440 DestTy->getDescription() + "'");
6441 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6442 delete (yyvsp[(4) - (4)].TypeVal);
6447 #line 3084 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6449 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6450 GEN_ERROR("select condition must be boolean");
6451 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6452 GEN_ERROR("select value types should match");
6453 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6459 #line 3092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6461 if (!UpRefs.empty())
6462 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6463 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6464 delete (yyvsp[(4) - (4)].TypeVal);
6470 #line 3099 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6472 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6473 GEN_ERROR("Invalid extractelement operands");
6474 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6480 #line 3105 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6482 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6483 GEN_ERROR("Invalid insertelement operands");
6484 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6490 #line 3111 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6492 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6493 GEN_ERROR("Invalid shufflevector operands");
6494 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6500 #line 3117 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6502 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6503 if (!Ty->isFirstClassType())
6504 GEN_ERROR("PHI node operands must be of first class type");
6505 (yyval.InstVal) = PHINode::Create(Ty);
6506 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6507 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6508 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6509 GEN_ERROR("All elements of a PHI node must be of the same type");
6510 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6511 (yyvsp[(2) - (2)].PHIList)->pop_front();
6513 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6519 #line 3133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6522 // Handle the short syntax
6523 const PointerType *PFTy = 0;
6524 const FunctionType *Ty = 0;
6525 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6526 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6527 // Pull out the types of all of the arguments...
6528 std::vector<const Type*> ParamTypes;
6529 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6530 for (; I != E; ++I) {
6531 const Type *Ty = I->Val->getType();
6532 if (Ty == Type::VoidTy)
6533 GEN_ERROR("Short call syntax cannot be used with varargs");
6534 ParamTypes.push_back(Ty);
6537 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6538 GEN_ERROR("Invalid result type for LLVM function");
6540 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6541 PFTy = PointerType::getUnqual(Ty);
6544 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6547 // Check for call to invalid intrinsic to avoid crashing later.
6548 if (Function *theF = dyn_cast<Function>(V)) {
6549 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6550 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6551 !theF->getIntrinsicID(true))
6552 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6553 theF->getName() + "'");
6556 // Set up the ParamAttrs for the function
6557 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6558 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6559 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6560 // Check the arguments
6562 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6563 // Make sure no arguments is a good thing!
6564 if (Ty->getNumParams() != 0)
6565 GEN_ERROR("No arguments passed to a function that "
6566 "expects arguments");
6567 } else { // Has arguments?
6568 // Loop through FunctionType's arguments and ensure they are specified
6569 // correctly. Also, gather any parameter attributes.
6570 FunctionType::param_iterator I = Ty->param_begin();
6571 FunctionType::param_iterator E = Ty->param_end();
6572 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6575 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6576 if (ArgI->Val->getType() != *I)
6577 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6578 (*I)->getDescription() + "'");
6579 Args.push_back(ArgI->Val);
6580 if (ArgI->Attrs != ParamAttr::None)
6581 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6583 if (Ty->isVarArg()) {
6585 for (; ArgI != ArgE; ++ArgI, ++index) {
6586 Args.push_back(ArgI->Val); // push the remaining varargs
6587 if (ArgI->Attrs != ParamAttr::None)
6588 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6590 } else if (I != E || ArgI != ArgE)
6591 GEN_ERROR("Invalid number of parameters detected");
6594 // Finish off the ParamAttrs and check them
6597 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6599 // Create the call node
6600 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6601 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6602 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6603 CI->setParamAttrs(PAL);
6604 (yyval.InstVal) = CI;
6605 delete (yyvsp[(6) - (8)].ParamList);
6606 delete (yyvsp[(3) - (8)].TypeVal);
6612 #line 3222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6614 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6620 #line 3227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6622 (yyval.BoolVal) = true;
6628 #line 3231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6630 (yyval.BoolVal) = false;
6636 #line 3238 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6638 if (!UpRefs.empty())
6639 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6640 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6641 delete (yyvsp[(2) - (3)].TypeVal);
6647 #line 3245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6649 if (!UpRefs.empty())
6650 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6651 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6652 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6653 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6655 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6656 delete (yyvsp[(2) - (6)].TypeVal);
6661 #line 3255 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6663 if (!UpRefs.empty())
6664 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6665 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6666 delete (yyvsp[(2) - (3)].TypeVal);
6672 #line 3262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6674 if (!UpRefs.empty())
6675 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6676 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6677 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6678 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6680 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6681 delete (yyvsp[(2) - (6)].TypeVal);
6686 #line 3272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6688 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6689 GEN_ERROR("Trying to free nonpointer type " +
6690 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6691 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6697 #line 3280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6699 if (!UpRefs.empty())
6700 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6701 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6702 GEN_ERROR("Can't load from nonpointer type: " +
6703 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6704 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6705 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6706 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6707 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6709 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6710 delete (yyvsp[(3) - (5)].TypeVal);
6715 #line 3294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6717 if (!UpRefs.empty())
6718 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6719 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6721 GEN_ERROR("Can't store to a nonpointer type: " +
6722 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6723 const Type *ElTy = PT->getElementType();
6724 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6725 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6726 "' into space of type '" + ElTy->getDescription() + "'");
6728 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6730 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6731 delete (yyvsp[(5) - (7)].TypeVal);
6736 #line 3311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6738 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
6739 if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
6740 GEN_ERROR("Invalid getresult operands");
6741 (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val));
6742 delete (yyvsp[(2) - (5)].TypeVal);
6748 #line 3319 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6750 if (!UpRefs.empty())
6751 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6752 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6753 GEN_ERROR("getelementptr insn requires pointer operand");
6755 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6756 GEN_ERROR("Invalid getelementptr indices for type '" +
6757 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6758 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6760 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6761 delete (yyvsp[(2) - (4)].TypeVal);
6762 delete (yyvsp[(4) - (4)].ValueList);
6767 #line 3334 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6769 if (!UpRefs.empty())
6770 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6771 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6772 GEN_ERROR("extractvalue insn requires an aggregate operand");
6774 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6775 GEN_ERROR("Invalid extractvalue indices for type '" +
6776 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6777 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6779 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6780 delete (yyvsp[(2) - (4)].TypeVal);
6781 delete (yyvsp[(4) - (4)].ConstantList);
6786 #line 3349 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6788 if (!UpRefs.empty())
6789 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6790 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6791 GEN_ERROR("extractvalue insn requires an aggregate operand");
6793 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6794 GEN_ERROR("Invalid insertvalue indices for type '" +
6795 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6796 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6797 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6799 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6800 delete (yyvsp[(2) - (7)].TypeVal);
6801 delete (yyvsp[(5) - (7)].TypeVal);
6802 delete (yyvsp[(7) - (7)].ConstantList);
6807 /* Line 1267 of yacc.c. */
6808 #line 6809 "llvmAsmParser.tab.c"
6811 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6815 YY_STACK_PRINT (yyss, yyssp);
6820 /* Now `shift' the result of the reduction. Determine what state
6821 that goes to, based on the state we popped back to and the rule
6822 number reduced by. */
6826 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6827 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6828 yystate = yytable[yystate];
6830 yystate = yydefgoto[yyn - YYNTOKENS];
6835 /*------------------------------------.
6836 | yyerrlab -- here on detecting error |
6837 `------------------------------------*/
6839 /* If not already recovering from an error, report this error. */
6843 #if ! YYERROR_VERBOSE
6844 yyerror (YY_("syntax error"));
6847 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6848 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6850 YYSIZE_T yyalloc = 2 * yysize;
6851 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6852 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6853 if (yymsg != yymsgbuf)
6854 YYSTACK_FREE (yymsg);
6855 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6857 yymsg_alloc = yyalloc;
6861 yymsg_alloc = sizeof yymsgbuf;
6865 if (0 < yysize && yysize <= yymsg_alloc)
6867 (void) yysyntax_error (yymsg, yystate, yychar);
6872 yyerror (YY_("syntax error"));
6874 goto yyexhaustedlab;
6882 if (yyerrstatus == 3)
6884 /* If just tried and failed to reuse look-ahead token after an
6885 error, discard it. */
6887 if (yychar <= YYEOF)
6889 /* Return failure if at end of input. */
6890 if (yychar == YYEOF)
6895 yydestruct ("Error: discarding",
6901 /* Else will try to reuse look-ahead token after shifting the error
6906 /*---------------------------------------------------.
6907 | yyerrorlab -- error raised explicitly by YYERROR. |
6908 `---------------------------------------------------*/
6911 /* Pacify compilers like GCC when the user code never invokes
6912 YYERROR and the label yyerrorlab therefore never appears in user
6914 if (/*CONSTCOND*/ 0)
6917 /* Do not reclaim the symbols of the rule which action triggered
6921 YY_STACK_PRINT (yyss, yyssp);
6926 /*-------------------------------------------------------------.
6927 | yyerrlab1 -- common code for both syntax error and YYERROR. |
6928 `-------------------------------------------------------------*/
6930 yyerrstatus = 3; /* Each real token shifted decrements this. */
6934 yyn = yypact[yystate];
6935 if (yyn != YYPACT_NINF)
6938 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6946 /* Pop the current state because it cannot handle the error token. */
6951 yydestruct ("Error: popping",
6952 yystos[yystate], yyvsp);
6955 YY_STACK_PRINT (yyss, yyssp);
6964 /* Shift the error token. */
6965 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6971 /*-------------------------------------.
6972 | yyacceptlab -- YYACCEPT comes here. |
6973 `-------------------------------------*/
6978 /*-----------------------------------.
6979 | yyabortlab -- YYABORT comes here. |
6980 `-----------------------------------*/
6986 /*-------------------------------------------------.
6987 | yyexhaustedlab -- memory exhaustion comes here. |
6988 `-------------------------------------------------*/
6990 yyerror (YY_("memory exhausted"));
6996 if (yychar != YYEOF && yychar != YYEMPTY)
6997 yydestruct ("Cleanup: discarding lookahead",
6999 /* Do not reclaim the symbols of the rule which action triggered
7000 this YYABORT or YYACCEPT. */
7002 YY_STACK_PRINT (yyss, yyssp);
7003 while (yyssp != yyss)
7005 yydestruct ("Cleanup: popping",
7006 yystos[*yyssp], yyvsp);
7011 YYSTACK_FREE (yyss);
7014 if (yymsg != yymsgbuf)
7015 YYSTACK_FREE (yymsg);
7017 /* Make sure YYID is used. */
7018 return YYID (yyresult);
7022 #line 3368 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
7025 // common code from the two 'RunVMAsmParser' functions
7026 static Module* RunParser(Module * M) {
7027 CurModule.CurrentModule = M;
7028 // Check to make sure the parser succeeded
7031 delete ParserResult;
7035 // Emit an error if there are any unresolved types left.
7036 if (!CurModule.LateResolveTypes.empty()) {
7037 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7038 if (DID.Type == ValID::LocalName) {
7039 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7041 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7044 delete ParserResult;
7048 // Emit an error if there are any unresolved values left.
7049 if (!CurModule.LateResolveValues.empty()) {
7050 Value *V = CurModule.LateResolveValues.back();
7051 std::map<Value*, std::pair<ValID, int> >::iterator I =
7052 CurModule.PlaceHolderInfo.find(V);
7054 if (I != CurModule.PlaceHolderInfo.end()) {
7055 ValID &DID = I->second.first;
7056 if (DID.Type == ValID::LocalName) {
7057 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7059 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7062 delete ParserResult;
7067 // Check to make sure that parsing produced a result
7071 // Reset ParserResult variable while saving its value for the result.
7072 Module *Result = ParserResult;
7078 void llvm::GenerateError(const std::string &message, int LineNo) {
7079 if (LineNo == -1) LineNo = LLLgetLineNo();
7080 // TODO: column number in exception
7082 TheParseError->setError(LLLgetFilename(), message, LineNo);
7086 int yyerror(const char *ErrorMsg) {
7087 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7088 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7089 if (yychar != YYEMPTY && yychar != 0) {
7090 errMsg += " while reading token: '";
7091 errMsg += std::string(LLLgetTokenStart(),
7092 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7094 GenerateError(errMsg);