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 "/Volumes/MacOS9/gcc/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 "/Volumes/MacOS9/gcc/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 354
1666 /* YYNRULES -- Number of states. */
1667 #define YYNSTATES 717
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 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1735 140, 143, 145, 147, 149, 150, 153, 155, 157, 159,
1736 161, 163, 165, 167, 169, 171, 172, 174, 176, 178,
1737 179, 181, 183, 184, 186, 188, 190, 192, 193, 195,
1738 197, 198, 200, 202, 204, 206, 208, 211, 213, 215,
1739 217, 219, 221, 223, 225, 227, 229, 232, 233, 236,
1740 238, 240, 242, 243, 246, 248, 250, 252, 254, 256,
1741 258, 260, 262, 264, 266, 267, 270, 271, 274, 275,
1742 278, 279, 283, 286, 287, 289, 290, 294, 296, 299,
1743 301, 303, 305, 307, 309, 311, 313, 315, 317, 321,
1744 323, 326, 332, 338, 344, 350, 354, 357, 363, 368,
1745 371, 373, 375, 377, 381, 383, 387, 389, 390, 392,
1746 396, 401, 405, 409, 414, 419, 423, 430, 436, 439,
1747 442, 445, 448, 451, 454, 457, 460, 463, 466, 469,
1748 472, 479, 485, 494, 501, 508, 516, 524, 532, 540,
1749 547, 556, 565, 571, 579, 583, 585, 587, 589, 591,
1750 592, 595, 602, 604, 605, 607, 610, 611, 615, 616,
1751 620, 624, 628, 632, 633, 642, 643, 653, 654, 664,
1752 670, 673, 677, 679, 683, 687, 691, 695, 697, 698,
1753 704, 708, 710, 714, 716, 717, 729, 731, 733, 738,
1754 740, 742, 745, 749, 750, 752, 754, 756, 758, 760,
1755 762, 764, 766, 768, 770, 772, 776, 780, 783, 786,
1756 790, 793, 799, 804, 806, 812, 814, 816, 818, 820,
1757 822, 824, 827, 829, 833, 836, 839, 843, 847, 850,
1758 851, 853, 856, 859, 863, 873, 883, 892, 908, 910,
1759 912, 919, 925, 928, 931, 938, 946, 951, 956, 963,
1760 970, 971, 972, 976, 979, 983, 986, 988, 994, 1000,
1761 1007, 1014, 1021, 1028, 1033, 1040, 1045, 1050, 1057, 1064,
1762 1067, 1077, 1079, 1081, 1082, 1086, 1093, 1097, 1104, 1107,
1763 1113, 1121, 1127, 1132, 1137
1766 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1767 static const yytype_int16 yyrhs[] =
1769 222, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1770 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1771 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1772 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1773 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1774 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1775 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1776 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1777 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1778 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1779 -1, 102, -1, 103, -1, 26, -1, 27, -1, 11,
1780 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1781 -1, 19, -1, 22, -1, 24, -1, 181, -1, -1,
1782 55, 159, 4, 160, -1, -1, 181, 161, -1, -1,
1783 7, 161, -1, 20, -1, 23, -1, 188, -1, -1,
1784 186, 161, -1, 42, -1, 44, -1, 43, -1, 45,
1785 -1, 47, -1, 49, -1, 46, -1, 48, -1, 51,
1786 -1, -1, 156, -1, 157, -1, 158, -1, -1, 46,
1787 -1, 48, -1, -1, 42, -1, 43, -1, 44, -1,
1788 47, -1, -1, 44, -1, 42, -1, -1, 63, -1,
1789 64, -1, 65, -1, 66, -1, 67, -1, 62, 4,
1790 -1, 142, -1, 121, -1, 141, -1, 122, -1, 144,
1791 -1, 145, -1, 147, -1, 148, -1, 149, -1, 54,
1792 4, -1, -1, 197, 196, -1, 144, -1, 142, -1,
1793 141, -1, -1, 199, 198, -1, 143, -1, 146, -1,
1794 144, -1, 142, -1, 141, -1, 150, -1, 151, -1,
1795 154, -1, 155, -1, 153, -1, -1, 201, 200, -1,
1796 -1, 152, 22, -1, -1, 54, 4, -1, -1, 162,
1797 54, 4, -1, 34, 22, -1, -1, 205, -1, -1,
1798 162, 208, 207, -1, 205, -1, 54, 4, -1, 11,
1799 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1800 -1, 17, -1, 50, -1, 209, -1, 210, 183, 163,
1801 -1, 244, -1, 164, 4, -1, 210, 159, 214, 160,
1802 201, -1, 10, 159, 214, 160, 201, -1, 165, 4,
1803 166, 210, 167, -1, 168, 4, 166, 210, 169, -1,
1804 170, 215, 171, -1, 170, 171, -1, 168, 170, 215,
1805 171, 169, -1, 168, 170, 171, 169, -1, 210, 197,
1806 -1, 210, -1, 10, -1, 211, -1, 213, 162, 211,
1807 -1, 213, -1, 213, 162, 39, -1, 39, -1, -1,
1808 210, -1, 215, 162, 210, -1, 210, 165, 218, 167,
1809 -1, 210, 165, 167, -1, 210, 172, 22, -1, 210,
1810 168, 218, 169, -1, 210, 170, 218, 171, -1, 210,
1811 170, 171, -1, 210, 168, 170, 218, 171, 169, -1,
1812 210, 168, 170, 171, 169, -1, 210, 40, -1, 210,
1813 41, -1, 210, 244, -1, 210, 217, -1, 210, 25,
1814 -1, 179, 3, -1, 179, 5, -1, 179, 4, -1,
1815 179, 6, -1, 11, 26, -1, 11, 27, -1, 180,
1816 9, -1, 176, 159, 216, 38, 210, 160, -1, 119,
1817 159, 216, 256, 160, -1, 133, 159, 216, 162, 216,
1818 162, 216, 160, -1, 174, 159, 216, 162, 216, 160,
1819 -1, 175, 159, 216, 162, 216, 160, -1, 90, 177,
1820 159, 216, 162, 216, 160, -1, 91, 178, 159, 216,
1821 162, 216, 160, -1, 92, 177, 159, 216, 162, 216,
1822 160, -1, 93, 178, 159, 216, 162, 216, 160, -1,
1823 135, 159, 216, 162, 216, 160, -1, 136, 159, 216,
1824 162, 216, 162, 216, 160, -1, 137, 159, 216, 162,
1825 216, 162, 216, 160, -1, 139, 159, 216, 257, 160,
1826 -1, 140, 159, 216, 162, 216, 257, 160, -1, 218,
1827 162, 216, -1, 216, -1, 32, -1, 33, -1, 37,
1828 -1, -1, 212, 244, -1, 125, 159, 221, 38, 210,
1829 160, -1, 223, -1, -1, 224, -1, 223, 224, -1,
1830 -1, 31, 225, 240, -1, -1, 30, 226, 241, -1,
1831 60, 59, 230, -1, 184, 18, 210, -1, 184, 18,
1832 10, -1, -1, 187, 191, 220, 219, 216, 183, 227,
1833 207, -1, -1, 187, 189, 191, 220, 219, 216, 183,
1834 228, 207, -1, -1, 187, 190, 191, 220, 219, 210,
1835 183, 229, 207, -1, 187, 191, 35, 194, 221, -1,
1836 52, 231, -1, 56, 161, 232, -1, 22, -1, 53,
1837 161, 22, -1, 68, 161, 22, -1, 165, 233, 167,
1838 -1, 233, 162, 22, -1, 22, -1, -1, 234, 162,
1839 210, 197, 182, -1, 210, 197, 182, -1, 234, -1,
1840 234, 162, 39, -1, 39, -1, -1, 195, 199, 212,
1841 186, 159, 235, 160, 201, 206, 203, 202, -1, 28,
1842 -1, 170, -1, 193, 191, 236, 237, -1, 29, -1,
1843 171, -1, 248, 239, -1, 192, 191, 236, -1, -1,
1844 61, -1, 3, -1, 4, -1, 5, -1, 6, -1,
1845 9, -1, 26, -1, 27, -1, 40, -1, 41, -1,
1846 25, -1, 168, 218, 169, -1, 165, 218, 167, -1,
1847 165, 167, -1, 172, 22, -1, 170, 218, 171, -1,
1848 170, 171, -1, 168, 170, 218, 171, 169, -1, 168,
1849 170, 171, 169, -1, 217, -1, 59, 242, 22, 162,
1850 22, -1, 7, -1, 8, -1, 181, -1, 186, -1,
1851 244, -1, 243, -1, 210, 245, -1, 246, -1, 247,
1852 162, 246, -1, 248, 249, -1, 238, 249, -1, 250,
1853 184, 251, -1, 250, 185, 251, -1, 250, 253, -1,
1854 -1, 21, -1, 69, 247, -1, 69, 10, -1, 70,
1855 17, 245, -1, 70, 11, 245, 162, 17, 245, 162,
1856 17, 245, -1, 71, 179, 245, 162, 17, 245, 165,
1857 252, 167, -1, 71, 179, 245, 162, 17, 245, 165,
1858 167, -1, 72, 195, 199, 212, 245, 159, 255, 160,
1859 201, 38, 17, 245, 73, 17, 245, -1, 73, -1,
1860 74, -1, 252, 179, 243, 162, 17, 245, -1, 179,
1861 243, 162, 17, 245, -1, 184, 259, -1, 185, 259,
1862 -1, 210, 165, 245, 162, 245, 167, -1, 254, 162,
1863 165, 245, 162, 245, 167, -1, 210, 197, 245, 197,
1864 -1, 17, 197, 245, 197, -1, 255, 162, 210, 197,
1865 245, 197, -1, 255, 162, 17, 197, 245, 197, -1,
1866 -1, -1, 256, 162, 246, -1, 162, 4, -1, 257,
1867 162, 4, -1, 58, 57, -1, 57, -1, 174, 210,
1868 245, 162, 245, -1, 175, 210, 245, 162, 245, -1,
1869 90, 177, 210, 245, 162, 245, -1, 91, 178, 210,
1870 245, 162, 245, -1, 92, 177, 210, 245, 162, 245,
1871 -1, 93, 178, 210, 245, 162, 245, -1, 176, 246,
1872 38, 210, -1, 133, 246, 162, 246, 162, 246, -1,
1873 134, 246, 162, 210, -1, 135, 246, 162, 246, -1,
1874 136, 246, 162, 246, 162, 246, -1, 137, 246, 162,
1875 246, 162, 246, -1, 132, 254, -1, 258, 195, 199,
1876 212, 245, 159, 255, 160, 201, -1, 261, -1, 36,
1877 -1, -1, 114, 210, 204, -1, 114, 210, 162, 11,
1878 245, 204, -1, 115, 210, 204, -1, 115, 210, 162,
1879 11, 245, 204, -1, 116, 246, -1, 260, 117, 210,
1880 245, 204, -1, 260, 118, 246, 162, 210, 245, 204,
1881 -1, 138, 210, 245, 162, 4, -1, 119, 210, 245,
1882 256, -1, 139, 210, 245, 257, -1, 140, 210, 245,
1883 162, 210, 245, 257, -1
1886 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1887 static const yytype_uint16 yyrline[] =
1889 0, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1143,
1890 1143, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 1145, 1145,
1891 1145, 1145, 1145, 1146, 1146, 1146, 1146, 1146, 1146, 1149,
1892 1149, 1150, 1150, 1151, 1151, 1152, 1152, 1153, 1153, 1157,
1893 1157, 1158, 1158, 1159, 1159, 1160, 1160, 1161, 1161, 1162,
1894 1162, 1163, 1163, 1164, 1165, 1170, 1171, 1171, 1171, 1171,
1895 1171, 1173, 1173, 1173, 1174, 1174, 1176, 1177, 1181, 1185,
1896 1190, 1196, 1196, 1198, 1199, 1204, 1210, 1211, 1212, 1213,
1897 1214, 1215, 1219, 1220, 1221, 1225, 1226, 1227, 1228, 1232,
1898 1233, 1234, 1238, 1239, 1240, 1241, 1242, 1246, 1247, 1248,
1899 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1264, 1265, 1266,
1900 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1277, 1278, 1283,
1901 1284, 1285, 1288, 1289, 1295, 1296, 1297, 1298, 1299, 1300,
1902 1301, 1302, 1303, 1304, 1307, 1308, 1314, 1315, 1322, 1323,
1903 1329, 1330, 1339, 1347, 1348, 1353, 1354, 1355, 1360, 1373,
1904 1373, 1373, 1373, 1373, 1373, 1373, 1376, 1380, 1384, 1391,
1905 1396, 1404, 1439, 1470, 1475, 1485, 1495, 1499, 1509, 1516,
1906 1525, 1532, 1537, 1542, 1549, 1550, 1557, 1564, 1572, 1578,
1907 1590, 1618, 1634, 1661, 1689, 1715, 1735, 1761, 1781, 1793,
1908 1800, 1866, 1876, 1886, 1892, 1902, 1908, 1918, 1924, 1930,
1909 1946, 1958, 1979, 1987, 1993, 2004, 2009, 2014, 2019, 2024,
1910 2030, 2036, 2042, 2050, 2061, 2065, 2073, 2073, 2076, 2076,
1911 2079, 2091, 2112, 2117, 2125, 2126, 2130, 2130, 2134, 2134,
1912 2137, 2140, 2164, 2176, 2175, 2187, 2186, 2196, 2195, 2206,
1913 2246, 2249, 2255, 2265, 2269, 2274, 2276, 2281, 2286, 2295,
1914 2305, 2316, 2320, 2329, 2338, 2343, 2492, 2492, 2494, 2503,
1915 2503, 2505, 2510, 2522, 2526, 2531, 2535, 2539, 2544, 2549,
1916 2553, 2557, 2561, 2565, 2569, 2573, 2595, 2617, 2623, 2636,
1917 2648, 2653, 2665, 2671, 2675, 2685, 2689, 2693, 2698, 2705,
1918 2705, 2711, 2720, 2725, 2730, 2734, 2743, 2752, 2765, 2774,
1919 2778, 2786, 2806, 2810, 2815, 2826, 2845, 2854, 2958, 2962,
1920 2969, 2980, 2993, 3002, 3015, 3026, 3036, 3047, 3055, 3065,
1921 3072, 3075, 3076, 3084, 3090, 3099, 3103, 3108, 3124, 3141,
1922 3153, 3165, 3179, 3193, 3205, 3226, 3233, 3239, 3245, 3251,
1923 3266, 3376, 3381, 3385, 3392, 3399, 3409, 3416, 3426, 3434,
1924 3448, 3465, 3479, 3494, 3509
1928 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1929 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1930 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1931 static const char *const yytname[] =
1933 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1934 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1935 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1936 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1937 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1938 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1939 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1940 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1941 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1942 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1943 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1944 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1945 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1946 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1947 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1948 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1949 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1950 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1951 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1952 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1953 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1954 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1955 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1956 "READNONE", "READONLY", "GC", "OPTSIZE", "NOINLINE", "ALWAYSINLINE",
1957 "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'",
1958 "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'",
1959 "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates",
1960 "FPredicates", "IntType", "FPType", "LocalName", "OptLocalName",
1961 "OptAddrSpace", "OptLocalAssign", "LocalNumber", "GlobalName",
1962 "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1963 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1964 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "Attribute",
1965 "OptAttributes", "RetAttr", "OptRetAttrs", "FuncAttr", "OptFuncAttrs",
1966 "OptGC", "OptAlign", "OptCAlign", "SectionString", "OptSection",
1967 "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types",
1968 "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI",
1969 "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal",
1970 "AliaseeRef", "Module", "DefinitionList", "Definition", "@1", "@2", "@3",
1971 "@4", "@5", "AsmBlock", "TargetDefinition", "LibrariesDefinition",
1972 "LibList", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1973 "FunctionHeader", "END", "Function", "FunctionProto", "OptSideEffect",
1974 "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal",
1975 "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1976 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ParamList",
1977 "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1978 "OptVolatile", "MemoryInst", 0
1983 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1985 static const yytype_uint16 yytoknum[] =
1987 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1988 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1989 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1990 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1991 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1992 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1993 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1994 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1995 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1996 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1997 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1998 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1999 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2000 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2001 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2002 405, 406, 407, 408, 409, 410, 411, 412, 413, 40,
2003 41, 61, 44, 42, 92, 91, 120, 93, 60, 62,
2008 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2009 static const yytype_uint16 yyr1[] =
2011 0, 173, 174, 174, 174, 174, 174, 174, 174, 174,
2012 174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
2013 176, 176, 176, 176, 176, 176, 176, 176, 176, 177,
2014 177, 177, 177, 177, 177, 177, 177, 177, 177, 178,
2015 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
2016 178, 178, 178, 178, 178, 179, 180, 180, 180, 180,
2017 180, 181, 181, 181, 182, 182, 183, 183, 184, 184,
2018 185, 186, 186, 187, 187, 188, 189, 189, 189, 189,
2019 189, 189, 190, 190, 190, 191, 191, 191, 191, 192,
2020 192, 192, 193, 193, 193, 193, 193, 194, 194, 194,
2021 195, 195, 195, 195, 195, 195, 195, 196, 196, 196,
2022 196, 196, 196, 196, 196, 196, 196, 197, 197, 198,
2023 198, 198, 199, 199, 200, 200, 200, 200, 200, 200,
2024 200, 200, 200, 200, 201, 201, 202, 202, 203, 203,
2025 204, 204, 205, 206, 206, 207, 207, 208, 208, 209,
2026 209, 209, 209, 209, 209, 209, 210, 210, 210, 210,
2027 210, 210, 210, 210, 210, 210, 210, 210, 210, 211,
2028 212, 212, 213, 213, 214, 214, 214, 214, 215, 215,
2029 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
2030 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
2031 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
2032 217, 217, 217, 217, 218, 218, 219, 219, 220, 220,
2033 221, 221, 222, 222, 223, 223, 225, 224, 226, 224,
2034 224, 224, 224, 227, 224, 228, 224, 229, 224, 224,
2035 224, 224, 230, 231, 231, 232, 233, 233, 233, 234,
2036 234, 235, 235, 235, 235, 236, 237, 237, 238, 239,
2037 239, 240, 241, 242, 242, 243, 243, 243, 243, 243,
2038 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
2039 243, 243, 243, 243, 243, 244, 244, 244, 244, 245,
2040 245, 246, 247, 247, 248, 248, 249, 249, 250, 250,
2041 250, 251, 251, 251, 251, 251, 251, 251, 251, 251,
2042 252, 252, 253, 253, 254, 254, 255, 255, 255, 255,
2043 255, 256, 256, 257, 257, 258, 258, 259, 259, 259,
2044 259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
2045 259, 259, 260, 260, 261, 261, 261, 261, 261, 261,
2046 261, 261, 261, 261, 261
2049 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2050 static const yytype_uint8 yyr2[] =
2052 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2053 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2054 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2055 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2056 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2057 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2058 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2059 2, 1, 1, 1, 0, 2, 1, 1, 1, 1,
2060 1, 1, 1, 1, 1, 0, 1, 1, 1, 0,
2061 1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
2062 0, 1, 1, 1, 1, 1, 2, 1, 1, 1,
2063 1, 1, 1, 1, 1, 1, 2, 0, 2, 1,
2064 1, 1, 0, 2, 1, 1, 1, 1, 1, 1,
2065 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2066 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
2067 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2068 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
2069 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
2070 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
2071 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2072 6, 5, 8, 6, 6, 7, 7, 7, 7, 6,
2073 8, 8, 5, 7, 3, 1, 1, 1, 1, 0,
2074 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
2075 3, 3, 3, 0, 8, 0, 9, 0, 9, 5,
2076 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
2077 3, 1, 3, 1, 0, 11, 1, 1, 4, 1,
2078 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
2079 1, 1, 1, 1, 1, 3, 3, 2, 2, 3,
2080 2, 5, 4, 1, 5, 1, 1, 1, 1, 1,
2081 1, 2, 1, 3, 2, 2, 3, 3, 2, 0,
2082 1, 2, 2, 3, 9, 9, 8, 15, 1, 1,
2083 6, 5, 2, 2, 6, 7, 4, 4, 6, 6,
2084 0, 0, 3, 2, 3, 2, 1, 5, 5, 6,
2085 6, 6, 6, 4, 6, 4, 4, 6, 6, 2,
2086 9, 1, 1, 0, 3, 6, 3, 6, 2, 5,
2090 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2091 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2092 means the default is an error. */
2093 static const yytype_uint16 yydefact[] =
2095 74, 61, 71, 62, 72, 63, 228, 226, 0, 0,
2096 0, 0, 0, 0, 85, 73, 0, 74, 224, 89,
2097 92, 0, 0, 240, 0, 0, 68, 0, 75, 76,
2098 78, 77, 79, 82, 80, 83, 81, 84, 86, 87,
2099 88, 85, 85, 219, 1, 225, 90, 91, 85, 229,
2100 93, 94, 95, 96, 85, 299, 227, 299, 0, 0,
2101 248, 241, 242, 230, 285, 286, 232, 149, 150, 151,
2102 154, 153, 152, 155, 156, 0, 0, 0, 0, 287,
2103 288, 157, 231, 159, 219, 219, 97, 218, 0, 100,
2104 100, 300, 295, 69, 259, 260, 261, 294, 243, 244,
2105 247, 0, 177, 160, 0, 0, 0, 0, 166, 178,
2106 0, 0, 177, 0, 0, 0, 99, 98, 0, 216,
2107 217, 0, 0, 101, 102, 103, 104, 105, 122, 262,
2108 0, 0, 343, 343, 298, 0, 245, 176, 117, 172,
2109 174, 0, 0, 0, 0, 0, 0, 165, 0, 0,
2110 158, 0, 0, 171, 0, 170, 0, 239, 149, 150,
2111 151, 154, 153, 152, 0, 0, 67, 67, 106, 0,
2112 256, 257, 258, 70, 342, 326, 0, 0, 0, 0,
2113 100, 308, 309, 2, 3, 4, 5, 6, 7, 8,
2114 9, 10, 14, 15, 16, 11, 12, 13, 0, 0,
2115 0, 0, 0, 0, 0, 0, 17, 18, 19, 20,
2116 21, 22, 23, 24, 25, 26, 27, 28, 0, 0,
2117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2118 296, 100, 312, 0, 341, 297, 313, 246, 169, 0,
2119 134, 67, 67, 168, 0, 179, 0, 134, 67, 67,
2120 0, 220, 197, 198, 193, 195, 194, 196, 199, 192,
2121 188, 189, 0, 0, 0, 0, 0, 0, 0, 0,
2122 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2123 191, 190, 233, 121, 120, 119, 123, 0, 325, 302,
2124 67, 292, 301, 0, 0, 55, 0, 122, 29, 30,
2125 31, 32, 33, 34, 35, 36, 37, 38, 0, 53,
2126 54, 49, 50, 51, 52, 39, 40, 41, 42, 43,
2127 44, 45, 46, 47, 48, 0, 0, 0, 140, 140,
2128 348, 67, 67, 339, 0, 0, 0, 0, 0, 67,
2129 67, 67, 67, 67, 0, 122, 0, 0, 0, 108,
2130 110, 109, 107, 111, 112, 113, 114, 115, 118, 175,
2131 173, 162, 163, 164, 167, 66, 161, 235, 237, 0,
2132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2133 0, 181, 215, 0, 0, 0, 185, 0, 182, 0,
2134 0, 0, 145, 0, 265, 266, 267, 268, 269, 274,
2135 270, 271, 272, 273, 263, 0, 0, 0, 0, 283,
2136 290, 289, 291, 0, 0, 303, 0, 0, 67, 67,
2137 67, 67, 0, 344, 0, 346, 321, 0, 0, 0,
2138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2139 0, 67, 0, 116, 128, 127, 124, 126, 125, 129,
2140 130, 133, 131, 132, 135, 145, 145, 0, 0, 0,
2141 0, 0, 321, 0, 0, 0, 0, 0, 0, 0,
2142 180, 166, 178, 0, 183, 184, 0, 0, 0, 0,
2143 234, 254, 264, 0, 277, 0, 0, 0, 280, 0,
2144 278, 293, 0, 0, 0, 0, 0, 0, 0, 0,
2145 0, 0, 352, 0, 0, 0, 335, 336, 0, 0,
2146 0, 0, 353, 0, 0, 0, 333, 0, 140, 0,
2147 236, 238, 67, 0, 0, 0, 0, 0, 0, 0,
2148 0, 0, 0, 0, 214, 187, 0, 0, 0, 0,
2149 0, 0, 147, 145, 253, 117, 251, 0, 0, 276,
2150 166, 0, 275, 279, 0, 0, 0, 0, 0, 0,
2151 0, 140, 141, 140, 0, 0, 0, 0, 0, 0,
2152 351, 323, 0, 67, 327, 328, 0, 0, 349, 67,
2153 221, 0, 0, 0, 0, 201, 0, 0, 0, 0,
2154 212, 0, 186, 0, 0, 67, 142, 148, 146, 65,
2155 0, 134, 0, 282, 0, 0, 0, 320, 329, 330,
2156 331, 332, 345, 347, 322, 0, 0, 334, 337, 338,
2157 324, 0, 320, 140, 0, 0, 0, 0, 0, 209,
2158 0, 0, 0, 203, 204, 200, 64, 250, 252, 117,
2159 143, 284, 281, 0, 0, 117, 117, 0, 314, 0,
2160 354, 0, 350, 205, 206, 207, 208, 0, 0, 0,
2161 213, 65, 144, 138, 0, 306, 0, 0, 0, 0,
2162 134, 0, 315, 134, 202, 210, 211, 249, 0, 136,
2163 304, 0, 305, 0, 108, 110, 117, 117, 0, 117,
2164 117, 340, 139, 0, 255, 0, 0, 317, 316, 0,
2165 0, 0, 137, 0, 0, 0, 117, 117, 311, 0,
2166 0, 319, 318, 310, 0, 0, 307
2169 /* YYDEFGOTO[NTERM-NUM]. */
2170 static const yytype_int16 yydefgoto[] =
2172 -1, 277, 278, 279, 308, 325, 164, 165, 79, 637,
2173 113, 12, 133, 80, 14, 15, 41, 42, 43, 48,
2174 54, 118, 128, 358, 238, 286, 169, 454, 361, 694,
2175 679, 423, 542, 663, 480, 543, 81, 166, 139, 156,
2176 140, 141, 110, 382, 409, 383, 121, 88, 157, 16,
2177 17, 18, 20, 19, 392, 455, 456, 63, 23, 61,
2178 101, 546, 547, 129, 172, 55, 96, 56, 49, 483,
2179 410, 83, 412, 291, 292, 57, 92, 93, 230, 667,
2180 134, 333, 647, 502, 512, 231, 232, 233, 234
2183 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2185 #define YYPACT_NINF -620
2186 static const yytype_int16 yypact[] =
2188 484, -620, -620, -620, -620, -620, -620, -620, -14, -116,
2189 -6, -83, 104, -31, 24, -620, 161, 528, -620, 238,
2190 204, 43, 49, -620, 5, 196, -620, 1912, -620, -620,
2191 -620, -620, -620, -620, -620, -620, -620, -620, -620, -620,
2192 -620, 173, 173, 227, -620, -620, -620, -620, 173, -620,
2193 -620, -620, -620, -620, 173, 202, -620, -9, 234, 243,
2194 246, -620, -620, -620, -620, -620, 67, -620, -620, -620,
2195 -620, -620, -620, -620, -620, 273, 285, 3, 624, -620,
2196 -620, -620, 4, -620, 201, 201, 253, -620, 81, 240,
2197 240, -620, -620, 39, -620, -620, -620, -620, -620, -620,
2198 -620, -59, 1564, -620, 128, 132, 643, 67, -620, 4,
2199 -114, 165, 1564, 145, 81, 81, -620, -620, 1605, -620,
2200 -620, 2014, 324, -620, -620, -620, -620, -620, -620, -620,
2201 -13, 188, 2299, 2299, -620, 328, -620, -620, 4, -620,
2202 189, 194, 2076, 2076, 186, -111, 2076, -620, 352, 205,
2203 -620, 2014, 2076, 67, 208, 4, 247, -620, 216, 351,
2204 355, 359, 365, 368, 269, 372, 1625, 306, -620, 1517,
2205 -620, -620, -620, -620, -620, -620, 325, 2094, 38, 373,
2206 240, -620, -620, -620, -620, -620, -620, -620, -620, -620,
2207 -620, -620, -620, -620, -620, -620, -620, -620, 298, 336,
2208 298, 336, 2076, 2076, 2076, 2076, -620, -620, -620, -620,
2209 -620, -620, -620, -620, -620, -620, -620, -620, 2076, 2076,
2210 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076, 2076,
2211 -620, 240, -620, 66, -620, -620, -620, -620, 231, 1791,
2212 -620, -17, -21, -620, 214, 4, 225, -620, 306, -5,
2213 1605, -620, -620, -620, -620, -620, -620, -620, -620, -620,
2214 -620, -620, 298, 336, 298, 336, 229, 230, 249, 250,
2215 251, 252, 256, 1809, 2117, 690, 364, 257, 259, 261,
2216 -620, -620, -620, -620, -620, -620, -620, 114, -620, 67,
2217 1019, -620, 262, 1189, 1189, -620, 1189, -620, -620, -620,
2218 -620, -620, -620, -620, -620, -620, -620, -620, 2076, -620,
2219 -620, -620, -620, -620, -620, -620, -620, -620, -620, -620,
2220 -620, -620, -620, -620, -620, 2076, 2076, 2076, -23, 28,
2221 -620, 1019, -18, 265, 266, 268, 272, 288, 289, 1019,
2222 1019, 1019, 1019, 1019, 383, -620, 2076, 2076, 398, -620,
2223 -620, -620, -620, -620, -620, -620, -620, -620, -620, -620,
2224 -620, 137, -620, -620, -620, -620, 137, -620, 145, 385,
2225 293, 294, 295, 297, 2014, 2014, 2014, 2014, 2014, 2014,
2226 2014, -620, -620, -56, 1069, -74, -620, -80, -620, 2014,
2227 2014, 2014, 296, 300, -620, -620, -620, -620, -620, -620,
2228 -620, -620, -620, -620, 396, 1832, 2135, 1239, 403, -620,
2229 -620, -620, -620, 2076, 299, -620, 301, 1517, 1019, 1019,
2230 1019, 1019, 8, -620, 33, -620, -620, 1189, 303, 2076,
2231 2076, 2076, 2076, 2076, 302, 304, 307, 308, 309, 2076,
2232 1517, 1019, 312, -620, -620, -620, -620, -620, -620, -620,
2233 -620, -620, -620, -620, -620, 296, 296, 2076, 2014, 2014,
2234 2014, 2014, -620, 317, 318, 319, 320, 304, 323, 2014,
2235 -620, 326, 1471, -77, -620, -620, 327, 330, 424, 2,
2236 -620, 1850, -620, 443, -620, -52, 1280, -73, -620, -72,
2237 -620, -620, 469, 471, 1189, 332, 334, 337, 338, 1189,
2238 494, 1189, 339, 343, 1189, 347, 4, -620, 348, 349,
2239 508, 519, 362, 2076, 1189, 1189, 4, 1189, 363, 2076,
2240 -620, -620, 26, 367, 375, 377, 387, 149, 2014, 2014,
2241 2014, 2014, 157, 2014, -620, -620, 357, 2014, 2014, 2076,
2242 505, 526, -620, 296, -620, 4, 391, 394, 393, -620,
2243 366, -62, -620, -620, 1189, 1189, 386, 1189, 1189, 1189,
2244 1189, 363, -620, 363, 2076, 1189, 395, 2076, 2076, 2076,
2245 -620, -620, 552, 1019, -620, -620, 405, 511, -620, 1019,
2246 -620, 2014, 2014, 2014, 2014, -620, 400, 406, 407, 408,
2247 -620, 304, -620, 411, 412, 57, -620, -620, -620, 11,
2248 1891, -620, 545, -620, 399, 413, 414, 2179, -620, -620,
2249 -620, -620, -620, -620, -620, 409, 1189, -620, -620, -620,
2250 -620, 304, 2179, 363, 417, 418, 423, 425, 2014, -620,
2251 2014, 2014, 180, -620, -620, -620, -620, -620, -620, 4,
2252 172, -620, -620, 556, -3, 46, 4, 181, -620, 422,
2253 362, 184, -620, -620, -620, -620, -620, 430, 431, 432,
2254 -620, 11, -620, 539, 1189, -620, 1337, -1, 865, 865,
2255 -620, 2197, -620, -620, -620, -620, -620, -620, 590, 445,
2256 -620, 433, -620, 1337, 446, 453, -620, -620, 86, 46,
2257 4, 137, -620, 582, -620, 596, 452, 231, 231, 598,
2258 865, 865, -620, 1189, 599, 1189, -620, -620, -620, 1189,
2259 544, 231, 231, -620, 603, 1189, -620
2262 /* YYPGOTO[NTERM-NUM]. */
2263 static const yytype_int16 yypgoto[] =
2265 -620, 42, 112, 200, -160, -158, -177, -620, 0, -39,
2266 -151, 531, -620, 9, -620, -620, -620, -620, 77, -620,
2267 -620, -620, -152, -620, -518, -620, -268, -620, -244, -620,
2268 -620, -311, -15, -620, -414, -620, -620, -26, 389, -164,
2269 -620, 514, 523, 142, -162, -261, 220, 263, 380, -620,
2270 -620, 625, -620, -620, -620, -620, -620, -620, -620, -620,
2271 -620, -620, -620, 559, -620, -620, -620, -620, -620, -620,
2272 -619, -82, 267, -198, -620, -620, 595, -620, 535, -620,
2273 -620, -620, 47, 215, -456, -620, 543, -620, -620
2276 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2277 positive, shift that token. If negative, reduce the rule which
2278 number is the opposite. If zero, do what YYDEFACT says.
2279 If YYTABLE_NINF, syntax error. */
2280 #define YYTABLE_NINF -224
2281 static const yytype_int16 yytable[] =
2283 11, 82, 296, 366, 280, 287, 330, 105, 295, 13,
2284 295, 532, 91, 385, 387, 170, 282, 11, 425, 499,
2285 94, 334, 335, 336, 337, 338, 13, 599, 297, 417,
2286 1, 344, 111, 3, 111, 5, 540, 111, 111, 21,
2287 326, 520, 521, 327, 501, 24, 131, 681, 146, 293,
2288 111, 146, 109, 25, 22, 294, 541, 147, 1, 111,
2289 244, 3, 500, 5, 696, 348, 29, 30, 31, 32,
2290 33, 34, 35, 36, 251, 37, 138, 440, 26, 345,
2291 109, 111, 469, 111, 281, 469, 138, 500, 469, 469,
2292 469, 475, 155, 11, 536, 474, 552, 367, 368, 553,
2293 469, -155, 370, 135, 372, 371, 469, 373, 136, 604,
2294 469, 470, 111, 119, 120, 549, 241, 242, 84, 85,
2295 245, 661, 27, 473, 699, 89, 249, 668, 669, 598,
2296 28, 90, 349, 350, 2, 632, 112, 4, 112, 422,
2297 -67, 112, 112, 155, 485, 487, 489, 427, 363, 442,
2298 362, 290, 351, 352, 112, 353, 354, 171, 355, 356,
2299 357, 44, 95, 112, 665, 650, 682, -67, 697, 698,
2300 60, 700, 701, 106, 227, 227, 328, 329, 290, 331,
2301 38, 39, 40, 346, 347, 112, 580, 112, 711, 712,
2302 424, -67, 332, 290, 290, 290, 290, 290, 339, 340,
2303 341, 342, 343, 290, 58, -155, 540, 578, 411, -155,
2304 59, 411, 411, 138, 411, 491, 112, 635, 62, -55,
2305 -55, -55, -55, 91, 155, 551, 102, 444, 445, 446,
2306 447, 505, 448, 507, 508, 509, 449, 450, 87, 451,
2307 452, 453, 252, 253, 228, 228, 50, 51, 52, 411,
2308 612, 53, 613, 494, 64, 65, 98, 411, 411, 411,
2309 411, 411, 86, 167, 87, 99, 1, 2, 100, 3,
2310 4, 5, 254, 255, 256, 257, 517, 103, 444, 445,
2311 446, 447, 418, 448, 46, 348, 47, 449, 450, 104,
2312 451, 452, 453, 248, 142, 116, 393, 117, 143, 419,
2313 420, 421, 122, 123, 124, 125, 126, 127, 150, 585,
2314 280, 564, 652, 444, 445, 446, 447, 590, 448, 572,
2315 441, 290, 449, 450, 148, 451, 452, 453, 168, 38,
2316 39, 40, 229, 229, 151, 152, 411, 411, 411, 411,
2317 660, 670, 572, 671, 673, 411, 671, 114, 115, 173,
2318 237, 239, 349, 350, 240, 243, 246, 640, 472, 411,
2319 -56, 111, 309, 310, -57, 247, 614, 250, -60, 617,
2320 618, 619, 351, 352, -59, 353, 354, -58, 355, 356,
2321 357, 258, 288, 364, 295, 365, 388, 290, 374, 375,
2322 281, 155, 298, 299, 300, 301, 302, 303, 304, 305,
2323 306, 307, 443, 290, 506, 290, 290, 290, 376, 377,
2324 378, 379, 411, 516, 155, 380, 389, 411, 390, 411,
2325 391, 439, 411, 457, 413, 490, 688, 428, 429, 691,
2326 430, 522, 411, 411, 431, 411, 311, 312, 313, 314,
2327 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2328 432, 433, 458, 459, 460, 545, 461, 482, 479, 481,
2329 472, 492, 539, 493, 510, 548, 511, 666, 504, 513,
2330 514, 515, 411, 411, 519, 411, 411, 411, 411, 528,
2331 529, 530, 531, 411, -223, 533, 554, 573, 555, 537,
2332 683, 411, 538, 579, 557, 535, 558, 411, 562, 559,
2333 560, 564, -69, 1, 2, 565, 3, 4, 5, 567,
2334 568, 569, 570, 595, 6, 7, 462, 463, 464, 465,
2335 466, 467, 468, 571, 572, 577, 592, 596, -222, 581,
2336 597, 476, 477, 478, 411, 603, 8, 582, 290, 583,
2337 9, 290, 290, 290, 10, 607, -69, 1, 2, 584,
2338 3, 4, 5, 600, 601, 602, 620, 616, 6, 7,
2339 414, 415, 628, 416, 622, 500, 629, 641, 642, 630,
2340 631, 633, 634, 664, 639, 643, 648, 653, 654, 644,
2341 8, 646, 411, 655, 9, 656, 411, 411, 10, 672,
2342 674, 675, 676, 678, 692, 695, 646, 693, 426, 636,
2343 523, 524, 525, 526, 702, -18, 434, 435, 436, 437,
2344 438, 534, -19, 703, 704, 705, 709, 714, 411, 411,
2345 715, 411, 677, 411, 132, 662, 149, 411, 360, 145,
2346 369, 64, 65, 411, 107, 67, 68, 69, 70, 71,
2347 72, 73, 45, 1, 2, 690, 3, 4, 5, 130,
2348 64, 65, 97, 107, 67, 68, 69, 70, 71, 72,
2349 73, 636, 1, 2, 0, 3, 4, 5, 235, 651,
2350 586, 587, 588, 589, 74, 591, 236, 527, 0, 593,
2351 594, 0, 0, 0, 0, 495, 496, 497, 498, 0,
2352 0, 0, 0, 74, 503, 0, 0, 64, 65, 0,
2353 107, 158, 159, 160, 161, 162, 163, 73, 518, 1,
2354 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2355 0, 0, 0, 624, 625, 626, 627, 0, 0, 0,
2356 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2357 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2359 0, 556, 0, 0, 0, 0, 561, 0, 563, 0,
2360 657, 566, 658, 659, 0, 0, 0, 0, 0, 0,
2361 0, 574, 575, 0, 576, 0, 0, 0, 75, 76,
2362 0, 0, 77, 0, 78, 108, 0, 0, 0, 0,
2363 0, 0, 0, 0, 0, 0, 0, 75, 76, 0,
2364 0, 77, 0, 78, 144, 0, 0, 0, 0, 0,
2365 0, 605, 606, 0, 608, 609, 610, 611, 0, 0,
2366 0, 0, 615, 0, 0, 0, 0, 0, 0, 0,
2367 621, 0, 0, 0, 0, 0, 623, 0, 0, 0,
2368 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2369 78, 386, 0, 0, 0, 0, 0, 0, 394, 395,
2370 396, 397, 64, 65, 398, 0, 0, 0, 0, 0,
2371 0, 0, 0, 649, 1, 2, 0, 3, 4, 5,
2372 399, 400, 401, 0, 0, 0, 0, 0, 0, 0,
2373 0, 0, 0, 0, 0, 402, 403, 0, 0, 0,
2374 0, 0, 0, 0, 0, 0, 0, 0, 0, 348,
2375 0, 0, 0, 0, 404, 0, 0, 0, 0, 0,
2376 0, 680, 0, 0, 0, 686, 687, 0, 0, 0,
2377 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2378 193, 194, 195, 196, 197, 262, 263, 264, 265, 0,
2379 0, 0, 0, 0, 0, 0, 0, 706, 707, 0,
2380 708, 0, 710, 0, 0, 0, 713, 0, 0, 0,
2381 0, 0, 716, 0, 266, 206, 684, 685, 209, 210,
2382 211, 212, 213, 214, 215, 216, 217, 0, 267, 0,
2383 268, 269, 270, 0, 271, 272, 351, 352, 0, 353,
2384 354, 0, 355, 356, 357, 0, 0, 0, 0, 0,
2385 0, 0, 394, 395, 396, 397, 64, 65, 398, 0,
2386 405, 0, 0, 406, 0, 407, 0, 408, 1, 2,
2387 0, 3, 4, 5, 399, 400, 401, 0, 0, 0,
2388 0, 0, 0, 0, 0, 0, 0, 0, 0, 402,
2389 403, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2390 0, 0, 0, 0, 111, 0, 64, 65, 404, 107,
2391 158, 159, 160, 161, 162, 163, 73, 0, 1, 2,
2392 0, 3, 4, 5, 183, 184, 185, 186, 187, 188,
2393 189, 190, 191, 192, 193, 194, 195, 196, 197, 262,
2394 263, 264, 265, 0, 0, 0, 0, 0, 0, 74,
2395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2396 0, 0, 0, 0, 0, 0, 0, 0, 266, 206,
2397 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
2398 217, 0, 267, 0, 268, 269, 270, 0, 271, 272,
2399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2400 0, 0, 0, 0, 0, 0, 0, 0, 112, 0,
2401 0, 0, 0, 0, 405, 0, 0, 406, 0, 407,
2402 0, 408, 394, 395, 396, 397, 64, 65, 398, 0,
2403 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
2404 0, 3, 4, 5, 399, 400, 401, 0, 0, 0,
2405 0, 0, 0, 0, 0, 0, 0, 0, 0, 402,
2406 403, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2407 471, 0, 0, 0, 0, 0, 64, 65, 404, 107,
2408 158, 159, 160, 161, 162, 163, 73, 0, 1, 2,
2409 0, 3, 4, 5, 183, 184, 185, 186, 187, 188,
2410 189, 190, 191, 192, 193, 194, 195, 196, 197, 262,
2411 263, 264, 265, 0, 0, 0, 0, 64, 65, 74,
2412 107, 158, 159, 160, 161, 162, 163, 73, 0, 1,
2413 2, 0, 3, 4, 5, 0, 0, 0, 266, 206,
2414 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
2415 217, 0, 267, 0, 268, 269, 270, 0, 271, 272,
2416 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2417 394, 395, 396, 397, 0, 0, 398, 0, 0, 0,
2418 0, 0, 0, 0, 405, 0, 0, 406, 0, 407,
2419 0, 408, 399, 400, 401, 0, 0, 0, 0, 0,
2420 0, 0, 0, 0, 0, 0, 0, 402, 403, 0,
2421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2422 0, 0, 0, 0, 0, 0, 404, 0, 0, 0,
2423 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2424 488, 0, 183, 184, 185, 186, 187, 188, 189, 190,
2425 191, 192, 193, 194, 195, 196, 197, 262, 263, 264,
2426 265, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2427 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2428 78, 550, 0, 0, 0, 0, 266, 206, 207, 208,
2429 209, 210, 211, 212, 213, 214, 215, 216, 217, 0,
2430 267, 0, 268, 269, 270, 0, 271, 272, 64, 65,
2431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2432 1, 2, 0, 3, 4, 5, 259, 0, 0, 0,
2433 0, 0, 405, 0, 0, 406, 0, 407, 0, 408,
2434 0, 260, 261, 0, 0, 0, 0, 0, 0, 0,
2435 0, 0, 0, 0, 64, 65, 111, 153, 67, 68,
2436 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2437 4, 5, 0, 0, 0, 0, 183, 184, 185, 186,
2438 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
2439 197, 262, 263, 264, 265, 0, 0, 74, 0, 0,
2440 0, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2441 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2442 266, 206, 207, 208, 209, 210, 211, 212, 213, 214,
2443 215, 216, 217, 137, 267, 0, 268, 269, 270, 0,
2444 271, 272, 64, 65, 74, 153, 67, 68, 69, 70,
2445 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2446 112, 0, 64, 65, -67, 0, 273, 0, 0, 274,
2447 0, 275, 0, 276, 1, 2, 0, 3, 4, 5,
2448 259, 0, 0, 0, 0, 74, 0, 0, 283, 284,
2449 0, 285, 0, 0, 0, 260, 261, 0, 0, 0,
2450 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2451 111, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2453 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2454 193, 194, 195, 196, 197, 262, 263, 264, 265, 0,
2455 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2456 154, 0, 77, 0, 78, 0, 0, 0, 0, 0,
2457 0, 0, 0, 0, 266, 206, 207, 208, 209, 210,
2458 211, 212, 213, 214, 215, 216, 217, 0, 267, 0,
2459 268, 269, 270, 0, 271, 272, 0, 0, 0, 75,
2460 76, 0, 0, 77, 0, 78, 0, 0, 0, 0,
2461 0, 0, 0, 0, 112, 0, 0, 0, 0, 0,
2462 273, 0, 0, 274, 0, 275, 0, 276, 64, 65,
2463 0, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2464 1, 2, 0, 3, 4, 5, 64, 65, 0, 107,
2465 158, 159, 160, 161, 162, 163, 73, 0, 1, 2,
2466 359, 3, 4, 5, 0, 0, 0, 0, 0, 64,
2467 65, 74, 107, 158, 159, 160, 161, 162, 163, 73,
2468 0, 1, 2, 0, 3, 4, 5, 64, 65, 74,
2469 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2470 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2471 0, 0, 74, 0, 0, 0, 0, 0, 0, 544,
2472 0, 0, 0, 0, 0, 0, 0, 0, 64, 65,
2473 74, 107, 67, 68, 69, 70, 71, 72, 73, 0,
2474 1, 2, 0, 3, 4, 5, 0, 0, 0, 64,
2475 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
2476 638, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2477 0, 74, 0, 0, 0, 0, 0, 0, 0, 0,
2478 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2479 0, 78, 74, 0, 0, 0, 0, 0, 0, 0,
2480 0, 0, 0, 75, 76, 0, 381, 77, 0, 78,
2481 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2482 0, 0, 0, 0, 0, 0, 75, 76, 0, 484,
2483 77, 0, 78, 0, 0, 0, 0, 0, 0, 0,
2484 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2485 78, 64, 65, 0, 107, 158, 159, 160, 161, 162,
2486 163, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2487 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2488 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2489 0, 78, 0, 0, 74, 0, 0, 0, 0, 0,
2490 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2491 77, 0, 78, 64, 65, 0, 107, 67, 68, 69,
2492 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2493 5, 64, 65, 0, 289, 67, 68, 69, 70, 71,
2494 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2495 0, 0, 0, 0, 64, 65, 74, 107, 158, 159,
2496 160, 161, 162, 163, 73, 0, 1, 2, 0, 3,
2497 4, 5, 64, 65, 74, 107, 158, 159, 160, 161,
2498 162, 163, 73, 0, 1, 2, 0, 3, 4, 5,
2499 0, 0, 0, 0, 0, 0, 0, 74, 0, 0,
2500 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2501 0, 0, 77, 0, 78, 74, 64, 65, 0, 107,
2502 67, 68, 69, 70, 71, 72, 645, 0, 1, 2,
2503 0, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2504 69, 70, 71, 72, 689, 0, 1, 2, 0, 3,
2505 4, 5, 0, 0, 0, 0, 0, 0, 0, 74,
2506 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2507 75, 76, 0, 0, 77, 0, 78, 74, 0, 0,
2508 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2509 0, 0, 77, 0, 78, 0, 0, 0, 0, 0,
2510 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2511 0, 75, 76, 0, 0, 77, 0, 384, 0, 0,
2512 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2513 76, 0, 0, 77, 0, 486, 0, 0, 0, 0,
2514 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2515 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2516 0, 0, 0, 0, 0, 174, 0, 0, 0, 0,
2517 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2518 0, 0, 0, 0, 0, 0, 175, 176, 0, 0,
2519 0, 75, 76, 0, 0, 77, 0, 78, 177, 178,
2520 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
2521 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
2522 199, 200, 201, 0, 0, 0, 0, 0, 0, 0,
2523 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2524 0, 0, 0, 202, 203, 204, 0, 0, 205, 206,
2525 207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
2526 217, 218, 219, 220, 221, 222, 223, 224, 225, 226
2529 static const yytype_int16 yycheck[] =
2531 0, 27, 179, 247, 166, 169, 204, 4, 11, 0,
2532 11, 467, 21, 274, 275, 28, 167, 17, 329, 11,
2533 29, 219, 220, 221, 222, 223, 17, 545, 180, 297,
2534 19, 229, 55, 22, 55, 24, 34, 55, 55, 53,
2535 200, 455, 456, 201, 11, 161, 7, 666, 162, 11,
2536 55, 162, 78, 59, 68, 17, 54, 171, 19, 55,
2537 171, 22, 54, 24, 683, 54, 42, 43, 44, 45,
2538 46, 47, 48, 49, 156, 51, 102, 345, 161, 231,
2539 106, 55, 162, 55, 166, 162, 112, 54, 162, 162,
2540 162, 171, 118, 93, 171, 169, 169, 248, 249, 171,
2541 162, 55, 262, 162, 264, 263, 162, 265, 167, 171,
2542 162, 167, 55, 32, 33, 167, 142, 143, 41, 42,
2543 146, 639, 18, 384, 38, 48, 152, 645, 646, 543,
2544 161, 54, 121, 122, 20, 591, 159, 23, 159, 162,
2545 163, 159, 159, 169, 405, 406, 407, 165, 169, 347,
2546 167, 177, 141, 142, 159, 144, 145, 170, 147, 148,
2547 149, 0, 171, 159, 167, 621, 167, 163, 686, 687,
2548 165, 689, 690, 170, 132, 133, 202, 203, 204, 205,
2549 156, 157, 158, 117, 118, 159, 160, 159, 706, 707,
2550 162, 163, 218, 219, 220, 221, 222, 223, 224, 225,
2551 226, 227, 228, 229, 161, 159, 34, 518, 290, 163,
2552 161, 293, 294, 239, 296, 413, 159, 160, 22, 3,
2553 4, 5, 6, 21, 250, 486, 159, 141, 142, 143,
2554 144, 429, 146, 431, 432, 433, 150, 151, 37, 153,
2555 154, 155, 26, 27, 132, 133, 42, 43, 44, 331,
2556 561, 47, 563, 417, 7, 8, 22, 339, 340, 341,
2557 342, 343, 35, 121, 37, 22, 19, 20, 22, 22,
2558 23, 24, 3, 4, 5, 6, 440, 4, 141, 142,
2559 143, 144, 308, 146, 46, 54, 48, 150, 151, 4,
2560 153, 154, 155, 151, 166, 42, 287, 44, 166, 325,
2561 326, 327, 62, 63, 64, 65, 66, 67, 163, 160,
2562 472, 162, 623, 141, 142, 143, 144, 160, 146, 162,
2563 346, 347, 150, 151, 159, 153, 154, 155, 4, 156,
2564 157, 158, 132, 133, 114, 115, 418, 419, 420, 421,
2565 160, 160, 162, 162, 160, 427, 162, 84, 85, 161,
2566 22, 162, 121, 122, 160, 169, 4, 601, 384, 441,
2567 9, 55, 26, 27, 9, 160, 564, 159, 9, 567,
2568 568, 569, 141, 142, 9, 144, 145, 9, 147, 148,
2569 149, 9, 57, 169, 11, 160, 22, 413, 159, 159,
2570 472, 417, 94, 95, 96, 97, 98, 99, 100, 101,
2571 102, 103, 4, 429, 430, 431, 432, 433, 159, 159,
2572 159, 159, 494, 439, 440, 159, 159, 499, 159, 501,
2573 159, 38, 504, 38, 162, 22, 670, 162, 162, 673,
2574 162, 457, 514, 515, 162, 517, 100, 101, 102, 103,
2575 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
2576 162, 162, 159, 159, 159, 481, 159, 61, 162, 159,
2577 486, 162, 38, 162, 162, 22, 162, 644, 165, 162,
2578 162, 162, 554, 555, 162, 557, 558, 559, 560, 162,
2579 162, 162, 162, 565, 0, 162, 17, 513, 17, 162,
2580 667, 573, 162, 519, 162, 169, 162, 579, 4, 162,
2581 162, 162, 18, 19, 20, 162, 22, 23, 24, 162,
2582 162, 162, 4, 539, 30, 31, 374, 375, 376, 377,
2583 378, 379, 380, 4, 162, 162, 169, 22, 0, 162,
2584 4, 389, 390, 391, 616, 169, 52, 162, 564, 162,
2585 56, 567, 568, 569, 60, 159, 18, 19, 20, 162,
2586 22, 23, 24, 162, 160, 162, 4, 162, 30, 31,
2587 293, 294, 162, 296, 159, 54, 160, 22, 169, 162,
2588 162, 160, 160, 17, 600, 162, 167, 160, 160, 165,
2589 52, 607, 664, 160, 56, 160, 668, 669, 60, 167,
2590 160, 160, 160, 54, 4, 162, 622, 152, 331, 599,
2591 458, 459, 460, 461, 22, 159, 339, 340, 341, 342,
2592 343, 469, 159, 17, 162, 17, 17, 73, 700, 701,
2593 17, 703, 661, 705, 93, 640, 112, 709, 239, 106,
2594 250, 7, 8, 715, 10, 11, 12, 13, 14, 15,
2595 16, 17, 17, 19, 20, 671, 22, 23, 24, 90,
2596 7, 8, 57, 10, 11, 12, 13, 14, 15, 16,
2597 17, 661, 19, 20, -1, 22, 23, 24, 133, 622,
2598 528, 529, 530, 531, 50, 533, 133, 462, -1, 537,
2599 538, -1, -1, -1, -1, 418, 419, 420, 421, -1,
2600 -1, -1, -1, 50, 427, -1, -1, 7, 8, -1,
2601 10, 11, 12, 13, 14, 15, 16, 17, 441, 19,
2602 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2603 -1, -1, -1, 581, 582, 583, 584, -1, -1, -1,
2604 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2605 50, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2606 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2607 -1, 494, -1, -1, -1, -1, 499, -1, 501, -1,
2608 628, 504, 630, 631, -1, -1, -1, -1, -1, -1,
2609 -1, 514, 515, -1, 517, -1, -1, -1, 164, 165,
2610 -1, -1, 168, -1, 170, 171, -1, -1, -1, -1,
2611 -1, -1, -1, -1, -1, -1, -1, 164, 165, -1,
2612 -1, 168, -1, 170, 171, -1, -1, -1, -1, -1,
2613 -1, 554, 555, -1, 557, 558, 559, 560, -1, -1,
2614 -1, -1, 565, -1, -1, -1, -1, -1, -1, -1,
2615 573, -1, -1, -1, -1, -1, 579, -1, -1, -1,
2616 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2617 170, 171, -1, -1, -1, -1, -1, -1, 3, 4,
2618 5, 6, 7, 8, 9, -1, -1, -1, -1, -1,
2619 -1, -1, -1, 616, 19, 20, -1, 22, 23, 24,
2620 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
2621 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2622 -1, -1, -1, -1, -1, -1, -1, -1, -1, 54,
2623 -1, -1, -1, -1, 59, -1, -1, -1, -1, -1,
2624 -1, 664, -1, -1, -1, 668, 669, -1, -1, -1,
2625 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2626 85, 86, 87, 88, 89, 90, 91, 92, 93, -1,
2627 -1, -1, -1, -1, -1, -1, -1, 700, 701, -1,
2628 703, -1, 705, -1, -1, -1, 709, -1, -1, -1,
2629 -1, -1, 715, -1, 119, 120, 121, 122, 123, 124,
2630 125, 126, 127, 128, 129, 130, 131, -1, 133, -1,
2631 135, 136, 137, -1, 139, 140, 141, 142, -1, 144,
2632 145, -1, 147, 148, 149, -1, -1, -1, -1, -1,
2633 -1, -1, 3, 4, 5, 6, 7, 8, 9, -1,
2634 165, -1, -1, 168, -1, 170, -1, 172, 19, 20,
2635 -1, 22, 23, 24, 25, 26, 27, -1, -1, -1,
2636 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2637 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2638 -1, -1, -1, -1, 55, -1, 7, 8, 59, 10,
2639 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2640 -1, 22, 23, 24, 75, 76, 77, 78, 79, 80,
2641 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2642 91, 92, 93, -1, -1, -1, -1, -1, -1, 50,
2643 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2644 -1, -1, -1, -1, -1, -1, -1, -1, 119, 120,
2645 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2646 131, -1, 133, -1, 135, 136, 137, -1, 139, 140,
2647 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2648 -1, -1, -1, -1, -1, -1, -1, -1, 159, -1,
2649 -1, -1, -1, -1, 165, -1, -1, 168, -1, 170,
2650 -1, 172, 3, 4, 5, 6, 7, 8, 9, -1,
2651 -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
2652 -1, 22, 23, 24, 25, 26, 27, -1, -1, -1,
2653 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2654 41, -1, -1, 164, 165, -1, -1, 168, -1, 170,
2655 171, -1, -1, -1, -1, -1, 7, 8, 59, 10,
2656 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2657 -1, 22, 23, 24, 75, 76, 77, 78, 79, 80,
2658 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2659 91, 92, 93, -1, -1, -1, -1, 7, 8, 50,
2660 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2661 20, -1, 22, 23, 24, -1, -1, -1, 119, 120,
2662 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2663 131, -1, 133, -1, 135, 136, 137, -1, 139, 140,
2664 50, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2665 3, 4, 5, 6, -1, -1, 9, -1, -1, -1,
2666 -1, -1, -1, -1, 165, -1, -1, 168, -1, 170,
2667 -1, 172, 25, 26, 27, -1, -1, -1, -1, -1,
2668 -1, -1, -1, -1, -1, -1, -1, 40, 41, -1,
2669 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2670 -1, -1, -1, -1, -1, -1, 59, -1, -1, -1,
2671 -1, -1, -1, 164, 165, -1, -1, 168, -1, 170,
2672 171, -1, 75, 76, 77, 78, 79, 80, 81, 82,
2673 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2674 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2675 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2676 170, 171, -1, -1, -1, -1, 119, 120, 121, 122,
2677 123, 124, 125, 126, 127, 128, 129, 130, 131, -1,
2678 133, -1, 135, 136, 137, -1, 139, 140, 7, 8,
2679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2680 19, 20, -1, 22, 23, 24, 25, -1, -1, -1,
2681 -1, -1, 165, -1, -1, 168, -1, 170, -1, 172,
2682 -1, 40, 41, -1, -1, -1, -1, -1, -1, -1,
2683 -1, -1, -1, -1, 7, 8, 55, 10, 11, 12,
2684 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2685 23, 24, -1, -1, -1, -1, 75, 76, 77, 78,
2686 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2687 89, 90, 91, 92, 93, -1, -1, 50, -1, -1,
2688 -1, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2689 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2690 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2691 129, 130, 131, 39, 133, -1, 135, 136, 137, -1,
2692 139, 140, 7, 8, 50, 10, 11, 12, 13, 14,
2693 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2694 159, -1, 7, 8, 163, -1, 165, -1, -1, 168,
2695 -1, 170, -1, 172, 19, 20, -1, 22, 23, 24,
2696 25, -1, -1, -1, -1, 50, -1, -1, 141, 142,
2697 -1, 144, -1, -1, -1, 40, 41, -1, -1, -1,
2698 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2699 55, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2700 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2701 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2702 85, 86, 87, 88, 89, 90, 91, 92, 93, -1,
2703 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2704 125, -1, 168, -1, 170, -1, -1, -1, -1, -1,
2705 -1, -1, -1, -1, 119, 120, 121, 122, 123, 124,
2706 125, 126, 127, 128, 129, 130, 131, -1, 133, -1,
2707 135, 136, 137, -1, 139, 140, -1, -1, -1, 164,
2708 165, -1, -1, 168, -1, 170, -1, -1, -1, -1,
2709 -1, -1, -1, -1, 159, -1, -1, -1, -1, -1,
2710 165, -1, -1, 168, -1, 170, -1, 172, 7, 8,
2711 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2712 19, 20, -1, 22, 23, 24, 7, 8, -1, 10,
2713 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2714 39, 22, 23, 24, -1, -1, -1, -1, -1, 7,
2715 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2716 -1, 19, 20, -1, 22, 23, 24, 7, 8, 50,
2717 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2718 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2719 -1, -1, 50, -1, -1, -1, -1, -1, -1, 39,
2720 -1, -1, -1, -1, -1, -1, -1, -1, 7, 8,
2721 50, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2722 19, 20, -1, 22, 23, 24, -1, -1, -1, 7,
2723 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2724 39, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2725 -1, 50, -1, -1, -1, -1, -1, -1, -1, -1,
2726 -1, -1, -1, -1, -1, 164, 165, -1, -1, 168,
2727 -1, 170, 50, -1, -1, -1, -1, -1, -1, -1,
2728 -1, -1, -1, 164, 165, -1, 167, 168, -1, 170,
2729 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2730 -1, -1, -1, -1, -1, -1, 164, 165, -1, 167,
2731 168, -1, 170, -1, -1, -1, -1, -1, -1, -1,
2732 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2733 170, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2734 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2735 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2736 -1, -1, -1, -1, -1, 164, 165, -1, -1, 168,
2737 -1, 170, -1, -1, 50, -1, -1, -1, -1, -1,
2738 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2739 168, -1, 170, 7, 8, -1, 10, 11, 12, 13,
2740 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2741 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2742 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2743 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2744 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2745 23, 24, 7, 8, 50, 10, 11, 12, 13, 14,
2746 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2747 -1, -1, -1, -1, -1, -1, -1, 50, -1, -1,
2748 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2749 -1, -1, 168, -1, 170, 50, 7, 8, -1, 10,
2750 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2751 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2752 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2753 23, 24, -1, -1, -1, -1, -1, -1, -1, 50,
2754 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2755 164, 165, -1, -1, 168, -1, 170, 50, -1, -1,
2756 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2757 -1, -1, 168, -1, 170, -1, -1, -1, -1, -1,
2758 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2759 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2760 -1, -1, -1, -1, -1, -1, -1, -1, -1, 164,
2761 165, -1, -1, 168, -1, 170, -1, -1, -1, -1,
2762 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2763 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2764 -1, -1, -1, -1, -1, 36, -1, -1, -1, -1,
2765 -1, -1, -1, 164, 165, -1, -1, 168, -1, 170,
2766 -1, -1, -1, -1, -1, -1, 57, 58, -1, -1,
2767 -1, 164, 165, -1, -1, 168, -1, 170, 69, 70,
2768 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2769 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2770 91, 92, 93, -1, -1, -1, -1, -1, -1, -1,
2771 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2772 -1, -1, -1, 114, 115, 116, -1, -1, 119, 120,
2773 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2774 131, 132, 133, 134, 135, 136, 137, 138, 139, 140
2777 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2778 symbol of state STATE-NUM. */
2779 static const yytype_uint16 yystos[] =
2781 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2782 60, 181, 184, 186, 187, 188, 222, 223, 224, 226,
2783 225, 53, 68, 231, 161, 59, 161, 18, 161, 42,
2784 43, 44, 45, 46, 47, 48, 49, 51, 156, 157,
2785 158, 189, 190, 191, 0, 224, 46, 48, 192, 241,
2786 42, 43, 44, 47, 193, 238, 240, 248, 161, 161,
2787 165, 232, 22, 230, 7, 8, 10, 11, 12, 13,
2788 14, 15, 16, 17, 50, 164, 165, 168, 170, 181,
2789 186, 209, 210, 244, 191, 191, 35, 37, 220, 191,
2790 191, 21, 249, 250, 29, 171, 239, 249, 22, 22,
2791 22, 233, 159, 4, 4, 4, 170, 10, 171, 210,
2792 215, 55, 159, 183, 220, 220, 42, 44, 194, 32,
2793 33, 219, 62, 63, 64, 65, 66, 67, 195, 236,
2794 236, 7, 184, 185, 253, 162, 167, 39, 210, 211,
2795 213, 214, 166, 166, 171, 215, 162, 171, 159, 214,
2796 163, 219, 219, 10, 125, 210, 212, 221, 11, 12,
2797 13, 14, 15, 16, 179, 180, 210, 216, 4, 199,
2798 28, 170, 237, 161, 36, 57, 58, 69, 70, 71,
2799 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
2800 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2801 92, 93, 114, 115, 116, 119, 120, 121, 122, 123,
2802 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
2803 134, 135, 136, 137, 138, 139, 140, 174, 175, 176,
2804 251, 258, 259, 260, 261, 251, 259, 22, 197, 162,
2805 160, 210, 210, 169, 171, 210, 4, 160, 216, 210,
2806 159, 244, 26, 27, 3, 4, 5, 6, 9, 25,
2807 40, 41, 90, 91, 92, 93, 119, 133, 135, 136,
2808 137, 139, 140, 165, 168, 170, 172, 174, 175, 176,
2809 217, 244, 183, 141, 142, 144, 198, 212, 57, 10,
2810 210, 246, 247, 11, 17, 11, 179, 195, 94, 95,
2811 96, 97, 98, 99, 100, 101, 102, 103, 177, 26,
2812 27, 100, 101, 102, 103, 104, 105, 106, 107, 108,
2813 109, 110, 111, 112, 113, 178, 177, 178, 210, 210,
2814 246, 210, 210, 254, 246, 246, 246, 246, 246, 210,
2815 210, 210, 210, 210, 246, 195, 117, 118, 54, 121,
2816 122, 141, 142, 144, 145, 147, 148, 149, 196, 39,
2817 211, 201, 167, 169, 169, 160, 201, 183, 183, 221,
2818 177, 178, 177, 178, 159, 159, 159, 159, 159, 159,
2819 159, 167, 216, 218, 170, 218, 171, 218, 22, 159,
2820 159, 159, 227, 186, 3, 4, 5, 6, 9, 25,
2821 26, 27, 40, 41, 59, 165, 168, 170, 172, 217,
2822 243, 244, 245, 162, 245, 245, 245, 199, 210, 210,
2823 210, 210, 162, 204, 162, 204, 245, 165, 162, 162,
2824 162, 162, 162, 162, 245, 245, 245, 245, 245, 38,
2825 199, 210, 246, 4, 141, 142, 143, 144, 146, 150,
2826 151, 153, 154, 155, 200, 228, 229, 38, 159, 159,
2827 159, 159, 216, 216, 216, 216, 216, 216, 216, 162,
2828 167, 171, 210, 218, 169, 171, 216, 216, 216, 162,
2829 207, 159, 61, 242, 167, 218, 170, 218, 171, 218,
2830 22, 246, 162, 162, 212, 245, 245, 245, 245, 11,
2831 54, 11, 256, 245, 165, 246, 210, 246, 246, 246,
2832 162, 162, 257, 162, 162, 162, 210, 212, 245, 162,
2833 207, 207, 210, 216, 216, 216, 216, 256, 162, 162,
2834 162, 162, 257, 162, 216, 169, 171, 162, 162, 38,
2835 34, 54, 205, 208, 39, 210, 234, 235, 22, 167,
2836 171, 218, 169, 171, 17, 17, 245, 162, 162, 162,
2837 162, 245, 4, 245, 162, 162, 245, 162, 162, 162,
2838 4, 4, 162, 210, 245, 245, 245, 162, 204, 210,
2839 160, 162, 162, 162, 162, 160, 216, 216, 216, 216,
2840 160, 216, 169, 216, 216, 210, 22, 4, 207, 197,
2841 162, 160, 162, 169, 171, 245, 245, 159, 245, 245,
2842 245, 245, 204, 204, 246, 245, 162, 246, 246, 246,
2843 4, 245, 159, 245, 216, 216, 216, 216, 162, 160,
2844 162, 162, 257, 160, 160, 160, 181, 182, 39, 210,
2845 201, 22, 169, 162, 165, 17, 210, 255, 167, 245,
2846 257, 255, 204, 160, 160, 160, 160, 216, 216, 216,
2847 160, 197, 205, 206, 17, 167, 179, 252, 197, 197,
2848 160, 162, 167, 160, 160, 160, 160, 182, 54, 203,
2849 245, 243, 167, 179, 121, 122, 245, 245, 201, 17,
2850 210, 201, 4, 152, 202, 162, 243, 197, 197, 38,
2851 197, 197, 22, 17, 162, 17, 245, 245, 245, 17,
2852 245, 197, 197, 245, 73, 17, 245
2855 #define yyerrok (yyerrstatus = 0)
2856 #define yyclearin (yychar = YYEMPTY)
2857 #define YYEMPTY (-2)
2860 #define YYACCEPT goto yyacceptlab
2861 #define YYABORT goto yyabortlab
2862 #define YYERROR goto yyerrorlab
2865 /* Like YYERROR except do call yyerror. This remains here temporarily
2866 to ease the transition to the new meaning of YYERROR, for GCC.
2867 Once GCC version 2 has supplanted version 1, this can go. */
2869 #define YYFAIL goto yyerrlab
2871 #define YYRECOVERING() (!!yyerrstatus)
2873 #define YYBACKUP(Token, Value) \
2875 if (yychar == YYEMPTY && yylen == 1) \
2879 yytoken = YYTRANSLATE (yychar); \
2885 yyerror (YY_("syntax error: cannot back up")); \
2892 #define YYERRCODE 256
2895 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2896 If N is 0, then set CURRENT to the empty location which ends
2897 the previous symbol: RHS[0] (always defined). */
2899 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2900 #ifndef YYLLOC_DEFAULT
2901 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2905 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2906 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2907 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2908 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2912 (Current).first_line = (Current).last_line = \
2913 YYRHSLOC (Rhs, 0).last_line; \
2914 (Current).first_column = (Current).last_column = \
2915 YYRHSLOC (Rhs, 0).last_column; \
2921 /* YY_LOCATION_PRINT -- Print the location on the stream.
2922 This macro was not mandated originally: define only if we know
2923 we won't break user code: when these are the locations we know. */
2925 #ifndef YY_LOCATION_PRINT
2926 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2927 # define YY_LOCATION_PRINT(File, Loc) \
2928 fprintf (File, "%d.%d-%d.%d", \
2929 (Loc).first_line, (Loc).first_column, \
2930 (Loc).last_line, (Loc).last_column)
2932 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2937 /* YYLEX -- calling `yylex' with the right arguments. */
2940 # define YYLEX yylex (YYLEX_PARAM)
2942 # define YYLEX yylex ()
2945 /* Enable debugging if requested. */
2949 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2950 # define YYFPRINTF fprintf
2953 # define YYDPRINTF(Args) \
2959 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2963 YYFPRINTF (stderr, "%s ", Title); \
2964 yy_symbol_print (stderr, \
2966 YYFPRINTF (stderr, "\n"); \
2971 /*--------------------------------.
2972 | Print this symbol on YYOUTPUT. |
2973 `--------------------------------*/
2976 #if (defined __STDC__ || defined __C99__FUNC__ \
2977 || defined __cplusplus || defined _MSC_VER)
2979 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2982 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2985 YYSTYPE const * const yyvaluep;
2991 if (yytype < YYNTOKENS)
2992 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3004 /*--------------------------------.
3005 | Print this symbol on YYOUTPUT. |
3006 `--------------------------------*/
3008 #if (defined __STDC__ || defined __C99__FUNC__ \
3009 || defined __cplusplus || defined _MSC_VER)
3011 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3014 yy_symbol_print (yyoutput, yytype, yyvaluep)
3017 YYSTYPE const * const yyvaluep;
3020 if (yytype < YYNTOKENS)
3021 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3023 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3025 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3026 YYFPRINTF (yyoutput, ")");
3029 /*------------------------------------------------------------------.
3030 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3032 `------------------------------------------------------------------*/
3034 #if (defined __STDC__ || defined __C99__FUNC__ \
3035 || defined __cplusplus || defined _MSC_VER)
3037 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3040 yy_stack_print (bottom, top)
3041 yytype_int16 *bottom;
3045 YYFPRINTF (stderr, "Stack now");
3046 for (; bottom <= top; ++bottom)
3047 YYFPRINTF (stderr, " %d", *bottom);
3048 YYFPRINTF (stderr, "\n");
3051 # define YY_STACK_PRINT(Bottom, Top) \
3054 yy_stack_print ((Bottom), (Top)); \
3058 /*------------------------------------------------.
3059 | Report that the YYRULE is going to be reduced. |
3060 `------------------------------------------------*/
3062 #if (defined __STDC__ || defined __C99__FUNC__ \
3063 || defined __cplusplus || defined _MSC_VER)
3065 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3068 yy_reduce_print (yyvsp, yyrule)
3073 int yynrhs = yyr2[yyrule];
3075 unsigned long int yylno = yyrline[yyrule];
3076 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3078 /* The symbols being reduced. */
3079 for (yyi = 0; yyi < yynrhs; yyi++)
3081 fprintf (stderr, " $%d = ", yyi + 1);
3082 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3083 &(yyvsp[(yyi + 1) - (yynrhs)])
3085 fprintf (stderr, "\n");
3089 # define YY_REDUCE_PRINT(Rule) \
3092 yy_reduce_print (yyvsp, Rule); \
3095 /* Nonzero means print parse trace. It is left uninitialized so that
3096 multiple parsers can coexist. */
3098 #else /* !YYDEBUG */
3099 # define YYDPRINTF(Args)
3100 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3101 # define YY_STACK_PRINT(Bottom, Top)
3102 # define YY_REDUCE_PRINT(Rule)
3103 #endif /* !YYDEBUG */
3106 /* YYINITDEPTH -- initial size of the parser's stacks. */
3108 # define YYINITDEPTH 200
3111 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3112 if the built-in stack extension method is used).
3114 Do not make this value too large; the results are undefined if
3115 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3116 evaluated with infinite-precision integer arithmetic. */
3119 # define YYMAXDEPTH 10000
3127 # if defined __GLIBC__ && defined _STRING_H
3128 # define yystrlen strlen
3130 /* Return the length of YYSTR. */
3131 #if (defined __STDC__ || defined __C99__FUNC__ \
3132 || defined __cplusplus || defined _MSC_VER)
3134 yystrlen (const char *yystr)
3142 for (yylen = 0; yystr[yylen]; yylen++)
3150 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3151 # define yystpcpy stpcpy
3153 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3155 #if (defined __STDC__ || defined __C99__FUNC__ \
3156 || defined __cplusplus || defined _MSC_VER)
3158 yystpcpy (char *yydest, const char *yysrc)
3161 yystpcpy (yydest, yysrc)
3167 const char *yys = yysrc;
3169 while ((*yyd++ = *yys++) != '\0')
3178 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3179 quotes and backslashes, so that it's suitable for yyerror. The
3180 heuristic is that double-quoting is unnecessary unless the string
3181 contains an apostrophe, a comma, or backslash (other than
3182 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3183 null, do not copy; instead, return the length of what the result
3186 yytnamerr (char *yyres, const char *yystr)
3191 char const *yyp = yystr;
3198 goto do_not_strip_quotes;
3202 goto do_not_strip_quotes;
3215 do_not_strip_quotes: ;
3219 return yystrlen (yystr);
3221 return yystpcpy (yyres, yystr) - yyres;
3225 /* Copy into YYRESULT an error message about the unexpected token
3226 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3227 including the terminating null byte. If YYRESULT is null, do not
3228 copy anything; just return the number of bytes that would be
3229 copied. As a special case, return 0 if an ordinary "syntax error"
3230 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3231 size calculation. */
3233 yysyntax_error (char *yyresult, int yystate, int yychar)
3235 int yyn = yypact[yystate];
3237 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3241 int yytype = YYTRANSLATE (yychar);
3242 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3243 YYSIZE_T yysize = yysize0;
3245 int yysize_overflow = 0;
3246 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3247 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3251 /* This is so xgettext sees the translatable formats that are
3252 constructed on the fly. */
3253 YY_("syntax error, unexpected %s");
3254 YY_("syntax error, unexpected %s, expecting %s");
3255 YY_("syntax error, unexpected %s, expecting %s or %s");
3256 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3257 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3261 static char const yyunexpected[] = "syntax error, unexpected %s";
3262 static char const yyexpecting[] = ", expecting %s";
3263 static char const yyor[] = " or %s";
3264 char yyformat[sizeof yyunexpected
3265 + sizeof yyexpecting - 1
3266 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3267 * (sizeof yyor - 1))];
3268 char const *yyprefix = yyexpecting;
3270 /* Start YYX at -YYN if negative to avoid negative indexes in
3272 int yyxbegin = yyn < 0 ? -yyn : 0;
3274 /* Stay within bounds of both yycheck and yytname. */
3275 int yychecklim = YYLAST - yyn + 1;
3276 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3279 yyarg[0] = yytname[yytype];
3280 yyfmt = yystpcpy (yyformat, yyunexpected);
3282 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3283 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3285 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3289 yyformat[sizeof yyunexpected - 1] = '\0';
3292 yyarg[yycount++] = yytname[yyx];
3293 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3294 yysize_overflow |= (yysize1 < yysize);
3296 yyfmt = yystpcpy (yyfmt, yyprefix);
3300 yyf = YY_(yyformat);
3301 yysize1 = yysize + yystrlen (yyf);
3302 yysize_overflow |= (yysize1 < yysize);
3305 if (yysize_overflow)
3306 return YYSIZE_MAXIMUM;
3310 /* Avoid sprintf, as that infringes on the user's name space.
3311 Don't have undefined behavior even if the translation
3312 produced a string with the wrong number of "%s"s. */
3313 char *yyp = yyresult;
3315 while ((*yyp = *yyf) != '\0')
3317 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3319 yyp += yytnamerr (yyp, yyarg[yyi++]);
3332 #endif /* YYERROR_VERBOSE */
3335 /*-----------------------------------------------.
3336 | Release the memory associated to this symbol. |
3337 `-----------------------------------------------*/
3340 #if (defined __STDC__ || defined __C99__FUNC__ \
3341 || defined __cplusplus || defined _MSC_VER)
3343 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3346 yydestruct (yymsg, yytype, yyvaluep)
3356 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3367 /* Prevent warnings from -Wmissing-prototypes. */
3369 #ifdef YYPARSE_PARAM
3370 #if defined __STDC__ || defined __cplusplus
3371 int yyparse (void *YYPARSE_PARAM);
3375 #else /* ! YYPARSE_PARAM */
3376 #if defined __STDC__ || defined __cplusplus
3381 #endif /* ! YYPARSE_PARAM */
3385 /* The look-ahead symbol. */
3388 /* The semantic value of the look-ahead symbol. */
3391 /* Number of syntax errors so far. */
3400 #ifdef YYPARSE_PARAM
3401 #if (defined __STDC__ || defined __C99__FUNC__ \
3402 || defined __cplusplus || defined _MSC_VER)
3404 yyparse (void *YYPARSE_PARAM)
3407 yyparse (YYPARSE_PARAM)
3408 void *YYPARSE_PARAM;
3410 #else /* ! YYPARSE_PARAM */
3411 #if (defined __STDC__ || defined __C99__FUNC__ \
3412 || defined __cplusplus || defined _MSC_VER)
3426 /* Number of tokens to shift before error messages enabled. */
3428 /* Look-ahead token as an internal (translated) token number. */
3431 /* Buffer for error messages, and its allocated size. */
3433 char *yymsg = yymsgbuf;
3434 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3437 /* Three stacks and their tools:
3438 `yyss': related to states,
3439 `yyvs': related to semantic values,
3440 `yyls': related to locations.
3442 Refer to the stacks thru separate pointers, to allow yyoverflow
3443 to reallocate them elsewhere. */
3445 /* The state stack. */
3446 yytype_int16 yyssa[YYINITDEPTH];
3447 yytype_int16 *yyss = yyssa;
3448 yytype_int16 *yyssp;
3450 /* The semantic value stack. */
3451 YYSTYPE yyvsa[YYINITDEPTH];
3452 YYSTYPE *yyvs = yyvsa;
3457 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3459 YYSIZE_T yystacksize = YYINITDEPTH;
3461 /* The variables used to return semantic value and location from the
3466 /* The number of symbols on the RHS of the reduced rule.
3467 Keep to zero when no symbol should be popped. */
3470 YYDPRINTF ((stderr, "Starting parse\n"));
3475 yychar = YYEMPTY; /* Cause a token to be read. */
3477 /* Initialize stack pointers.
3478 Waste one element of value and location stack
3479 so that they stay on the same level as the state stack.
3480 The wasted elements are never initialized. */
3487 /*------------------------------------------------------------.
3488 | yynewstate -- Push a new state, which is found in yystate. |
3489 `------------------------------------------------------------*/
3491 /* In all cases, when you get here, the value and location stacks
3492 have just been pushed. So pushing a state here evens the stacks. */
3498 if (yyss + yystacksize - 1 <= yyssp)
3500 /* Get the current used size of the three stacks, in elements. */
3501 YYSIZE_T yysize = yyssp - yyss + 1;
3505 /* Give user a chance to reallocate the stack. Use copies of
3506 these so that the &'s don't force the real ones into
3508 YYSTYPE *yyvs1 = yyvs;
3509 yytype_int16 *yyss1 = yyss;
3512 /* Each stack pointer address is followed by the size of the
3513 data in use in that stack, in bytes. This used to be a
3514 conditional around just the two extra args, but that might
3515 be undefined if yyoverflow is a macro. */
3516 yyoverflow (YY_("memory exhausted"),
3517 &yyss1, yysize * sizeof (*yyssp),
3518 &yyvs1, yysize * sizeof (*yyvsp),
3525 #else /* no yyoverflow */
3526 # ifndef YYSTACK_RELOCATE
3527 goto yyexhaustedlab;
3529 /* Extend the stack our own way. */
3530 if (YYMAXDEPTH <= yystacksize)
3531 goto yyexhaustedlab;
3533 if (YYMAXDEPTH < yystacksize)
3534 yystacksize = YYMAXDEPTH;
3537 yytype_int16 *yyss1 = yyss;
3538 union yyalloc *yyptr =
3539 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3541 goto yyexhaustedlab;
3542 YYSTACK_RELOCATE (yyss);
3543 YYSTACK_RELOCATE (yyvs);
3545 # undef YYSTACK_RELOCATE
3547 YYSTACK_FREE (yyss1);
3550 #endif /* no yyoverflow */
3552 yyssp = yyss + yysize - 1;
3553 yyvsp = yyvs + yysize - 1;
3556 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3557 (unsigned long int) yystacksize));
3559 if (yyss + yystacksize - 1 <= yyssp)
3563 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3572 /* Do appropriate processing given the current state. Read a
3573 look-ahead token if we need one and don't already have one. */
3575 /* First try to decide what to do without reference to look-ahead token. */
3576 yyn = yypact[yystate];
3577 if (yyn == YYPACT_NINF)
3580 /* Not known => get a look-ahead token if don't already have one. */
3582 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3583 if (yychar == YYEMPTY)
3585 YYDPRINTF ((stderr, "Reading a token: "));
3589 if (yychar <= YYEOF)
3591 yychar = yytoken = YYEOF;
3592 YYDPRINTF ((stderr, "Now at end of input.\n"));
3596 yytoken = YYTRANSLATE (yychar);
3597 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3600 /* If the proper action on seeing token YYTOKEN is to reduce or to
3601 detect an error, take that action. */
3603 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3608 if (yyn == 0 || yyn == YYTABLE_NINF)
3617 /* Count tokens shifted since error; after three, turn off error
3622 /* Shift the look-ahead token. */
3623 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3625 /* Discard the shifted token unless it is eof. */
3626 if (yychar != YYEOF)
3635 /*-----------------------------------------------------------.
3636 | yydefault -- do the default action for the current state. |
3637 `-----------------------------------------------------------*/
3639 yyn = yydefact[yystate];
3645 /*-----------------------------.
3646 | yyreduce -- Do a reduction. |
3647 `-----------------------------*/
3649 /* yyn is the number of a rule to reduce with. */
3652 /* If YYLEN is nonzero, implement the default value of the action:
3655 Otherwise, the following line sets YYVAL to garbage.
3656 This behavior is undocumented and Bison
3657 users should not rely upon it. Assigning to YYVAL
3658 unconditionally makes the parser a bit smaller, and it avoids a
3659 GCC warning that YYVAL may be used uninitialized. */
3660 yyval = yyvsp[1-yylen];
3663 YY_REDUCE_PRINT (yyn);
3667 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3668 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3672 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3673 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3677 #line 1150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3678 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3682 #line 1150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3683 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3687 #line 1151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3688 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3692 #line 1151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3693 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3697 #line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3698 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3702 #line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3703 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3707 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3708 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3712 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3713 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3717 #line 1157 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3718 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3722 #line 1157 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3723 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3727 #line 1158 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3728 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3732 #line 1158 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3733 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3737 #line 1159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3738 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3742 #line 1159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3743 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3747 #line 1160 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3748 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3752 #line 1160 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3753 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3757 #line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3758 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3762 #line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3763 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3767 #line 1162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3768 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3772 #line 1162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3773 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3777 #line 1163 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3778 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3782 #line 1163 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3783 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3787 #line 1164 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3788 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3792 #line 1165 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3793 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3797 #line 1174 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3798 { (yyval.StrVal) = 0; ;}
3802 #line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3803 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3807 #line 1177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3808 { (yyval.UIntVal)=0; ;}
3812 #line 1181 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3814 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3820 #line 1185 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3828 #line 1190 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3830 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3836 #line 1199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3844 #line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3846 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3852 #line 1210 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3853 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3857 #line 1211 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3858 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3862 #line 1212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3863 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3867 #line 1213 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3868 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3872 #line 1214 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3873 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3877 #line 1215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3878 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3882 #line 1219 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3883 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3887 #line 1220 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3888 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3892 #line 1221 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3893 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3897 #line 1225 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3898 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3902 #line 1226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3903 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3907 #line 1227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3908 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3912 #line 1228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3913 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3917 #line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3918 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3922 #line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3923 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3927 #line 1234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3928 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3932 #line 1238 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3933 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3937 #line 1239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3938 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3942 #line 1240 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3943 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3947 #line 1241 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3948 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3952 #line 1242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3953 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3957 #line 1246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3958 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3962 #line 1247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3963 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3967 #line 1248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3968 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3972 #line 1251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3973 { (yyval.UIntVal) = CallingConv::C; ;}
3977 #line 1252 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3978 { (yyval.UIntVal) = CallingConv::C; ;}
3982 #line 1253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3983 { (yyval.UIntVal) = CallingConv::Fast; ;}
3987 #line 1254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3988 { (yyval.UIntVal) = CallingConv::Cold; ;}
3992 #line 1255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3993 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3997 #line 1256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3998 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
4002 #line 1257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4004 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
4005 GEN_ERROR("Calling conv too large");
4006 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4012 #line 1264 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4013 { (yyval.Attributes) = Attribute::ZExt; ;}
4017 #line 1265 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4018 { (yyval.Attributes) = Attribute::ZExt; ;}
4022 #line 1266 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4023 { (yyval.Attributes) = Attribute::SExt; ;}
4027 #line 1267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4028 { (yyval.Attributes) = Attribute::SExt; ;}
4032 #line 1268 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4033 { (yyval.Attributes) = Attribute::InReg; ;}
4037 #line 1269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4038 { (yyval.Attributes) = Attribute::StructRet; ;}
4042 #line 1270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4043 { (yyval.Attributes) = Attribute::NoAlias; ;}
4047 #line 1271 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4048 { (yyval.Attributes) = Attribute::ByVal; ;}
4052 #line 1272 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4053 { (yyval.Attributes) = Attribute::Nest; ;}
4057 #line 1273 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4058 { (yyval.Attributes) =
4059 Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4063 #line 1277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4064 { (yyval.Attributes) = Attribute::None; ;}
4068 #line 1278 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4070 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4075 #line 1283 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4076 { (yyval.Attributes) = Attribute::InReg; ;}
4080 #line 1284 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4081 { (yyval.Attributes) = Attribute::ZExt; ;}
4085 #line 1285 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4086 { (yyval.Attributes) = Attribute::SExt; ;}
4090 #line 1288 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4091 { (yyval.Attributes) = Attribute::None; ;}
4095 #line 1289 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4097 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4102 #line 1295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4103 { (yyval.Attributes) = Attribute::NoReturn; ;}
4107 #line 1296 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4108 { (yyval.Attributes) = Attribute::NoUnwind; ;}
4112 #line 1297 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4113 { (yyval.Attributes) = Attribute::InReg; ;}
4117 #line 1298 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4118 { (yyval.Attributes) = Attribute::ZExt; ;}
4122 #line 1299 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4123 { (yyval.Attributes) = Attribute::SExt; ;}
4127 #line 1300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4128 { (yyval.Attributes) = Attribute::ReadNone; ;}
4132 #line 1301 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4133 { (yyval.Attributes) = Attribute::ReadOnly; ;}
4137 #line 1302 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4138 { (yyval.Attributes) = Attribute::NoInline; ;}
4142 #line 1303 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4143 { (yyval.Attributes) = Attribute::AlwaysInline; ;}
4147 #line 1304 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4148 { (yyval.Attributes) = Attribute::OptimizeForSize; ;}
4152 #line 1307 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4153 { (yyval.Attributes) = Attribute::None; ;}
4157 #line 1308 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4159 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4164 #line 1314 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4165 { (yyval.StrVal) = 0; ;}
4169 #line 1315 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4171 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4176 #line 1322 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4177 { (yyval.UIntVal) = 0; ;}
4181 #line 1323 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4183 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4184 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4185 GEN_ERROR("Alignment must be a power of two");
4191 #line 1329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4192 { (yyval.UIntVal) = 0; ;}
4196 #line 1330 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4198 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4199 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4200 GEN_ERROR("Alignment must be a power of two");
4206 #line 1339 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4208 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4209 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4210 GEN_ERROR("Invalid character in section name");
4211 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4217 #line 1347 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4218 { (yyval.StrVal) = 0; ;}
4222 #line 1348 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4223 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4227 #line 1353 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4232 #line 1354 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4237 #line 1355 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4239 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4240 delete (yyvsp[(1) - (1)].StrVal);
4246 #line 1360 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4248 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4249 GEN_ERROR("Alignment must be a power of two");
4250 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4256 #line 1376 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4258 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4264 #line 1380 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4266 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4272 #line 1384 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4274 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4275 GEN_ERROR("Cannot form a pointer to a basic block");
4276 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4277 delete (yyvsp[(1) - (3)].TypeVal);
4283 #line 1391 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4284 { // Named types are also simple types...
4285 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4287 (yyval.TypeVal) = new PATypeHolder(tmp);
4292 #line 1396 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4293 { // Type UpReference
4294 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4295 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4296 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4297 (yyval.TypeVal) = new PATypeHolder(OT);
4298 UR_OUT("New Upreference!\n");
4304 #line 1404 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4306 // Allow but ignore attributes on function types; this permits auto-upgrade.
4307 // FIXME: remove in LLVM 3.0.
4308 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4309 if (!FunctionType::isValidReturnType(RetTy))
4310 GEN_ERROR("Invalid result type for LLVM function");
4312 std::vector<const Type*> Params;
4313 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4314 for (; I != E; ++I ) {
4315 const Type *Ty = I->Ty->get();
4316 Params.push_back(Ty);
4319 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4320 if (isVarArg) Params.pop_back();
4322 for (unsigned i = 0; i != Params.size(); ++i)
4323 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4324 GEN_ERROR("Function arguments must be value types!");
4328 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4329 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4330 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4332 // Delete the argument list
4333 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4336 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4343 #line 1439 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4345 // Allow but ignore attributes on function types; this permits auto-upgrade.
4346 // FIXME: remove in LLVM 3.0.
4347 std::vector<const Type*> Params;
4348 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4349 for ( ; I != E; ++I ) {
4350 const Type* Ty = I->Ty->get();
4351 Params.push_back(Ty);
4354 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4355 if (isVarArg) Params.pop_back();
4357 for (unsigned i = 0; i != Params.size(); ++i)
4358 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4359 GEN_ERROR("Function arguments must be value types!");
4363 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4364 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4366 // Delete the argument list
4367 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4370 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4377 #line 1470 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4378 { // Sized array type?
4379 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4380 delete (yyvsp[(4) - (5)].TypeVal);
4386 #line 1475 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4388 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4389 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4390 GEN_ERROR("Unsigned result not equal to signed result");
4391 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4392 GEN_ERROR("Element type of a VectorType must be primitive");
4393 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4394 delete (yyvsp[(4) - (5)].TypeVal);
4400 #line 1485 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4401 { // Structure type?
4402 std::vector<const Type*> Elements;
4403 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4404 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4405 Elements.push_back(*I);
4407 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4408 delete (yyvsp[(2) - (3)].TypeList);
4414 #line 1495 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4415 { // Empty structure type?
4416 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4422 #line 1499 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4424 std::vector<const Type*> Elements;
4425 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4426 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4427 Elements.push_back(*I);
4429 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4430 delete (yyvsp[(3) - (5)].TypeList);
4436 #line 1509 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4437 { // Empty structure type?
4438 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4444 #line 1516 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4446 // Allow but ignore attributes on function types; this permits auto-upgrade.
4447 // FIXME: remove in LLVM 3.0.
4448 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4449 (yyval.TypeWithAttrs).Attrs = Attribute::None;
4454 #line 1525 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4456 if (!UpRefs.empty())
4457 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4458 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4459 GEN_ERROR("LLVM functions cannot return aggregate types");
4460 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4465 #line 1532 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4467 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4472 #line 1537 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4474 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4475 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4481 #line 1542 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4483 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4489 #line 1550 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4491 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4492 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4493 TWA.Ty = new PATypeHolder(Type::VoidTy);
4494 (yyval.TypeWithAttrsList)->push_back(TWA);
4500 #line 1557 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4502 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4503 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4504 TWA.Ty = new PATypeHolder(Type::VoidTy);
4505 (yyval.TypeWithAttrsList)->push_back(TWA);
4511 #line 1564 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4513 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4519 #line 1572 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4521 (yyval.TypeList) = new std::list<PATypeHolder>();
4522 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4523 delete (yyvsp[(1) - (1)].TypeVal);
4529 #line 1578 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4531 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4532 delete (yyvsp[(3) - (3)].TypeVal);
4538 #line 1590 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4539 { // Nonempty unsized arr
4540 if (!UpRefs.empty())
4541 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4542 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4544 GEN_ERROR("Cannot make array constant with type: '" +
4545 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4546 const Type *ETy = ATy->getElementType();
4547 uint64_t NumElements = ATy->getNumElements();
4549 // Verify that we have the correct size...
4550 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4551 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4552 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4553 utostr(NumElements) + "");
4555 // Verify all elements are correct type!
4556 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4557 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4558 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4559 ETy->getDescription() +"' as required!\nIt is of type '"+
4560 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4563 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4564 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4570 #line 1618 "/Volumes/MacOS9/gcc/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 if (NumElements != uint64_t(-1) && NumElements != 0)
4581 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4582 " arguments, but has size of " + utostr(NumElements) +"");
4583 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4584 delete (yyvsp[(1) - (3)].TypeVal);
4590 #line 1634 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4592 if (!UpRefs.empty())
4593 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4594 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4596 GEN_ERROR("Cannot make array constant with type: '" +
4597 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4599 uint64_t NumElements = ATy->getNumElements();
4600 const Type *ETy = ATy->getElementType();
4601 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4602 GEN_ERROR("Can't build string constant of size " +
4603 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4604 " when array has size " + utostr(NumElements) + "");
4605 std::vector<Constant*> Vals;
4606 if (ETy == Type::Int8Ty) {
4607 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4608 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4610 delete (yyvsp[(3) - (3)].StrVal);
4611 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4613 delete (yyvsp[(3) - (3)].StrVal);
4614 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4615 delete (yyvsp[(1) - (3)].TypeVal);
4621 #line 1661 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4622 { // Nonempty unsized arr
4623 if (!UpRefs.empty())
4624 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4625 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4627 GEN_ERROR("Cannot make packed constant with type: '" +
4628 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4629 const Type *ETy = PTy->getElementType();
4630 unsigned NumElements = PTy->getNumElements();
4632 // Verify that we have the correct size...
4633 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4634 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4635 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4636 utostr(NumElements) + "");
4638 // Verify all elements are correct type!
4639 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4640 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4641 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4642 ETy->getDescription() +"' as required!\nIt is of type '"+
4643 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4646 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4647 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4653 #line 1689 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4655 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4657 GEN_ERROR("Cannot make struct constant with type: '" +
4658 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4660 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4661 GEN_ERROR("Illegal number of initializers for structure type");
4663 // Check to ensure that constants are compatible with the type initializer!
4664 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4665 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4666 GEN_ERROR("Expected type '" +
4667 STy->getElementType(i)->getDescription() +
4668 "' for element #" + utostr(i) +
4669 " of structure initializer");
4671 // Check to ensure that Type is not packed
4672 if (STy->isPacked())
4673 GEN_ERROR("Unpacked Initializer to vector type '" +
4674 STy->getDescription() + "'");
4676 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4677 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4683 #line 1715 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4685 if (!UpRefs.empty())
4686 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4687 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4689 GEN_ERROR("Cannot make struct constant with type: '" +
4690 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4692 if (STy->getNumContainedTypes() != 0)
4693 GEN_ERROR("Illegal number of initializers for structure type");
4695 // Check to ensure that Type is not packed
4696 if (STy->isPacked())
4697 GEN_ERROR("Unpacked Initializer to vector type '" +
4698 STy->getDescription() + "'");
4700 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4701 delete (yyvsp[(1) - (3)].TypeVal);
4707 #line 1735 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4709 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4711 GEN_ERROR("Cannot make struct constant with type: '" +
4712 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4714 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4715 GEN_ERROR("Illegal number of initializers for structure type");
4717 // Check to ensure that constants are compatible with the type initializer!
4718 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4719 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4720 GEN_ERROR("Expected type '" +
4721 STy->getElementType(i)->getDescription() +
4722 "' for element #" + utostr(i) +
4723 " of structure initializer");
4725 // Check to ensure that Type is packed
4726 if (!STy->isPacked())
4727 GEN_ERROR("Vector initializer to non-vector type '" +
4728 STy->getDescription() + "'");
4730 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4731 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4737 #line 1761 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4739 if (!UpRefs.empty())
4740 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4741 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4743 GEN_ERROR("Cannot make struct constant with type: '" +
4744 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4746 if (STy->getNumContainedTypes() != 0)
4747 GEN_ERROR("Illegal number of initializers for structure type");
4749 // Check to ensure that Type is packed
4750 if (!STy->isPacked())
4751 GEN_ERROR("Vector initializer to non-vector type '" +
4752 STy->getDescription() + "'");
4754 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4755 delete (yyvsp[(1) - (5)].TypeVal);
4761 #line 1781 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4763 if (!UpRefs.empty())
4764 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4765 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4767 GEN_ERROR("Cannot make null pointer constant with type: '" +
4768 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4770 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4771 delete (yyvsp[(1) - (2)].TypeVal);
4777 #line 1793 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4779 if (!UpRefs.empty())
4780 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4781 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4782 delete (yyvsp[(1) - (2)].TypeVal);
4788 #line 1800 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4790 if (!UpRefs.empty())
4791 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4792 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4794 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4796 // ConstExprs can exist in the body of a function, thus creating
4797 // GlobalValues whenever they refer to a variable. Because we are in
4798 // the context of a function, getExistingVal will search the functions
4799 // symbol table instead of the module symbol table for the global symbol,
4800 // which throws things all off. To get around this, we just tell
4801 // getExistingVal that we are at global scope here.
4803 Function *SavedCurFn = CurFun.CurrentFunction;
4804 CurFun.CurrentFunction = 0;
4806 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4809 CurFun.CurrentFunction = SavedCurFn;
4811 // If this is an initializer for a constant pointer, which is referencing a
4812 // (currently) undefined variable, create a stub now that shall be replaced
4813 // in the future with the right type of variable.
4816 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4817 const PointerType *PT = cast<PointerType>(Ty);
4819 // First check to see if the forward references value is already created!
4820 PerModuleInfo::GlobalRefsType::iterator I =
4821 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4823 if (I != CurModule.GlobalRefs.end()) {
4824 V = I->second; // Placeholder already exists, use it...
4825 (yyvsp[(2) - (2)].ValIDVal).destroy();
4828 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4829 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4830 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4831 GEN_ERROR("Invalid reference to global");
4833 // Create the forward referenced global.
4835 if (const FunctionType *FTy =
4836 dyn_cast<FunctionType>(PT->getElementType())) {
4837 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4838 CurModule.CurrentModule);
4840 GV = new GlobalVariable(PT->getElementType(), false,
4841 GlobalValue::ExternalWeakLinkage, 0,
4842 Name, CurModule.CurrentModule);
4845 // Keep track of the fact that we have a forward ref to recycle it
4846 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4851 (yyval.ConstVal) = cast<GlobalValue>(V);
4852 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4858 #line 1866 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4860 if (!UpRefs.empty())
4861 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4862 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4863 GEN_ERROR("Mismatched types for constant expression: " +
4864 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4865 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4866 delete (yyvsp[(1) - (2)].TypeVal);
4872 #line 1876 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4874 if (!UpRefs.empty())
4875 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4876 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4877 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4878 GEN_ERROR("Cannot create a null initialized value of this type");
4879 (yyval.ConstVal) = Constant::getNullValue(Ty);
4880 delete (yyvsp[(1) - (2)].TypeVal);
4886 #line 1886 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4887 { // integral constants
4888 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4889 GEN_ERROR("Constant value doesn't fit in type");
4890 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4896 #line 1892 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4897 { // arbitrary precision integer constants
4898 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4899 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4900 GEN_ERROR("Constant value does not fit in type");
4902 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4903 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4904 delete (yyvsp[(2) - (2)].APIntVal);
4910 #line 1902 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4911 { // integral constants
4912 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4913 GEN_ERROR("Constant value doesn't fit in type");
4914 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4920 #line 1908 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4921 { // arbitrary precision integer constants
4922 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4923 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4924 GEN_ERROR("Constant value does not fit in type");
4926 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4927 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4928 delete (yyvsp[(2) - (2)].APIntVal);
4934 #line 1918 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4935 { // Boolean constants
4936 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4937 GEN_ERROR("Constant true must have type i1");
4938 (yyval.ConstVal) = ConstantInt::getTrue();
4944 #line 1924 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4945 { // Boolean constants
4946 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4947 GEN_ERROR("Constant false must have type i1");
4948 (yyval.ConstVal) = ConstantInt::getFalse();
4954 #line 1930 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4955 { // Floating point constants
4956 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4957 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)].PrimType)==Type::FloatTy) {
4962 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
4965 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4966 delete (yyvsp[(2) - (2)].FPVal);
4972 #line 1946 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4974 if (!UpRefs.empty())
4975 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4976 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4977 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4978 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4979 GEN_ERROR("invalid cast opcode for cast from '" +
4980 Val->getType()->getDescription() + "' to '" +
4981 DestTy->getDescription() + "'");
4982 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4983 delete (yyvsp[(5) - (6)].TypeVal);
4988 #line 1958 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4990 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4991 GEN_ERROR("GetElementPtr requires a pointer operand");
4994 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4996 GEN_ERROR("Index list invalid for constant getelementptr");
4998 SmallVector<Constant*, 8> IdxVec;
4999 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
5000 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
5001 IdxVec.push_back(C);
5003 GEN_ERROR("Indices to constant getelementptr must be constants");
5005 delete (yyvsp[(4) - (5)].ValueList);
5007 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5013 #line 1979 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5015 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5016 GEN_ERROR("Select condition must be of boolean type");
5017 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5018 GEN_ERROR("Select operand types must match");
5019 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5025 #line 1987 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5027 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5028 GEN_ERROR("Binary operator types must match");
5030 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5035 #line 1993 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5037 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5038 GEN_ERROR("Logical operator types must match");
5039 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5040 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5041 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5042 GEN_ERROR("Logical operator requires integral operands");
5044 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5050 #line 2004 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5052 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5053 GEN_ERROR("icmp operand types must match");
5054 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5059 #line 2009 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5061 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5062 GEN_ERROR("fcmp operand types must match");
5063 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5068 #line 2014 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5070 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5071 GEN_ERROR("vicmp operand types must match");
5072 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5077 #line 2019 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5079 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5080 GEN_ERROR("vfcmp operand types must match");
5081 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5086 #line 2024 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5088 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5089 GEN_ERROR("Invalid extractelement operands");
5090 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5096 #line 2030 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5098 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5099 GEN_ERROR("Invalid insertelement operands");
5100 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5106 #line 2036 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5108 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5109 GEN_ERROR("Invalid shufflevector operands");
5110 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5116 #line 2042 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5118 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5119 GEN_ERROR("ExtractValue requires an aggregate operand");
5121 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5122 delete (yyvsp[(4) - (5)].ConstantList);
5128 #line 2050 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5130 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5131 GEN_ERROR("InsertValue requires an aggregate operand");
5133 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5134 delete (yyvsp[(6) - (7)].ConstantList);
5140 #line 2061 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5142 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5148 #line 2065 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5150 (yyval.ConstVector) = new std::vector<Constant*>();
5151 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5157 #line 2073 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5158 { (yyval.BoolVal) = false; ;}
5162 #line 2073 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5163 { (yyval.BoolVal) = true; ;}
5167 #line 2076 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5168 { (yyval.BoolVal) = true; ;}
5172 #line 2076 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5173 { (yyval.BoolVal) = false; ;}
5177 #line 2079 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5179 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5180 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5182 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5184 GEN_ERROR("Aliases can be created only to global values");
5186 (yyval.ConstVal) = Aliasee;
5188 delete (yyvsp[(1) - (2)].TypeVal);
5193 #line 2091 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5195 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5196 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5197 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5198 GEN_ERROR("invalid cast opcode for cast from '" +
5199 Val->getType()->getDescription() + "' to '" +
5200 DestTy->getDescription() + "'");
5202 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5204 delete (yyvsp[(5) - (6)].TypeVal);
5209 #line 2112 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5211 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5212 CurModule.ModuleDone();
5218 #line 2117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5220 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5221 CurModule.ModuleDone();
5227 #line 2130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5228 { CurFun.isDeclare = false; ;}
5232 #line 2130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5234 CurFun.FunctionDone();
5240 #line 2134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5241 { CurFun.isDeclare = true; ;}
5245 #line 2134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5252 #line 2137 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5259 #line 2140 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5261 if (!UpRefs.empty())
5262 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5263 // Eagerly resolve types. This is not an optimization, this is a
5264 // requirement that is due to the fact that we could have this:
5266 // %list = type { %list * }
5267 // %list = type { %list * } ; repeated type decl
5269 // If types are not resolved eagerly, then the two types will not be
5270 // determined to be the same type!
5272 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5274 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5276 // If this is a named type that is not a redefinition, add it to the slot
5278 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5281 delete (yyvsp[(3) - (3)].TypeVal);
5287 #line 2164 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5289 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5291 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5293 // If this is a named type that is not a redefinition, add it to the slot
5295 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5302 #line 2176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5304 /* "Externally Visible" Linkage */
5305 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5306 GEN_ERROR("Global value initializer is not a constant");
5307 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5308 (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));
5314 #line 2183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5321 #line 2187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5323 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5324 GEN_ERROR("Global value initializer is not a constant");
5325 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));
5331 #line 2192 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5338 #line 2196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5340 if (!UpRefs.empty())
5341 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5342 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));
5344 delete (yyvsp[(6) - (7)].TypeVal);
5349 #line 2202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5357 #line 2206 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5360 if ((yyvsp[(1) - (5)].StrVal)) {
5361 Name = *(yyvsp[(1) - (5)].StrVal);
5362 delete (yyvsp[(1) - (5)].StrVal);
5365 GEN_ERROR("Alias name cannot be empty");
5367 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5369 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5371 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5372 CurModule.CurrentModule);
5373 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5374 InsertValue(GA, CurModule.Values);
5377 // If there was a forward reference of this alias, resolve it now.
5381 ID = ValID::createGlobalName(Name);
5383 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5385 if (GlobalValue *FWGV =
5386 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5387 // Replace uses of the fwdref with the actual alias.
5388 FWGV->replaceAllUsesWith(GA);
5389 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5390 GV->eraseFromParent();
5392 cast<Function>(FWGV)->eraseFromParent();
5401 #line 2246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5408 #line 2249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5415 #line 2255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5417 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5418 if (AsmSoFar.empty())
5419 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5421 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5422 delete (yyvsp[(1) - (1)].StrVal);
5428 #line 2265 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5430 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5431 delete (yyvsp[(3) - (3)].StrVal);
5436 #line 2269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5438 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5439 delete (yyvsp[(3) - (3)].StrVal);
5444 #line 2276 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5446 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5447 delete (yyvsp[(3) - (3)].StrVal);
5453 #line 2281 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5455 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5456 delete (yyvsp[(1) - (1)].StrVal);
5462 #line 2286 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5469 #line 2295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5471 if (!UpRefs.empty())
5472 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5473 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5474 GEN_ERROR("Argument types must be first-class");
5475 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].Attributes); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5476 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5477 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5483 #line 2305 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5485 if (!UpRefs.empty())
5486 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5487 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5488 GEN_ERROR("Argument types must be first-class");
5489 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].Attributes); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5490 (yyval.ArgList) = new ArgListType;
5491 (yyval.ArgList)->push_back(E);
5497 #line 2316 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5499 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5505 #line 2320 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5507 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5508 struct ArgListEntry E;
5509 E.Ty = new PATypeHolder(Type::VoidTy);
5511 E.Attrs = Attribute::None;
5512 (yyval.ArgList)->push_back(E);
5518 #line 2329 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5520 (yyval.ArgList) = new ArgListType;
5521 struct ArgListEntry E;
5522 E.Ty = new PATypeHolder(Type::VoidTy);
5524 E.Attrs = Attribute::None;
5525 (yyval.ArgList)->push_back(E);
5531 #line 2338 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5533 (yyval.ArgList) = 0;
5539 #line 2344 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5541 std::string FunctionName(*(yyvsp[(4) - (11)].StrVal));
5542 delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory!
5544 // Check the function result for abstractness if this is a define. We should
5545 // have no abstract types at this point
5546 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(3) - (11)].TypeVal)))
5547 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(3) - (11)].TypeVal)->get()->getDescription());
5549 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (11)].TypeVal)))
5550 GEN_ERROR("Invalid result type for LLVM function");
5552 std::vector<const Type*> ParamTypeList;
5553 SmallVector<AttributeWithIndex, 8> Attrs;
5554 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
5556 Attributes RetAttrs = (yyvsp[(2) - (11)].Attributes);
5557 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None) {
5558 if ((yyvsp[(8) - (11)].Attributes) & Attribute::ZExt) {
5559 RetAttrs = RetAttrs | Attribute::ZExt;
5560 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::ZExt;
5562 if ((yyvsp[(8) - (11)].Attributes) & Attribute::SExt) {
5563 RetAttrs = RetAttrs | Attribute::SExt;
5564 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::SExt;
5566 if ((yyvsp[(8) - (11)].Attributes) & Attribute::InReg) {
5567 RetAttrs = RetAttrs | Attribute::InReg;
5568 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::InReg;
5571 if (RetAttrs != Attribute::None)
5572 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
5573 if ((yyvsp[(6) - (11)].ArgList)) { // If there are arguments...
5575 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin(); I != (yyvsp[(6) - (11)].ArgList)->end(); ++I, ++index) {
5576 const Type* Ty = I->Ty->get();
5577 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5578 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5579 ParamTypeList.push_back(Ty);
5580 if (Ty != Type::VoidTy && I->Attrs != Attribute::None)
5581 Attrs.push_back(AttributeWithIndex::get(index, I->Attrs));
5584 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None)
5585 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(8) - (11)].Attributes)));
5587 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5588 if (isVarArg) ParamTypeList.pop_back();
5592 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
5594 FunctionType *FT = FunctionType::get(*(yyvsp[(3) - (11)].TypeVal), ParamTypeList, isVarArg);
5595 const PointerType *PFT = PointerType::getUnqual(FT);
5596 delete (yyvsp[(3) - (11)].TypeVal);
5599 if (!FunctionName.empty()) {
5600 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5602 ID = ValID::createGlobalID(CurModule.Values.size());
5606 // See if this function was forward referenced. If so, recycle the object.
5607 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5608 // Move the function to the end of the list, from whereever it was
5609 // previously inserted.
5610 Fn = cast<Function>(FWRef);
5611 assert(Fn->getAttributes().isEmpty() &&
5612 "Forward reference has parameter attributes!");
5613 CurModule.CurrentModule->getFunctionList().remove(Fn);
5614 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5615 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5616 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5617 if (Fn->getFunctionType() != FT ) {
5618 // The existing function doesn't have the same type. This is an overload
5620 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5621 } else if (Fn->getAttributes() != PAL) {
5622 // The existing function doesn't have the same parameter attributes.
5623 // This is an overload error.
5624 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5625 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5626 // Neither the existing or the current function is a declaration and they
5627 // have the same name and same type. Clearly this is a redefinition.
5628 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5629 } else if (Fn->isDeclaration()) {
5630 // Make sure to strip off any argument names so we can't get conflicts.
5631 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5635 } else { // Not already defined?
5636 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5637 CurModule.CurrentModule);
5638 InsertValue(Fn, CurModule.Values);
5642 CurFun.FunctionStart(Fn);
5644 if (CurFun.isDeclare) {
5645 // If we have declaration, always overwrite linkage. This will allow us to
5646 // correctly handle cases, when pointer to function is passed as argument to
5647 // another function.
5648 Fn->setLinkage(CurFun.Linkage);
5649 Fn->setVisibility(CurFun.Visibility);
5651 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5652 Fn->setAttributes(PAL);
5653 Fn->setAlignment((yyvsp[(10) - (11)].UIntVal));
5654 if ((yyvsp[(9) - (11)].StrVal)) {
5655 Fn->setSection(*(yyvsp[(9) - (11)].StrVal));
5656 delete (yyvsp[(9) - (11)].StrVal);
5658 if ((yyvsp[(11) - (11)].StrVal)) {
5659 Fn->setGC((yyvsp[(11) - (11)].StrVal)->c_str());
5660 delete (yyvsp[(11) - (11)].StrVal);
5663 // Add all of the arguments we parsed to the function...
5664 if ((yyvsp[(6) - (11)].ArgList)) { // Is null if empty...
5665 if (isVarArg) { // Nuke the last entry
5666 assert((yyvsp[(6) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(6) - (11)].ArgList)->back().Name == 0 &&
5667 "Not a varargs marker!");
5668 delete (yyvsp[(6) - (11)].ArgList)->back().Ty;
5669 (yyvsp[(6) - (11)].ArgList)->pop_back(); // Delete the last entry
5671 Function::arg_iterator ArgIt = Fn->arg_begin();
5672 Function::arg_iterator ArgEnd = Fn->arg_end();
5674 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin();
5675 I != (yyvsp[(6) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5676 delete I->Ty; // Delete the typeholder...
5677 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5683 delete (yyvsp[(6) - (11)].ArgList); // We're now done with the argument list
5690 #line 2494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5692 (yyval.FunctionVal) = CurFun.CurrentFunction;
5694 // Make sure that we keep track of the linkage type even if there was a
5695 // previous "declare".
5696 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5697 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5702 #line 2505 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5704 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5710 #line 2510 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5712 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5713 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5714 (yyval.FunctionVal) = CurFun.CurrentFunction;
5715 CurFun.FunctionDone();
5721 #line 2522 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5723 (yyval.BoolVal) = false;
5729 #line 2526 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5731 (yyval.BoolVal) = true;
5737 #line 2531 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5738 { // A reference to a direct constant
5739 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5745 #line 2535 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5747 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5753 #line 2539 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5754 { // arbitrary precision integer constants
5755 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5756 delete (yyvsp[(1) - (1)].APIntVal);
5762 #line 2544 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5763 { // arbitrary precision integer constants
5764 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5765 delete (yyvsp[(1) - (1)].APIntVal);
5771 #line 2549 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5772 { // Perhaps it's an FP constant?
5773 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5779 #line 2553 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5781 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5787 #line 2557 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5789 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5795 #line 2561 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5797 (yyval.ValIDVal) = ValID::createNull();
5803 #line 2565 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5805 (yyval.ValIDVal) = ValID::createUndef();
5811 #line 2569 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5812 { // A vector zero constant.
5813 (yyval.ValIDVal) = ValID::createZeroInit();
5819 #line 2573 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5820 { // Nonempty unsized packed vector
5821 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5822 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5824 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5825 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5827 VectorType* pt = VectorType::get(ETy, NumElements);
5828 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5830 // Verify all elements are correct type!
5831 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5832 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5833 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5834 ETy->getDescription() +"' as required!\nIt is of type '" +
5835 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5838 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5839 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5845 #line 2595 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5846 { // Nonempty unsized arr
5847 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5848 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5850 if (!ETy->isFirstClassType())
5851 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5853 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5854 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5856 // Verify all elements are correct type!
5857 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5858 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5859 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5860 ETy->getDescription() +"' as required!\nIt is of type '"+
5861 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5864 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5865 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5871 #line 2617 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5873 // Use undef instead of an array because it's inconvenient to determine
5874 // the element type at this point, there being no elements to examine.
5875 (yyval.ValIDVal) = ValID::createUndef();
5881 #line 2623 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5883 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5884 const Type *ETy = Type::Int8Ty;
5886 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5888 std::vector<Constant*> Vals;
5889 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5890 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5891 delete (yyvsp[(2) - (2)].StrVal);
5892 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5898 #line 2636 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5900 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5901 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5902 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5904 const StructType *STy = StructType::get(Elements);
5905 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5907 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5908 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5914 #line 2648 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5916 const StructType *STy = StructType::get(std::vector<const Type*>());
5917 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5923 #line 2653 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5925 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5926 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5927 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5929 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5930 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5932 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5933 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5939 #line 2665 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5941 const StructType *STy = StructType::get(std::vector<const Type*>(),
5943 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5949 #line 2671 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5951 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5957 #line 2675 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5959 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5960 delete (yyvsp[(3) - (5)].StrVal);
5961 delete (yyvsp[(5) - (5)].StrVal);
5967 #line 2685 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5968 { // Is it an integer reference...?
5969 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5975 #line 2689 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5977 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5983 #line 2693 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5984 { // Is it a named reference...?
5985 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5986 delete (yyvsp[(1) - (1)].StrVal);
5992 #line 2698 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5993 { // Is it a named reference...?
5994 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5995 delete (yyvsp[(1) - (1)].StrVal);
6001 #line 2711 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6003 if (!UpRefs.empty())
6004 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
6005 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
6006 delete (yyvsp[(1) - (2)].TypeVal);
6012 #line 2720 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6014 (yyval.ValueList) = new std::vector<Value *>();
6015 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
6021 #line 2725 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6023 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6029 #line 2730 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6031 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6037 #line 2734 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6038 { // Do not allow functions with 0 basic blocks
6039 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6045 #line 2743 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6047 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6049 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6050 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6051 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6057 #line 2752 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6060 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6061 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6062 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6063 " is incorrect, expected %" + utostr((unsigned)ValNum));
6065 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6066 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6072 #line 2765 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6074 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6075 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6076 if (CI2->getParent() == 0)
6077 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6078 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6079 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6085 #line 2774 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6086 { // Empty space between instruction lists
6087 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6093 #line 2778 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6094 { // Labelled (named) basic block
6095 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6096 delete (yyvsp[(1) - (1)].StrVal);
6103 #line 2786 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6104 { // Return with a result...
6105 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6106 assert(!VL.empty() && "Invalid ret operands!");
6107 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6108 if (VL.size() > 1 ||
6109 (isa<StructType>(ReturnType) &&
6110 (VL.empty() || VL[0]->getType() != ReturnType))) {
6111 Value *RV = UndefValue::get(ReturnType);
6112 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6113 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6114 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6117 (yyval.TermInstVal) = ReturnInst::Create(RV);
6119 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6121 delete (yyvsp[(2) - (2)].ValueList);
6127 #line 2806 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6128 { // Return with no result...
6129 (yyval.TermInstVal) = ReturnInst::Create();
6135 #line 2810 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6136 { // Unconditional Branch...
6137 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6139 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6144 #line 2815 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6146 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6147 GEN_ERROR("Branch condition must have type i1");
6148 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6150 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6152 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6154 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6159 #line 2826 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6161 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6163 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6165 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6166 (yyval.TermInstVal) = S;
6168 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6169 E = (yyvsp[(8) - (9)].JumpTable)->end();
6170 for (; I != E; ++I) {
6171 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6172 S->addCase(CI, I->second);
6174 GEN_ERROR("Switch case is constant, but not a simple integer");
6176 delete (yyvsp[(8) - (9)].JumpTable);
6182 #line 2845 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6184 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6186 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6188 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6189 (yyval.TermInstVal) = S;
6195 #line 2855 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6198 // Handle the short syntax
6199 const PointerType *PFTy = 0;
6200 const FunctionType *Ty = 0;
6201 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (15)].TypeVal)->get())) ||
6202 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6203 // Pull out the types of all of the arguments...
6204 std::vector<const Type*> ParamTypes;
6205 ParamList::iterator I = (yyvsp[(7) - (15)].ParamList)->begin(), E = (yyvsp[(7) - (15)].ParamList)->end();
6206 for (; I != E; ++I) {
6207 const Type *Ty = I->Val->getType();
6208 if (Ty == Type::VoidTy)
6209 GEN_ERROR("Short call syntax cannot be used with varargs");
6210 ParamTypes.push_back(Ty);
6213 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (15)].TypeVal)))
6214 GEN_ERROR("Invalid result type for LLVM function");
6216 Ty = FunctionType::get((yyvsp[(4) - (15)].TypeVal)->get(), ParamTypes, false);
6217 PFTy = PointerType::getUnqual(Ty);
6220 delete (yyvsp[(4) - (15)].TypeVal);
6222 Value *V = getVal(PFTy, (yyvsp[(5) - (15)].ValIDVal)); // Get the function we're calling...
6224 BasicBlock *Normal = getBBVal((yyvsp[(12) - (15)].ValIDVal));
6226 BasicBlock *Except = getBBVal((yyvsp[(15) - (15)].ValIDVal));
6229 SmallVector<AttributeWithIndex, 8> Attrs;
6230 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6232 Attributes RetAttrs = (yyvsp[(3) - (15)].Attributes);
6233 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None) {
6234 if ((yyvsp[(9) - (15)].Attributes) & Attribute::ZExt) {
6235 RetAttrs = RetAttrs | Attribute::ZExt;
6236 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::ZExt;
6238 if ((yyvsp[(9) - (15)].Attributes) & Attribute::SExt) {
6239 RetAttrs = RetAttrs | Attribute::SExt;
6240 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::SExt;
6242 if ((yyvsp[(9) - (15)].Attributes) & Attribute::InReg) {
6243 RetAttrs = RetAttrs | Attribute::InReg;
6244 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::InReg;
6247 if (RetAttrs != Attribute::None)
6248 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6250 // Check the arguments
6252 if ((yyvsp[(7) - (15)].ParamList)->empty()) { // Has no arguments?
6253 // Make sure no arguments is a good thing!
6254 if (Ty->getNumParams() != 0)
6255 GEN_ERROR("No arguments passed to a function that "
6256 "expects arguments");
6257 } else { // Has arguments?
6258 // Loop through FunctionType's arguments and ensure they are specified
6260 FunctionType::param_iterator I = Ty->param_begin();
6261 FunctionType::param_iterator E = Ty->param_end();
6262 ParamList::iterator ArgI = (yyvsp[(7) - (15)].ParamList)->begin(), ArgE = (yyvsp[(7) - (15)].ParamList)->end();
6265 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6266 if (ArgI->Val->getType() != *I)
6267 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6268 (*I)->getDescription() + "'");
6269 Args.push_back(ArgI->Val);
6270 if (ArgI->Attrs != Attribute::None)
6271 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6274 if (Ty->isVarArg()) {
6276 for (; ArgI != ArgE; ++ArgI, ++index) {
6277 Args.push_back(ArgI->Val); // push the remaining varargs
6278 if (ArgI->Attrs != Attribute::None)
6279 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6281 } else if (I != E || ArgI != ArgE)
6282 GEN_ERROR("Invalid number of parameters detected");
6284 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None)
6285 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (15)].Attributes)));
6288 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6290 // Create the InvokeInst
6291 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6292 Args.begin(), Args.end());
6293 II->setCallingConv((yyvsp[(2) - (15)].UIntVal));
6294 II->setAttributes(PAL);
6295 (yyval.TermInstVal) = II;
6296 delete (yyvsp[(7) - (15)].ParamList);
6302 #line 2958 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6304 (yyval.TermInstVal) = new UnwindInst();
6310 #line 2962 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6312 (yyval.TermInstVal) = new UnreachableInst();
6318 #line 2969 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6320 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6321 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6324 GEN_ERROR("May only switch on a constant pool value");
6326 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6328 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6333 #line 2980 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6335 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6336 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6340 GEN_ERROR("May only switch on a constant pool value");
6342 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6344 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6349 #line 2993 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6351 // Is this definition named?? if so, assign the name...
6352 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6354 InsertValue((yyvsp[(2) - (2)].InstVal));
6355 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6361 #line 3002 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6364 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6366 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6367 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6368 " is incorrect, expected %" + utostr((unsigned)ValNum));
6370 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6376 #line 3015 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6377 { // Used for PHI nodes
6378 if (!UpRefs.empty())
6379 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6380 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6381 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6383 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6385 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6386 delete (yyvsp[(1) - (6)].TypeVal);
6391 #line 3026 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6393 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6394 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6396 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6398 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6403 #line 3036 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6405 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6406 if (!UpRefs.empty())
6407 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6408 // Used for call and invoke instructions
6409 (yyval.ParamList) = new ParamList();
6410 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6411 (yyval.ParamList)->push_back(E);
6412 delete (yyvsp[(1) - (4)].TypeVal);
6418 #line 3047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6420 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6421 // Labels are only valid in ASMs
6422 (yyval.ParamList) = new ParamList();
6423 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6424 (yyval.ParamList)->push_back(E);
6430 #line 3055 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6432 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6433 if (!UpRefs.empty())
6434 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6435 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6436 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6437 (yyval.ParamList)->push_back(E);
6438 delete (yyvsp[(3) - (6)].TypeVal);
6444 #line 3065 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6446 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6447 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6448 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6449 (yyval.ParamList)->push_back(E);
6455 #line 3072 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6456 { (yyval.ParamList) = new ParamList(); ;}
6460 #line 3075 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6461 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6465 #line 3076 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6467 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6468 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6474 #line 3084 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6476 (yyval.ConstantList) = new std::vector<unsigned>();
6477 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6478 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6479 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6484 #line 3090 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6486 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6487 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6488 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6489 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6495 #line 3099 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6497 (yyval.BoolVal) = true;
6503 #line 3103 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6505 (yyval.BoolVal) = false;
6511 #line 3108 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6513 if (!UpRefs.empty())
6514 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6515 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6516 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6518 "Arithmetic operator requires integer, FP, or packed operands");
6519 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6521 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6523 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6524 if ((yyval.InstVal) == 0)
6525 GEN_ERROR("binary operator returned null");
6526 delete (yyvsp[(2) - (5)].TypeVal);
6531 #line 3124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6533 if (!UpRefs.empty())
6534 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6535 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6536 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6537 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6538 GEN_ERROR("Logical operator requires integral operands");
6540 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6542 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6544 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6545 if ((yyval.InstVal) == 0)
6546 GEN_ERROR("binary operator returned null");
6547 delete (yyvsp[(2) - (5)].TypeVal);
6552 #line 3141 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6554 if (!UpRefs.empty())
6555 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6556 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6558 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6560 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6561 if ((yyval.InstVal) == 0)
6562 GEN_ERROR("icmp operator returned null");
6563 delete (yyvsp[(3) - (6)].TypeVal);
6568 #line 3153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6570 if (!UpRefs.empty())
6571 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6572 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6574 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6576 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6577 if ((yyval.InstVal) == 0)
6578 GEN_ERROR("fcmp operator returned null");
6579 delete (yyvsp[(3) - (6)].TypeVal);
6584 #line 3165 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6586 if (!UpRefs.empty())
6587 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6588 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6589 GEN_ERROR("Scalar types not supported by vicmp instruction");
6590 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6592 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6594 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6595 if ((yyval.InstVal) == 0)
6596 GEN_ERROR("vicmp operator returned null");
6597 delete (yyvsp[(3) - (6)].TypeVal);
6602 #line 3179 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6604 if (!UpRefs.empty())
6605 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6606 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6607 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6608 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6610 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6612 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6613 if ((yyval.InstVal) == 0)
6614 GEN_ERROR("vfcmp operator returned null");
6615 delete (yyvsp[(3) - (6)].TypeVal);
6620 #line 3193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6622 if (!UpRefs.empty())
6623 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6624 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6625 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6626 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6627 GEN_ERROR("invalid cast opcode for cast from '" +
6628 Val->getType()->getDescription() + "' to '" +
6629 DestTy->getDescription() + "'");
6630 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6631 delete (yyvsp[(4) - (4)].TypeVal);
6636 #line 3205 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6638 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6640 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6641 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6642 GEN_ERROR("vector select value types must be vector types");
6643 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6644 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6645 if (cond_type->getElementType() != Type::Int1Ty)
6646 GEN_ERROR("vector select condition element type must be boolean");
6647 if (cond_type->getNumElements() != select_type->getNumElements())
6648 GEN_ERROR("vector select number of elements must be the same");
6650 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6651 GEN_ERROR("select condition must be boolean");
6653 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6654 GEN_ERROR("select value types must match");
6655 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6661 #line 3226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6663 if (!UpRefs.empty())
6664 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6665 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6666 delete (yyvsp[(4) - (4)].TypeVal);
6672 #line 3233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6674 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6675 GEN_ERROR("Invalid extractelement operands");
6676 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6682 #line 3239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6684 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6685 GEN_ERROR("Invalid insertelement operands");
6686 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6692 #line 3245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6694 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6695 GEN_ERROR("Invalid shufflevector operands");
6696 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6702 #line 3251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6704 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6705 if (!Ty->isFirstClassType())
6706 GEN_ERROR("PHI node operands must be of first class type");
6707 (yyval.InstVal) = PHINode::Create(Ty);
6708 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6709 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6710 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6711 GEN_ERROR("All elements of a PHI node must be of the same type");
6712 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6713 (yyvsp[(2) - (2)].PHIList)->pop_front();
6715 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6721 #line 3267 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6724 // Handle the short syntax
6725 const PointerType *PFTy = 0;
6726 const FunctionType *Ty = 0;
6727 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (9)].TypeVal)->get())) ||
6728 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6729 // Pull out the types of all of the arguments...
6730 std::vector<const Type*> ParamTypes;
6731 ParamList::iterator I = (yyvsp[(7) - (9)].ParamList)->begin(), E = (yyvsp[(7) - (9)].ParamList)->end();
6732 for (; I != E; ++I) {
6733 const Type *Ty = I->Val->getType();
6734 if (Ty == Type::VoidTy)
6735 GEN_ERROR("Short call syntax cannot be used with varargs");
6736 ParamTypes.push_back(Ty);
6739 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (9)].TypeVal)))
6740 GEN_ERROR("Invalid result type for LLVM function");
6742 Ty = FunctionType::get((yyvsp[(4) - (9)].TypeVal)->get(), ParamTypes, false);
6743 PFTy = PointerType::getUnqual(Ty);
6746 Value *V = getVal(PFTy, (yyvsp[(5) - (9)].ValIDVal)); // Get the function we're calling...
6749 // Check for call to invalid intrinsic to avoid crashing later.
6750 if (Function *theF = dyn_cast<Function>(V)) {
6751 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6752 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6753 !theF->getIntrinsicID(true))
6754 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6755 theF->getName() + "'");
6758 // Set up the Attributes for the function
6759 SmallVector<AttributeWithIndex, 8> Attrs;
6760 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6762 Attributes RetAttrs = (yyvsp[(3) - (9)].Attributes);
6763 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None) {
6764 if ((yyvsp[(9) - (9)].Attributes) & Attribute::ZExt) {
6765 RetAttrs = RetAttrs | Attribute::ZExt;
6766 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::ZExt;
6768 if ((yyvsp[(9) - (9)].Attributes) & Attribute::SExt) {
6769 RetAttrs = RetAttrs | Attribute::SExt;
6770 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::SExt;
6772 if ((yyvsp[(9) - (9)].Attributes) & Attribute::InReg) {
6773 RetAttrs = RetAttrs | Attribute::InReg;
6774 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::InReg;
6777 if (RetAttrs != Attribute::None)
6778 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6780 // Check the arguments
6782 if ((yyvsp[(7) - (9)].ParamList)->empty()) { // Has no arguments?
6783 // Make sure no arguments is a good thing!
6784 if (Ty->getNumParams() != 0)
6785 GEN_ERROR("No arguments passed to a function that "
6786 "expects arguments");
6787 } else { // Has arguments?
6788 // Loop through FunctionType's arguments and ensure they are specified
6789 // correctly. Also, gather any parameter attributes.
6790 FunctionType::param_iterator I = Ty->param_begin();
6791 FunctionType::param_iterator E = Ty->param_end();
6792 ParamList::iterator ArgI = (yyvsp[(7) - (9)].ParamList)->begin(), ArgE = (yyvsp[(7) - (9)].ParamList)->end();
6795 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6796 if (ArgI->Val->getType() != *I)
6797 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6798 (*I)->getDescription() + "'");
6799 Args.push_back(ArgI->Val);
6800 if (ArgI->Attrs != Attribute::None)
6801 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6803 if (Ty->isVarArg()) {
6805 for (; ArgI != ArgE; ++ArgI, ++index) {
6806 Args.push_back(ArgI->Val); // push the remaining varargs
6807 if (ArgI->Attrs != Attribute::None)
6808 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6810 } else if (I != E || ArgI != ArgE)
6811 GEN_ERROR("Invalid number of parameters detected");
6813 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None)
6814 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (9)].Attributes)));
6816 // Finish off the Attributes and check them
6819 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6821 // Create the call node
6822 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6823 CI->setTailCall((yyvsp[(1) - (9)].BoolVal));
6824 CI->setCallingConv((yyvsp[(2) - (9)].UIntVal));
6825 CI->setAttributes(PAL);
6826 (yyval.InstVal) = CI;
6827 delete (yyvsp[(7) - (9)].ParamList);
6828 delete (yyvsp[(4) - (9)].TypeVal);
6834 #line 3376 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6836 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6842 #line 3381 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6844 (yyval.BoolVal) = true;
6850 #line 3385 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6852 (yyval.BoolVal) = false;
6858 #line 3392 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6860 if (!UpRefs.empty())
6861 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6862 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6863 delete (yyvsp[(2) - (3)].TypeVal);
6869 #line 3399 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6871 if (!UpRefs.empty())
6872 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6873 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6874 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6875 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6877 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6878 delete (yyvsp[(2) - (6)].TypeVal);
6883 #line 3409 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6885 if (!UpRefs.empty())
6886 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6887 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6888 delete (yyvsp[(2) - (3)].TypeVal);
6894 #line 3416 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6896 if (!UpRefs.empty())
6897 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6898 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6899 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6900 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6902 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6903 delete (yyvsp[(2) - (6)].TypeVal);
6908 #line 3426 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6910 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6911 GEN_ERROR("Trying to free nonpointer type " +
6912 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6913 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6919 #line 3434 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6921 if (!UpRefs.empty())
6922 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6923 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6924 GEN_ERROR("Can't load from nonpointer type: " +
6925 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6926 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6927 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6928 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6929 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6931 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6932 delete (yyvsp[(3) - (5)].TypeVal);
6937 #line 3448 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6939 if (!UpRefs.empty())
6940 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6941 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6943 GEN_ERROR("Can't store to a nonpointer type: " +
6944 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6945 const Type *ElTy = PT->getElementType();
6946 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6947 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6948 "' into space of type '" + ElTy->getDescription() + "'");
6950 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6952 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6953 delete (yyvsp[(5) - (7)].TypeVal);
6958 #line 3465 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6960 if (!UpRefs.empty())
6961 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6962 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6963 GEN_ERROR("getresult insn requires an aggregate operand");
6964 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6965 GEN_ERROR("Invalid getresult index for type '" +
6966 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6968 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6970 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6971 delete (yyvsp[(2) - (5)].TypeVal);
6976 #line 3479 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6978 if (!UpRefs.empty())
6979 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6980 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6981 GEN_ERROR("getelementptr insn requires pointer operand");
6983 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6984 GEN_ERROR("Invalid getelementptr indices for type '" +
6985 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6986 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6988 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6989 delete (yyvsp[(2) - (4)].TypeVal);
6990 delete (yyvsp[(4) - (4)].ValueList);
6995 #line 3494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6997 if (!UpRefs.empty())
6998 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6999 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
7000 GEN_ERROR("extractvalue insn requires an aggregate operand");
7002 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
7003 GEN_ERROR("Invalid extractvalue indices for type '" +
7004 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7005 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7007 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
7008 delete (yyvsp[(2) - (4)].TypeVal);
7009 delete (yyvsp[(4) - (4)].ConstantList);
7014 #line 3509 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
7016 if (!UpRefs.empty())
7017 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
7018 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
7019 GEN_ERROR("extractvalue insn requires an aggregate operand");
7021 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
7022 GEN_ERROR("Invalid insertvalue indices for type '" +
7023 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
7024 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
7025 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
7027 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
7028 delete (yyvsp[(2) - (7)].TypeVal);
7029 delete (yyvsp[(5) - (7)].TypeVal);
7030 delete (yyvsp[(7) - (7)].ConstantList);
7035 /* Line 1267 of yacc.c. */
7036 #line 7037 "llvmAsmParser.tab.c"
7039 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7043 YY_STACK_PRINT (yyss, yyssp);
7048 /* Now `shift' the result of the reduction. Determine what state
7049 that goes to, based on the state we popped back to and the rule
7050 number reduced by. */
7054 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7055 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7056 yystate = yytable[yystate];
7058 yystate = yydefgoto[yyn - YYNTOKENS];
7063 /*------------------------------------.
7064 | yyerrlab -- here on detecting error |
7065 `------------------------------------*/
7067 /* If not already recovering from an error, report this error. */
7071 #if ! YYERROR_VERBOSE
7072 yyerror (YY_("syntax error"));
7075 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7076 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7078 YYSIZE_T yyalloc = 2 * yysize;
7079 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7080 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7081 if (yymsg != yymsgbuf)
7082 YYSTACK_FREE (yymsg);
7083 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7085 yymsg_alloc = yyalloc;
7089 yymsg_alloc = sizeof yymsgbuf;
7093 if (0 < yysize && yysize <= yymsg_alloc)
7095 (void) yysyntax_error (yymsg, yystate, yychar);
7100 yyerror (YY_("syntax error"));
7102 goto yyexhaustedlab;
7110 if (yyerrstatus == 3)
7112 /* If just tried and failed to reuse look-ahead token after an
7113 error, discard it. */
7115 if (yychar <= YYEOF)
7117 /* Return failure if at end of input. */
7118 if (yychar == YYEOF)
7123 yydestruct ("Error: discarding",
7129 /* Else will try to reuse look-ahead token after shifting the error
7134 /*---------------------------------------------------.
7135 | yyerrorlab -- error raised explicitly by YYERROR. |
7136 `---------------------------------------------------*/
7139 /* Pacify compilers like GCC when the user code never invokes
7140 YYERROR and the label yyerrorlab therefore never appears in user
7142 if (/*CONSTCOND*/ 0)
7145 /* Do not reclaim the symbols of the rule which action triggered
7149 YY_STACK_PRINT (yyss, yyssp);
7154 /*-------------------------------------------------------------.
7155 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7156 `-------------------------------------------------------------*/
7158 yyerrstatus = 3; /* Each real token shifted decrements this. */
7162 yyn = yypact[yystate];
7163 if (yyn != YYPACT_NINF)
7166 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7174 /* Pop the current state because it cannot handle the error token. */
7179 yydestruct ("Error: popping",
7180 yystos[yystate], yyvsp);
7183 YY_STACK_PRINT (yyss, yyssp);
7192 /* Shift the error token. */
7193 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7199 /*-------------------------------------.
7200 | yyacceptlab -- YYACCEPT comes here. |
7201 `-------------------------------------*/
7206 /*-----------------------------------.
7207 | yyabortlab -- YYABORT comes here. |
7208 `-----------------------------------*/
7214 /*-------------------------------------------------.
7215 | yyexhaustedlab -- memory exhaustion comes here. |
7216 `-------------------------------------------------*/
7218 yyerror (YY_("memory exhausted"));
7224 if (yychar != YYEOF && yychar != YYEMPTY)
7225 yydestruct ("Cleanup: discarding lookahead",
7227 /* Do not reclaim the symbols of the rule which action triggered
7228 this YYABORT or YYACCEPT. */
7230 YY_STACK_PRINT (yyss, yyssp);
7231 while (yyssp != yyss)
7233 yydestruct ("Cleanup: popping",
7234 yystos[*yyssp], yyvsp);
7239 YYSTACK_FREE (yyss);
7242 if (yymsg != yymsgbuf)
7243 YYSTACK_FREE (yymsg);
7245 /* Make sure YYID is used. */
7246 return YYID (yyresult);
7250 #line 3528 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
7253 // common code from the two 'RunVMAsmParser' functions
7254 static Module* RunParser(Module * M) {
7255 CurModule.CurrentModule = M;
7256 // Check to make sure the parser succeeded
7259 delete ParserResult;
7263 // Emit an error if there are any unresolved types left.
7264 if (!CurModule.LateResolveTypes.empty()) {
7265 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7266 if (DID.Type == ValID::LocalName) {
7267 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7269 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7272 delete ParserResult;
7276 // Emit an error if there are any unresolved values left.
7277 if (!CurModule.LateResolveValues.empty()) {
7278 Value *V = CurModule.LateResolveValues.back();
7279 std::map<Value*, std::pair<ValID, int> >::iterator I =
7280 CurModule.PlaceHolderInfo.find(V);
7282 if (I != CurModule.PlaceHolderInfo.end()) {
7283 ValID &DID = I->second.first;
7284 if (DID.Type == ValID::LocalName) {
7285 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7287 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7290 delete ParserResult;
7295 // Check to make sure that parsing produced a result
7299 // Reset ParserResult variable while saving its value for the result.
7300 Module *Result = ParserResult;
7306 void llvm::GenerateError(const std::string &message, int LineNo) {
7307 if (LineNo == -1) LineNo = LLLgetLineNo();
7308 // TODO: column number in exception
7310 TheParseError->setError(LLLgetFilename(), message, LineNo);
7314 int yyerror(const char *ErrorMsg) {
7315 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7316 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7317 if (yychar != YYEMPTY && yychar != 0) {
7318 errMsg += " while reading token: '";
7319 errMsg += std::string(LLLgetTokenStart(),
7320 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7322 GenerateError(errMsg);