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,
236 #define ESINT64VAL 258
237 #define EUINT64VAL 259
238 #define ESAPINTVAL 260
239 #define EUAPINTVAL 261
240 #define LOCALVAL_ID 262
241 #define GLOBALVAL_ID 263
249 #define PPC_FP128 271
253 #define GLOBALVAR 275
255 #define STRINGCONSTANT 277
256 #define ATSTRINGCONSTANT 278
257 #define PCTSTRINGCONSTANT 279
258 #define ZEROINITIALIZER 280
270 #define THREAD_LOCAL 292
272 #define DOTDOTDOT 294
278 #define APPENDING 300
279 #define DLLIMPORT 301
280 #define DLLEXPORT 302
281 #define EXTERN_WEAK 303
288 #define ADDRSPACE 310
294 #define SIDEEFFECT 316
297 #define FASTCC_TOK 319
298 #define COLDCC_TOK 320
299 #define X86_STDCALLCC_TOK 321
300 #define X86_FASTCALLCC_TOK 322
301 #define DATALAYOUT 323
307 #define UNREACHABLE 329
352 #define GETELEMENTPTR 374
368 #define EXTRACTELEMENT 390
369 #define INSERTELEMENT 391
370 #define SHUFFLEVECTOR 392
371 #define GETRESULT 393
372 #define EXTRACTVALUE 394
373 #define INSERTVALUE 395
388 #define ALWAYSINLINE 410
391 #define PROTECTED 413
396 /* Copy the first part of user declarations. */
397 #line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
399 #include "ParserInternals.h"
400 #include "llvm/CallingConv.h"
401 #include "llvm/InlineAsm.h"
402 #include "llvm/Instructions.h"
403 #include "llvm/Module.h"
404 #include "llvm/ValueSymbolTable.h"
405 #include "llvm/AutoUpgrade.h"
406 #include "llvm/Support/GetElementPtrTypeIterator.h"
407 #include "llvm/Support/CommandLine.h"
408 #include "llvm/ADT/SmallVector.h"
409 #include "llvm/ADT/STLExtras.h"
410 #include "llvm/Support/MathExtras.h"
411 #include "llvm/Support/Streams.h"
417 // The following is a gross hack. In order to rid the libAsmParser library of
418 // exceptions, we have to have a way of getting the yyparse function to go into
419 // an error situation. So, whenever we want an error to occur, the GenerateError
420 // function (see bottom of file) sets TriggerError. Then, at the end of each
421 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
422 // (a goto) to put YACC in error state. Furthermore, several calls to
423 // GenerateError are made from inside productions and they must simulate the
424 // previous exception behavior by exiting the production immediately. We have
425 // replaced these with the GEN_ERROR macro which calls GeneratError and then
426 // immediately invokes YYERROR. This would be so much cleaner if it was a
427 // recursive descent parser.
428 static bool TriggerError = false;
429 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
430 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
432 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
433 int yylex(); // declaration" of xxx warnings.
435 using namespace llvm;
437 static Module *ParserResult;
439 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
440 // relating to upreferences in the input stream.
442 //#define DEBUG_UPREFS 1
444 #define UR_OUT(X) cerr << X
449 #define YYERROR_VERBOSE 1
451 static GlobalVariable *CurGV;
454 // This contains info used when building the body of a function. It is
455 // destroyed when the function is completed.
457 typedef std::vector<Value *> ValueList; // Numbered defs
460 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
462 static struct PerModuleInfo {
463 Module *CurrentModule;
464 ValueList Values; // Module level numbered definitions
465 ValueList LateResolveValues;
466 std::vector<PATypeHolder> Types;
467 std::map<ValID, PATypeHolder> LateResolveTypes;
469 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
470 /// how they were referenced and on which line of the input they came from so
471 /// that we can resolve them later and print error messages as appropriate.
472 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
474 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
475 // references to global values. Global values may be referenced before they
476 // are defined, and if so, the temporary object that they represent is held
477 // here. This is used for forward references of GlobalValues.
479 typedef std::map<std::pair<const PointerType *,
480 ValID>, GlobalValue*> GlobalRefsType;
481 GlobalRefsType GlobalRefs;
484 // If we could not resolve some functions at function compilation time
485 // (calls to functions before they are defined), resolve them now... Types
486 // are resolved when the constant pool has been completely parsed.
488 ResolveDefinitions(LateResolveValues);
492 // Check to make sure that all global value forward references have been
495 if (!GlobalRefs.empty()) {
496 std::string UndefinedReferences = "Unresolved global references exist:\n";
498 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
500 UndefinedReferences += " " + I->first.first->getDescription() + " " +
501 I->first.second.getName() + "\n";
503 GenerateError(UndefinedReferences);
507 // Look for intrinsic functions and CallInst that need to be upgraded
508 for (Module::iterator FI = CurrentModule->begin(),
509 FE = CurrentModule->end(); FI != FE; )
510 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
512 Values.clear(); // Clear out function local definitions
517 // GetForwardRefForGlobal - Check to see if there is a forward reference
518 // for this global. If so, remove it from the GlobalRefs map and return it.
519 // If not, just return null.
520 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
521 // Check to see if there is a forward reference to this global variable...
522 // if there is, eliminate it and patch the reference to use the new def'n.
523 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
524 GlobalValue *Ret = 0;
525 if (I != GlobalRefs.end()) {
532 bool TypeIsUnresolved(PATypeHolder* PATy) {
533 // If it isn't abstract, its resolved
534 const Type* Ty = PATy->get();
535 if (!Ty->isAbstract())
537 // Traverse the type looking for abstract types. If it isn't abstract then
538 // we don't need to traverse that leg of the type.
539 std::vector<const Type*> WorkList, SeenList;
540 WorkList.push_back(Ty);
541 while (!WorkList.empty()) {
542 const Type* Ty = WorkList.back();
543 SeenList.push_back(Ty);
545 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
546 // Check to see if this is an unresolved type
547 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
548 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
549 for ( ; I != E; ++I) {
550 if (I->second.get() == OpTy)
553 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
554 const Type* TheTy = SeqTy->getElementType();
555 if (TheTy->isAbstract() && TheTy != Ty) {
556 std::vector<const Type*>::iterator I = SeenList.begin(),
562 WorkList.push_back(TheTy);
564 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
565 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
566 const Type* TheTy = StrTy->getElementType(i);
567 if (TheTy->isAbstract() && TheTy != Ty) {
568 std::vector<const Type*>::iterator I = SeenList.begin(),
574 WorkList.push_back(TheTy);
583 static struct PerFunctionInfo {
584 Function *CurrentFunction; // Pointer to current function being created
586 ValueList Values; // Keep track of #'d definitions
588 ValueList LateResolveValues;
589 bool isDeclare; // Is this function a forward declararation?
590 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
591 GlobalValue::VisibilityTypes Visibility;
593 /// BBForwardRefs - When we see forward references to basic blocks, keep
594 /// track of them here.
595 std::map<ValID, BasicBlock*> BBForwardRefs;
597 inline PerFunctionInfo() {
600 Linkage = GlobalValue::ExternalLinkage;
601 Visibility = GlobalValue::DefaultVisibility;
604 inline void FunctionStart(Function *M) {
609 void FunctionDone() {
610 // Any forward referenced blocks left?
611 if (!BBForwardRefs.empty()) {
612 GenerateError("Undefined reference to label " +
613 BBForwardRefs.begin()->second->getName());
617 // Resolve all forward references now.
618 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
620 Values.clear(); // Clear out function local definitions
621 BBForwardRefs.clear();
624 Linkage = GlobalValue::ExternalLinkage;
625 Visibility = GlobalValue::DefaultVisibility;
627 } CurFun; // Info for the current function...
629 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
632 //===----------------------------------------------------------------------===//
633 // Code to handle definitions of all the types
634 //===----------------------------------------------------------------------===//
636 /// InsertValue - Insert a value into the value table. If it is named, this
637 /// returns -1, otherwise it returns the slot number for the value.
638 static int InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
639 // Things that have names or are void typed don't get slot numbers
640 if (V->hasName() || (V->getType() == Type::VoidTy))
643 // In the case of function values, we have to allow for the forward reference
644 // of basic blocks, which are included in the numbering. Consequently, we keep
645 // track of the next insertion location with NextValNum. When a BB gets
646 // inserted, it could change the size of the CurFun.Values vector.
647 if (&ValueTab == &CurFun.Values) {
648 if (ValueTab.size() <= CurFun.NextValNum)
649 ValueTab.resize(CurFun.NextValNum+1);
650 ValueTab[CurFun.NextValNum++] = V;
651 return CurFun.NextValNum-1;
653 // For all other lists, its okay to just tack it on the back of the vector.
654 ValueTab.push_back(V);
655 return ValueTab.size()-1;
658 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
660 case ValID::LocalID: // Is it a numbered definition?
661 // Module constants occupy the lowest numbered slots...
662 if (D.Num < CurModule.Types.size())
663 return CurModule.Types[D.Num];
665 case ValID::LocalName: // Is it a named definition?
666 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
667 D.destroy(); // Free old strdup'd memory...
672 GenerateError("Internal parser error: Invalid symbol type reference");
676 // If we reached here, we referenced either a symbol that we don't know about
677 // or an id number that hasn't been read yet. We may be referencing something
678 // forward, so just create an entry to be resolved later and get to it...
680 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
683 if (inFunctionScope()) {
684 if (D.Type == ValID::LocalName) {
685 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
688 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
693 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
694 if (I != CurModule.LateResolveTypes.end())
697 Type *Typ = OpaqueType::get();
698 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
702 // getExistingVal - Look up the value specified by the provided type and
703 // the provided ValID. If the value exists and has already been defined, return
704 // it. Otherwise return null.
706 static Value *getExistingVal(const Type *Ty, const ValID &D) {
707 if (isa<FunctionType>(Ty)) {
708 GenerateError("Functions are not values and "
709 "must be referenced as pointers");
714 case ValID::LocalID: { // Is it a numbered definition?
715 // Check that the number is within bounds.
716 if (D.Num >= CurFun.Values.size())
718 Value *Result = CurFun.Values[D.Num];
719 if (Ty != Result->getType()) {
720 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
721 Result->getType()->getDescription() + "' does not match "
722 "expected type, '" + Ty->getDescription() + "'");
727 case ValID::GlobalID: { // Is it a numbered definition?
728 if (D.Num >= CurModule.Values.size())
730 Value *Result = CurModule.Values[D.Num];
731 if (Ty != Result->getType()) {
732 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
733 Result->getType()->getDescription() + "' does not match "
734 "expected type, '" + Ty->getDescription() + "'");
740 case ValID::LocalName: { // Is it a named definition?
741 if (!inFunctionScope())
743 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
744 Value *N = SymTab.lookup(D.getName());
747 if (N->getType() != Ty)
750 D.destroy(); // Free old strdup'd memory...
753 case ValID::GlobalName: { // Is it a named definition?
754 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
755 Value *N = SymTab.lookup(D.getName());
758 if (N->getType() != Ty)
761 D.destroy(); // Free old strdup'd memory...
765 // Check to make sure that "Ty" is an integral type, and that our
766 // value will fit into the specified type...
767 case ValID::ConstSIntVal: // Is it a constant pool reference??
768 if (!isa<IntegerType>(Ty) ||
769 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
770 GenerateError("Signed integral constant '" +
771 itostr(D.ConstPool64) + "' is invalid for type '" +
772 Ty->getDescription() + "'");
775 return ConstantInt::get(Ty, D.ConstPool64, true);
777 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
778 if (isa<IntegerType>(Ty) &&
779 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
780 return ConstantInt::get(Ty, D.UConstPool64);
782 if (!isa<IntegerType>(Ty) ||
783 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
784 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
785 "' is invalid or out of range for type '" +
786 Ty->getDescription() + "'");
789 // This is really a signed reference. Transmogrify.
790 return ConstantInt::get(Ty, D.ConstPool64, true);
792 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
793 if (!isa<IntegerType>(Ty)) {
794 GenerateError("Integral constant '" + D.getName() +
795 "' is invalid or out of range for type '" +
796 Ty->getDescription() + "'");
801 APSInt Tmp = *D.ConstPoolInt;
802 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
803 return ConstantInt::get(Tmp);
806 case ValID::ConstFPVal: // Is it a floating point const pool reference?
807 if (!Ty->isFloatingPoint() ||
808 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
809 GenerateError("FP constant invalid for type");
812 // Lexer has no type info, so builds all float and double FP constants
813 // as double. Fix this here. Long double does not need this.
814 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
817 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
820 return ConstantFP::get(*D.ConstPoolFP);
822 case ValID::ConstNullVal: // Is it a null value?
823 if (!isa<PointerType>(Ty)) {
824 GenerateError("Cannot create a a non pointer null");
827 return ConstantPointerNull::get(cast<PointerType>(Ty));
829 case ValID::ConstUndefVal: // Is it an undef value?
830 return UndefValue::get(Ty);
832 case ValID::ConstZeroVal: // Is it a zero value?
833 return Constant::getNullValue(Ty);
835 case ValID::ConstantVal: // Fully resolved constant?
836 if (D.ConstantValue->getType() != Ty) {
837 GenerateError("Constant expression type different from required type");
840 return D.ConstantValue;
842 case ValID::InlineAsmVal: { // Inline asm expression
843 const PointerType *PTy = dyn_cast<PointerType>(Ty);
844 const FunctionType *FTy =
845 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
846 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
847 GenerateError("Invalid type for asm constraint string");
850 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
851 D.IAD->HasSideEffects);
852 D.destroy(); // Free InlineAsmDescriptor.
856 assert(0 && "Unhandled case!");
860 assert(0 && "Unhandled case!");
864 // getVal - This function is identical to getExistingVal, except that if a
865 // value is not already defined, it "improvises" by creating a placeholder var
866 // that looks and acts just like the requested variable. When the value is
867 // defined later, all uses of the placeholder variable are replaced with the
870 static Value *getVal(const Type *Ty, const ValID &ID) {
871 if (Ty == Type::LabelTy) {
872 GenerateError("Cannot use a basic block here");
876 // See if the value has already been defined.
877 Value *V = getExistingVal(Ty, ID);
879 if (TriggerError) return 0;
881 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
882 GenerateError("Invalid use of a non-first-class type");
886 // If we reached here, we referenced either a symbol that we don't know about
887 // or an id number that hasn't been read yet. We may be referencing something
888 // forward, so just create an entry to be resolved later and get to it...
891 case ValID::GlobalName:
892 case ValID::GlobalID: {
893 const PointerType *PTy = dyn_cast<PointerType>(Ty);
895 GenerateError("Invalid type for reference to global" );
898 const Type* ElTy = PTy->getElementType();
899 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
900 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
902 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
903 (Module*)0, false, PTy->getAddressSpace());
907 V = new Argument(Ty);
910 // Remember where this forward reference came from. FIXME, shouldn't we try
911 // to recycle these things??
912 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
915 if (inFunctionScope())
916 InsertValue(V, CurFun.LateResolveValues);
918 InsertValue(V, CurModule.LateResolveValues);
922 /// defineBBVal - This is a definition of a new basic block with the specified
923 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
924 static BasicBlock *defineBBVal(const ValID &ID) {
925 assert(inFunctionScope() && "Can't get basic block at global scope!");
929 // First, see if this was forward referenced
931 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
932 if (BBI != CurFun.BBForwardRefs.end()) {
934 // The forward declaration could have been inserted anywhere in the
935 // function: insert it into the correct place now.
936 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
937 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
939 // We're about to erase the entry, save the key so we can clean it up.
940 ValID Tmp = BBI->first;
942 // Erase the forward ref from the map as its no longer "forward"
943 CurFun.BBForwardRefs.erase(ID);
945 // The key has been removed from the map but so we don't want to leave
946 // strdup'd memory around so destroy it too.
949 // If its a numbered definition, bump the number and set the BB value.
950 if (ID.Type == ValID::LocalID) {
951 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
955 // We haven't seen this BB before and its first mention is a definition.
956 // Just create it and return it.
957 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
958 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
959 if (ID.Type == ValID::LocalID) {
960 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
969 /// getBBVal - get an existing BB value or create a forward reference for it.
971 static BasicBlock *getBBVal(const ValID &ID) {
972 assert(inFunctionScope() && "Can't get basic block at global scope!");
976 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
977 if (BBI != CurFun.BBForwardRefs.end()) {
979 } if (ID.Type == ValID::LocalName) {
980 std::string Name = ID.getName();
981 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
983 if (N->getType()->getTypeID() == Type::LabelTyID)
984 BB = cast<BasicBlock>(N);
986 GenerateError("Reference to label '" + Name + "' is actually of type '"+
987 N->getType()->getDescription() + "'");
989 } else if (ID.Type == ValID::LocalID) {
990 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
991 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
992 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
994 GenerateError("Reference to label '%" + utostr(ID.Num) +
995 "' is actually of type '"+
996 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
999 GenerateError("Illegal label reference " + ID.getName());
1003 // If its already been defined, return it now.
1005 ID.destroy(); // Free strdup'd memory.
1009 // Otherwise, this block has not been seen before, create it.
1011 if (ID.Type == ValID::LocalName)
1012 Name = ID.getName();
1013 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1015 // Insert it in the forward refs map.
1016 CurFun.BBForwardRefs[ID] = BB;
1022 //===----------------------------------------------------------------------===//
1023 // Code to handle forward references in instructions
1024 //===----------------------------------------------------------------------===//
1026 // This code handles the late binding needed with statements that reference
1027 // values not defined yet... for example, a forward branch, or the PHI node for
1030 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1031 // and back patchs after we are done.
1034 // ResolveDefinitions - If we could not resolve some defs at parsing
1035 // time (forward branches, phi functions for loops, etc...) resolve the
1039 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1040 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1041 while (!LateResolvers.empty()) {
1042 Value *V = LateResolvers.back();
1043 LateResolvers.pop_back();
1045 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1046 CurModule.PlaceHolderInfo.find(V);
1047 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1049 ValID &DID = PHI->second.first;
1051 Value *TheRealValue = getExistingVal(V->getType(), DID);
1055 V->replaceAllUsesWith(TheRealValue);
1057 CurModule.PlaceHolderInfo.erase(PHI);
1058 } else if (FutureLateResolvers) {
1059 // Functions have their unresolved items forwarded to the module late
1061 InsertValue(V, *FutureLateResolvers);
1063 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1064 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1065 "' of type '" + V->getType()->getDescription() + "'",
1066 PHI->second.second);
1069 GenerateError("Reference to an invalid definition: #" +
1070 itostr(DID.Num) + " of type '" +
1071 V->getType()->getDescription() + "'",
1072 PHI->second.second);
1077 LateResolvers.clear();
1080 // ResolveTypeTo - A brand new type was just declared. This means that (if
1081 // name is not null) things referencing Name can be resolved. Otherwise, things
1082 // refering to the number can be resolved. Do this now.
1084 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1087 D = ValID::createLocalName(*Name);
1089 D = ValID::createLocalID(CurModule.Types.size());
1091 std::map<ValID, PATypeHolder>::iterator I =
1092 CurModule.LateResolveTypes.find(D);
1093 if (I != CurModule.LateResolveTypes.end()) {
1094 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1095 CurModule.LateResolveTypes.erase(I);
1100 // setValueName - Set the specified value to the name given. The name may be
1101 // null potentially, in which case this is a noop. The string passed in is
1102 // assumed to be a malloc'd string buffer, and is free'd by this function.
1104 static void setValueName(Value *V, std::string *NameStr) {
1105 if (!NameStr) return;
1106 std::string Name(*NameStr); // Copy string
1107 delete NameStr; // Free old string
1109 if (V->getType() == Type::VoidTy) {
1110 GenerateError("Can't assign name '" + Name+"' to value with void type");
1114 assert(inFunctionScope() && "Must be in function scope!");
1115 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1116 if (ST.lookup(Name)) {
1117 GenerateError("Redefinition of value '" + Name + "' of type '" +
1118 V->getType()->getDescription() + "'");
1126 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1127 /// this is a declaration, otherwise it is a definition.
1128 static GlobalVariable *
1129 ParseGlobalVariable(std::string *NameStr,
1130 GlobalValue::LinkageTypes Linkage,
1131 GlobalValue::VisibilityTypes Visibility,
1132 bool isConstantGlobal, const Type *Ty,
1133 Constant *Initializer, bool IsThreadLocal,
1134 unsigned AddressSpace = 0) {
1135 if (isa<FunctionType>(Ty)) {
1136 GenerateError("Cannot declare global vars of function type");
1139 if (Ty == Type::LabelTy) {
1140 GenerateError("Cannot declare global vars of label type");
1144 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1148 Name = *NameStr; // Copy string
1149 delete NameStr; // Free old string
1152 // See if this global value was forward referenced. If so, recycle the
1155 if (!Name.empty()) {
1156 ID = ValID::createGlobalName(Name);
1158 ID = ValID::createGlobalID(CurModule.Values.size());
1161 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1162 // Move the global to the end of the list, from whereever it was
1163 // previously inserted.
1164 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1165 CurModule.CurrentModule->getGlobalList().remove(GV);
1166 CurModule.CurrentModule->getGlobalList().push_back(GV);
1167 GV->setInitializer(Initializer);
1168 GV->setLinkage(Linkage);
1169 GV->setVisibility(Visibility);
1170 GV->setConstant(isConstantGlobal);
1171 GV->setThreadLocal(IsThreadLocal);
1172 InsertValue(GV, CurModule.Values);
1179 // If this global has a name
1180 if (!Name.empty()) {
1181 // if the global we're parsing has an initializer (is a definition) and
1182 // has external linkage.
1183 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1184 // If there is already a global with external linkage with this name
1185 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1186 // If we allow this GVar to get created, it will be renamed in the
1187 // symbol table because it conflicts with an existing GVar. We can't
1188 // allow redefinition of GVars whose linking indicates that their name
1189 // must stay the same. Issue the error.
1190 GenerateError("Redefinition of global variable named '" + Name +
1191 "' of type '" + Ty->getDescription() + "'");
1196 // Otherwise there is no existing GV to use, create one now.
1197 GlobalVariable *GV =
1198 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1199 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1200 GV->setVisibility(Visibility);
1201 InsertValue(GV, CurModule.Values);
1205 // setTypeName - Set the specified type to the name given. The name may be
1206 // null potentially, in which case this is a noop. The string passed in is
1207 // assumed to be a malloc'd string buffer, and is freed by this function.
1209 // This function returns true if the type has already been defined, but is
1210 // allowed to be redefined in the specified context. If the name is a new name
1211 // for the type plane, it is inserted and false is returned.
1212 static bool setTypeName(const Type *T, std::string *NameStr) {
1213 assert(!inFunctionScope() && "Can't give types function-local names!");
1214 if (NameStr == 0) return false;
1216 std::string Name(*NameStr); // Copy string
1217 delete NameStr; // Free old string
1219 // We don't allow assigning names to void type
1220 if (T == Type::VoidTy) {
1221 GenerateError("Can't assign name '" + Name + "' to the void type");
1225 // Set the type name, checking for conflicts as we do so.
1226 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1228 if (AlreadyExists) { // Inserting a name that is already defined???
1229 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1230 assert(Existing && "Conflict but no matching type?!");
1232 // There is only one case where this is allowed: when we are refining an
1233 // opaque type. In this case, Existing will be an opaque type.
1234 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1235 // We ARE replacing an opaque type!
1236 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1240 // Otherwise, this is an attempt to redefine a type. That's okay if
1241 // the redefinition is identical to the original. This will be so if
1242 // Existing and T point to the same Type object. In this one case we
1243 // allow the equivalent redefinition.
1244 if (Existing == T) return true; // Yes, it's equal.
1246 // Any other kind of (non-equivalent) redefinition is an error.
1247 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1248 T->getDescription() + "'");
1254 //===----------------------------------------------------------------------===//
1255 // Code for handling upreferences in type names...
1258 // TypeContains - Returns true if Ty directly contains E in it.
1260 static bool TypeContains(const Type *Ty, const Type *E) {
1261 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1262 E) != Ty->subtype_end();
1266 struct UpRefRecord {
1267 // NestingLevel - The number of nesting levels that need to be popped before
1268 // this type is resolved.
1269 unsigned NestingLevel;
1271 // LastContainedTy - This is the type at the current binding level for the
1272 // type. Every time we reduce the nesting level, this gets updated.
1273 const Type *LastContainedTy;
1275 // UpRefTy - This is the actual opaque type that the upreference is
1276 // represented with.
1277 OpaqueType *UpRefTy;
1279 UpRefRecord(unsigned NL, OpaqueType *URTy)
1280 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1284 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1285 static std::vector<UpRefRecord> UpRefs;
1287 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1288 /// called. It loops through the UpRefs vector, which is a list of the
1289 /// currently active types. For each type, if the up reference is contained in
1290 /// the newly completed type, we decrement the level count. When the level
1291 /// count reaches zero, the upreferenced type is the type that is passed in:
1292 /// thus we can complete the cycle.
1294 static PATypeHolder HandleUpRefs(const Type *ty) {
1295 // If Ty isn't abstract, or if there are no up-references in it, then there is
1296 // nothing to resolve here.
1297 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1299 PATypeHolder Ty(ty);
1300 UR_OUT("Type '" << Ty->getDescription() <<
1301 "' newly formed. Resolving upreferences.\n" <<
1302 UpRefs.size() << " upreferences active!\n");
1304 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1305 // to zero), we resolve them all together before we resolve them to Ty. At
1306 // the end of the loop, if there is anything to resolve to Ty, it will be in
1308 OpaqueType *TypeToResolve = 0;
1310 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1311 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1312 << UpRefs[i].second->getDescription() << ") = "
1313 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1314 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1315 // Decrement level of upreference
1316 unsigned Level = --UpRefs[i].NestingLevel;
1317 UpRefs[i].LastContainedTy = Ty;
1318 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1319 if (Level == 0) { // Upreference should be resolved!
1320 if (!TypeToResolve) {
1321 TypeToResolve = UpRefs[i].UpRefTy;
1323 UR_OUT(" * Resolving upreference for "
1324 << UpRefs[i].second->getDescription() << "\n";
1325 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1326 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1327 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1328 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1330 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1331 --i; // Do not skip the next element...
1336 if (TypeToResolve) {
1337 UR_OUT(" * Resolving upreference for "
1338 << UpRefs[i].second->getDescription() << "\n";
1339 std::string OldName = TypeToResolve->getDescription());
1340 TypeToResolve->refineAbstractTypeTo(Ty);
1346 //===----------------------------------------------------------------------===//
1347 // RunVMAsmParser - Define an interface to this parser
1348 //===----------------------------------------------------------------------===//
1350 static Module* RunParser(Module * M);
1352 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1354 Module *M = RunParser(new Module(LLLgetFilename()));
1361 /* Enabling traces. */
1366 /* Enabling verbose error messages. */
1367 #ifdef YYERROR_VERBOSE
1368 # undef YYERROR_VERBOSE
1369 # define YYERROR_VERBOSE 1
1371 # define YYERROR_VERBOSE 0
1374 /* Enabling the token table. */
1375 #ifndef YYTOKEN_TABLE
1376 # define YYTOKEN_TABLE 0
1379 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1380 typedef union YYSTYPE
1381 #line 977 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
1383 llvm::Module *ModuleVal;
1384 llvm::Function *FunctionVal;
1385 llvm::BasicBlock *BasicBlockVal;
1386 llvm::TerminatorInst *TermInstVal;
1387 llvm::Instruction *InstVal;
1388 llvm::Constant *ConstVal;
1390 const llvm::Type *PrimType;
1391 std::list<llvm::PATypeHolder> *TypeList;
1392 llvm::PATypeHolder *TypeVal;
1393 llvm::Value *ValueVal;
1394 std::vector<llvm::Value*> *ValueList;
1395 std::vector<unsigned> *ConstantList;
1396 llvm::ArgListType *ArgList;
1397 llvm::TypeWithAttrs TypeWithAttrs;
1398 llvm::TypeWithAttrsList *TypeWithAttrsList;
1399 llvm::ParamList *ParamList;
1401 // Represent the RHS of PHI node
1402 std::list<std::pair<llvm::Value*,
1403 llvm::BasicBlock*> > *PHIList;
1404 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1405 std::vector<llvm::Constant*> *ConstVector;
1407 llvm::GlobalValue::LinkageTypes Linkage;
1408 llvm::GlobalValue::VisibilityTypes Visibility;
1409 llvm::Attributes Attributes;
1410 llvm::APInt *APIntVal;
1415 llvm::APFloat *FPVal;
1418 std::string *StrVal; // This memory must be deleted
1419 llvm::ValID ValIDVal;
1421 llvm::Instruction::BinaryOps BinaryOpVal;
1422 llvm::Instruction::TermOps TermOpVal;
1423 llvm::Instruction::MemoryOps MemOpVal;
1424 llvm::Instruction::CastOps CastOpVal;
1425 llvm::Instruction::OtherOps OtherOpVal;
1426 llvm::ICmpInst::Predicate IPredicate;
1427 llvm::FCmpInst::Predicate FPredicate;
1429 /* Line 193 of yacc.c. */
1430 #line 1431 "llvmAsmParser.tab.c"
1432 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1433 # define YYSTYPE_IS_DECLARED 1
1434 # define YYSTYPE_IS_TRIVIAL 1
1439 /* Copy the second part of user declarations. */
1442 /* Line 216 of yacc.c. */
1443 #line 1444 "llvmAsmParser.tab.c"
1450 typedef YYTYPE_UINT8 yytype_uint8;
1452 typedef unsigned char yytype_uint8;
1456 typedef YYTYPE_INT8 yytype_int8;
1457 #elif (defined __STDC__ || defined __C99__FUNC__ \
1458 || defined __cplusplus || defined _MSC_VER)
1459 typedef signed char yytype_int8;
1461 typedef short int yytype_int8;
1464 #ifdef YYTYPE_UINT16
1465 typedef YYTYPE_UINT16 yytype_uint16;
1467 typedef unsigned short int yytype_uint16;
1471 typedef YYTYPE_INT16 yytype_int16;
1473 typedef short int yytype_int16;
1477 # ifdef __SIZE_TYPE__
1478 # define YYSIZE_T __SIZE_TYPE__
1479 # elif defined size_t
1480 # define YYSIZE_T size_t
1481 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1482 || defined __cplusplus || defined _MSC_VER)
1483 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1484 # define YYSIZE_T size_t
1486 # define YYSIZE_T unsigned int
1490 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1493 # if defined YYENABLE_NLS && YYENABLE_NLS
1495 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1496 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1500 # define YY_(msgid) msgid
1504 /* Suppress unused-variable warnings by "using" E. */
1505 #if ! defined lint || defined __GNUC__
1506 # define YYUSE(e) ((void) (e))
1508 # define YYUSE(e) /* empty */
1511 /* Identity function, used to suppress warnings about constant conditions. */
1513 # define YYID(n) (n)
1515 #if (defined __STDC__ || defined __C99__FUNC__ \
1516 || defined __cplusplus || defined _MSC_VER)
1529 #if ! defined yyoverflow || YYERROR_VERBOSE
1531 /* The parser invokes alloca or malloc; define the necessary symbols. */
1533 # ifdef YYSTACK_USE_ALLOCA
1534 # if YYSTACK_USE_ALLOCA
1536 # define YYSTACK_ALLOC __builtin_alloca
1537 # elif defined __BUILTIN_VA_ARG_INCR
1538 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1540 # define YYSTACK_ALLOC __alloca
1541 # elif defined _MSC_VER
1542 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1543 # define alloca _alloca
1545 # define YYSTACK_ALLOC alloca
1546 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1547 || defined __cplusplus || defined _MSC_VER)
1548 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1550 # define _STDLIB_H 1
1557 # ifdef YYSTACK_ALLOC
1558 /* Pacify GCC's `empty if-body' warning. */
1559 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1560 # ifndef YYSTACK_ALLOC_MAXIMUM
1561 /* The OS might guarantee only one guard page at the bottom of the stack,
1562 and a page size can be as small as 4096 bytes. So we cannot safely
1563 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1564 to allow for a few compiler-allocated temporary stack slots. */
1565 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1568 # define YYSTACK_ALLOC YYMALLOC
1569 # define YYSTACK_FREE YYFREE
1570 # ifndef YYSTACK_ALLOC_MAXIMUM
1571 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1573 # if (defined __cplusplus && ! defined _STDLIB_H \
1574 && ! ((defined YYMALLOC || defined malloc) \
1575 && (defined YYFREE || defined free)))
1576 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1578 # define _STDLIB_H 1
1582 # define YYMALLOC malloc
1583 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1584 || defined __cplusplus || defined _MSC_VER)
1585 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1589 # define YYFREE free
1590 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1591 || defined __cplusplus || defined _MSC_VER)
1592 void free (void *); /* INFRINGES ON USER NAME SPACE */
1596 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1599 #if (! defined yyoverflow \
1600 && (! defined __cplusplus \
1601 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1603 /* A type that is properly aligned for any stack member. */
1610 /* The size of the maximum gap between one aligned stack and the next. */
1611 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1613 /* The size of an array large to enough to hold all stacks, each with
1615 # define YYSTACK_BYTES(N) \
1616 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1617 + YYSTACK_GAP_MAXIMUM)
1619 /* Copy COUNT objects from FROM to TO. The source and destination do
1622 # if defined __GNUC__ && 1 < __GNUC__
1623 # define YYCOPY(To, From, Count) \
1624 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1626 # define YYCOPY(To, From, Count) \
1630 for (yyi = 0; yyi < (Count); yyi++) \
1631 (To)[yyi] = (From)[yyi]; \
1637 /* Relocate STACK from its old location to the new one. The
1638 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1639 elements in the stack, and YYPTR gives the new location of the
1640 stack. Advance YYPTR to a properly aligned location for the next
1642 # define YYSTACK_RELOCATE(Stack) \
1645 YYSIZE_T yynewbytes; \
1646 YYCOPY (&yyptr->Stack, Stack, yysize); \
1647 Stack = &yyptr->Stack; \
1648 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1649 yyptr += yynewbytes / sizeof (*yyptr); \
1655 /* YYFINAL -- State number of the termination state. */
1657 /* YYLAST -- Last index in YYTABLE. */
1660 /* YYNTOKENS -- Number of terminals. */
1661 #define YYNTOKENS 173
1662 /* YYNNTS -- Number of nonterminals. */
1664 /* YYNRULES -- Number of rules. */
1665 #define YYNRULES 348
1666 /* YYNRULES -- Number of states. */
1667 #define YYNSTATES 708
1669 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1670 #define YYUNDEFTOK 2
1671 #define YYMAXUTOK 413
1673 #define YYTRANSLATE(YYX) \
1674 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1676 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1677 static const yytype_uint8 yytranslate[] =
1679 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1683 159, 160, 163, 2, 162, 2, 2, 2, 2, 2,
1684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1685 168, 161, 169, 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, 165, 164, 167, 2, 2, 2, 2, 2, 172,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1691 166, 2, 2, 170, 2, 171, 2, 2, 2, 2,
1692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1703 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1704 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1705 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1706 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1707 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1708 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1709 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1710 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1711 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1712 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1713 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1714 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1715 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1716 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1717 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1718 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1719 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1724 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1726 static const yytype_uint16 yyprhs[] =
1728 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1729 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1730 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1731 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1732 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1733 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1734 118, 123, 124, 127, 128, 131, 133, 135, 137, 138,
1735 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
1736 160, 162, 164, 166, 167, 169, 171, 172, 174, 176,
1737 178, 180, 181, 183, 185, 186, 188, 190, 192, 194,
1738 196, 199, 201, 203, 205, 207, 209, 211, 213, 215,
1739 217, 220, 221, 224, 226, 228, 230, 231, 234, 236,
1740 238, 240, 242, 244, 246, 248, 250, 252, 254, 255,
1741 258, 259, 262, 263, 266, 267, 271, 274, 275, 277,
1742 278, 282, 284, 287, 289, 291, 293, 295, 297, 299,
1743 301, 303, 305, 309, 311, 314, 320, 326, 332, 338,
1744 342, 345, 351, 356, 359, 361, 363, 365, 369, 371,
1745 375, 377, 378, 380, 384, 389, 393, 397, 402, 407,
1746 411, 418, 424, 427, 430, 433, 436, 439, 442, 445,
1747 448, 451, 454, 457, 460, 467, 473, 482, 489, 496,
1748 504, 512, 520, 528, 535, 544, 553, 559, 567, 571,
1749 573, 575, 577, 579, 580, 583, 590, 592, 593, 595,
1750 598, 599, 603, 604, 608, 612, 616, 620, 621, 630,
1751 631, 641, 642, 652, 658, 661, 665, 667, 671, 675,
1752 679, 683, 685, 686, 692, 696, 698, 702, 704, 705,
1753 717, 719, 721, 726, 728, 730, 733, 737, 738, 740,
1754 742, 744, 746, 748, 750, 752, 754, 756, 758, 760,
1755 764, 768, 771, 774, 778, 781, 787, 792, 794, 800,
1756 802, 804, 806, 808, 810, 812, 815, 817, 821, 824,
1757 827, 831, 835, 838, 839, 841, 844, 847, 851, 861,
1758 871, 880, 896, 898, 900, 907, 913, 916, 919, 926,
1759 934, 939, 944, 951, 958, 959, 960, 964, 967, 971,
1760 974, 976, 982, 988, 995, 1002, 1009, 1016, 1021, 1028,
1761 1033, 1038, 1045, 1052, 1055, 1065, 1067, 1069, 1070, 1074,
1762 1081, 1085, 1092, 1095, 1101, 1109, 1115, 1120, 1125
1765 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1766 static const yytype_int16 yyrhs[] =
1768 220, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1769 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1770 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1771 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1772 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1773 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1774 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1775 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1776 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1777 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1778 -1, 102, -1, 103, -1, 26, -1, 27, -1, 19,
1779 -1, 22, -1, 24, -1, 179, -1, -1, 55, 159,
1780 4, 160, -1, -1, 179, 161, -1, -1, 7, 161,
1781 -1, 20, -1, 23, -1, 186, -1, -1, 184, 161,
1782 -1, 42, -1, 44, -1, 43, -1, 45, -1, 47,
1783 -1, 49, -1, 46, -1, 48, -1, 51, -1, -1,
1784 156, -1, 157, -1, 158, -1, -1, 46, -1, 48,
1785 -1, -1, 42, -1, 43, -1, 44, -1, 47, -1,
1786 -1, 44, -1, 42, -1, -1, 63, -1, 64, -1,
1787 65, -1, 66, -1, 67, -1, 62, 4, -1, 142,
1788 -1, 121, -1, 141, -1, 122, -1, 144, -1, 145,
1789 -1, 147, -1, 148, -1, 149, -1, 54, 4, -1,
1790 -1, 195, 194, -1, 144, -1, 142, -1, 141, -1,
1791 -1, 197, 196, -1, 143, -1, 146, -1, 144, -1,
1792 142, -1, 141, -1, 150, -1, 151, -1, 154, -1,
1793 155, -1, 153, -1, -1, 199, 198, -1, -1, 152,
1794 22, -1, -1, 54, 4, -1, -1, 162, 54, 4,
1795 -1, 34, 22, -1, -1, 203, -1, -1, 162, 206,
1796 205, -1, 203, -1, 54, 4, -1, 11, -1, 12,
1797 -1, 13, -1, 16, -1, 15, -1, 14, -1, 17,
1798 -1, 50, -1, 207, -1, 208, 181, 163, -1, 242,
1799 -1, 164, 4, -1, 208, 159, 212, 160, 199, -1,
1800 10, 159, 212, 160, 199, -1, 165, 4, 166, 208,
1801 167, -1, 168, 4, 166, 208, 169, -1, 170, 213,
1802 171, -1, 170, 171, -1, 168, 170, 213, 171, 169,
1803 -1, 168, 170, 171, 169, -1, 208, 195, -1, 208,
1804 -1, 10, -1, 209, -1, 211, 162, 209, -1, 211,
1805 -1, 211, 162, 39, -1, 39, -1, -1, 208, -1,
1806 213, 162, 208, -1, 208, 165, 216, 167, -1, 208,
1807 165, 167, -1, 208, 172, 22, -1, 208, 168, 216,
1808 169, -1, 208, 170, 216, 171, -1, 208, 170, 171,
1809 -1, 208, 168, 170, 216, 171, 169, -1, 208, 168,
1810 170, 171, 169, -1, 208, 40, -1, 208, 41, -1,
1811 208, 242, -1, 208, 215, -1, 208, 25, -1, 208,
1812 3, -1, 208, 5, -1, 208, 4, -1, 208, 6,
1813 -1, 208, 26, -1, 208, 27, -1, 208, 9, -1,
1814 176, 159, 214, 38, 208, 160, -1, 119, 159, 214,
1815 254, 160, -1, 133, 159, 214, 162, 214, 162, 214,
1816 160, -1, 174, 159, 214, 162, 214, 160, -1, 175,
1817 159, 214, 162, 214, 160, -1, 90, 177, 159, 214,
1818 162, 214, 160, -1, 91, 178, 159, 214, 162, 214,
1819 160, -1, 92, 177, 159, 214, 162, 214, 160, -1,
1820 93, 178, 159, 214, 162, 214, 160, -1, 135, 159,
1821 214, 162, 214, 160, -1, 136, 159, 214, 162, 214,
1822 162, 214, 160, -1, 137, 159, 214, 162, 214, 162,
1823 214, 160, -1, 139, 159, 214, 255, 160, -1, 140,
1824 159, 214, 162, 214, 255, 160, -1, 216, 162, 214,
1825 -1, 214, -1, 32, -1, 33, -1, 37, -1, -1,
1826 210, 242, -1, 125, 159, 219, 38, 208, 160, -1,
1827 221, -1, -1, 222, -1, 221, 222, -1, -1, 31,
1828 223, 238, -1, -1, 30, 224, 239, -1, 60, 59,
1829 228, -1, 182, 18, 208, -1, 182, 18, 10, -1,
1830 -1, 185, 189, 218, 217, 214, 181, 225, 205, -1,
1831 -1, 185, 187, 189, 218, 217, 214, 181, 226, 205,
1832 -1, -1, 185, 188, 189, 218, 217, 208, 181, 227,
1833 205, -1, 185, 189, 35, 192, 219, -1, 52, 229,
1834 -1, 56, 161, 230, -1, 22, -1, 53, 161, 22,
1835 -1, 68, 161, 22, -1, 165, 231, 167, -1, 231,
1836 162, 22, -1, 22, -1, -1, 232, 162, 208, 195,
1837 180, -1, 208, 195, 180, -1, 232, -1, 232, 162,
1838 39, -1, 39, -1, -1, 193, 197, 210, 184, 159,
1839 233, 160, 199, 204, 201, 200, -1, 28, -1, 170,
1840 -1, 191, 189, 234, 235, -1, 29, -1, 171, -1,
1841 246, 237, -1, 190, 189, 234, -1, -1, 61, -1,
1842 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1843 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1844 168, 216, 169, -1, 165, 216, 167, -1, 165, 167,
1845 -1, 172, 22, -1, 170, 216, 171, -1, 170, 171,
1846 -1, 168, 170, 216, 171, 169, -1, 168, 170, 171,
1847 169, -1, 215, -1, 59, 240, 22, 162, 22, -1,
1848 7, -1, 8, -1, 179, -1, 184, -1, 242, -1,
1849 241, -1, 208, 243, -1, 244, -1, 245, 162, 244,
1850 -1, 246, 247, -1, 236, 247, -1, 248, 182, 249,
1851 -1, 248, 183, 249, -1, 248, 251, -1, -1, 21,
1852 -1, 69, 245, -1, 69, 10, -1, 70, 17, 243,
1853 -1, 70, 11, 243, 162, 17, 243, 162, 17, 243,
1854 -1, 71, 11, 243, 162, 17, 243, 165, 250, 167,
1855 -1, 71, 11, 243, 162, 17, 243, 165, 167, -1,
1856 72, 193, 197, 210, 243, 159, 253, 160, 199, 38,
1857 17, 243, 73, 17, 243, -1, 73, -1, 74, -1,
1858 250, 11, 241, 162, 17, 243, -1, 11, 241, 162,
1859 17, 243, -1, 182, 257, -1, 183, 257, -1, 208,
1860 165, 243, 162, 243, 167, -1, 252, 162, 165, 243,
1861 162, 243, 167, -1, 208, 195, 243, 195, -1, 17,
1862 195, 243, 195, -1, 253, 162, 208, 195, 243, 195,
1863 -1, 253, 162, 17, 195, 243, 195, -1, -1, -1,
1864 254, 162, 244, -1, 162, 4, -1, 255, 162, 4,
1865 -1, 58, 57, -1, 57, -1, 174, 208, 243, 162,
1866 243, -1, 175, 208, 243, 162, 243, -1, 90, 177,
1867 208, 243, 162, 243, -1, 91, 178, 208, 243, 162,
1868 243, -1, 92, 177, 208, 243, 162, 243, -1, 93,
1869 178, 208, 243, 162, 243, -1, 176, 244, 38, 208,
1870 -1, 133, 244, 162, 244, 162, 244, -1, 134, 244,
1871 162, 208, -1, 135, 244, 162, 244, -1, 136, 244,
1872 162, 244, 162, 244, -1, 137, 244, 162, 244, 162,
1873 244, -1, 132, 252, -1, 256, 193, 197, 210, 243,
1874 159, 253, 160, 199, -1, 259, -1, 36, -1, -1,
1875 114, 208, 202, -1, 114, 208, 162, 11, 243, 202,
1876 -1, 115, 208, 202, -1, 115, 208, 162, 11, 243,
1877 202, -1, 116, 244, -1, 258, 117, 208, 243, 202,
1878 -1, 258, 118, 244, 162, 208, 243, 202, -1, 138,
1879 208, 243, 162, 4, -1, 119, 208, 243, 254, -1,
1880 139, 208, 243, 255, -1, 140, 208, 243, 162, 208,
1884 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1885 static const yytype_uint16 yyrline[] =
1887 0, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143,
1888 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 1145, 1145,
1889 1145, 1145, 1145, 1146, 1146, 1146, 1146, 1146, 1146, 1149,
1890 1149, 1150, 1150, 1151, 1151, 1152, 1152, 1153, 1153, 1157,
1891 1157, 1158, 1158, 1159, 1159, 1160, 1160, 1161, 1161, 1162,
1892 1162, 1163, 1163, 1164, 1165, 1168, 1168, 1168, 1169, 1169,
1893 1171, 1172, 1176, 1180, 1185, 1191, 1191, 1193, 1194, 1199,
1894 1205, 1206, 1207, 1208, 1209, 1210, 1214, 1215, 1216, 1220,
1895 1221, 1222, 1223, 1227, 1228, 1229, 1233, 1234, 1235, 1236,
1896 1237, 1241, 1242, 1243, 1246, 1247, 1248, 1249, 1250, 1251,
1897 1252, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267,
1898 1268, 1272, 1273, 1278, 1279, 1280, 1283, 1284, 1290, 1291,
1899 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1302, 1303,
1900 1309, 1310, 1317, 1318, 1324, 1325, 1334, 1342, 1343, 1348,
1901 1349, 1350, 1355, 1368, 1368, 1368, 1368, 1368, 1368, 1368,
1902 1371, 1375, 1379, 1386, 1391, 1399, 1434, 1465, 1470, 1480,
1903 1490, 1494, 1504, 1511, 1520, 1527, 1532, 1537, 1544, 1545,
1904 1552, 1559, 1567, 1573, 1585, 1613, 1629, 1656, 1684, 1710,
1905 1730, 1756, 1776, 1788, 1795, 1861, 1871, 1881, 1892, 1905,
1906 1916, 1930, 1937, 1944, 1962, 1974, 1995, 2003, 2009, 2020,
1907 2025, 2030, 2035, 2040, 2046, 2052, 2058, 2066, 2077, 2081,
1908 2089, 2089, 2092, 2092, 2095, 2107, 2128, 2133, 2141, 2142,
1909 2146, 2146, 2150, 2150, 2153, 2156, 2180, 2192, 2191, 2203,
1910 2202, 2212, 2211, 2222, 2262, 2265, 2271, 2281, 2285, 2290,
1911 2292, 2297, 2302, 2311, 2321, 2332, 2336, 2345, 2354, 2359,
1912 2508, 2508, 2510, 2519, 2519, 2521, 2526, 2538, 2542, 2547,
1913 2551, 2555, 2560, 2565, 2569, 2573, 2577, 2581, 2585, 2589,
1914 2611, 2633, 2639, 2652, 2664, 2669, 2681, 2687, 2691, 2701,
1915 2705, 2709, 2714, 2721, 2721, 2727, 2736, 2741, 2746, 2750,
1916 2759, 2768, 2781, 2790, 2794, 2802, 2822, 2826, 2831, 2842,
1917 2861, 2870, 2974, 2978, 2985, 2996, 3009, 3018, 3031, 3042,
1918 3052, 3063, 3071, 3081, 3088, 3091, 3092, 3100, 3106, 3115,
1919 3119, 3124, 3140, 3157, 3169, 3181, 3195, 3209, 3221, 3242,
1920 3249, 3255, 3261, 3267, 3282, 3392, 3397, 3401, 3408, 3415,
1921 3425, 3432, 3442, 3450, 3464, 3481, 3495, 3510, 3525
1925 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1926 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1927 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1928 static const char *const yytname[] =
1930 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1931 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1932 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1933 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1934 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1935 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1936 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1937 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1938 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1939 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1940 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1941 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1942 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1943 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1944 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1945 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1946 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1947 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1948 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1949 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1950 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1951 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1952 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1953 "READNONE", "READONLY", "GC", "OPTSIZE", "NOINLINE", "ALWAYSINLINE",
1954 "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'",
1955 "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'",
1956 "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates",
1957 "FPredicates", "LocalName", "OptLocalName", "OptAddrSpace",
1958 "OptLocalAssign", "LocalNumber", "GlobalName", "OptGlobalAssign",
1959 "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage",
1960 "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage",
1961 "AliasLinkage", "OptCallingConv", "Attribute", "OptAttributes",
1962 "RetAttr", "OptRetAttrs", "FuncAttr", "OptFuncAttrs", "OptGC",
1963 "OptAlign", "OptCAlign", "SectionString", "OptSection",
1964 "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types",
1965 "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI",
1966 "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal",
1967 "AliaseeRef", "Module", "DefinitionList", "Definition", "@1", "@2", "@3",
1968 "@4", "@5", "AsmBlock", "TargetDefinition", "LibrariesDefinition",
1969 "LibList", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1970 "FunctionHeader", "END", "Function", "FunctionProto", "OptSideEffect",
1971 "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal",
1972 "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1973 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ParamList",
1974 "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1975 "OptVolatile", "MemoryInst", 0
1980 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1982 static const yytype_uint16 yytoknum[] =
1984 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1985 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1986 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1987 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1988 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1989 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1990 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1991 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1992 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1993 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1994 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1995 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1996 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1997 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1998 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1999 405, 406, 407, 408, 409, 410, 411, 412, 413, 40,
2000 41, 61, 44, 42, 92, 91, 120, 93, 60, 62,
2005 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2006 static const yytype_uint16 yyr1[] =
2008 0, 173, 174, 174, 174, 174, 174, 174, 174, 174,
2009 174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
2010 176, 176, 176, 176, 176, 176, 176, 176, 176, 177,
2011 177, 177, 177, 177, 177, 177, 177, 177, 177, 178,
2012 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
2013 178, 178, 178, 178, 178, 179, 179, 179, 180, 180,
2014 181, 181, 182, 182, 183, 184, 184, 185, 185, 186,
2015 187, 187, 187, 187, 187, 187, 188, 188, 188, 189,
2016 189, 189, 189, 190, 190, 190, 191, 191, 191, 191,
2017 191, 192, 192, 192, 193, 193, 193, 193, 193, 193,
2018 193, 194, 194, 194, 194, 194, 194, 194, 194, 194,
2019 194, 195, 195, 196, 196, 196, 197, 197, 198, 198,
2020 198, 198, 198, 198, 198, 198, 198, 198, 199, 199,
2021 200, 200, 201, 201, 202, 202, 203, 204, 204, 205,
2022 205, 206, 206, 207, 207, 207, 207, 207, 207, 207,
2023 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
2024 208, 208, 208, 209, 210, 210, 211, 211, 212, 212,
2025 212, 212, 213, 213, 214, 214, 214, 214, 214, 214,
2026 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2027 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
2028 215, 215, 215, 215, 215, 215, 215, 215, 216, 216,
2029 217, 217, 218, 218, 219, 219, 220, 220, 221, 221,
2030 223, 222, 224, 222, 222, 222, 222, 225, 222, 226,
2031 222, 227, 222, 222, 222, 222, 228, 229, 229, 230,
2032 231, 231, 231, 232, 232, 233, 233, 233, 233, 234,
2033 235, 235, 236, 237, 237, 238, 239, 240, 240, 241,
2034 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
2035 241, 241, 241, 241, 241, 241, 241, 241, 241, 242,
2036 242, 242, 242, 243, 243, 244, 245, 245, 246, 246,
2037 247, 247, 248, 248, 248, 249, 249, 249, 249, 249,
2038 249, 249, 249, 249, 250, 250, 251, 251, 252, 252,
2039 253, 253, 253, 253, 253, 254, 254, 255, 255, 256,
2040 256, 257, 257, 257, 257, 257, 257, 257, 257, 257,
2041 257, 257, 257, 257, 257, 257, 258, 258, 259, 259,
2042 259, 259, 259, 259, 259, 259, 259, 259, 259
2045 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2046 static const yytype_uint8 yyr2[] =
2048 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2049 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2050 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2051 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2052 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2053 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2054 4, 0, 2, 0, 2, 1, 1, 1, 0, 2,
2055 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2056 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
2057 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
2058 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2059 2, 0, 2, 1, 1, 1, 0, 2, 1, 1,
2060 1, 1, 1, 1, 1, 1, 1, 1, 0, 2,
2061 0, 2, 0, 2, 0, 3, 2, 0, 1, 0,
2062 3, 1, 2, 1, 1, 1, 1, 1, 1, 1,
2063 1, 1, 3, 1, 2, 5, 5, 5, 5, 3,
2064 2, 5, 4, 2, 1, 1, 1, 3, 1, 3,
2065 1, 0, 1, 3, 4, 3, 3, 4, 4, 3,
2066 6, 5, 2, 2, 2, 2, 2, 2, 2, 2,
2067 2, 2, 2, 2, 6, 5, 8, 6, 6, 7,
2068 7, 7, 7, 6, 8, 8, 5, 7, 3, 1,
2069 1, 1, 1, 0, 2, 6, 1, 0, 1, 2,
2070 0, 3, 0, 3, 3, 3, 3, 0, 8, 0,
2071 9, 0, 9, 5, 2, 3, 1, 3, 3, 3,
2072 3, 1, 0, 5, 3, 1, 3, 1, 0, 11,
2073 1, 1, 4, 1, 1, 2, 3, 0, 1, 1,
2074 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2075 3, 2, 2, 3, 2, 5, 4, 1, 5, 1,
2076 1, 1, 1, 1, 1, 2, 1, 3, 2, 2,
2077 3, 3, 2, 0, 1, 2, 2, 3, 9, 9,
2078 8, 15, 1, 1, 6, 5, 2, 2, 6, 7,
2079 4, 4, 6, 6, 0, 0, 3, 2, 3, 2,
2080 1, 5, 5, 6, 6, 6, 6, 4, 6, 4,
2081 4, 6, 6, 2, 9, 1, 1, 0, 3, 6,
2082 3, 6, 2, 5, 7, 5, 4, 4, 7
2085 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2086 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2087 means the default is an error. */
2088 static const yytype_uint16 yydefact[] =
2090 68, 55, 65, 56, 66, 57, 222, 220, 0, 0,
2091 0, 0, 0, 0, 79, 67, 0, 68, 218, 83,
2092 86, 0, 0, 234, 0, 0, 62, 0, 69, 70,
2093 72, 71, 73, 76, 74, 77, 75, 78, 80, 81,
2094 82, 79, 79, 213, 1, 219, 84, 85, 79, 223,
2095 87, 88, 89, 90, 79, 293, 221, 293, 0, 0,
2096 242, 235, 236, 224, 279, 280, 226, 143, 144, 145,
2097 148, 147, 146, 149, 150, 0, 0, 0, 0, 281,
2098 282, 151, 225, 153, 213, 213, 91, 212, 0, 94,
2099 94, 294, 289, 63, 253, 254, 255, 288, 237, 238,
2100 241, 0, 171, 154, 0, 0, 0, 0, 160, 172,
2101 0, 0, 171, 0, 0, 0, 93, 92, 0, 210,
2102 211, 0, 0, 95, 96, 97, 98, 99, 116, 256,
2103 0, 0, 337, 337, 292, 0, 239, 170, 111, 166,
2104 168, 0, 0, 0, 0, 0, 0, 159, 0, 0,
2105 152, 0, 0, 165, 0, 164, 0, 233, 61, 61,
2106 100, 0, 250, 251, 252, 64, 336, 320, 0, 0,
2107 0, 0, 94, 302, 303, 2, 3, 4, 5, 6,
2108 7, 8, 9, 10, 14, 15, 16, 11, 12, 13,
2109 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
2110 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
2111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2112 0, 0, 290, 94, 306, 0, 335, 291, 307, 240,
2113 163, 0, 128, 61, 61, 162, 0, 173, 0, 128,
2114 61, 61, 0, 214, 187, 189, 188, 190, 193, 186,
2115 191, 192, 182, 183, 0, 0, 0, 0, 0, 0,
2116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2117 0, 0, 185, 184, 227, 115, 114, 113, 117, 0,
2118 319, 296, 61, 286, 295, 0, 0, 0, 116, 29,
2119 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2120 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2121 43, 44, 45, 46, 47, 48, 0, 0, 0, 134,
2122 134, 342, 61, 61, 333, 0, 0, 0, 0, 0,
2123 61, 61, 61, 61, 61, 0, 116, 0, 0, 0,
2124 102, 104, 103, 101, 105, 106, 107, 108, 109, 112,
2125 169, 167, 156, 157, 158, 161, 60, 155, 229, 231,
2126 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2127 0, 0, 175, 209, 0, 0, 0, 179, 0, 176,
2128 0, 0, 0, 139, 0, 259, 260, 261, 262, 263,
2129 268, 264, 265, 266, 267, 257, 0, 0, 0, 0,
2130 277, 284, 283, 285, 0, 0, 297, 0, 0, 61,
2131 61, 61, 61, 0, 338, 0, 340, 315, 0, 0,
2132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2133 0, 0, 61, 0, 110, 122, 121, 118, 120, 119,
2134 123, 124, 127, 125, 126, 129, 139, 139, 0, 0,
2135 0, 0, 0, 315, 0, 0, 0, 0, 0, 0,
2136 0, 174, 160, 172, 0, 177, 178, 0, 0, 0,
2137 0, 228, 248, 258, 0, 271, 0, 0, 0, 274,
2138 0, 272, 287, 0, 0, 0, 0, 0, 0, 0,
2139 0, 0, 0, 346, 0, 0, 0, 329, 330, 0,
2140 0, 0, 0, 347, 0, 0, 0, 327, 0, 134,
2141 0, 230, 232, 61, 0, 0, 0, 0, 0, 0,
2142 0, 0, 0, 0, 0, 208, 181, 0, 0, 0,
2143 0, 0, 0, 141, 139, 247, 111, 245, 0, 0,
2144 270, 160, 0, 269, 273, 0, 0, 0, 0, 0,
2145 0, 0, 134, 135, 134, 0, 0, 0, 0, 0,
2146 0, 345, 317, 0, 61, 321, 322, 0, 0, 343,
2147 61, 215, 0, 0, 0, 0, 195, 0, 0, 0,
2148 0, 206, 0, 180, 0, 0, 61, 136, 142, 140,
2149 59, 0, 128, 0, 276, 0, 0, 0, 314, 323,
2150 324, 325, 326, 339, 341, 316, 0, 0, 328, 331,
2151 332, 318, 0, 314, 134, 0, 0, 0, 0, 0,
2152 203, 0, 0, 0, 197, 198, 194, 58, 244, 246,
2153 111, 137, 278, 275, 0, 0, 111, 111, 0, 308,
2154 0, 348, 0, 344, 199, 200, 201, 202, 0, 0,
2155 0, 207, 59, 138, 132, 0, 0, 300, 0, 0,
2156 0, 128, 0, 309, 128, 196, 204, 205, 243, 0,
2157 130, 298, 0, 0, 299, 102, 104, 111, 111, 0,
2158 111, 111, 334, 133, 0, 249, 0, 0, 311, 310,
2159 0, 0, 0, 131, 0, 0, 0, 111, 111, 305,
2160 0, 0, 313, 312, 304, 0, 0, 301
2163 /* YYDEFGOTO[NTERM-NUM]. */
2164 static const yytype_int16 yydefgoto[] =
2166 -1, 269, 270, 271, 299, 316, 79, 628, 113, 12,
2167 133, 80, 14, 15, 41, 42, 43, 48, 54, 118,
2168 128, 349, 230, 278, 161, 445, 352, 685, 670, 414,
2169 533, 654, 471, 534, 81, 158, 139, 156, 140, 141,
2170 110, 373, 400, 374, 121, 88, 157, 16, 17, 18,
2171 20, 19, 383, 446, 447, 63, 23, 61, 101, 537,
2172 538, 129, 164, 55, 96, 56, 49, 474, 401, 83,
2173 403, 283, 284, 57, 92, 93, 222, 658, 134, 324,
2174 638, 493, 503, 223, 224, 225, 226
2177 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2179 #define YYPACT_NINF -624
2180 static const yytype_int16 yypact[] =
2182 815, -624, -624, -624, -624, -624, -624, -624, 14, -114,
2183 16, -73, 78, -31, 299, -624, 163, 2187, -624, 164,
2184 80, 19, 22, -624, 2, 179, -624, 1912, -624, -624,
2185 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2186 -624, 68, 68, 201, -624, -624, -624, -624, 68, -624,
2187 -624, -624, -624, -624, 68, 200, -624, 5, 215, 222,
2188 225, -624, -624, -624, -624, -624, 117, -624, -624, -624,
2189 -624, -624, -624, -624, -624, 264, 277, 7, 49, -624,
2190 -624, -624, -12, -624, 252, 252, 198, -624, 79, 231,
2191 231, -624, -624, 83, -624, -624, -624, -624, -624, -624,
2192 -624, -21, 649, -624, 138, 149, 627, 117, -624, -12,
2193 -120, 159, 649, 158, 79, 79, -624, -624, 1557, -624,
2194 -624, 2012, 320, -624, -624, -624, -624, -624, -624, -624,
2195 -13, 173, 2237, 2237, -624, 313, -624, -624, -12, -624,
2196 174, 177, 2012, 2012, 169, -118, 2012, -624, 336, 191,
2197 -624, 2012, 2012, 117, 193, -12, 226, -624, 1296, 308,
2198 -624, 1516, -624, -624, -624, -624, -624, -624, 307, 2031,
2199 108, 357, 231, -624, -624, -624, -624, -624, -624, -624,
2200 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2201 454, 958, 454, 958, 2012, 2012, 2012, 2012, -624, -624,
2202 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2203 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012,
2204 2012, 2012, -624, 231, -624, 55, -624, -624, -624, -624,
2205 161, 1748, -624, -23, -41, -624, 203, -12, 214, -624,
2206 308, -20, 1557, -624, -624, -624, -624, -624, -624, -624,
2207 -624, -624, -624, -624, 454, 958, 454, 958, 216, 217,
2208 218, 220, 221, 224, 227, 1789, 2076, 732, 351, 228,
2209 229, 230, -624, -624, -624, -624, -624, -624, -624, 109,
2210 -624, 117, 956, -624, 219, 1466, 1466, 1466, -624, -624,
2211 -624, -624, -624, -624, -624, -624, -624, -624, -624, 2012,
2212 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2213 -624, -624, -624, -624, -624, -624, 2012, 2012, 2012, -10,
2214 3, -624, 956, -17, 223, 237, 238, 239, 240, 241,
2215 956, 956, 956, 956, 956, 352, -624, 2012, 2012, 387,
2216 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2217 -624, -624, 539, -624, -624, -624, -624, 539, -624, 158,
2218 354, 234, 248, 249, 250, 2012, 2012, 2012, 2012, 2012,
2219 2012, 2012, -624, -624, 42, 1006, -121, -624, -116, -624,
2220 2012, 2012, 2012, 253, 251, -624, -624, -624, -624, -624,
2221 -624, -624, -624, -624, -624, 353, 1807, 2094, 1175, 390,
2222 -624, -624, -624, -624, 2012, 255, -624, 256, 1516, 956,
2223 956, 956, 956, 20, -624, 29, -624, -624, 1466, 254,
2224 2012, 2012, 2012, 2012, 2012, 258, 259, 261, 262, 263,
2225 2012, 1516, 956, 266, -624, -624, -624, -624, -624, -624,
2226 -624, -624, -624, -624, -624, -624, 253, 253, 2012, 2012,
2227 2012, 2012, 2012, -624, 269, 270, 272, 273, 259, 274,
2228 2012, -624, 268, 1126, -84, -624, -624, 280, 281, 406,
2229 -5, -624, 1830, -624, 423, -624, 61, 1345, -56, -624,
2230 -77, -624, -624, 430, 431, 1466, 288, 290, 291, 292,
2231 1466, 455, 1466, 296, 298, 1466, 300, -12, -624, 301,
2232 302, 457, 461, 306, 2012, 1466, 1466, -12, 1466, 311,
2233 2012, -624, -624, -1, 312, 314, 317, 319, 101, 2012,
2234 2012, 2012, 2012, 112, 2012, -624, -624, 318, 2012, 2012,
2235 2012, 453, 478, -624, 253, -624, -12, 321, 326, 327,
2236 -624, 323, -67, -624, -624, 1466, 1466, 329, 1466, 1466,
2237 1466, 1466, 311, -624, 311, 2012, 1466, 328, 2012, 2012,
2238 2012, -624, -624, 489, 956, -624, -624, 335, 441, -624,
2239 956, -624, 2012, 2012, 2012, 2012, -624, 334, 337, 339,
2240 340, -624, 259, -624, 343, 345, 15, -624, -624, -624,
2241 178, 1848, -624, 484, -624, 338, 350, 349, 2117, -624,
2242 -624, -624, -624, -624, -624, -624, 348, 1466, -624, -624,
2243 -624, -624, 259, 2117, 311, 356, 359, 360, 361, 2012,
2244 -624, 2012, 2012, 115, -624, -624, -624, -624, -624, -624,
2245 -12, 116, -624, -624, 505, -7, 59, -12, 118, -624,
2246 358, 306, 124, -624, -624, -624, -624, -624, 363, 364,
2247 366, -624, 178, -624, 473, 1466, 1614, -624, -6, 802,
2248 802, -624, 2135, -624, -624, -624, -624, -624, -624, 526,
2249 379, -624, 374, 1614, -624, 378, 380, -624, -624, 442,
2250 59, -12, 539, -624, 516, -624, 523, 396, 161, 161,
2251 524, 802, 802, -624, 1466, 525, 1466, -624, -624, -624,
2252 1466, 486, 161, 161, -624, 543, 1466, -624
2255 /* YYPGOTO[NTERM-NUM]. */
2256 static const yytype_int16 yypgoto[] =
2258 -624, 132, 155, 181, -165, -154, 0, -86, -143, 474,
2259 -624, 6, -624, -624, -624, -624, 67, -624, -624, -624,
2260 -142, -624, -499, -624, -252, -624, -231, -624, -624, -313,
2261 -63, -624, -434, -624, -624, -26, 342, -152, -624, 458,
2262 463, -11, -156, -242, 202, 244, 332, -624, -624, 554,
2263 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2264 -624, 485, -624, -624, -624, -624, -624, -624, -623, -79,
2265 213, -193, -624, -624, 520, -624, 445, -624, -624, -624,
2266 -34, 129, -448, -624, 456, -624, -624
2269 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2270 positive, shift that token. If negative, reduce the rule which
2271 number is the opposite. If zero, do what YYDEFACT says.
2272 If YYTABLE_NINF, syntax error. */
2273 #define YYTABLE_NINF -218
2274 static const yytype_int16 yytable[] =
2276 11, 82, 272, 321, 656, 673, 13, 416, 357, 279,
2277 523, 105, 511, 512, 111, 162, 274, 11, 325, 326,
2278 327, 328, 329, 13, 376, 378, 91, 317, 335, 531,
2279 288, 490, 111, 672, 94, 111, 408, 590, 111, 318,
2280 492, 460, 146, 111, 146, 111, 460, 24, 465, 532,
2281 687, 147, 109, 236, 111, 466, 64, 65, 111, 107,
2282 67, 68, 69, 70, 71, 72, 73, 21, 1, 2,
2283 111, 3, 4, 5, 491, 25, 138, 243, 460, 273,
2284 109, 336, 22, 491, 431, 460, 138, 527, 26, 361,
2285 131, 363, 155, 11, 544, 460, 27, 358, 359, 74,
2286 589, 362, 1, 364, 595, 3, 460, 5, 84, 85,
2287 159, 119, 120, 543, -149, 89, 233, 234, 112, 285,
2288 237, 90, 50, 51, 52, 286, 241, 53, 354, 2,
2289 28, 652, 4, 464, 623, 155, 112, 659, 660, 112,
2290 240, 135, 112, 282, 353, 433, 136, 112, 418, 112,
2291 531, -61, 413, -61, 476, 478, 480, 163, 112, 571,
2292 657, 674, 112, 44, 641, 415, -61, 60, 319, 320,
2293 282, 322, 337, 338, 112, 626, 95, 106, 688, 689,
2294 58, 691, 692, 59, 323, 282, 282, 282, 282, 282,
2295 330, 331, 332, 333, 334, 282, 569, 1, 702, 703,
2296 3, 62, 5, 402, 460, 138, 402, 402, 402, 461,
2297 46, 482, 47, 75, 76, 339, 155, 77, -149, 78,
2298 108, 91, -149, 460, 38, 39, 40, 496, 540, 498,
2299 499, 500, 339, 64, 65, 542, 86, 98, 87, 603,
2300 116, 604, 117, 402, 99, 1, 2, 100, 3, 4,
2301 5, 402, 402, 402, 402, 402, 485, 435, 436, 437,
2302 438, 576, 439, 555, 219, 219, 440, 441, 103, 442,
2303 443, 444, 581, 409, 563, 651, 102, 563, 661, 508,
2304 662, 104, 340, 341, 664, 384, 662, 220, 220, 87,
2305 410, 411, 412, 122, 123, 124, 125, 126, 127, 340,
2306 341, 643, 342, 343, 142, 344, 345, 272, 346, 347,
2307 348, 432, 282, 221, 221, 143, 151, 152, 148, 342,
2308 343, 150, 344, 345, 160, 346, 347, 348, 114, 115,
2309 402, 402, 402, 402, 165, 229, 231, 232, 235, 402,
2310 238, 29, 30, 31, 32, 33, 34, 35, 36, 463,
2311 37, 239, 242, 402, 453, 454, 455, 456, 457, 458,
2312 459, 631, 605, 111, 280, 608, 609, 610, 287, 467,
2313 468, 469, 355, 379, 356, 365, 366, 367, 282, 368,
2314 369, 404, 155, 370, 273, 419, 371, 380, 381, 382,
2315 430, 434, 448, 449, 282, 497, 282, 282, 282, 420,
2316 421, 422, 423, 424, 507, 155, 402, 450, 451, 452,
2317 472, 402, 481, 402, 473, 470, 402, 483, 484, 495,
2318 501, 502, 513, 504, 505, 506, 402, 402, 510, 402,
2319 679, 519, 520, 682, 521, 522, 524, 526, 514, 515,
2320 516, 517, 528, 529, 530, 539, 536, 545, 546, 525,
2321 548, 463, 549, 550, 551, 38, 39, 40, 555, 553,
2322 556, 561, 558, 559, 560, 562, 402, 402, 563, 402,
2323 402, 402, 402, 568, 572, 587, 573, 402, 564, 574,
2324 690, 575, 588, 591, 570, 402, 592, 583, 598, 593,
2325 607, 402, 594, 611, 613, 491, 619, 620, 405, 406,
2326 407, 621, 622, 624, 586, 625, 632, 633, 577, 578,
2327 579, 580, 634, 582, 635, 639, 644, 584, 585, 645,
2328 646, 647, 655, 665, 666, 663, 667, 669, 402, 282,
2329 683, 684, 282, 282, 282, 417, 686, -18, 693, -19,
2330 694, 696, 700, 425, 426, 427, 428, 429, 289, 290,
2331 291, 292, 293, 294, 295, 296, 297, 298, 695, 705,
2332 706, 615, 616, 617, 618, 630, 668, 132, 653, 145,
2333 149, 45, 637, 351, 360, 130, 402, 97, 227, 642,
2334 402, 402, 518, 435, 436, 437, 438, 637, 439, 228,
2335 627, 0, 440, 441, 0, 442, 443, 444, 0, 0,
2336 0, 0, 0, 0, 0, 0, 0, 0, 648, 0,
2337 649, 650, 402, 402, 0, 402, 0, 402, 0, 0,
2338 0, 402, 486, 487, 488, 489, 0, 402, 0, 0,
2339 0, 494, 0, 0, 64, 65, 681, 107, 67, 68,
2340 69, 70, 71, 72, 73, 509, 1, 2, 0, 3,
2341 4, 5, 627, 0, 0, 0, 64, 65, 0, 107,
2342 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2343 0, 3, 4, 5, 0, 0, 0, 74, 0, 0,
2344 435, 436, 437, 438, 0, 439, 0, 0, 137, 440,
2345 441, 0, 442, 443, 444, 0, 0, 0, 547, 74,
2346 0, 0, 0, 552, 0, 554, 0, 0, 557, 0,
2347 0, 0, 0, 0, 0, 0, 0, 0, 565, 566,
2348 0, 567, 0, 0, 0, 0, 0, 0, 0, 0,
2349 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,
2350 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2351 0, 1, 2, 0, 3, 4, 5, 0, 596, 597,
2352 0, 599, 600, 601, 602, 0, 0, 0, 0, 606,
2353 0, 0, 0, 0, 0, 0, 0, 612, 0, 0,
2354 0, 0, 74, 614, 0, 0, 0, 0, 0, 0,
2355 0, 75, 76, 0, 0, 77, 0, 78, 144, 0,
2356 0, 0, 0, 0, 0, 385, 386, 387, 388, 64,
2357 65, 389, 0, 75, 76, -217, 0, 77, 0, 78,
2358 640, 1, 2, 0, 3, 4, 5, 390, 391, 392,
2359 0, 0, 0, -63, 1, 2, 0, 3, 4, 5,
2360 0, 0, 393, 394, 0, 6, 7, 0, 0, 0,
2361 0, 0, 0, 0, 0, 0, 339, 0, 0, 0,
2362 0, 395, 0, 0, 0, 0, 0, 8, 671, 0,
2363 0, 9, 677, 678, 0, 10, 0, 175, 176, 177,
2364 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
2365 188, 189, 254, 255, 256, 257, 75, 76, 0, 0,
2366 77, 0, 78, 377, 697, 698, 0, 699, 0, 701,
2367 0, 0, 0, 704, 0, 0, 0, 0, 0, 707,
2368 0, 258, 198, 675, 676, 201, 202, 203, 204, 205,
2369 206, 207, 208, 209, 0, 259, 0, 260, 261, 262,
2370 0, 263, 264, 342, 343, 0, 344, 345, 0, 346,
2371 347, 348, 0, 0, 0, 0, 0, 0, 0, 385,
2372 386, 387, 388, 64, 65, 389, 0, 396, 0, 0,
2373 397, 0, 398, 0, 399, 1, 2, 0, 3, 4,
2374 5, 390, 391, 392, 300, 301, 0, 0, 0, 0,
2375 0, 0, 0, 0, 0, 0, 393, 394, 0, 0,
2376 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2377 0, 111, 0, 64, 65, 395, 107, 67, 68, 69,
2378 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2379 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2380 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2381 0, 0, 0, 0, 0, 0, 74, 0, 302, 303,
2382 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
2383 314, 315, 0, 0, 0, 258, 198, 199, 200, 201,
2384 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2385 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2387 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2388 0, 396, 0, 0, 397, 0, 398, 0, 399, 244,
2389 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2390 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2391 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2392 0, 0, 0, 0, 0, 0, 252, 253, 0, 0,
2393 75, 76, 0, 0, 77, 0, 78, 462, 0, 0,
2394 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2395 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2396 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2397 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2398 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2400 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2401 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2402 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2403 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2404 0, 0, 0, 0, 0, 112, 0, 0, 0, -61,
2405 0, 265, 0, 0, 266, 0, 267, 0, 268, 244,
2406 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2407 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2408 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2409 0, 0, 0, 0, 0, 0, 252, 253, 0, 75,
2410 76, 0, 0, 77, 0, 78, 479, 0, 0, 0,
2411 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2412 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2413 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2414 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2415 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2416 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2417 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2418 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2419 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2421 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2422 0, 265, 0, 0, 266, 0, 267, 0, 268, 385,
2423 386, 387, 388, 64, 65, 389, 0, 0, 0, 0,
2424 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2425 5, 390, 391, 392, 0, 0, 0, 0, 0, 0,
2426 0, 0, 0, 0, 0, 0, 393, 394, 0, 75,
2427 76, 0, 0, 77, 0, 78, 541, 0, 0, 0,
2428 0, 0, 0, 64, 65, 395, 153, 67, 68, 69,
2429 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2430 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2431 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2432 0, 0, 0, 0, 64, 65, 74, 153, 67, 68,
2433 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2434 4, 5, 0, 0, 0, 258, 198, 199, 200, 201,
2435 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2436 0, 260, 261, 262, 0, 263, 264, 74, 0, 0,
2437 0, 0, 0, 0, 0, 0, 0, 385, 386, 387,
2438 388, 0, 0, 389, 0, 0, 0, 0, 0, 0,
2439 0, 396, 0, 0, 397, 0, 398, 0, 399, 390,
2440 391, 392, 0, 0, 0, 0, 0, 0, 0, 0,
2441 0, 0, 0, 0, 393, 394, 0, 275, 276, 0,
2442 277, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2443 0, 0, 0, 395, 0, 0, 0, 0, 0, 0,
2444 75, 76, 154, 0, 77, 0, 78, 0, 0, 175,
2445 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
2446 186, 187, 188, 189, 254, 255, 256, 257, 0, 0,
2447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2448 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2449 0, 0, 0, 258, 198, 199, 200, 201, 202, 203,
2450 204, 205, 206, 207, 208, 209, 0, 259, 0, 260,
2451 261, 262, 0, 263, 264, 64, 65, 0, 107, 67,
2452 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2453 3, 4, 5, 0, 0, 0, 0, 0, 0, 396,
2454 0, 0, 397, 0, 398, 0, 399, 350, 0, 0,
2455 0, 0, 0, 0, 0, 0, 64, 65, 74, 107,
2456 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2457 0, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2458 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2459 4, 5, 0, 0, 0, 0, 0, 64, 65, 74,
2460 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2461 2, 0, 3, 4, 5, 64, 65, 74, 107, 67,
2462 68, 69, 70, 71, 72, 73, 0, 1, 2, 535,
2463 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2464 74, 0, 0, 0, 0, 0, 0, 629, 0, 0,
2465 0, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2466 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2467 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2468 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
2469 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2471 0, 0, 0, 75, 76, 0, 372, 77, 0, 78,
2472 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2473 0, 75, 76, 0, 475, 77, 0, 78, 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, 78, 64,
2478 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2479 0, 1, 2, 0, 3, 4, 5, 0, 64, 65,
2480 0, 281, 67, 68, 69, 70, 71, 72, 73, 0,
2481 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2482 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2483 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2484 77, 74, 78, 64, 65, 0, 107, 67, 68, 69,
2485 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2486 5, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2487 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2488 0, 0, 0, 0, 64, 65, 74, 107, 67, 68,
2489 69, 70, 71, 72, 636, 0, 1, 2, 0, 3,
2490 4, 5, 64, 65, 74, 107, 67, 68, 69, 70,
2491 71, 72, 680, 0, 1, 2, 0, 3, 4, 5,
2492 0, 0, 0, 0, 0, 0, 0, 74, 0, 0,
2493 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2494 77, 0, 78, 0, 0, 74, 0, -216, 0, 0,
2495 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2496 0, 78, 0, 0, 0, -63, 1, 2, 0, 3,
2497 4, 5, 0, 0, 0, 0, 0, 6, 7, 0,
2498 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2499 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
2500 75, 76, 0, 9, 77, 0, 375, 10, 0, 0,
2501 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2502 0, 0, 77, 0, 477, 0, 0, 0, 0, 0,
2503 0, 0, 0, 166, 0, 0, 0, 0, 0, 0,
2504 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2505 0, 0, 0, 0, 167, 168, 0, 0, 0, 75,
2506 76, 0, 0, 77, 0, 78, 169, 170, 171, 172,
2507 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
2508 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2509 193, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2510 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2511 0, 194, 195, 196, 0, 0, 197, 198, 199, 200,
2512 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
2513 211, 212, 213, 214, 215, 216, 217, 218
2516 static const yytype_int16 yycheck[] =
2518 0, 27, 158, 196, 11, 11, 0, 320, 239, 161,
2519 458, 4, 446, 447, 55, 28, 159, 17, 211, 212,
2520 213, 214, 215, 17, 266, 267, 21, 192, 221, 34,
2521 172, 11, 55, 656, 29, 55, 288, 536, 55, 193,
2522 11, 162, 162, 55, 162, 55, 162, 161, 169, 54,
2523 673, 171, 78, 171, 55, 171, 7, 8, 55, 10,
2524 11, 12, 13, 14, 15, 16, 17, 53, 19, 20,
2525 55, 22, 23, 24, 54, 59, 102, 156, 162, 158,
2526 106, 223, 68, 54, 336, 162, 112, 171, 161, 254,
2527 7, 256, 118, 93, 171, 162, 18, 240, 241, 50,
2528 534, 255, 19, 257, 171, 22, 162, 24, 41, 42,
2529 121, 32, 33, 169, 55, 48, 142, 143, 159, 11,
2530 146, 54, 42, 43, 44, 17, 152, 47, 169, 20,
2531 161, 630, 23, 375, 582, 161, 159, 636, 637, 159,
2532 151, 162, 159, 169, 167, 338, 167, 159, 165, 159,
2533 34, 163, 162, 163, 396, 397, 398, 170, 159, 160,
2534 167, 167, 159, 0, 612, 162, 163, 165, 194, 195,
2535 196, 197, 117, 118, 159, 160, 171, 170, 677, 678,
2536 161, 680, 681, 161, 210, 211, 212, 213, 214, 215,
2537 216, 217, 218, 219, 220, 221, 509, 19, 697, 698,
2538 22, 22, 24, 282, 162, 231, 285, 286, 287, 167,
2539 46, 404, 48, 164, 165, 54, 242, 168, 159, 170,
2540 171, 21, 163, 162, 156, 157, 158, 420, 167, 422,
2541 423, 424, 54, 7, 8, 477, 35, 22, 37, 552,
2542 42, 554, 44, 322, 22, 19, 20, 22, 22, 23,
2543 24, 330, 331, 332, 333, 334, 408, 141, 142, 143,
2544 144, 160, 146, 162, 132, 133, 150, 151, 4, 153,
2545 154, 155, 160, 299, 162, 160, 159, 162, 160, 431,
2546 162, 4, 121, 122, 160, 279, 162, 132, 133, 37,
2547 316, 317, 318, 62, 63, 64, 65, 66, 67, 121,
2548 122, 614, 141, 142, 166, 144, 145, 463, 147, 148,
2549 149, 337, 338, 132, 133, 166, 114, 115, 159, 141,
2550 142, 163, 144, 145, 4, 147, 148, 149, 84, 85,
2551 409, 410, 411, 412, 161, 22, 162, 160, 169, 418,
2552 4, 42, 43, 44, 45, 46, 47, 48, 49, 375,
2553 51, 160, 159, 432, 365, 366, 367, 368, 369, 370,
2554 371, 592, 555, 55, 57, 558, 559, 560, 11, 380,
2555 381, 382, 169, 22, 160, 159, 159, 159, 404, 159,
2556 159, 162, 408, 159, 463, 162, 159, 159, 159, 159,
2557 38, 4, 38, 159, 420, 421, 422, 423, 424, 162,
2558 162, 162, 162, 162, 430, 431, 485, 159, 159, 159,
2559 159, 490, 22, 492, 61, 162, 495, 162, 162, 165,
2560 162, 162, 448, 162, 162, 162, 505, 506, 162, 508,
2561 661, 162, 162, 664, 162, 162, 162, 169, 449, 450,
2562 451, 452, 162, 162, 38, 22, 472, 17, 17, 460,
2563 162, 477, 162, 162, 162, 156, 157, 158, 162, 4,
2564 162, 4, 162, 162, 162, 4, 545, 546, 162, 548,
2565 549, 550, 551, 162, 162, 22, 162, 556, 504, 162,
2566 38, 162, 4, 162, 510, 564, 160, 169, 159, 162,
2567 162, 570, 169, 4, 159, 54, 162, 160, 285, 286,
2568 287, 162, 162, 160, 530, 160, 22, 169, 519, 520,
2569 521, 522, 162, 524, 165, 167, 160, 528, 529, 160,
2570 160, 160, 17, 160, 160, 167, 160, 54, 607, 555,
2571 4, 152, 558, 559, 560, 322, 162, 159, 22, 159,
2572 17, 17, 17, 330, 331, 332, 333, 334, 94, 95,
2573 96, 97, 98, 99, 100, 101, 102, 103, 162, 73,
2574 17, 572, 573, 574, 575, 591, 652, 93, 631, 106,
2575 112, 17, 598, 231, 242, 90, 655, 57, 133, 613,
2576 659, 660, 453, 141, 142, 143, 144, 613, 146, 133,
2577 590, -1, 150, 151, -1, 153, 154, 155, -1, -1,
2578 -1, -1, -1, -1, -1, -1, -1, -1, 619, -1,
2579 621, 622, 691, 692, -1, 694, -1, 696, -1, -1,
2580 -1, 700, 409, 410, 411, 412, -1, 706, -1, -1,
2581 -1, 418, -1, -1, 7, 8, 662, 10, 11, 12,
2582 13, 14, 15, 16, 17, 432, 19, 20, -1, 22,
2583 23, 24, 652, -1, -1, -1, 7, 8, -1, 10,
2584 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2585 -1, 22, 23, 24, -1, -1, -1, 50, -1, -1,
2586 141, 142, 143, 144, -1, 146, -1, -1, 39, 150,
2587 151, -1, 153, 154, 155, -1, -1, -1, 485, 50,
2588 -1, -1, -1, 490, -1, 492, -1, -1, 495, -1,
2589 -1, -1, -1, -1, -1, -1, -1, -1, 505, 506,
2590 -1, 508, -1, -1, -1, -1, -1, -1, -1, -1,
2591 -1, -1, -1, -1, -1, -1, -1, -1, -1, 7,
2592 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2593 -1, 19, 20, -1, 22, 23, 24, -1, 545, 546,
2594 -1, 548, 549, 550, 551, -1, -1, -1, -1, 556,
2595 -1, -1, -1, -1, -1, -1, -1, 564, -1, -1,
2596 -1, -1, 50, 570, -1, -1, -1, -1, -1, -1,
2597 -1, 164, 165, -1, -1, 168, -1, 170, 171, -1,
2598 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
2599 8, 9, -1, 164, 165, 0, -1, 168, -1, 170,
2600 607, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2601 -1, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2602 -1, -1, 40, 41, -1, 30, 31, -1, -1, -1,
2603 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
2604 -1, 59, -1, -1, -1, -1, -1, 52, 655, -1,
2605 -1, 56, 659, 660, -1, 60, -1, 75, 76, 77,
2606 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2607 88, 89, 90, 91, 92, 93, 164, 165, -1, -1,
2608 168, -1, 170, 171, 691, 692, -1, 694, -1, 696,
2609 -1, -1, -1, 700, -1, -1, -1, -1, -1, 706,
2610 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2611 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2612 -1, 139, 140, 141, 142, -1, 144, 145, -1, 147,
2613 148, 149, -1, -1, -1, -1, -1, -1, -1, 3,
2614 4, 5, 6, 7, 8, 9, -1, 165, -1, -1,
2615 168, -1, 170, -1, 172, 19, 20, -1, 22, 23,
2616 24, 25, 26, 27, 26, 27, -1, -1, -1, -1,
2617 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2618 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2619 -1, 55, -1, 7, 8, 59, 10, 11, 12, 13,
2620 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2621 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2622 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2623 -1, -1, -1, -1, -1, -1, 50, -1, 100, 101,
2624 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
2625 112, 113, -1, -1, -1, 119, 120, 121, 122, 123,
2626 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2627 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2628 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2629 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2630 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2631 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2632 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2633 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2634 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2635 164, 165, -1, -1, 168, -1, 170, 171, -1, -1,
2636 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2637 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2638 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2639 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2640 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2641 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2642 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2643 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2644 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2645 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2646 -1, -1, -1, -1, -1, 159, -1, -1, -1, 163,
2647 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2648 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2649 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2650 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2651 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2652 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2653 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2654 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2655 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2656 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2657 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2658 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2659 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2660 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2661 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2663 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2664 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2665 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2666 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2667 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2668 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2669 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2670 -1, -1, -1, 7, 8, 59, 10, 11, 12, 13,
2671 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2672 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2673 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2674 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2675 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2676 23, 24, -1, -1, -1, 119, 120, 121, 122, 123,
2677 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2678 -1, 135, 136, 137, -1, 139, 140, 50, -1, -1,
2679 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
2680 6, -1, -1, 9, -1, -1, -1, -1, -1, -1,
2681 -1, 165, -1, -1, 168, -1, 170, -1, 172, 25,
2682 26, 27, -1, -1, -1, -1, -1, -1, -1, -1,
2683 -1, -1, -1, -1, 40, 41, -1, 141, 142, -1,
2684 144, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2685 -1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
2686 164, 165, 125, -1, 168, -1, 170, -1, -1, 75,
2687 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2688 86, 87, 88, 89, 90, 91, 92, 93, -1, -1,
2689 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2690 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2691 -1, -1, -1, 119, 120, 121, 122, 123, 124, 125,
2692 126, 127, 128, 129, 130, 131, -1, 133, -1, 135,
2693 136, 137, -1, 139, 140, 7, 8, -1, 10, 11,
2694 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2695 22, 23, 24, -1, -1, -1, -1, -1, -1, 165,
2696 -1, -1, 168, -1, 170, -1, 172, 39, -1, -1,
2697 -1, -1, -1, -1, -1, -1, 7, 8, 50, 10,
2698 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2699 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2700 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2701 23, 24, -1, -1, -1, -1, -1, 7, 8, 50,
2702 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2703 20, -1, 22, 23, 24, 7, 8, 50, 10, 11,
2704 12, 13, 14, 15, 16, 17, -1, 19, 20, 39,
2705 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2706 50, -1, -1, -1, -1, -1, -1, 39, -1, -1,
2707 -1, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2708 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2709 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2710 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2711 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2712 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2713 -1, -1, -1, 164, 165, -1, 167, 168, -1, 170,
2714 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2715 -1, 164, 165, -1, 167, 168, -1, 170, -1, -1,
2716 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2717 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2718 170, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2719 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2720 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2721 -1, 19, 20, -1, 22, 23, 24, -1, 7, 8,
2722 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2723 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2724 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2725 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2726 168, 50, 170, 7, 8, -1, 10, 11, 12, 13,
2727 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2728 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2729 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2730 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2731 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2732 23, 24, 7, 8, 50, 10, 11, 12, 13, 14,
2733 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2734 -1, -1, -1, -1, -1, -1, -1, 50, -1, -1,
2735 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2736 168, -1, 170, -1, -1, 50, -1, 0, -1, -1,
2737 -1, -1, -1, -1, -1, 164, 165, -1, -1, 168,
2738 -1, 170, -1, -1, -1, 18, 19, 20, -1, 22,
2739 23, 24, -1, -1, -1, -1, -1, 30, 31, -1,
2740 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2741 -1, -1, -1, -1, -1, -1, -1, -1, -1, 52,
2742 164, 165, -1, 56, 168, -1, 170, 60, -1, -1,
2743 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2744 -1, -1, 168, -1, 170, -1, -1, -1, -1, -1,
2745 -1, -1, -1, 36, -1, -1, -1, -1, -1, -1,
2746 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2747 -1, -1, -1, -1, 57, 58, -1, -1, -1, 164,
2748 165, -1, -1, 168, -1, 170, 69, 70, 71, 72,
2749 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
2750 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2751 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2752 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2753 -1, 114, 115, 116, -1, -1, 119, 120, 121, 122,
2754 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
2755 133, 134, 135, 136, 137, 138, 139, 140
2758 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2759 symbol of state STATE-NUM. */
2760 static const yytype_uint16 yystos[] =
2762 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2763 60, 179, 182, 184, 185, 186, 220, 221, 222, 224,
2764 223, 53, 68, 229, 161, 59, 161, 18, 161, 42,
2765 43, 44, 45, 46, 47, 48, 49, 51, 156, 157,
2766 158, 187, 188, 189, 0, 222, 46, 48, 190, 239,
2767 42, 43, 44, 47, 191, 236, 238, 246, 161, 161,
2768 165, 230, 22, 228, 7, 8, 10, 11, 12, 13,
2769 14, 15, 16, 17, 50, 164, 165, 168, 170, 179,
2770 184, 207, 208, 242, 189, 189, 35, 37, 218, 189,
2771 189, 21, 247, 248, 29, 171, 237, 247, 22, 22,
2772 22, 231, 159, 4, 4, 4, 170, 10, 171, 208,
2773 213, 55, 159, 181, 218, 218, 42, 44, 192, 32,
2774 33, 217, 62, 63, 64, 65, 66, 67, 193, 234,
2775 234, 7, 182, 183, 251, 162, 167, 39, 208, 209,
2776 211, 212, 166, 166, 171, 213, 162, 171, 159, 212,
2777 163, 217, 217, 10, 125, 208, 210, 219, 208, 214,
2778 4, 197, 28, 170, 235, 161, 36, 57, 58, 69,
2779 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2780 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2781 90, 91, 92, 93, 114, 115, 116, 119, 120, 121,
2782 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2783 132, 133, 134, 135, 136, 137, 138, 139, 140, 174,
2784 175, 176, 249, 256, 257, 258, 259, 249, 257, 22,
2785 195, 162, 160, 208, 208, 169, 171, 208, 4, 160,
2786 214, 208, 159, 242, 3, 4, 5, 6, 9, 25,
2787 26, 27, 40, 41, 90, 91, 92, 93, 119, 133,
2788 135, 136, 137, 139, 140, 165, 168, 170, 172, 174,
2789 175, 176, 215, 242, 181, 141, 142, 144, 196, 210,
2790 57, 10, 208, 244, 245, 11, 17, 11, 193, 94,
2791 95, 96, 97, 98, 99, 100, 101, 102, 103, 177,
2792 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2793 108, 109, 110, 111, 112, 113, 178, 177, 178, 208,
2794 208, 244, 208, 208, 252, 244, 244, 244, 244, 244,
2795 208, 208, 208, 208, 208, 244, 193, 117, 118, 54,
2796 121, 122, 141, 142, 144, 145, 147, 148, 149, 194,
2797 39, 209, 199, 167, 169, 169, 160, 199, 181, 181,
2798 219, 177, 178, 177, 178, 159, 159, 159, 159, 159,
2799 159, 159, 167, 214, 216, 170, 216, 171, 216, 22,
2800 159, 159, 159, 225, 184, 3, 4, 5, 6, 9,
2801 25, 26, 27, 40, 41, 59, 165, 168, 170, 172,
2802 215, 241, 242, 243, 162, 243, 243, 243, 197, 208,
2803 208, 208, 208, 162, 202, 162, 202, 243, 165, 162,
2804 162, 162, 162, 162, 162, 243, 243, 243, 243, 243,
2805 38, 197, 208, 244, 4, 141, 142, 143, 144, 146,
2806 150, 151, 153, 154, 155, 198, 226, 227, 38, 159,
2807 159, 159, 159, 214, 214, 214, 214, 214, 214, 214,
2808 162, 167, 171, 208, 216, 169, 171, 214, 214, 214,
2809 162, 205, 159, 61, 240, 167, 216, 170, 216, 171,
2810 216, 22, 244, 162, 162, 210, 243, 243, 243, 243,
2811 11, 54, 11, 254, 243, 165, 244, 208, 244, 244,
2812 244, 162, 162, 255, 162, 162, 162, 208, 210, 243,
2813 162, 205, 205, 208, 214, 214, 214, 214, 254, 162,
2814 162, 162, 162, 255, 162, 214, 169, 171, 162, 162,
2815 38, 34, 54, 203, 206, 39, 208, 232, 233, 22,
2816 167, 171, 216, 169, 171, 17, 17, 243, 162, 162,
2817 162, 162, 243, 4, 243, 162, 162, 243, 162, 162,
2818 162, 4, 4, 162, 208, 243, 243, 243, 162, 202,
2819 208, 160, 162, 162, 162, 162, 160, 214, 214, 214,
2820 214, 160, 214, 169, 214, 214, 208, 22, 4, 205,
2821 195, 162, 160, 162, 169, 171, 243, 243, 159, 243,
2822 243, 243, 243, 202, 202, 244, 243, 162, 244, 244,
2823 244, 4, 243, 159, 243, 214, 214, 214, 214, 162,
2824 160, 162, 162, 255, 160, 160, 160, 179, 180, 39,
2825 208, 199, 22, 169, 162, 165, 17, 208, 253, 167,
2826 243, 255, 253, 202, 160, 160, 160, 160, 214, 214,
2827 214, 160, 195, 203, 204, 17, 11, 167, 250, 195,
2828 195, 160, 162, 167, 160, 160, 160, 160, 180, 54,
2829 201, 243, 241, 11, 167, 121, 122, 243, 243, 199,
2830 17, 208, 199, 4, 152, 200, 162, 241, 195, 195,
2831 38, 195, 195, 22, 17, 162, 17, 243, 243, 243,
2832 17, 243, 195, 195, 243, 73, 17, 243
2835 #define yyerrok (yyerrstatus = 0)
2836 #define yyclearin (yychar = YYEMPTY)
2837 #define YYEMPTY (-2)
2840 #define YYACCEPT goto yyacceptlab
2841 #define YYABORT goto yyabortlab
2842 #define YYERROR goto yyerrorlab
2845 /* Like YYERROR except do call yyerror. This remains here temporarily
2846 to ease the transition to the new meaning of YYERROR, for GCC.
2847 Once GCC version 2 has supplanted version 1, this can go. */
2849 #define YYFAIL goto yyerrlab
2851 #define YYRECOVERING() (!!yyerrstatus)
2853 #define YYBACKUP(Token, Value) \
2855 if (yychar == YYEMPTY && yylen == 1) \
2859 yytoken = YYTRANSLATE (yychar); \
2865 yyerror (YY_("syntax error: cannot back up")); \
2872 #define YYERRCODE 256
2875 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2876 If N is 0, then set CURRENT to the empty location which ends
2877 the previous symbol: RHS[0] (always defined). */
2879 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2880 #ifndef YYLLOC_DEFAULT
2881 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2885 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2886 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2887 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2888 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2892 (Current).first_line = (Current).last_line = \
2893 YYRHSLOC (Rhs, 0).last_line; \
2894 (Current).first_column = (Current).last_column = \
2895 YYRHSLOC (Rhs, 0).last_column; \
2901 /* YY_LOCATION_PRINT -- Print the location on the stream.
2902 This macro was not mandated originally: define only if we know
2903 we won't break user code: when these are the locations we know. */
2905 #ifndef YY_LOCATION_PRINT
2906 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2907 # define YY_LOCATION_PRINT(File, Loc) \
2908 fprintf (File, "%d.%d-%d.%d", \
2909 (Loc).first_line, (Loc).first_column, \
2910 (Loc).last_line, (Loc).last_column)
2912 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2917 /* YYLEX -- calling `yylex' with the right arguments. */
2920 # define YYLEX yylex (YYLEX_PARAM)
2922 # define YYLEX yylex ()
2925 /* Enable debugging if requested. */
2929 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2930 # define YYFPRINTF fprintf
2933 # define YYDPRINTF(Args) \
2939 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2943 YYFPRINTF (stderr, "%s ", Title); \
2944 yy_symbol_print (stderr, \
2946 YYFPRINTF (stderr, "\n"); \
2951 /*--------------------------------.
2952 | Print this symbol on YYOUTPUT. |
2953 `--------------------------------*/
2956 #if (defined __STDC__ || defined __C99__FUNC__ \
2957 || defined __cplusplus || defined _MSC_VER)
2959 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2962 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2965 YYSTYPE const * const yyvaluep;
2971 if (yytype < YYNTOKENS)
2972 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2984 /*--------------------------------.
2985 | Print this symbol on YYOUTPUT. |
2986 `--------------------------------*/
2988 #if (defined __STDC__ || defined __C99__FUNC__ \
2989 || defined __cplusplus || defined _MSC_VER)
2991 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2994 yy_symbol_print (yyoutput, yytype, yyvaluep)
2997 YYSTYPE const * const yyvaluep;
3000 if (yytype < YYNTOKENS)
3001 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3003 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3005 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3006 YYFPRINTF (yyoutput, ")");
3009 /*------------------------------------------------------------------.
3010 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3012 `------------------------------------------------------------------*/
3014 #if (defined __STDC__ || defined __C99__FUNC__ \
3015 || defined __cplusplus || defined _MSC_VER)
3017 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3020 yy_stack_print (bottom, top)
3021 yytype_int16 *bottom;
3025 YYFPRINTF (stderr, "Stack now");
3026 for (; bottom <= top; ++bottom)
3027 YYFPRINTF (stderr, " %d", *bottom);
3028 YYFPRINTF (stderr, "\n");
3031 # define YY_STACK_PRINT(Bottom, Top) \
3034 yy_stack_print ((Bottom), (Top)); \
3038 /*------------------------------------------------.
3039 | Report that the YYRULE is going to be reduced. |
3040 `------------------------------------------------*/
3042 #if (defined __STDC__ || defined __C99__FUNC__ \
3043 || defined __cplusplus || defined _MSC_VER)
3045 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3048 yy_reduce_print (yyvsp, yyrule)
3053 int yynrhs = yyr2[yyrule];
3055 unsigned long int yylno = yyrline[yyrule];
3056 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3058 /* The symbols being reduced. */
3059 for (yyi = 0; yyi < yynrhs; yyi++)
3061 fprintf (stderr, " $%d = ", yyi + 1);
3062 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3063 &(yyvsp[(yyi + 1) - (yynrhs)])
3065 fprintf (stderr, "\n");
3069 # define YY_REDUCE_PRINT(Rule) \
3072 yy_reduce_print (yyvsp, Rule); \
3075 /* Nonzero means print parse trace. It is left uninitialized so that
3076 multiple parsers can coexist. */
3078 #else /* !YYDEBUG */
3079 # define YYDPRINTF(Args)
3080 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3081 # define YY_STACK_PRINT(Bottom, Top)
3082 # define YY_REDUCE_PRINT(Rule)
3083 #endif /* !YYDEBUG */
3086 /* YYINITDEPTH -- initial size of the parser's stacks. */
3088 # define YYINITDEPTH 200
3091 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3092 if the built-in stack extension method is used).
3094 Do not make this value too large; the results are undefined if
3095 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3096 evaluated with infinite-precision integer arithmetic. */
3099 # define YYMAXDEPTH 10000
3107 # if defined __GLIBC__ && defined _STRING_H
3108 # define yystrlen strlen
3110 /* Return the length of YYSTR. */
3111 #if (defined __STDC__ || defined __C99__FUNC__ \
3112 || defined __cplusplus || defined _MSC_VER)
3114 yystrlen (const char *yystr)
3122 for (yylen = 0; yystr[yylen]; yylen++)
3130 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3131 # define yystpcpy stpcpy
3133 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3135 #if (defined __STDC__ || defined __C99__FUNC__ \
3136 || defined __cplusplus || defined _MSC_VER)
3138 yystpcpy (char *yydest, const char *yysrc)
3141 yystpcpy (yydest, yysrc)
3147 const char *yys = yysrc;
3149 while ((*yyd++ = *yys++) != '\0')
3158 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3159 quotes and backslashes, so that it's suitable for yyerror. The
3160 heuristic is that double-quoting is unnecessary unless the string
3161 contains an apostrophe, a comma, or backslash (other than
3162 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3163 null, do not copy; instead, return the length of what the result
3166 yytnamerr (char *yyres, const char *yystr)
3171 char const *yyp = yystr;
3178 goto do_not_strip_quotes;
3182 goto do_not_strip_quotes;
3195 do_not_strip_quotes: ;
3199 return yystrlen (yystr);
3201 return yystpcpy (yyres, yystr) - yyres;
3205 /* Copy into YYRESULT an error message about the unexpected token
3206 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3207 including the terminating null byte. If YYRESULT is null, do not
3208 copy anything; just return the number of bytes that would be
3209 copied. As a special case, return 0 if an ordinary "syntax error"
3210 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3211 size calculation. */
3213 yysyntax_error (char *yyresult, int yystate, int yychar)
3215 int yyn = yypact[yystate];
3217 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3221 int yytype = YYTRANSLATE (yychar);
3222 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3223 YYSIZE_T yysize = yysize0;
3225 int yysize_overflow = 0;
3226 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3227 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3231 /* This is so xgettext sees the translatable formats that are
3232 constructed on the fly. */
3233 YY_("syntax error, unexpected %s");
3234 YY_("syntax error, unexpected %s, expecting %s");
3235 YY_("syntax error, unexpected %s, expecting %s or %s");
3236 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3237 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3241 static char const yyunexpected[] = "syntax error, unexpected %s";
3242 static char const yyexpecting[] = ", expecting %s";
3243 static char const yyor[] = " or %s";
3244 char yyformat[sizeof yyunexpected
3245 + sizeof yyexpecting - 1
3246 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3247 * (sizeof yyor - 1))];
3248 char const *yyprefix = yyexpecting;
3250 /* Start YYX at -YYN if negative to avoid negative indexes in
3252 int yyxbegin = yyn < 0 ? -yyn : 0;
3254 /* Stay within bounds of both yycheck and yytname. */
3255 int yychecklim = YYLAST - yyn + 1;
3256 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3259 yyarg[0] = yytname[yytype];
3260 yyfmt = yystpcpy (yyformat, yyunexpected);
3262 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3263 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3265 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3269 yyformat[sizeof yyunexpected - 1] = '\0';
3272 yyarg[yycount++] = yytname[yyx];
3273 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3274 yysize_overflow |= (yysize1 < yysize);
3276 yyfmt = yystpcpy (yyfmt, yyprefix);
3280 yyf = YY_(yyformat);
3281 yysize1 = yysize + yystrlen (yyf);
3282 yysize_overflow |= (yysize1 < yysize);
3285 if (yysize_overflow)
3286 return YYSIZE_MAXIMUM;
3290 /* Avoid sprintf, as that infringes on the user's name space.
3291 Don't have undefined behavior even if the translation
3292 produced a string with the wrong number of "%s"s. */
3293 char *yyp = yyresult;
3295 while ((*yyp = *yyf) != '\0')
3297 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3299 yyp += yytnamerr (yyp, yyarg[yyi++]);
3312 #endif /* YYERROR_VERBOSE */
3315 /*-----------------------------------------------.
3316 | Release the memory associated to this symbol. |
3317 `-----------------------------------------------*/
3320 #if (defined __STDC__ || defined __C99__FUNC__ \
3321 || defined __cplusplus || defined _MSC_VER)
3323 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3326 yydestruct (yymsg, yytype, yyvaluep)
3336 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3347 /* Prevent warnings from -Wmissing-prototypes. */
3349 #ifdef YYPARSE_PARAM
3350 #if defined __STDC__ || defined __cplusplus
3351 int yyparse (void *YYPARSE_PARAM);
3355 #else /* ! YYPARSE_PARAM */
3356 #if defined __STDC__ || defined __cplusplus
3361 #endif /* ! YYPARSE_PARAM */
3365 /* The look-ahead symbol. */
3368 /* The semantic value of the look-ahead symbol. */
3371 /* Number of syntax errors so far. */
3380 #ifdef YYPARSE_PARAM
3381 #if (defined __STDC__ || defined __C99__FUNC__ \
3382 || defined __cplusplus || defined _MSC_VER)
3384 yyparse (void *YYPARSE_PARAM)
3387 yyparse (YYPARSE_PARAM)
3388 void *YYPARSE_PARAM;
3390 #else /* ! YYPARSE_PARAM */
3391 #if (defined __STDC__ || defined __C99__FUNC__ \
3392 || defined __cplusplus || defined _MSC_VER)
3406 /* Number of tokens to shift before error messages enabled. */
3408 /* Look-ahead token as an internal (translated) token number. */
3411 /* Buffer for error messages, and its allocated size. */
3413 char *yymsg = yymsgbuf;
3414 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3417 /* Three stacks and their tools:
3418 `yyss': related to states,
3419 `yyvs': related to semantic values,
3420 `yyls': related to locations.
3422 Refer to the stacks thru separate pointers, to allow yyoverflow
3423 to reallocate them elsewhere. */
3425 /* The state stack. */
3426 yytype_int16 yyssa[YYINITDEPTH];
3427 yytype_int16 *yyss = yyssa;
3428 yytype_int16 *yyssp;
3430 /* The semantic value stack. */
3431 YYSTYPE yyvsa[YYINITDEPTH];
3432 YYSTYPE *yyvs = yyvsa;
3437 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3439 YYSIZE_T yystacksize = YYINITDEPTH;
3441 /* The variables used to return semantic value and location from the
3446 /* The number of symbols on the RHS of the reduced rule.
3447 Keep to zero when no symbol should be popped. */
3450 YYDPRINTF ((stderr, "Starting parse\n"));
3455 yychar = YYEMPTY; /* Cause a token to be read. */
3457 /* Initialize stack pointers.
3458 Waste one element of value and location stack
3459 so that they stay on the same level as the state stack.
3460 The wasted elements are never initialized. */
3467 /*------------------------------------------------------------.
3468 | yynewstate -- Push a new state, which is found in yystate. |
3469 `------------------------------------------------------------*/
3471 /* In all cases, when you get here, the value and location stacks
3472 have just been pushed. So pushing a state here evens the stacks. */
3478 if (yyss + yystacksize - 1 <= yyssp)
3480 /* Get the current used size of the three stacks, in elements. */
3481 YYSIZE_T yysize = yyssp - yyss + 1;
3485 /* Give user a chance to reallocate the stack. Use copies of
3486 these so that the &'s don't force the real ones into
3488 YYSTYPE *yyvs1 = yyvs;
3489 yytype_int16 *yyss1 = yyss;
3492 /* Each stack pointer address is followed by the size of the
3493 data in use in that stack, in bytes. This used to be a
3494 conditional around just the two extra args, but that might
3495 be undefined if yyoverflow is a macro. */
3496 yyoverflow (YY_("memory exhausted"),
3497 &yyss1, yysize * sizeof (*yyssp),
3498 &yyvs1, yysize * sizeof (*yyvsp),
3505 #else /* no yyoverflow */
3506 # ifndef YYSTACK_RELOCATE
3507 goto yyexhaustedlab;
3509 /* Extend the stack our own way. */
3510 if (YYMAXDEPTH <= yystacksize)
3511 goto yyexhaustedlab;
3513 if (YYMAXDEPTH < yystacksize)
3514 yystacksize = YYMAXDEPTH;
3517 yytype_int16 *yyss1 = yyss;
3518 union yyalloc *yyptr =
3519 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3521 goto yyexhaustedlab;
3522 YYSTACK_RELOCATE (yyss);
3523 YYSTACK_RELOCATE (yyvs);
3525 # undef YYSTACK_RELOCATE
3527 YYSTACK_FREE (yyss1);
3530 #endif /* no yyoverflow */
3532 yyssp = yyss + yysize - 1;
3533 yyvsp = yyvs + yysize - 1;
3536 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3537 (unsigned long int) yystacksize));
3539 if (yyss + yystacksize - 1 <= yyssp)
3543 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3552 /* Do appropriate processing given the current state. Read a
3553 look-ahead token if we need one and don't already have one. */
3555 /* First try to decide what to do without reference to look-ahead token. */
3556 yyn = yypact[yystate];
3557 if (yyn == YYPACT_NINF)
3560 /* Not known => get a look-ahead token if don't already have one. */
3562 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3563 if (yychar == YYEMPTY)
3565 YYDPRINTF ((stderr, "Reading a token: "));
3569 if (yychar <= YYEOF)
3571 yychar = yytoken = YYEOF;
3572 YYDPRINTF ((stderr, "Now at end of input.\n"));
3576 yytoken = YYTRANSLATE (yychar);
3577 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3580 /* If the proper action on seeing token YYTOKEN is to reduce or to
3581 detect an error, take that action. */
3583 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3588 if (yyn == 0 || yyn == YYTABLE_NINF)
3597 /* Count tokens shifted since error; after three, turn off error
3602 /* Shift the look-ahead token. */
3603 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3605 /* Discard the shifted token unless it is eof. */
3606 if (yychar != YYEOF)
3615 /*-----------------------------------------------------------.
3616 | yydefault -- do the default action for the current state. |
3617 `-----------------------------------------------------------*/
3619 yyn = yydefact[yystate];
3625 /*-----------------------------.
3626 | yyreduce -- Do a reduction. |
3627 `-----------------------------*/
3629 /* yyn is the number of a rule to reduce with. */
3632 /* If YYLEN is nonzero, implement the default value of the action:
3635 Otherwise, the following line sets YYVAL to garbage.
3636 This behavior is undocumented and Bison
3637 users should not rely upon it. Assigning to YYVAL
3638 unconditionally makes the parser a bit smaller, and it avoids a
3639 GCC warning that YYVAL may be used uninitialized. */
3640 yyval = yyvsp[1-yylen];
3643 YY_REDUCE_PRINT (yyn);
3647 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3648 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3652 #line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3653 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3657 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3658 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3662 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3663 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3667 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3668 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3672 #line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3673 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3677 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3678 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3682 #line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3683 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3687 #line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3688 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3692 #line 1153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3693 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3697 #line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3698 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3702 #line 1157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3703 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3707 #line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3708 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3712 #line 1158 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3713 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3717 #line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3718 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3722 #line 1159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3723 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3727 #line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3728 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3732 #line 1160 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3733 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3737 #line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3738 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3742 #line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3743 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3747 #line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3748 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3752 #line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3753 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3757 #line 1163 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3758 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3762 #line 1163 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3763 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3767 #line 1164 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3768 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3772 #line 1165 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3773 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3777 #line 1169 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3778 { (yyval.StrVal) = 0; ;}
3782 #line 1171 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3783 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3787 #line 1172 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3788 { (yyval.UIntVal)=0; ;}
3792 #line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3794 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3800 #line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3808 #line 1185 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3810 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3816 #line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3824 #line 1199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3826 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3832 #line 1205 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3833 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3837 #line 1206 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3838 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3842 #line 1207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3843 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3847 #line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3848 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3852 #line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3853 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3857 #line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3858 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3862 #line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3863 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3867 #line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3868 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3872 #line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3873 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3877 #line 1220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3878 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3882 #line 1221 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3883 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3887 #line 1222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3888 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3892 #line 1223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3893 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3897 #line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3898 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3902 #line 1228 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3903 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3907 #line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3908 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3912 #line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3913 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3917 #line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3918 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3922 #line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3923 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3927 #line 1236 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3928 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3932 #line 1237 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3933 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3937 #line 1241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3938 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3942 #line 1242 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3943 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3947 #line 1243 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3948 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3952 #line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3953 { (yyval.UIntVal) = CallingConv::C; ;}
3957 #line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3958 { (yyval.UIntVal) = CallingConv::C; ;}
3962 #line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3963 { (yyval.UIntVal) = CallingConv::Fast; ;}
3967 #line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3968 { (yyval.UIntVal) = CallingConv::Cold; ;}
3972 #line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3973 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3977 #line 1251 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3978 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3982 #line 1252 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3984 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3985 GEN_ERROR("Calling conv too large");
3986 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3992 #line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3993 { (yyval.Attributes) = Attribute::ZExt; ;}
3997 #line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
3998 { (yyval.Attributes) = Attribute::ZExt; ;}
4002 #line 1261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4003 { (yyval.Attributes) = Attribute::SExt; ;}
4007 #line 1262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4008 { (yyval.Attributes) = Attribute::SExt; ;}
4012 #line 1263 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4013 { (yyval.Attributes) = Attribute::InReg; ;}
4017 #line 1264 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4018 { (yyval.Attributes) = Attribute::StructRet; ;}
4022 #line 1265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4023 { (yyval.Attributes) = Attribute::NoAlias; ;}
4027 #line 1266 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4028 { (yyval.Attributes) = Attribute::ByVal; ;}
4032 #line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4033 { (yyval.Attributes) = Attribute::Nest; ;}
4037 #line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4038 { (yyval.Attributes) =
4039 Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4043 #line 1272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4044 { (yyval.Attributes) = Attribute::None; ;}
4048 #line 1273 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4050 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4055 #line 1278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4056 { (yyval.Attributes) = Attribute::InReg; ;}
4060 #line 1279 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4061 { (yyval.Attributes) = Attribute::ZExt; ;}
4065 #line 1280 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4066 { (yyval.Attributes) = Attribute::SExt; ;}
4070 #line 1283 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4071 { (yyval.Attributes) = Attribute::None; ;}
4075 #line 1284 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4077 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4082 #line 1290 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4083 { (yyval.Attributes) = Attribute::NoReturn; ;}
4087 #line 1291 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4088 { (yyval.Attributes) = Attribute::NoUnwind; ;}
4092 #line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4093 { (yyval.Attributes) = Attribute::InReg; ;}
4097 #line 1293 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4098 { (yyval.Attributes) = Attribute::ZExt; ;}
4102 #line 1294 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4103 { (yyval.Attributes) = Attribute::SExt; ;}
4107 #line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4108 { (yyval.Attributes) = Attribute::ReadNone; ;}
4112 #line 1296 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4113 { (yyval.Attributes) = Attribute::ReadOnly; ;}
4117 #line 1297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4118 { (yyval.Attributes) = Attribute::NoInline; ;}
4122 #line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4123 { (yyval.Attributes) = Attribute::AlwaysInline; ;}
4127 #line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4128 { (yyval.Attributes) = Attribute::OptimizeForSize; ;}
4132 #line 1302 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4133 { (yyval.Attributes) = Attribute::None; ;}
4137 #line 1303 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4139 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4144 #line 1309 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4145 { (yyval.StrVal) = 0; ;}
4149 #line 1310 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4151 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4156 #line 1317 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4157 { (yyval.UIntVal) = 0; ;}
4161 #line 1318 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4163 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4164 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4165 GEN_ERROR("Alignment must be a power of two");
4171 #line 1324 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4172 { (yyval.UIntVal) = 0; ;}
4176 #line 1325 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4178 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4179 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4180 GEN_ERROR("Alignment must be a power of two");
4186 #line 1334 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4188 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4189 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4190 GEN_ERROR("Invalid character in section name");
4191 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4197 #line 1342 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4198 { (yyval.StrVal) = 0; ;}
4202 #line 1343 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4203 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4207 #line 1348 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4212 #line 1349 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4217 #line 1350 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4219 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4220 delete (yyvsp[(1) - (1)].StrVal);
4226 #line 1355 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4228 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4229 GEN_ERROR("Alignment must be a power of two");
4230 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4236 #line 1371 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4238 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4244 #line 1375 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4246 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4252 #line 1379 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4254 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4255 GEN_ERROR("Cannot form a pointer to a basic block");
4256 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4257 delete (yyvsp[(1) - (3)].TypeVal);
4263 #line 1386 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4264 { // Named types are also simple types...
4265 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4267 (yyval.TypeVal) = new PATypeHolder(tmp);
4272 #line 1391 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4273 { // Type UpReference
4274 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4275 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4276 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4277 (yyval.TypeVal) = new PATypeHolder(OT);
4278 UR_OUT("New Upreference!\n");
4284 #line 1399 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4286 // Allow but ignore attributes on function types; this permits auto-upgrade.
4287 // FIXME: remove in LLVM 3.0.
4288 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4289 if (!FunctionType::isValidReturnType(RetTy))
4290 GEN_ERROR("Invalid result type for LLVM function");
4292 std::vector<const Type*> Params;
4293 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4294 for (; I != E; ++I ) {
4295 const Type *Ty = I->Ty->get();
4296 Params.push_back(Ty);
4299 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4300 if (isVarArg) Params.pop_back();
4302 for (unsigned i = 0; i != Params.size(); ++i)
4303 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4304 GEN_ERROR("Function arguments must be value types!");
4308 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4309 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4310 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4312 // Delete the argument list
4313 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4316 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4323 #line 1434 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4325 // Allow but ignore attributes on function types; this permits auto-upgrade.
4326 // FIXME: remove in LLVM 3.0.
4327 std::vector<const Type*> Params;
4328 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4329 for ( ; I != E; ++I ) {
4330 const Type* Ty = I->Ty->get();
4331 Params.push_back(Ty);
4334 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4335 if (isVarArg) Params.pop_back();
4337 for (unsigned i = 0; i != Params.size(); ++i)
4338 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4339 GEN_ERROR("Function arguments must be value types!");
4343 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4344 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4346 // Delete the argument list
4347 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4350 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4357 #line 1465 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4358 { // Sized array type?
4359 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4360 delete (yyvsp[(4) - (5)].TypeVal);
4366 #line 1470 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4368 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4369 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4370 GEN_ERROR("Unsigned result not equal to signed result");
4371 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4372 GEN_ERROR("Element type of a VectorType must be primitive");
4373 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4374 delete (yyvsp[(4) - (5)].TypeVal);
4380 #line 1480 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4381 { // Structure type?
4382 std::vector<const Type*> Elements;
4383 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4384 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4385 Elements.push_back(*I);
4387 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4388 delete (yyvsp[(2) - (3)].TypeList);
4394 #line 1490 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4395 { // Empty structure type?
4396 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4402 #line 1494 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4404 std::vector<const Type*> Elements;
4405 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4406 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4407 Elements.push_back(*I);
4409 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4410 delete (yyvsp[(3) - (5)].TypeList);
4416 #line 1504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4417 { // Empty structure type?
4418 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4424 #line 1511 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4426 // Allow but ignore attributes on function types; this permits auto-upgrade.
4427 // FIXME: remove in LLVM 3.0.
4428 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4429 (yyval.TypeWithAttrs).Attrs = Attribute::None;
4434 #line 1520 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4436 if (!UpRefs.empty())
4437 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4438 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4439 GEN_ERROR("LLVM functions cannot return aggregate types");
4440 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4445 #line 1527 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4447 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4452 #line 1532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4454 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4455 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4461 #line 1537 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4463 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4469 #line 1545 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4471 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4472 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4473 TWA.Ty = new PATypeHolder(Type::VoidTy);
4474 (yyval.TypeWithAttrsList)->push_back(TWA);
4480 #line 1552 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4482 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4483 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4484 TWA.Ty = new PATypeHolder(Type::VoidTy);
4485 (yyval.TypeWithAttrsList)->push_back(TWA);
4491 #line 1559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4493 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4499 #line 1567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4501 (yyval.TypeList) = new std::list<PATypeHolder>();
4502 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4503 delete (yyvsp[(1) - (1)].TypeVal);
4509 #line 1573 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4511 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4512 delete (yyvsp[(3) - (3)].TypeVal);
4518 #line 1585 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4519 { // Nonempty unsized arr
4520 if (!UpRefs.empty())
4521 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4522 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4524 GEN_ERROR("Cannot make array constant with type: '" +
4525 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4526 const Type *ETy = ATy->getElementType();
4527 uint64_t NumElements = ATy->getNumElements();
4529 // Verify that we have the correct size...
4530 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4531 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4532 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4533 utostr(NumElements) + "");
4535 // Verify all elements are correct type!
4536 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4537 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4538 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4539 ETy->getDescription() +"' as required!\nIt is of type '"+
4540 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4543 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4544 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4550 #line 1613 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4552 if (!UpRefs.empty())
4553 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4554 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4556 GEN_ERROR("Cannot make array constant with type: '" +
4557 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4559 uint64_t NumElements = ATy->getNumElements();
4560 if (NumElements != uint64_t(-1) && NumElements != 0)
4561 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4562 " arguments, but has size of " + utostr(NumElements) +"");
4563 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4564 delete (yyvsp[(1) - (3)].TypeVal);
4570 #line 1629 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4572 if (!UpRefs.empty())
4573 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4574 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4576 GEN_ERROR("Cannot make array constant with type: '" +
4577 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4579 uint64_t NumElements = ATy->getNumElements();
4580 const Type *ETy = ATy->getElementType();
4581 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4582 GEN_ERROR("Can't build string constant of size " +
4583 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4584 " when array has size " + utostr(NumElements) + "");
4585 std::vector<Constant*> Vals;
4586 if (ETy == Type::Int8Ty) {
4587 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4588 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4590 delete (yyvsp[(3) - (3)].StrVal);
4591 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4593 delete (yyvsp[(3) - (3)].StrVal);
4594 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4595 delete (yyvsp[(1) - (3)].TypeVal);
4601 #line 1656 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4602 { // Nonempty unsized arr
4603 if (!UpRefs.empty())
4604 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4605 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4607 GEN_ERROR("Cannot make packed constant with type: '" +
4608 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4609 const Type *ETy = PTy->getElementType();
4610 unsigned NumElements = PTy->getNumElements();
4612 // Verify that we have the correct size...
4613 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4614 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4615 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4616 utostr(NumElements) + "");
4618 // Verify all elements are correct type!
4619 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4620 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4621 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4622 ETy->getDescription() +"' as required!\nIt is of type '"+
4623 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4626 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4627 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4633 #line 1684 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4635 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4637 GEN_ERROR("Cannot make struct constant with type: '" +
4638 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4640 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4641 GEN_ERROR("Illegal number of initializers for structure type");
4643 // Check to ensure that constants are compatible with the type initializer!
4644 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4645 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4646 GEN_ERROR("Expected type '" +
4647 STy->getElementType(i)->getDescription() +
4648 "' for element #" + utostr(i) +
4649 " of structure initializer");
4651 // Check to ensure that Type is not packed
4652 if (STy->isPacked())
4653 GEN_ERROR("Unpacked Initializer to vector type '" +
4654 STy->getDescription() + "'");
4656 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4657 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4663 #line 1710 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4665 if (!UpRefs.empty())
4666 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4667 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4669 GEN_ERROR("Cannot make struct constant with type: '" +
4670 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4672 if (STy->getNumContainedTypes() != 0)
4673 GEN_ERROR("Illegal number of initializers for structure type");
4675 // Check to ensure that Type is not packed
4676 if (STy->isPacked())
4677 GEN_ERROR("Unpacked Initializer to vector type '" +
4678 STy->getDescription() + "'");
4680 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4681 delete (yyvsp[(1) - (3)].TypeVal);
4687 #line 1730 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4689 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4691 GEN_ERROR("Cannot make struct constant with type: '" +
4692 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4694 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4695 GEN_ERROR("Illegal number of initializers for structure type");
4697 // Check to ensure that constants are compatible with the type initializer!
4698 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4699 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4700 GEN_ERROR("Expected type '" +
4701 STy->getElementType(i)->getDescription() +
4702 "' for element #" + utostr(i) +
4703 " of structure initializer");
4705 // Check to ensure that Type is packed
4706 if (!STy->isPacked())
4707 GEN_ERROR("Vector initializer to non-vector type '" +
4708 STy->getDescription() + "'");
4710 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4711 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4717 #line 1756 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4719 if (!UpRefs.empty())
4720 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4721 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4723 GEN_ERROR("Cannot make struct constant with type: '" +
4724 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4726 if (STy->getNumContainedTypes() != 0)
4727 GEN_ERROR("Illegal number of initializers for structure type");
4729 // Check to ensure that Type is packed
4730 if (!STy->isPacked())
4731 GEN_ERROR("Vector initializer to non-vector type '" +
4732 STy->getDescription() + "'");
4734 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4735 delete (yyvsp[(1) - (5)].TypeVal);
4741 #line 1776 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4743 if (!UpRefs.empty())
4744 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4745 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4747 GEN_ERROR("Cannot make null pointer constant with type: '" +
4748 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4750 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4751 delete (yyvsp[(1) - (2)].TypeVal);
4757 #line 1788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4759 if (!UpRefs.empty())
4760 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4761 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4762 delete (yyvsp[(1) - (2)].TypeVal);
4768 #line 1795 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4770 if (!UpRefs.empty())
4771 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4772 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4774 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4776 // ConstExprs can exist in the body of a function, thus creating
4777 // GlobalValues whenever they refer to a variable. Because we are in
4778 // the context of a function, getExistingVal will search the functions
4779 // symbol table instead of the module symbol table for the global symbol,
4780 // which throws things all off. To get around this, we just tell
4781 // getExistingVal that we are at global scope here.
4783 Function *SavedCurFn = CurFun.CurrentFunction;
4784 CurFun.CurrentFunction = 0;
4786 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4789 CurFun.CurrentFunction = SavedCurFn;
4791 // If this is an initializer for a constant pointer, which is referencing a
4792 // (currently) undefined variable, create a stub now that shall be replaced
4793 // in the future with the right type of variable.
4796 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4797 const PointerType *PT = cast<PointerType>(Ty);
4799 // First check to see if the forward references value is already created!
4800 PerModuleInfo::GlobalRefsType::iterator I =
4801 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4803 if (I != CurModule.GlobalRefs.end()) {
4804 V = I->second; // Placeholder already exists, use it...
4805 (yyvsp[(2) - (2)].ValIDVal).destroy();
4808 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4809 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4810 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4811 GEN_ERROR("Invalid reference to global");
4813 // Create the forward referenced global.
4815 if (const FunctionType *FTy =
4816 dyn_cast<FunctionType>(PT->getElementType())) {
4817 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4818 CurModule.CurrentModule);
4820 GV = new GlobalVariable(PT->getElementType(), false,
4821 GlobalValue::ExternalWeakLinkage, 0,
4822 Name, CurModule.CurrentModule);
4825 // Keep track of the fact that we have a forward ref to recycle it
4826 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4831 (yyval.ConstVal) = cast<GlobalValue>(V);
4832 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4838 #line 1861 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4840 if (!UpRefs.empty())
4841 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4842 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4843 GEN_ERROR("Mismatched types for constant expression: " +
4844 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4845 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4846 delete (yyvsp[(1) - (2)].TypeVal);
4852 #line 1871 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4854 if (!UpRefs.empty())
4855 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4856 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4857 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4858 GEN_ERROR("Cannot create a null initialized value of this type");
4859 (yyval.ConstVal) = Constant::getNullValue(Ty);
4860 delete (yyvsp[(1) - (2)].TypeVal);
4866 #line 1881 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4867 { // integral constants
4868 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4869 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val)))
4870 GEN_ERROR("Constant value doesn't fit in type");
4871 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].SInt64Val), true);
4873 GEN_ERROR("integer constant must have integer type");
4875 delete (yyvsp[(1) - (2)].TypeVal);
4881 #line 1892 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4882 { // arbitrary precision integer constants
4883 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4884 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4885 GEN_ERROR("Constant value does not fit in type");
4886 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(IT->getBitWidth());
4887 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4889 GEN_ERROR("integer constant must have integer type");
4891 delete (yyvsp[(1) - (2)].TypeVal);
4892 delete (yyvsp[(2) - (2)].APIntVal);
4898 #line 1905 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4899 { // integral constants
4900 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4901 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val)))
4902 GEN_ERROR("Constant value doesn't fit in type");
4903 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].UInt64Val), false);
4905 GEN_ERROR("integer constant must have integer type");
4907 delete (yyvsp[(1) - (2)].TypeVal);
4913 #line 1916 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4914 { // arbitrary precision integer constants
4915 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4916 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4917 GEN_ERROR("Constant value does not fit in type");
4918 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(IT->getBitWidth());
4919 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4921 GEN_ERROR("integer constant must have integer type");
4924 delete (yyvsp[(2) - (2)].APIntVal);
4925 delete (yyvsp[(1) - (2)].TypeVal);
4931 #line 1930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4932 { // Boolean constants
4933 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4934 GEN_ERROR("Constant true must have type i1");
4935 (yyval.ConstVal) = ConstantInt::getTrue();
4936 delete (yyvsp[(1) - (2)].TypeVal);
4942 #line 1937 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4943 { // Boolean constants
4944 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4945 GEN_ERROR("Constant false must have type i1");
4946 (yyval.ConstVal) = ConstantInt::getFalse();
4947 delete (yyvsp[(1) - (2)].TypeVal);
4953 #line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4954 { // Floating point constants
4955 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal)))
4956 GEN_ERROR("Floating point constant invalid for type");
4958 // Lexer has no type info, so builds all float and double FP constants
4959 // as double. Fix this here. Long double is done right.
4960 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].TypeVal)->get()==Type::FloatTy) {
4962 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
4965 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4966 delete (yyvsp[(1) - (2)].TypeVal);
4967 delete (yyvsp[(2) - (2)].FPVal);
4973 #line 1962 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4975 if (!UpRefs.empty())
4976 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4977 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4978 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4979 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4980 GEN_ERROR("invalid cast opcode for cast from '" +
4981 Val->getType()->getDescription() + "' to '" +
4982 DestTy->getDescription() + "'");
4983 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4984 delete (yyvsp[(5) - (6)].TypeVal);
4989 #line 1974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
4991 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4992 GEN_ERROR("GetElementPtr requires a pointer operand");
4995 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4997 GEN_ERROR("Index list invalid for constant getelementptr");
4999 SmallVector<Constant*, 8> IdxVec;
5000 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
5001 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
5002 IdxVec.push_back(C);
5004 GEN_ERROR("Indices to constant getelementptr must be constants");
5006 delete (yyvsp[(4) - (5)].ValueList);
5008 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5014 #line 1995 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5016 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5017 GEN_ERROR("Select condition must be of boolean type");
5018 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5019 GEN_ERROR("Select operand types must match");
5020 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5026 #line 2003 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5028 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5029 GEN_ERROR("Binary operator types must match");
5031 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5036 #line 2009 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5038 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5039 GEN_ERROR("Logical operator types must match");
5040 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5041 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5042 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5043 GEN_ERROR("Logical operator requires integral operands");
5045 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5051 #line 2020 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5053 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5054 GEN_ERROR("icmp operand types must match");
5055 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5060 #line 2025 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5062 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5063 GEN_ERROR("fcmp operand types must match");
5064 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5069 #line 2030 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5071 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5072 GEN_ERROR("vicmp operand types must match");
5073 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5078 #line 2035 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5080 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5081 GEN_ERROR("vfcmp operand types must match");
5082 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5087 #line 2040 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5089 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5090 GEN_ERROR("Invalid extractelement operands");
5091 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5097 #line 2046 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5099 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5100 GEN_ERROR("Invalid insertelement operands");
5101 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5107 #line 2052 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5109 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5110 GEN_ERROR("Invalid shufflevector operands");
5111 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5117 #line 2058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5119 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5120 GEN_ERROR("ExtractValue requires an aggregate operand");
5122 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5123 delete (yyvsp[(4) - (5)].ConstantList);
5129 #line 2066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5131 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5132 GEN_ERROR("InsertValue requires an aggregate operand");
5134 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5135 delete (yyvsp[(6) - (7)].ConstantList);
5141 #line 2077 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5143 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5149 #line 2081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5151 (yyval.ConstVector) = new std::vector<Constant*>();
5152 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5158 #line 2089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5159 { (yyval.BoolVal) = false; ;}
5163 #line 2089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5164 { (yyval.BoolVal) = true; ;}
5168 #line 2092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5169 { (yyval.BoolVal) = true; ;}
5173 #line 2092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5174 { (yyval.BoolVal) = false; ;}
5178 #line 2095 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5180 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5181 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5183 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5185 GEN_ERROR("Aliases can be created only to global values");
5187 (yyval.ConstVal) = Aliasee;
5189 delete (yyvsp[(1) - (2)].TypeVal);
5194 #line 2107 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5196 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5197 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5198 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5199 GEN_ERROR("invalid cast opcode for cast from '" +
5200 Val->getType()->getDescription() + "' to '" +
5201 DestTy->getDescription() + "'");
5203 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5205 delete (yyvsp[(5) - (6)].TypeVal);
5210 #line 2128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5212 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5213 CurModule.ModuleDone();
5219 #line 2133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5221 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5222 CurModule.ModuleDone();
5228 #line 2146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5229 { CurFun.isDeclare = false; ;}
5233 #line 2146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5235 CurFun.FunctionDone();
5241 #line 2150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5242 { CurFun.isDeclare = true; ;}
5246 #line 2150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5253 #line 2153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5260 #line 2156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5262 if (!UpRefs.empty())
5263 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5264 // Eagerly resolve types. This is not an optimization, this is a
5265 // requirement that is due to the fact that we could have this:
5267 // %list = type { %list * }
5268 // %list = type { %list * } ; repeated type decl
5270 // If types are not resolved eagerly, then the two types will not be
5271 // determined to be the same type!
5273 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5275 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5277 // If this is a named type that is not a redefinition, add it to the slot
5279 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5282 delete (yyvsp[(3) - (3)].TypeVal);
5288 #line 2180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5290 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5292 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5294 // If this is a named type that is not a redefinition, add it to the slot
5296 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5303 #line 2192 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5305 /* "Externally Visible" Linkage */
5306 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5307 GEN_ERROR("Global value initializer is not a constant");
5308 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5309 (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));
5315 #line 2199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5322 #line 2203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5324 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5325 GEN_ERROR("Global value initializer is not a constant");
5326 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));
5332 #line 2208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5339 #line 2212 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5341 if (!UpRefs.empty())
5342 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5343 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));
5345 delete (yyvsp[(6) - (7)].TypeVal);
5350 #line 2218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5358 #line 2222 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5361 if ((yyvsp[(1) - (5)].StrVal)) {
5362 Name = *(yyvsp[(1) - (5)].StrVal);
5363 delete (yyvsp[(1) - (5)].StrVal);
5366 GEN_ERROR("Alias name cannot be empty");
5368 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5370 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5372 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5373 CurModule.CurrentModule);
5374 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5375 InsertValue(GA, CurModule.Values);
5378 // If there was a forward reference of this alias, resolve it now.
5382 ID = ValID::createGlobalName(Name);
5384 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5386 if (GlobalValue *FWGV =
5387 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5388 // Replace uses of the fwdref with the actual alias.
5389 FWGV->replaceAllUsesWith(GA);
5390 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5391 GV->eraseFromParent();
5393 cast<Function>(FWGV)->eraseFromParent();
5402 #line 2262 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5409 #line 2265 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5416 #line 2271 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5418 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5419 if (AsmSoFar.empty())
5420 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5422 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5423 delete (yyvsp[(1) - (1)].StrVal);
5429 #line 2281 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5431 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5432 delete (yyvsp[(3) - (3)].StrVal);
5437 #line 2285 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5439 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5440 delete (yyvsp[(3) - (3)].StrVal);
5445 #line 2292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5447 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5448 delete (yyvsp[(3) - (3)].StrVal);
5454 #line 2297 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5456 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5457 delete (yyvsp[(1) - (1)].StrVal);
5463 #line 2302 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5470 #line 2311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5472 if (!UpRefs.empty())
5473 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5474 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5475 GEN_ERROR("Argument types must be first-class");
5476 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].Attributes); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5477 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5478 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5484 #line 2321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5486 if (!UpRefs.empty())
5487 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5488 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5489 GEN_ERROR("Argument types must be first-class");
5490 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].Attributes); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5491 (yyval.ArgList) = new ArgListType;
5492 (yyval.ArgList)->push_back(E);
5498 #line 2332 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5500 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5506 #line 2336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5508 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5509 struct ArgListEntry E;
5510 E.Ty = new PATypeHolder(Type::VoidTy);
5512 E.Attrs = Attribute::None;
5513 (yyval.ArgList)->push_back(E);
5519 #line 2345 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5521 (yyval.ArgList) = new ArgListType;
5522 struct ArgListEntry E;
5523 E.Ty = new PATypeHolder(Type::VoidTy);
5525 E.Attrs = Attribute::None;
5526 (yyval.ArgList)->push_back(E);
5532 #line 2354 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5534 (yyval.ArgList) = 0;
5540 #line 2360 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5542 std::string FunctionName(*(yyvsp[(4) - (11)].StrVal));
5543 delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory!
5545 // Check the function result for abstractness if this is a define. We should
5546 // have no abstract types at this point
5547 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(3) - (11)].TypeVal)))
5548 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(3) - (11)].TypeVal)->get()->getDescription());
5550 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (11)].TypeVal)))
5551 GEN_ERROR("Invalid result type for LLVM function");
5553 std::vector<const Type*> ParamTypeList;
5554 SmallVector<AttributeWithIndex, 8> Attrs;
5555 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
5557 Attributes RetAttrs = (yyvsp[(2) - (11)].Attributes);
5558 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None) {
5559 if ((yyvsp[(8) - (11)].Attributes) & Attribute::ZExt) {
5560 RetAttrs = RetAttrs | Attribute::ZExt;
5561 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::ZExt;
5563 if ((yyvsp[(8) - (11)].Attributes) & Attribute::SExt) {
5564 RetAttrs = RetAttrs | Attribute::SExt;
5565 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::SExt;
5567 if ((yyvsp[(8) - (11)].Attributes) & Attribute::InReg) {
5568 RetAttrs = RetAttrs | Attribute::InReg;
5569 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::InReg;
5572 if (RetAttrs != Attribute::None)
5573 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
5574 if ((yyvsp[(6) - (11)].ArgList)) { // If there are arguments...
5576 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin(); I != (yyvsp[(6) - (11)].ArgList)->end(); ++I, ++index) {
5577 const Type* Ty = I->Ty->get();
5578 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5579 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5580 ParamTypeList.push_back(Ty);
5581 if (Ty != Type::VoidTy && I->Attrs != Attribute::None)
5582 Attrs.push_back(AttributeWithIndex::get(index, I->Attrs));
5585 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None)
5586 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(8) - (11)].Attributes)));
5588 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5589 if (isVarArg) ParamTypeList.pop_back();
5593 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
5595 FunctionType *FT = FunctionType::get(*(yyvsp[(3) - (11)].TypeVal), ParamTypeList, isVarArg);
5596 const PointerType *PFT = PointerType::getUnqual(FT);
5597 delete (yyvsp[(3) - (11)].TypeVal);
5600 if (!FunctionName.empty()) {
5601 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5603 ID = ValID::createGlobalID(CurModule.Values.size());
5607 // See if this function was forward referenced. If so, recycle the object.
5608 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5609 // Move the function to the end of the list, from whereever it was
5610 // previously inserted.
5611 Fn = cast<Function>(FWRef);
5612 assert(Fn->getAttributes().isEmpty() &&
5613 "Forward reference has parameter attributes!");
5614 CurModule.CurrentModule->getFunctionList().remove(Fn);
5615 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5616 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5617 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5618 if (Fn->getFunctionType() != FT ) {
5619 // The existing function doesn't have the same type. This is an overload
5621 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5622 } else if (Fn->getAttributes() != PAL) {
5623 // The existing function doesn't have the same parameter attributes.
5624 // This is an overload error.
5625 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5626 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5627 // Neither the existing or the current function is a declaration and they
5628 // have the same name and same type. Clearly this is a redefinition.
5629 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5630 } else if (Fn->isDeclaration()) {
5631 // Make sure to strip off any argument names so we can't get conflicts.
5632 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5636 } else { // Not already defined?
5637 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5638 CurModule.CurrentModule);
5639 InsertValue(Fn, CurModule.Values);
5643 CurFun.FunctionStart(Fn);
5645 if (CurFun.isDeclare) {
5646 // If we have declaration, always overwrite linkage. This will allow us to
5647 // correctly handle cases, when pointer to function is passed as argument to
5648 // another function.
5649 Fn->setLinkage(CurFun.Linkage);
5650 Fn->setVisibility(CurFun.Visibility);
5652 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5653 Fn->setAttributes(PAL);
5654 Fn->setAlignment((yyvsp[(10) - (11)].UIntVal));
5655 if ((yyvsp[(9) - (11)].StrVal)) {
5656 Fn->setSection(*(yyvsp[(9) - (11)].StrVal));
5657 delete (yyvsp[(9) - (11)].StrVal);
5659 if ((yyvsp[(11) - (11)].StrVal)) {
5660 Fn->setGC((yyvsp[(11) - (11)].StrVal)->c_str());
5661 delete (yyvsp[(11) - (11)].StrVal);
5664 // Add all of the arguments we parsed to the function...
5665 if ((yyvsp[(6) - (11)].ArgList)) { // Is null if empty...
5666 if (isVarArg) { // Nuke the last entry
5667 assert((yyvsp[(6) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(6) - (11)].ArgList)->back().Name == 0 &&
5668 "Not a varargs marker!");
5669 delete (yyvsp[(6) - (11)].ArgList)->back().Ty;
5670 (yyvsp[(6) - (11)].ArgList)->pop_back(); // Delete the last entry
5672 Function::arg_iterator ArgIt = Fn->arg_begin();
5673 Function::arg_iterator ArgEnd = Fn->arg_end();
5675 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin();
5676 I != (yyvsp[(6) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5677 delete I->Ty; // Delete the typeholder...
5678 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5684 delete (yyvsp[(6) - (11)].ArgList); // We're now done with the argument list
5691 #line 2510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5693 (yyval.FunctionVal) = CurFun.CurrentFunction;
5695 // Make sure that we keep track of the linkage type even if there was a
5696 // previous "declare".
5697 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5698 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5703 #line 2521 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5705 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5711 #line 2526 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5713 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5714 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5715 (yyval.FunctionVal) = CurFun.CurrentFunction;
5716 CurFun.FunctionDone();
5722 #line 2538 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5724 (yyval.BoolVal) = false;
5730 #line 2542 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5732 (yyval.BoolVal) = true;
5738 #line 2547 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5739 { // A reference to a direct constant
5740 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5746 #line 2551 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5748 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5754 #line 2555 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5755 { // arbitrary precision integer constants
5756 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5757 delete (yyvsp[(1) - (1)].APIntVal);
5763 #line 2560 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5764 { // arbitrary precision integer constants
5765 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5766 delete (yyvsp[(1) - (1)].APIntVal);
5772 #line 2565 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5773 { // Perhaps it's an FP constant?
5774 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5780 #line 2569 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5782 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5788 #line 2573 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5790 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5796 #line 2577 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5798 (yyval.ValIDVal) = ValID::createNull();
5804 #line 2581 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5806 (yyval.ValIDVal) = ValID::createUndef();
5812 #line 2585 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5813 { // A vector zero constant.
5814 (yyval.ValIDVal) = ValID::createZeroInit();
5820 #line 2589 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5821 { // Nonempty unsized packed vector
5822 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5823 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5825 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5826 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5828 VectorType* pt = VectorType::get(ETy, NumElements);
5829 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5831 // Verify all elements are correct type!
5832 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5833 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5834 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5835 ETy->getDescription() +"' as required!\nIt is of type '" +
5836 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5839 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5840 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5846 #line 2611 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5847 { // Nonempty unsized arr
5848 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5849 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5851 if (!ETy->isFirstClassType())
5852 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5854 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5855 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5857 // Verify all elements are correct type!
5858 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5859 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5860 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5861 ETy->getDescription() +"' as required!\nIt is of type '"+
5862 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5865 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5866 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5872 #line 2633 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5874 // Use undef instead of an array because it's inconvenient to determine
5875 // the element type at this point, there being no elements to examine.
5876 (yyval.ValIDVal) = ValID::createUndef();
5882 #line 2639 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5884 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5885 const Type *ETy = Type::Int8Ty;
5887 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5889 std::vector<Constant*> Vals;
5890 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5891 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5892 delete (yyvsp[(2) - (2)].StrVal);
5893 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5899 #line 2652 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5901 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5902 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5903 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5905 const StructType *STy = StructType::get(Elements);
5906 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5908 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5909 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5915 #line 2664 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5917 const StructType *STy = StructType::get(std::vector<const Type*>());
5918 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5924 #line 2669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5926 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5927 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5928 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5930 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5931 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5933 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5934 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5940 #line 2681 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5942 const StructType *STy = StructType::get(std::vector<const Type*>(),
5944 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5950 #line 2687 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5952 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5958 #line 2691 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5960 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5961 delete (yyvsp[(3) - (5)].StrVal);
5962 delete (yyvsp[(5) - (5)].StrVal);
5968 #line 2701 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5969 { // Is it an integer reference...?
5970 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5976 #line 2705 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5978 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5984 #line 2709 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5985 { // Is it a named reference...?
5986 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5987 delete (yyvsp[(1) - (1)].StrVal);
5993 #line 2714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
5994 { // Is it a named reference...?
5995 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5996 delete (yyvsp[(1) - (1)].StrVal);
6002 #line 2727 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6004 if (!UpRefs.empty())
6005 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
6006 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
6007 delete (yyvsp[(1) - (2)].TypeVal);
6013 #line 2736 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6015 (yyval.ValueList) = new std::vector<Value *>();
6016 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
6022 #line 2741 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6024 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6030 #line 2746 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6032 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6038 #line 2750 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6039 { // Do not allow functions with 0 basic blocks
6040 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6046 #line 2759 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6048 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6050 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6051 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6052 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6058 #line 2768 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6061 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6062 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6063 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6064 " is incorrect, expected %" + utostr((unsigned)ValNum));
6066 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6067 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6073 #line 2781 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6075 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6076 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6077 if (CI2->getParent() == 0)
6078 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6079 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6080 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6086 #line 2790 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6087 { // Empty space between instruction lists
6088 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6094 #line 2794 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6095 { // Labelled (named) basic block
6096 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6097 delete (yyvsp[(1) - (1)].StrVal);
6104 #line 2802 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6105 { // Return with a result...
6106 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6107 assert(!VL.empty() && "Invalid ret operands!");
6108 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6109 if (VL.size() > 1 ||
6110 (isa<StructType>(ReturnType) &&
6111 (VL.empty() || VL[0]->getType() != ReturnType))) {
6112 Value *RV = UndefValue::get(ReturnType);
6113 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6114 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6115 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6118 (yyval.TermInstVal) = ReturnInst::Create(RV);
6120 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6122 delete (yyvsp[(2) - (2)].ValueList);
6128 #line 2822 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6129 { // Return with no result...
6130 (yyval.TermInstVal) = ReturnInst::Create();
6136 #line 2826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6137 { // Unconditional Branch...
6138 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6140 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6145 #line 2831 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6147 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6148 GEN_ERROR("Branch condition must have type i1");
6149 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6151 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6153 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6155 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6160 #line 2842 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6162 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6164 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6166 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6167 (yyval.TermInstVal) = S;
6169 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6170 E = (yyvsp[(8) - (9)].JumpTable)->end();
6171 for (; I != E; ++I) {
6172 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6173 S->addCase(CI, I->second);
6175 GEN_ERROR("Switch case is constant, but not a simple integer");
6177 delete (yyvsp[(8) - (9)].JumpTable);
6183 #line 2861 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6185 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6187 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6189 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6190 (yyval.TermInstVal) = S;
6196 #line 2871 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6199 // Handle the short syntax
6200 const PointerType *PFTy = 0;
6201 const FunctionType *Ty = 0;
6202 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (15)].TypeVal)->get())) ||
6203 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6204 // Pull out the types of all of the arguments...
6205 std::vector<const Type*> ParamTypes;
6206 ParamList::iterator I = (yyvsp[(7) - (15)].ParamList)->begin(), E = (yyvsp[(7) - (15)].ParamList)->end();
6207 for (; I != E; ++I) {
6208 const Type *Ty = I->Val->getType();
6209 if (Ty == Type::VoidTy)
6210 GEN_ERROR("Short call syntax cannot be used with varargs");
6211 ParamTypes.push_back(Ty);
6214 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (15)].TypeVal)))
6215 GEN_ERROR("Invalid result type for LLVM function");
6217 Ty = FunctionType::get((yyvsp[(4) - (15)].TypeVal)->get(), ParamTypes, false);
6218 PFTy = PointerType::getUnqual(Ty);
6221 delete (yyvsp[(4) - (15)].TypeVal);
6223 Value *V = getVal(PFTy, (yyvsp[(5) - (15)].ValIDVal)); // Get the function we're calling...
6225 BasicBlock *Normal = getBBVal((yyvsp[(12) - (15)].ValIDVal));
6227 BasicBlock *Except = getBBVal((yyvsp[(15) - (15)].ValIDVal));
6230 SmallVector<AttributeWithIndex, 8> Attrs;
6231 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6233 Attributes RetAttrs = (yyvsp[(3) - (15)].Attributes);
6234 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None) {
6235 if ((yyvsp[(9) - (15)].Attributes) & Attribute::ZExt) {
6236 RetAttrs = RetAttrs | Attribute::ZExt;
6237 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::ZExt;
6239 if ((yyvsp[(9) - (15)].Attributes) & Attribute::SExt) {
6240 RetAttrs = RetAttrs | Attribute::SExt;
6241 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::SExt;
6243 if ((yyvsp[(9) - (15)].Attributes) & Attribute::InReg) {
6244 RetAttrs = RetAttrs | Attribute::InReg;
6245 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::InReg;
6248 if (RetAttrs != Attribute::None)
6249 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6251 // Check the arguments
6253 if ((yyvsp[(7) - (15)].ParamList)->empty()) { // Has no arguments?
6254 // Make sure no arguments is a good thing!
6255 if (Ty->getNumParams() != 0)
6256 GEN_ERROR("No arguments passed to a function that "
6257 "expects arguments");
6258 } else { // Has arguments?
6259 // Loop through FunctionType's arguments and ensure they are specified
6261 FunctionType::param_iterator I = Ty->param_begin();
6262 FunctionType::param_iterator E = Ty->param_end();
6263 ParamList::iterator ArgI = (yyvsp[(7) - (15)].ParamList)->begin(), ArgE = (yyvsp[(7) - (15)].ParamList)->end();
6266 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6267 if (ArgI->Val->getType() != *I)
6268 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6269 (*I)->getDescription() + "'");
6270 Args.push_back(ArgI->Val);
6271 if (ArgI->Attrs != Attribute::None)
6272 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6275 if (Ty->isVarArg()) {
6277 for (; ArgI != ArgE; ++ArgI, ++index) {
6278 Args.push_back(ArgI->Val); // push the remaining varargs
6279 if (ArgI->Attrs != Attribute::None)
6280 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6282 } else if (I != E || ArgI != ArgE)
6283 GEN_ERROR("Invalid number of parameters detected");
6285 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None)
6286 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (15)].Attributes)));
6289 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6291 // Create the InvokeInst
6292 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6293 Args.begin(), Args.end());
6294 II->setCallingConv((yyvsp[(2) - (15)].UIntVal));
6295 II->setAttributes(PAL);
6296 (yyval.TermInstVal) = II;
6297 delete (yyvsp[(7) - (15)].ParamList);
6303 #line 2974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6305 (yyval.TermInstVal) = new UnwindInst();
6311 #line 2978 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6313 (yyval.TermInstVal) = new UnreachableInst();
6319 #line 2985 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6321 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6322 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6325 GEN_ERROR("May only switch on a constant pool value");
6327 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6329 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6334 #line 2996 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6336 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6337 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6341 GEN_ERROR("May only switch on a constant pool value");
6343 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6345 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6350 #line 3009 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6352 // Is this definition named?? if so, assign the name...
6353 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6355 InsertValue((yyvsp[(2) - (2)].InstVal));
6356 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6362 #line 3018 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6365 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6367 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6368 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6369 " is incorrect, expected %" + utostr((unsigned)ValNum));
6371 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6377 #line 3031 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6378 { // Used for PHI nodes
6379 if (!UpRefs.empty())
6380 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6381 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6382 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6384 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6386 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6387 delete (yyvsp[(1) - (6)].TypeVal);
6392 #line 3042 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6394 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6395 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6397 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6399 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6404 #line 3052 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6406 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6407 if (!UpRefs.empty())
6408 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6409 // Used for call and invoke instructions
6410 (yyval.ParamList) = new ParamList();
6411 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6412 (yyval.ParamList)->push_back(E);
6413 delete (yyvsp[(1) - (4)].TypeVal);
6419 #line 3063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6421 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6422 // Labels are only valid in ASMs
6423 (yyval.ParamList) = new ParamList();
6424 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6425 (yyval.ParamList)->push_back(E);
6431 #line 3071 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6433 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6434 if (!UpRefs.empty())
6435 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6436 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6437 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6438 (yyval.ParamList)->push_back(E);
6439 delete (yyvsp[(3) - (6)].TypeVal);
6445 #line 3081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6447 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6448 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6449 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6450 (yyval.ParamList)->push_back(E);
6456 #line 3088 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6457 { (yyval.ParamList) = new ParamList(); ;}
6461 #line 3091 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6462 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6466 #line 3092 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6468 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6469 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6475 #line 3100 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6477 (yyval.ConstantList) = new std::vector<unsigned>();
6478 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6479 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6480 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6485 #line 3106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6487 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6488 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6489 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6490 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6496 #line 3115 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6498 (yyval.BoolVal) = true;
6504 #line 3119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6506 (yyval.BoolVal) = false;
6512 #line 3124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6514 if (!UpRefs.empty())
6515 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6516 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6517 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6519 "Arithmetic operator requires integer, FP, or packed operands");
6520 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6522 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6524 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6525 if ((yyval.InstVal) == 0)
6526 GEN_ERROR("binary operator returned null");
6527 delete (yyvsp[(2) - (5)].TypeVal);
6532 #line 3140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6534 if (!UpRefs.empty())
6535 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6536 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6537 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6538 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6539 GEN_ERROR("Logical operator requires integral operands");
6541 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6543 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6545 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6546 if ((yyval.InstVal) == 0)
6547 GEN_ERROR("binary operator returned null");
6548 delete (yyvsp[(2) - (5)].TypeVal);
6553 #line 3157 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6555 if (!UpRefs.empty())
6556 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6557 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6559 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6561 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6562 if ((yyval.InstVal) == 0)
6563 GEN_ERROR("icmp operator returned null");
6564 delete (yyvsp[(3) - (6)].TypeVal);
6569 #line 3169 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6571 if (!UpRefs.empty())
6572 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6573 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6575 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6577 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6578 if ((yyval.InstVal) == 0)
6579 GEN_ERROR("fcmp operator returned null");
6580 delete (yyvsp[(3) - (6)].TypeVal);
6585 #line 3181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6587 if (!UpRefs.empty())
6588 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6589 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6590 GEN_ERROR("Scalar types not supported by vicmp instruction");
6591 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6593 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6595 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6596 if ((yyval.InstVal) == 0)
6597 GEN_ERROR("vicmp operator returned null");
6598 delete (yyvsp[(3) - (6)].TypeVal);
6603 #line 3195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6605 if (!UpRefs.empty())
6606 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6607 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6608 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6609 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6611 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6613 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6614 if ((yyval.InstVal) == 0)
6615 GEN_ERROR("vfcmp operator returned null");
6616 delete (yyvsp[(3) - (6)].TypeVal);
6621 #line 3209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6623 if (!UpRefs.empty())
6624 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6625 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6626 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6627 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6628 GEN_ERROR("invalid cast opcode for cast from '" +
6629 Val->getType()->getDescription() + "' to '" +
6630 DestTy->getDescription() + "'");
6631 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6632 delete (yyvsp[(4) - (4)].TypeVal);
6637 #line 3221 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6639 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6641 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6642 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6643 GEN_ERROR("vector select value types must be vector types");
6644 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6645 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6646 if (cond_type->getElementType() != Type::Int1Ty)
6647 GEN_ERROR("vector select condition element type must be boolean");
6648 if (cond_type->getNumElements() != select_type->getNumElements())
6649 GEN_ERROR("vector select number of elements must be the same");
6651 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6652 GEN_ERROR("select condition must be boolean");
6654 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6655 GEN_ERROR("select value types must match");
6656 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6662 #line 3242 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6664 if (!UpRefs.empty())
6665 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6666 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6667 delete (yyvsp[(4) - (4)].TypeVal);
6673 #line 3249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6675 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6676 GEN_ERROR("Invalid extractelement operands");
6677 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6683 #line 3255 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6685 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6686 GEN_ERROR("Invalid insertelement operands");
6687 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6693 #line 3261 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6695 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6696 GEN_ERROR("Invalid shufflevector operands");
6697 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6703 #line 3267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6705 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6706 if (!Ty->isFirstClassType())
6707 GEN_ERROR("PHI node operands must be of first class type");
6708 (yyval.InstVal) = PHINode::Create(Ty);
6709 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6710 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6711 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6712 GEN_ERROR("All elements of a PHI node must be of the same type");
6713 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6714 (yyvsp[(2) - (2)].PHIList)->pop_front();
6716 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6722 #line 3283 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6725 // Handle the short syntax
6726 const PointerType *PFTy = 0;
6727 const FunctionType *Ty = 0;
6728 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (9)].TypeVal)->get())) ||
6729 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6730 // Pull out the types of all of the arguments...
6731 std::vector<const Type*> ParamTypes;
6732 ParamList::iterator I = (yyvsp[(7) - (9)].ParamList)->begin(), E = (yyvsp[(7) - (9)].ParamList)->end();
6733 for (; I != E; ++I) {
6734 const Type *Ty = I->Val->getType();
6735 if (Ty == Type::VoidTy)
6736 GEN_ERROR("Short call syntax cannot be used with varargs");
6737 ParamTypes.push_back(Ty);
6740 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (9)].TypeVal)))
6741 GEN_ERROR("Invalid result type for LLVM function");
6743 Ty = FunctionType::get((yyvsp[(4) - (9)].TypeVal)->get(), ParamTypes, false);
6744 PFTy = PointerType::getUnqual(Ty);
6747 Value *V = getVal(PFTy, (yyvsp[(5) - (9)].ValIDVal)); // Get the function we're calling...
6750 // Check for call to invalid intrinsic to avoid crashing later.
6751 if (Function *theF = dyn_cast<Function>(V)) {
6752 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6753 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6754 !theF->getIntrinsicID(true))
6755 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6756 theF->getName() + "'");
6759 // Set up the Attributes for the function
6760 SmallVector<AttributeWithIndex, 8> Attrs;
6761 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6763 Attributes RetAttrs = (yyvsp[(3) - (9)].Attributes);
6764 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None) {
6765 if ((yyvsp[(9) - (9)].Attributes) & Attribute::ZExt) {
6766 RetAttrs = RetAttrs | Attribute::ZExt;
6767 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::ZExt;
6769 if ((yyvsp[(9) - (9)].Attributes) & Attribute::SExt) {
6770 RetAttrs = RetAttrs | Attribute::SExt;
6771 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::SExt;
6773 if ((yyvsp[(9) - (9)].Attributes) & Attribute::InReg) {
6774 RetAttrs = RetAttrs | Attribute::InReg;
6775 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::InReg;
6778 if (RetAttrs != Attribute::None)
6779 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6781 // Check the arguments
6783 if ((yyvsp[(7) - (9)].ParamList)->empty()) { // Has no arguments?
6784 // Make sure no arguments is a good thing!
6785 if (Ty->getNumParams() != 0)
6786 GEN_ERROR("No arguments passed to a function that "
6787 "expects arguments");
6788 } else { // Has arguments?
6789 // Loop through FunctionType's arguments and ensure they are specified
6790 // correctly. Also, gather any parameter attributes.
6791 FunctionType::param_iterator I = Ty->param_begin();
6792 FunctionType::param_iterator E = Ty->param_end();
6793 ParamList::iterator ArgI = (yyvsp[(7) - (9)].ParamList)->begin(), ArgE = (yyvsp[(7) - (9)].ParamList)->end();
6796 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6797 if (ArgI->Val->getType() != *I)
6798 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6799 (*I)->getDescription() + "'");
6800 Args.push_back(ArgI->Val);
6801 if (ArgI->Attrs != Attribute::None)
6802 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6804 if (Ty->isVarArg()) {
6806 for (; ArgI != ArgE; ++ArgI, ++index) {
6807 Args.push_back(ArgI->Val); // push the remaining varargs
6808 if (ArgI->Attrs != Attribute::None)
6809 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6811 } else if (I != E || ArgI != ArgE)
6812 GEN_ERROR("Invalid number of parameters detected");
6814 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None)
6815 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (9)].Attributes)));
6817 // Finish off the Attributes and check them
6820 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6822 // Create the call node
6823 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6824 CI->setTailCall((yyvsp[(1) - (9)].BoolVal));
6825 CI->setCallingConv((yyvsp[(2) - (9)].UIntVal));
6826 CI->setAttributes(PAL);
6827 (yyval.InstVal) = CI;
6828 delete (yyvsp[(7) - (9)].ParamList);
6829 delete (yyvsp[(4) - (9)].TypeVal);
6835 #line 3392 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6837 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6843 #line 3397 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6845 (yyval.BoolVal) = true;
6851 #line 3401 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6853 (yyval.BoolVal) = false;
6859 #line 3408 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6861 if (!UpRefs.empty())
6862 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6863 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6864 delete (yyvsp[(2) - (3)].TypeVal);
6870 #line 3415 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6872 if (!UpRefs.empty())
6873 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6874 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6875 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6876 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6878 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6879 delete (yyvsp[(2) - (6)].TypeVal);
6884 #line 3425 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6886 if (!UpRefs.empty())
6887 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6888 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6889 delete (yyvsp[(2) - (3)].TypeVal);
6895 #line 3432 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6897 if (!UpRefs.empty())
6898 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6899 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6900 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6901 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6903 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6904 delete (yyvsp[(2) - (6)].TypeVal);
6909 #line 3442 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6911 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6912 GEN_ERROR("Trying to free nonpointer type " +
6913 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6914 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6920 #line 3450 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6922 if (!UpRefs.empty())
6923 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6924 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6925 GEN_ERROR("Can't load from nonpointer type: " +
6926 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6927 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6928 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6929 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6930 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6932 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6933 delete (yyvsp[(3) - (5)].TypeVal);
6938 #line 3464 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6940 if (!UpRefs.empty())
6941 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6942 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6944 GEN_ERROR("Can't store to a nonpointer type: " +
6945 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6946 const Type *ElTy = PT->getElementType();
6947 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6948 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6949 "' into space of type '" + ElTy->getDescription() + "'");
6951 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6953 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6954 delete (yyvsp[(5) - (7)].TypeVal);
6959 #line 3481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6961 if (!UpRefs.empty())
6962 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6963 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6964 GEN_ERROR("getresult insn requires an aggregate operand");
6965 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6966 GEN_ERROR("Invalid getresult index for type '" +
6967 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6969 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6971 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6972 delete (yyvsp[(2) - (5)].TypeVal);
6977 #line 3495 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6979 if (!UpRefs.empty())
6980 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6981 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6982 GEN_ERROR("getelementptr insn requires pointer operand");
6984 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6985 GEN_ERROR("Invalid getelementptr indices for type '" +
6986 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6987 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6989 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6990 delete (yyvsp[(2) - (4)].TypeVal);
6991 delete (yyvsp[(4) - (4)].ValueList);
6996 #line 3510 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
6998 if (!UpRefs.empty())
6999 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
7000 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
7001 GEN_ERROR("extractvalue insn requires an aggregate operand");
7003 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
7004 GEN_ERROR("Invalid extractvalue indices for type '" +
7005 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7006 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7008 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
7009 delete (yyvsp[(2) - (4)].TypeVal);
7010 delete (yyvsp[(4) - (4)].ConstantList);
7015 #line 3525 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
7017 if (!UpRefs.empty())
7018 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
7019 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
7020 GEN_ERROR("extractvalue insn requires an aggregate operand");
7022 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
7023 GEN_ERROR("Invalid insertvalue indices for type '" +
7024 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
7025 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
7026 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
7028 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
7029 delete (yyvsp[(2) - (7)].TypeVal);
7030 delete (yyvsp[(5) - (7)].TypeVal);
7031 delete (yyvsp[(7) - (7)].ConstantList);
7036 /* Line 1267 of yacc.c. */
7037 #line 7038 "llvmAsmParser.tab.c"
7040 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7044 YY_STACK_PRINT (yyss, yyssp);
7049 /* Now `shift' the result of the reduction. Determine what state
7050 that goes to, based on the state we popped back to and the rule
7051 number reduced by. */
7055 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7056 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7057 yystate = yytable[yystate];
7059 yystate = yydefgoto[yyn - YYNTOKENS];
7064 /*------------------------------------.
7065 | yyerrlab -- here on detecting error |
7066 `------------------------------------*/
7068 /* If not already recovering from an error, report this error. */
7072 #if ! YYERROR_VERBOSE
7073 yyerror (YY_("syntax error"));
7076 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7077 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7079 YYSIZE_T yyalloc = 2 * yysize;
7080 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7081 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7082 if (yymsg != yymsgbuf)
7083 YYSTACK_FREE (yymsg);
7084 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7086 yymsg_alloc = yyalloc;
7090 yymsg_alloc = sizeof yymsgbuf;
7094 if (0 < yysize && yysize <= yymsg_alloc)
7096 (void) yysyntax_error (yymsg, yystate, yychar);
7101 yyerror (YY_("syntax error"));
7103 goto yyexhaustedlab;
7111 if (yyerrstatus == 3)
7113 /* If just tried and failed to reuse look-ahead token after an
7114 error, discard it. */
7116 if (yychar <= YYEOF)
7118 /* Return failure if at end of input. */
7119 if (yychar == YYEOF)
7124 yydestruct ("Error: discarding",
7130 /* Else will try to reuse look-ahead token after shifting the error
7135 /*---------------------------------------------------.
7136 | yyerrorlab -- error raised explicitly by YYERROR. |
7137 `---------------------------------------------------*/
7140 /* Pacify compilers like GCC when the user code never invokes
7141 YYERROR and the label yyerrorlab therefore never appears in user
7143 if (/*CONSTCOND*/ 0)
7146 /* Do not reclaim the symbols of the rule which action triggered
7150 YY_STACK_PRINT (yyss, yyssp);
7155 /*-------------------------------------------------------------.
7156 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7157 `-------------------------------------------------------------*/
7159 yyerrstatus = 3; /* Each real token shifted decrements this. */
7163 yyn = yypact[yystate];
7164 if (yyn != YYPACT_NINF)
7167 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7175 /* Pop the current state because it cannot handle the error token. */
7180 yydestruct ("Error: popping",
7181 yystos[yystate], yyvsp);
7184 YY_STACK_PRINT (yyss, yyssp);
7193 /* Shift the error token. */
7194 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7200 /*-------------------------------------.
7201 | yyacceptlab -- YYACCEPT comes here. |
7202 `-------------------------------------*/
7207 /*-----------------------------------.
7208 | yyabortlab -- YYABORT comes here. |
7209 `-----------------------------------*/
7215 /*-------------------------------------------------.
7216 | yyexhaustedlab -- memory exhaustion comes here. |
7217 `-------------------------------------------------*/
7219 yyerror (YY_("memory exhausted"));
7225 if (yychar != YYEOF && yychar != YYEMPTY)
7226 yydestruct ("Cleanup: discarding lookahead",
7228 /* Do not reclaim the symbols of the rule which action triggered
7229 this YYABORT or YYACCEPT. */
7231 YY_STACK_PRINT (yyss, yyssp);
7232 while (yyssp != yyss)
7234 yydestruct ("Cleanup: popping",
7235 yystos[*yyssp], yyvsp);
7240 YYSTACK_FREE (yyss);
7243 if (yymsg != yymsgbuf)
7244 YYSTACK_FREE (yymsg);
7246 /* Make sure YYID is used. */
7247 return YYID (yyresult);
7251 #line 3544 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
7254 // common code from the two 'RunVMAsmParser' functions
7255 static Module* RunParser(Module * M) {
7256 CurModule.CurrentModule = M;
7257 // Check to make sure the parser succeeded
7260 delete ParserResult;
7264 // Emit an error if there are any unresolved types left.
7265 if (!CurModule.LateResolveTypes.empty()) {
7266 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7267 if (DID.Type == ValID::LocalName) {
7268 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7270 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7273 delete ParserResult;
7277 // Emit an error if there are any unresolved values left.
7278 if (!CurModule.LateResolveValues.empty()) {
7279 Value *V = CurModule.LateResolveValues.back();
7280 std::map<Value*, std::pair<ValID, int> >::iterator I =
7281 CurModule.PlaceHolderInfo.find(V);
7283 if (I != CurModule.PlaceHolderInfo.end()) {
7284 ValID &DID = I->second.first;
7285 if (DID.Type == ValID::LocalName) {
7286 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7288 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7291 delete ParserResult;
7296 // Check to make sure that parsing produced a result
7300 // Reset ParserResult variable while saving its value for the result.
7301 Module *Result = ParserResult;
7307 void llvm::GenerateError(const std::string &message, int LineNo) {
7308 if (LineNo == -1) LineNo = LLLgetLineNo();
7309 // TODO: column number in exception
7311 TheParseError->setError(LLLgetFilename(), message, LineNo);
7315 int yyerror(const char *ErrorMsg) {
7316 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7317 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7318 if (yychar != YYEMPTY && yychar != 0) {
7319 errMsg += " while reading token: '";
7320 errMsg += std::string(LLLgetTokenStart(),
7321 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7323 GenerateError(errMsg);