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 "/cvs/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()) {
527 I->first.second.destroy();
533 bool TypeIsUnresolved(PATypeHolder* PATy) {
534 // If it isn't abstract, its resolved
535 const Type* Ty = PATy->get();
536 if (!Ty->isAbstract())
538 // Traverse the type looking for abstract types. If it isn't abstract then
539 // we don't need to traverse that leg of the type.
540 std::vector<const Type*> WorkList, SeenList;
541 WorkList.push_back(Ty);
542 while (!WorkList.empty()) {
543 const Type* Ty = WorkList.back();
544 SeenList.push_back(Ty);
546 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
547 // Check to see if this is an unresolved type
548 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
549 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
550 for ( ; I != E; ++I) {
551 if (I->second.get() == OpTy)
554 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
555 const Type* TheTy = SeqTy->getElementType();
556 if (TheTy->isAbstract() && TheTy != Ty) {
557 std::vector<const Type*>::iterator I = SeenList.begin(),
563 WorkList.push_back(TheTy);
565 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
566 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
567 const Type* TheTy = StrTy->getElementType(i);
568 if (TheTy->isAbstract() && TheTy != Ty) {
569 std::vector<const Type*>::iterator I = SeenList.begin(),
575 WorkList.push_back(TheTy);
584 static struct PerFunctionInfo {
585 Function *CurrentFunction; // Pointer to current function being created
587 ValueList Values; // Keep track of #'d definitions
589 ValueList LateResolveValues;
590 bool isDeclare; // Is this function a forward declararation?
591 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
592 GlobalValue::VisibilityTypes Visibility;
594 /// BBForwardRefs - When we see forward references to basic blocks, keep
595 /// track of them here.
596 std::map<ValID, BasicBlock*> BBForwardRefs;
598 inline PerFunctionInfo() {
601 Linkage = GlobalValue::ExternalLinkage;
602 Visibility = GlobalValue::DefaultVisibility;
605 inline void FunctionStart(Function *M) {
610 void FunctionDone() {
611 // Any forward referenced blocks left?
612 if (!BBForwardRefs.empty()) {
613 GenerateError("Undefined reference to label " +
614 BBForwardRefs.begin()->second->getName());
618 // Resolve all forward references now.
619 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
621 Values.clear(); // Clear out function local definitions
622 BBForwardRefs.clear();
625 Linkage = GlobalValue::ExternalLinkage;
626 Visibility = GlobalValue::DefaultVisibility;
628 } CurFun; // Info for the current function...
630 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
633 //===----------------------------------------------------------------------===//
634 // Code to handle definitions of all the types
635 //===----------------------------------------------------------------------===//
637 /// InsertValue - Insert a value into the value table. If it is named, this
638 /// returns -1, otherwise it returns the slot number for the value.
639 static int InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
640 // Things that have names or are void typed don't get slot numbers
641 if (V->hasName() || (V->getType() == Type::VoidTy))
644 // In the case of function values, we have to allow for the forward reference
645 // of basic blocks, which are included in the numbering. Consequently, we keep
646 // track of the next insertion location with NextValNum. When a BB gets
647 // inserted, it could change the size of the CurFun.Values vector.
648 if (&ValueTab == &CurFun.Values) {
649 if (ValueTab.size() <= CurFun.NextValNum)
650 ValueTab.resize(CurFun.NextValNum+1);
651 ValueTab[CurFun.NextValNum++] = V;
652 return CurFun.NextValNum-1;
654 // For all other lists, its okay to just tack it on the back of the vector.
655 ValueTab.push_back(V);
656 return ValueTab.size()-1;
659 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
661 case ValID::LocalID: // Is it a numbered definition?
662 // Module constants occupy the lowest numbered slots...
663 if (D.Num < CurModule.Types.size())
664 return CurModule.Types[D.Num];
666 case ValID::LocalName: // Is it a named definition?
667 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
668 D.destroy(); // Free old strdup'd memory...
673 GenerateError("Internal parser error: Invalid symbol type reference");
677 // If we reached here, we referenced either a symbol that we don't know about
678 // or an id number that hasn't been read yet. We may be referencing something
679 // forward, so just create an entry to be resolved later and get to it...
681 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
684 if (inFunctionScope()) {
685 if (D.Type == ValID::LocalName) {
686 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
689 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
694 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
695 if (I != CurModule.LateResolveTypes.end()) {
700 Type *Typ = OpaqueType::get();
701 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
705 // getExistingVal - Look up the value specified by the provided type and
706 // the provided ValID. If the value exists and has already been defined, return
707 // it. Otherwise return null.
709 static Value *getExistingVal(const Type *Ty, const ValID &D) {
710 if (isa<FunctionType>(Ty)) {
711 GenerateError("Functions are not values and "
712 "must be referenced as pointers");
717 case ValID::LocalID: { // Is it a numbered definition?
718 // Check that the number is within bounds.
719 if (D.Num >= CurFun.Values.size())
721 Value *Result = CurFun.Values[D.Num];
722 if (Ty != Result->getType()) {
723 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
724 Result->getType()->getDescription() + "' does not match "
725 "expected type, '" + Ty->getDescription() + "'");
730 case ValID::GlobalID: { // Is it a numbered definition?
731 if (D.Num >= CurModule.Values.size())
733 Value *Result = CurModule.Values[D.Num];
734 if (Ty != Result->getType()) {
735 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
736 Result->getType()->getDescription() + "' does not match "
737 "expected type, '" + Ty->getDescription() + "'");
743 case ValID::LocalName: { // Is it a named definition?
744 if (!inFunctionScope())
746 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
747 Value *N = SymTab.lookup(D.getName());
750 if (N->getType() != Ty)
753 D.destroy(); // Free old strdup'd memory...
756 case ValID::GlobalName: { // Is it a named definition?
757 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
758 Value *N = SymTab.lookup(D.getName());
761 if (N->getType() != Ty)
764 D.destroy(); // Free old strdup'd memory...
768 // Check to make sure that "Ty" is an integral type, and that our
769 // value will fit into the specified type...
770 case ValID::ConstSIntVal: // Is it a constant pool reference??
771 if (!isa<IntegerType>(Ty) ||
772 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
773 GenerateError("Signed integral constant '" +
774 itostr(D.ConstPool64) + "' is invalid for type '" +
775 Ty->getDescription() + "'");
778 return ConstantInt::get(Ty, D.ConstPool64, true);
780 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
781 if (isa<IntegerType>(Ty) &&
782 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
783 return ConstantInt::get(Ty, D.UConstPool64);
785 if (!isa<IntegerType>(Ty) ||
786 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
787 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
788 "' is invalid or out of range for type '" +
789 Ty->getDescription() + "'");
792 // This is really a signed reference. Transmogrify.
793 return ConstantInt::get(Ty, D.ConstPool64, true);
795 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
796 if (!isa<IntegerType>(Ty)) {
797 GenerateError("Integral constant '" + D.getName() +
798 "' is invalid or out of range for type '" +
799 Ty->getDescription() + "'");
804 APSInt Tmp = *D.ConstPoolInt;
805 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
806 return ConstantInt::get(Tmp);
809 case ValID::ConstFPVal: // Is it a floating point const pool reference?
810 if (!Ty->isFloatingPoint() ||
811 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
812 GenerateError("FP constant invalid for type");
815 // Lexer has no type info, so builds all float and double FP constants
816 // as double. Fix this here. Long double does not need this.
817 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
820 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
823 return ConstantFP::get(*D.ConstPoolFP);
825 case ValID::ConstNullVal: // Is it a null value?
826 if (!isa<PointerType>(Ty)) {
827 GenerateError("Cannot create a a non pointer null");
830 return ConstantPointerNull::get(cast<PointerType>(Ty));
832 case ValID::ConstUndefVal: // Is it an undef value?
833 return UndefValue::get(Ty);
835 case ValID::ConstZeroVal: // Is it a zero value?
836 return Constant::getNullValue(Ty);
838 case ValID::ConstantVal: // Fully resolved constant?
839 if (D.ConstantValue->getType() != Ty) {
840 GenerateError("Constant expression type different from required type");
843 return D.ConstantValue;
845 case ValID::InlineAsmVal: { // Inline asm expression
846 const PointerType *PTy = dyn_cast<PointerType>(Ty);
847 const FunctionType *FTy =
848 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
849 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
850 GenerateError("Invalid type for asm constraint string");
853 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
854 D.IAD->HasSideEffects);
855 D.destroy(); // Free InlineAsmDescriptor.
859 assert(0 && "Unhandled case!");
863 assert(0 && "Unhandled case!");
867 // getVal - This function is identical to getExistingVal, except that if a
868 // value is not already defined, it "improvises" by creating a placeholder var
869 // that looks and acts just like the requested variable. When the value is
870 // defined later, all uses of the placeholder variable are replaced with the
873 static Value *getVal(const Type *Ty, const ValID &ID) {
874 if (Ty == Type::LabelTy) {
875 GenerateError("Cannot use a basic block here");
879 // See if the value has already been defined.
880 Value *V = getExistingVal(Ty, ID);
882 if (TriggerError) return 0;
884 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
885 GenerateError("Invalid use of a non-first-class type");
889 // If we reached here, we referenced either a symbol that we don't know about
890 // or an id number that hasn't been read yet. We may be referencing something
891 // forward, so just create an entry to be resolved later and get to it...
894 case ValID::GlobalName:
895 case ValID::GlobalID: {
896 const PointerType *PTy = dyn_cast<PointerType>(Ty);
898 GenerateError("Invalid type for reference to global" );
901 const Type* ElTy = PTy->getElementType();
902 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
903 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
905 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
906 (Module*)0, false, PTy->getAddressSpace());
910 V = new Argument(Ty);
913 // Remember where this forward reference came from. FIXME, shouldn't we try
914 // to recycle these things??
915 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
918 if (inFunctionScope())
919 InsertValue(V, CurFun.LateResolveValues);
921 InsertValue(V, CurModule.LateResolveValues);
925 /// defineBBVal - This is a definition of a new basic block with the specified
926 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
927 static BasicBlock *defineBBVal(const ValID &ID) {
928 assert(inFunctionScope() && "Can't get basic block at global scope!");
932 // First, see if this was forward referenced
934 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
935 if (BBI != CurFun.BBForwardRefs.end()) {
937 // The forward declaration could have been inserted anywhere in the
938 // function: insert it into the correct place now.
939 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
940 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
942 // We're about to erase the entry, save the key so we can clean it up.
943 ValID Tmp = BBI->first;
945 // Erase the forward ref from the map as its no longer "forward"
946 CurFun.BBForwardRefs.erase(ID);
948 // The key has been removed from the map but so we don't want to leave
949 // strdup'd memory around so destroy it too.
952 // If its a numbered definition, bump the number and set the BB value.
953 if (ID.Type == ValID::LocalID) {
954 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
958 // We haven't seen this BB before and its first mention is a definition.
959 // Just create it and return it.
960 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
961 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
962 if (ID.Type == ValID::LocalID) {
963 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
972 /// getBBVal - get an existing BB value or create a forward reference for it.
974 static BasicBlock *getBBVal(const ValID &ID) {
975 assert(inFunctionScope() && "Can't get basic block at global scope!");
979 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
980 if (BBI != CurFun.BBForwardRefs.end()) {
982 } if (ID.Type == ValID::LocalName) {
983 std::string Name = ID.getName();
984 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
986 if (N->getType()->getTypeID() == Type::LabelTyID)
987 BB = cast<BasicBlock>(N);
989 GenerateError("Reference to label '" + Name + "' is actually of type '"+
990 N->getType()->getDescription() + "'");
992 } else if (ID.Type == ValID::LocalID) {
993 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
994 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
995 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
997 GenerateError("Reference to label '%" + utostr(ID.Num) +
998 "' is actually of type '"+
999 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
1002 GenerateError("Illegal label reference " + ID.getName());
1006 // If its already been defined, return it now.
1008 ID.destroy(); // Free strdup'd memory.
1012 // Otherwise, this block has not been seen before, create it.
1014 if (ID.Type == ValID::LocalName)
1015 Name = ID.getName();
1016 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1018 // Insert it in the forward refs map.
1019 CurFun.BBForwardRefs[ID] = BB;
1025 //===----------------------------------------------------------------------===//
1026 // Code to handle forward references in instructions
1027 //===----------------------------------------------------------------------===//
1029 // This code handles the late binding needed with statements that reference
1030 // values not defined yet... for example, a forward branch, or the PHI node for
1033 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1034 // and back patchs after we are done.
1037 // ResolveDefinitions - If we could not resolve some defs at parsing
1038 // time (forward branches, phi functions for loops, etc...) resolve the
1042 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1043 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1044 while (!LateResolvers.empty()) {
1045 Value *V = LateResolvers.back();
1046 LateResolvers.pop_back();
1048 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1049 CurModule.PlaceHolderInfo.find(V);
1050 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1052 ValID &DID = PHI->second.first;
1054 Value *TheRealValue = getExistingVal(V->getType(), DID);
1058 V->replaceAllUsesWith(TheRealValue);
1060 CurModule.PlaceHolderInfo.erase(PHI);
1061 } else if (FutureLateResolvers) {
1062 // Functions have their unresolved items forwarded to the module late
1064 InsertValue(V, *FutureLateResolvers);
1066 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1067 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1068 "' of type '" + V->getType()->getDescription() + "'",
1069 PHI->second.second);
1072 GenerateError("Reference to an invalid definition: #" +
1073 itostr(DID.Num) + " of type '" +
1074 V->getType()->getDescription() + "'",
1075 PHI->second.second);
1080 LateResolvers.clear();
1083 // ResolveTypeTo - A brand new type was just declared. This means that (if
1084 // name is not null) things referencing Name can be resolved. Otherwise, things
1085 // refering to the number can be resolved. Do this now.
1087 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1090 D = ValID::createLocalName(*Name);
1092 D = ValID::createLocalID(CurModule.Types.size());
1094 std::map<ValID, PATypeHolder>::iterator I =
1095 CurModule.LateResolveTypes.find(D);
1096 if (I != CurModule.LateResolveTypes.end()) {
1097 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1099 CurModule.LateResolveTypes.erase(I);
1104 // setValueName - Set the specified value to the name given. The name may be
1105 // null potentially, in which case this is a noop. The string passed in is
1106 // assumed to be a malloc'd string buffer, and is free'd by this function.
1108 static void setValueName(Value *V, std::string *NameStr) {
1109 if (!NameStr) return;
1110 std::string Name(*NameStr); // Copy string
1111 delete NameStr; // Free old string
1113 if (V->getType() == Type::VoidTy) {
1114 GenerateError("Can't assign name '" + Name+"' to value with void type");
1118 assert(inFunctionScope() && "Must be in function scope!");
1119 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1120 if (ST.lookup(Name)) {
1121 GenerateError("Redefinition of value '" + Name + "' of type '" +
1122 V->getType()->getDescription() + "'");
1130 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1131 /// this is a declaration, otherwise it is a definition.
1132 static GlobalVariable *
1133 ParseGlobalVariable(std::string *NameStr,
1134 GlobalValue::LinkageTypes Linkage,
1135 GlobalValue::VisibilityTypes Visibility,
1136 bool isConstantGlobal, const Type *Ty,
1137 Constant *Initializer, bool IsThreadLocal,
1138 unsigned AddressSpace = 0) {
1139 if (isa<FunctionType>(Ty)) {
1140 GenerateError("Cannot declare global vars of function type");
1143 if (Ty == Type::LabelTy) {
1144 GenerateError("Cannot declare global vars of label type");
1148 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1152 Name = *NameStr; // Copy string
1153 delete NameStr; // Free old string
1156 // See if this global value was forward referenced. If so, recycle the
1159 if (!Name.empty()) {
1160 ID = ValID::createGlobalName(Name);
1162 ID = ValID::createGlobalID(CurModule.Values.size());
1165 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1166 // Move the global to the end of the list, from whereever it was
1167 // previously inserted.
1168 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1169 CurModule.CurrentModule->getGlobalList().remove(GV);
1170 CurModule.CurrentModule->getGlobalList().push_back(GV);
1171 GV->setInitializer(Initializer);
1172 GV->setLinkage(Linkage);
1173 GV->setVisibility(Visibility);
1174 GV->setConstant(isConstantGlobal);
1175 GV->setThreadLocal(IsThreadLocal);
1176 InsertValue(GV, CurModule.Values);
1183 // If this global has a name
1184 if (!Name.empty()) {
1185 // if the global we're parsing has an initializer (is a definition) and
1186 // has external linkage.
1187 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1188 // If there is already a global with external linkage with this name
1189 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1190 // If we allow this GVar to get created, it will be renamed in the
1191 // symbol table because it conflicts with an existing GVar. We can't
1192 // allow redefinition of GVars whose linking indicates that their name
1193 // must stay the same. Issue the error.
1194 GenerateError("Redefinition of global variable named '" + Name +
1195 "' of type '" + Ty->getDescription() + "'");
1200 // Otherwise there is no existing GV to use, create one now.
1201 GlobalVariable *GV =
1202 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1203 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1204 GV->setVisibility(Visibility);
1205 InsertValue(GV, CurModule.Values);
1209 // setTypeName - Set the specified type to the name given. The name may be
1210 // null potentially, in which case this is a noop. The string passed in is
1211 // assumed to be a malloc'd string buffer, and is freed by this function.
1213 // This function returns true if the type has already been defined, but is
1214 // allowed to be redefined in the specified context. If the name is a new name
1215 // for the type plane, it is inserted and false is returned.
1216 static bool setTypeName(const Type *T, std::string *NameStr) {
1217 assert(!inFunctionScope() && "Can't give types function-local names!");
1218 if (NameStr == 0) return false;
1220 std::string Name(*NameStr); // Copy string
1221 delete NameStr; // Free old string
1223 // We don't allow assigning names to void type
1224 if (T == Type::VoidTy) {
1225 GenerateError("Can't assign name '" + Name + "' to the void type");
1229 // Set the type name, checking for conflicts as we do so.
1230 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1232 if (AlreadyExists) { // Inserting a name that is already defined???
1233 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1234 assert(Existing && "Conflict but no matching type?!");
1236 // There is only one case where this is allowed: when we are refining an
1237 // opaque type. In this case, Existing will be an opaque type.
1238 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1239 // We ARE replacing an opaque type!
1240 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1244 // Otherwise, this is an attempt to redefine a type. That's okay if
1245 // the redefinition is identical to the original. This will be so if
1246 // Existing and T point to the same Type object. In this one case we
1247 // allow the equivalent redefinition.
1248 if (Existing == T) return true; // Yes, it's equal.
1250 // Any other kind of (non-equivalent) redefinition is an error.
1251 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1252 T->getDescription() + "'");
1258 //===----------------------------------------------------------------------===//
1259 // Code for handling upreferences in type names...
1262 // TypeContains - Returns true if Ty directly contains E in it.
1264 static bool TypeContains(const Type *Ty, const Type *E) {
1265 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1266 E) != Ty->subtype_end();
1270 struct UpRefRecord {
1271 // NestingLevel - The number of nesting levels that need to be popped before
1272 // this type is resolved.
1273 unsigned NestingLevel;
1275 // LastContainedTy - This is the type at the current binding level for the
1276 // type. Every time we reduce the nesting level, this gets updated.
1277 const Type *LastContainedTy;
1279 // UpRefTy - This is the actual opaque type that the upreference is
1280 // represented with.
1281 OpaqueType *UpRefTy;
1283 UpRefRecord(unsigned NL, OpaqueType *URTy)
1284 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1288 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1289 static std::vector<UpRefRecord> UpRefs;
1291 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1292 /// called. It loops through the UpRefs vector, which is a list of the
1293 /// currently active types. For each type, if the up reference is contained in
1294 /// the newly completed type, we decrement the level count. When the level
1295 /// count reaches zero, the upreferenced type is the type that is passed in:
1296 /// thus we can complete the cycle.
1298 static PATypeHolder HandleUpRefs(const Type *ty) {
1299 // If Ty isn't abstract, or if there are no up-references in it, then there is
1300 // nothing to resolve here.
1301 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1303 PATypeHolder Ty(ty);
1304 UR_OUT("Type '" << Ty->getDescription() <<
1305 "' newly formed. Resolving upreferences.\n" <<
1306 UpRefs.size() << " upreferences active!\n");
1308 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1309 // to zero), we resolve them all together before we resolve them to Ty. At
1310 // the end of the loop, if there is anything to resolve to Ty, it will be in
1312 OpaqueType *TypeToResolve = 0;
1314 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1315 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1316 << UpRefs[i].second->getDescription() << ") = "
1317 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1318 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1319 // Decrement level of upreference
1320 unsigned Level = --UpRefs[i].NestingLevel;
1321 UpRefs[i].LastContainedTy = Ty;
1322 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1323 if (Level == 0) { // Upreference should be resolved!
1324 if (!TypeToResolve) {
1325 TypeToResolve = UpRefs[i].UpRefTy;
1327 UR_OUT(" * Resolving upreference for "
1328 << UpRefs[i].second->getDescription() << "\n";
1329 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1330 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1331 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1332 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1334 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1335 --i; // Do not skip the next element...
1340 if (TypeToResolve) {
1341 UR_OUT(" * Resolving upreference for "
1342 << UpRefs[i].second->getDescription() << "\n";
1343 std::string OldName = TypeToResolve->getDescription());
1344 TypeToResolve->refineAbstractTypeTo(Ty);
1350 //===----------------------------------------------------------------------===//
1351 // RunVMAsmParser - Define an interface to this parser
1352 //===----------------------------------------------------------------------===//
1354 static Module* RunParser(Module * M);
1356 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1358 Module *M = RunParser(new Module(LLLgetFilename()));
1365 /* Enabling traces. */
1370 /* Enabling verbose error messages. */
1371 #ifdef YYERROR_VERBOSE
1372 # undef YYERROR_VERBOSE
1373 # define YYERROR_VERBOSE 1
1375 # define YYERROR_VERBOSE 0
1378 /* Enabling the token table. */
1379 #ifndef YYTOKEN_TABLE
1380 # define YYTOKEN_TABLE 0
1383 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1384 typedef union YYSTYPE
1385 #line 981 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
1387 llvm::Module *ModuleVal;
1388 llvm::Function *FunctionVal;
1389 llvm::BasicBlock *BasicBlockVal;
1390 llvm::TerminatorInst *TermInstVal;
1391 llvm::Instruction *InstVal;
1392 llvm::Constant *ConstVal;
1394 const llvm::Type *PrimType;
1395 std::list<llvm::PATypeHolder> *TypeList;
1396 llvm::PATypeHolder *TypeVal;
1397 llvm::Value *ValueVal;
1398 std::vector<llvm::Value*> *ValueList;
1399 std::vector<unsigned> *ConstantList;
1400 llvm::ArgListType *ArgList;
1401 llvm::TypeWithAttrs TypeWithAttrs;
1402 llvm::TypeWithAttrsList *TypeWithAttrsList;
1403 llvm::ParamList *ParamList;
1405 // Represent the RHS of PHI node
1406 std::list<std::pair<llvm::Value*,
1407 llvm::BasicBlock*> > *PHIList;
1408 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1409 std::vector<llvm::Constant*> *ConstVector;
1411 llvm::GlobalValue::LinkageTypes Linkage;
1412 llvm::GlobalValue::VisibilityTypes Visibility;
1413 llvm::Attributes Attributes;
1414 llvm::APInt *APIntVal;
1419 llvm::APFloat *FPVal;
1422 std::string *StrVal; // This memory must be deleted
1423 llvm::ValID ValIDVal;
1425 llvm::Instruction::BinaryOps BinaryOpVal;
1426 llvm::Instruction::TermOps TermOpVal;
1427 llvm::Instruction::MemoryOps MemOpVal;
1428 llvm::Instruction::CastOps CastOpVal;
1429 llvm::Instruction::OtherOps OtherOpVal;
1430 llvm::ICmpInst::Predicate IPredicate;
1431 llvm::FCmpInst::Predicate FPredicate;
1433 /* Line 187 of yacc.c. */
1434 #line 1435 "llvmAsmParser.tab.c"
1436 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1437 # define YYSTYPE_IS_DECLARED 1
1438 # define YYSTYPE_IS_TRIVIAL 1
1443 /* Copy the second part of user declarations. */
1446 /* Line 216 of yacc.c. */
1447 #line 1448 "llvmAsmParser.tab.c"
1454 typedef YYTYPE_UINT8 yytype_uint8;
1456 typedef unsigned char yytype_uint8;
1460 typedef YYTYPE_INT8 yytype_int8;
1461 #elif (defined __STDC__ || defined __C99__FUNC__ \
1462 || defined __cplusplus || defined _MSC_VER)
1463 typedef signed char yytype_int8;
1465 typedef short int yytype_int8;
1468 #ifdef YYTYPE_UINT16
1469 typedef YYTYPE_UINT16 yytype_uint16;
1471 typedef unsigned short int yytype_uint16;
1475 typedef YYTYPE_INT16 yytype_int16;
1477 typedef short int yytype_int16;
1481 # ifdef __SIZE_TYPE__
1482 # define YYSIZE_T __SIZE_TYPE__
1483 # elif defined size_t
1484 # define YYSIZE_T size_t
1485 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1486 || defined __cplusplus || defined _MSC_VER)
1487 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1488 # define YYSIZE_T size_t
1490 # define YYSIZE_T unsigned int
1494 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1499 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1500 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1504 # define YY_(msgid) msgid
1508 /* Suppress unused-variable warnings by "using" E. */
1509 #if ! defined lint || defined __GNUC__
1510 # define YYUSE(e) ((void) (e))
1512 # define YYUSE(e) /* empty */
1515 /* Identity function, used to suppress warnings about constant conditions. */
1517 # define YYID(n) (n)
1519 #if (defined __STDC__ || defined __C99__FUNC__ \
1520 || defined __cplusplus || defined _MSC_VER)
1533 #if ! defined yyoverflow || YYERROR_VERBOSE
1535 /* The parser invokes alloca or malloc; define the necessary symbols. */
1537 # ifdef YYSTACK_USE_ALLOCA
1538 # if YYSTACK_USE_ALLOCA
1540 # define YYSTACK_ALLOC __builtin_alloca
1541 # elif defined __BUILTIN_VA_ARG_INCR
1542 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1544 # define YYSTACK_ALLOC __alloca
1545 # elif defined _MSC_VER
1546 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1547 # define alloca _alloca
1549 # define YYSTACK_ALLOC alloca
1550 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1551 || defined __cplusplus || defined _MSC_VER)
1552 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1554 # define _STDLIB_H 1
1561 # ifdef YYSTACK_ALLOC
1562 /* Pacify GCC's `empty if-body' warning. */
1563 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1564 # ifndef YYSTACK_ALLOC_MAXIMUM
1565 /* The OS might guarantee only one guard page at the bottom of the stack,
1566 and a page size can be as small as 4096 bytes. So we cannot safely
1567 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1568 to allow for a few compiler-allocated temporary stack slots. */
1569 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1572 # define YYSTACK_ALLOC YYMALLOC
1573 # define YYSTACK_FREE YYFREE
1574 # ifndef YYSTACK_ALLOC_MAXIMUM
1575 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1577 # if (defined __cplusplus && ! defined _STDLIB_H \
1578 && ! ((defined YYMALLOC || defined malloc) \
1579 && (defined YYFREE || defined free)))
1580 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1582 # define _STDLIB_H 1
1586 # define YYMALLOC malloc
1587 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1588 || defined __cplusplus || defined _MSC_VER)
1589 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1593 # define YYFREE free
1594 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1595 || defined __cplusplus || defined _MSC_VER)
1596 void free (void *); /* INFRINGES ON USER NAME SPACE */
1600 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1603 #if (! defined yyoverflow \
1604 && (! defined __cplusplus \
1605 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1607 /* A type that is properly aligned for any stack member. */
1614 /* The size of the maximum gap between one aligned stack and the next. */
1615 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1617 /* The size of an array large to enough to hold all stacks, each with
1619 # define YYSTACK_BYTES(N) \
1620 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1621 + YYSTACK_GAP_MAXIMUM)
1623 /* Copy COUNT objects from FROM to TO. The source and destination do
1626 # if defined __GNUC__ && 1 < __GNUC__
1627 # define YYCOPY(To, From, Count) \
1628 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1630 # define YYCOPY(To, From, Count) \
1634 for (yyi = 0; yyi < (Count); yyi++) \
1635 (To)[yyi] = (From)[yyi]; \
1641 /* Relocate STACK from its old location to the new one. The
1642 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1643 elements in the stack, and YYPTR gives the new location of the
1644 stack. Advance YYPTR to a properly aligned location for the next
1646 # define YYSTACK_RELOCATE(Stack) \
1649 YYSIZE_T yynewbytes; \
1650 YYCOPY (&yyptr->Stack, Stack, yysize); \
1651 Stack = &yyptr->Stack; \
1652 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1653 yyptr += yynewbytes / sizeof (*yyptr); \
1659 /* YYFINAL -- State number of the termination state. */
1661 /* YYLAST -- Last index in YYTABLE. */
1664 /* YYNTOKENS -- Number of terminals. */
1665 #define YYNTOKENS 173
1666 /* YYNNTS -- Number of nonterminals. */
1668 /* YYNRULES -- Number of rules. */
1669 #define YYNRULES 348
1670 /* YYNRULES -- Number of states. */
1671 #define YYNSTATES 708
1673 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1674 #define YYUNDEFTOK 2
1675 #define YYMAXUTOK 413
1677 #define YYTRANSLATE(YYX) \
1678 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1680 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1681 static const yytype_uint8 yytranslate[] =
1683 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1687 159, 160, 163, 2, 162, 2, 2, 2, 2, 2,
1688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1689 168, 161, 169, 2, 2, 2, 2, 2, 2, 2,
1690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1692 2, 165, 164, 167, 2, 2, 2, 2, 2, 172,
1693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1695 166, 2, 2, 170, 2, 171, 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, 2, 2, 2, 2,
1705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1706 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1707 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1708 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1709 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1710 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1711 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1712 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1713 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1714 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1715 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1716 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1717 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1718 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1719 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1720 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1721 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1722 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1723 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1728 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1730 static const yytype_uint16 yyprhs[] =
1732 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1733 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1734 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1735 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1736 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1737 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1738 118, 123, 124, 127, 128, 131, 133, 135, 137, 138,
1739 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
1740 160, 162, 164, 166, 167, 169, 171, 172, 174, 176,
1741 178, 180, 181, 183, 185, 186, 188, 190, 192, 194,
1742 196, 199, 201, 203, 205, 207, 209, 211, 213, 215,
1743 217, 220, 221, 224, 226, 228, 230, 231, 234, 236,
1744 238, 240, 242, 244, 246, 248, 250, 252, 254, 255,
1745 258, 259, 262, 263, 266, 267, 271, 274, 275, 277,
1746 278, 282, 284, 287, 289, 291, 293, 295, 297, 299,
1747 301, 303, 305, 309, 311, 314, 320, 326, 332, 338,
1748 342, 345, 351, 356, 359, 361, 363, 365, 369, 371,
1749 375, 377, 378, 380, 384, 389, 393, 397, 402, 407,
1750 411, 418, 424, 427, 430, 433, 436, 439, 442, 445,
1751 448, 451, 454, 457, 460, 467, 473, 482, 489, 496,
1752 504, 512, 520, 528, 535, 544, 553, 559, 567, 571,
1753 573, 575, 577, 579, 580, 583, 590, 592, 593, 595,
1754 598, 599, 603, 604, 608, 612, 616, 620, 621, 630,
1755 631, 641, 642, 652, 658, 661, 665, 667, 671, 675,
1756 679, 683, 685, 686, 692, 696, 698, 702, 704, 705,
1757 717, 719, 721, 726, 728, 730, 733, 737, 738, 740,
1758 742, 744, 746, 748, 750, 752, 754, 756, 758, 760,
1759 764, 768, 771, 774, 778, 781, 787, 792, 794, 800,
1760 802, 804, 806, 808, 810, 812, 815, 817, 821, 824,
1761 827, 831, 835, 838, 839, 841, 844, 847, 851, 861,
1762 871, 880, 896, 898, 900, 907, 913, 916, 919, 926,
1763 934, 939, 944, 951, 958, 959, 960, 964, 967, 971,
1764 974, 976, 982, 988, 995, 1002, 1009, 1016, 1021, 1028,
1765 1033, 1038, 1045, 1052, 1055, 1065, 1067, 1069, 1070, 1074,
1766 1081, 1085, 1092, 1095, 1101, 1109, 1115, 1120, 1125
1769 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1770 static const yytype_int16 yyrhs[] =
1772 220, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1773 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1774 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1775 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1776 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1777 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1778 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1779 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1780 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1781 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1782 -1, 102, -1, 103, -1, 26, -1, 27, -1, 19,
1783 -1, 22, -1, 24, -1, 179, -1, -1, 55, 159,
1784 4, 160, -1, -1, 179, 161, -1, -1, 7, 161,
1785 -1, 20, -1, 23, -1, 186, -1, -1, 184, 161,
1786 -1, 42, -1, 44, -1, 43, -1, 45, -1, 47,
1787 -1, 49, -1, 46, -1, 48, -1, 51, -1, -1,
1788 156, -1, 157, -1, 158, -1, -1, 46, -1, 48,
1789 -1, -1, 42, -1, 43, -1, 44, -1, 47, -1,
1790 -1, 44, -1, 42, -1, -1, 63, -1, 64, -1,
1791 65, -1, 66, -1, 67, -1, 62, 4, -1, 142,
1792 -1, 121, -1, 141, -1, 122, -1, 144, -1, 145,
1793 -1, 147, -1, 148, -1, 149, -1, 54, 4, -1,
1794 -1, 195, 194, -1, 144, -1, 142, -1, 141, -1,
1795 -1, 197, 196, -1, 143, -1, 146, -1, 144, -1,
1796 142, -1, 141, -1, 150, -1, 151, -1, 154, -1,
1797 155, -1, 153, -1, -1, 199, 198, -1, -1, 152,
1798 22, -1, -1, 54, 4, -1, -1, 162, 54, 4,
1799 -1, 34, 22, -1, -1, 203, -1, -1, 162, 206,
1800 205, -1, 203, -1, 54, 4, -1, 11, -1, 12,
1801 -1, 13, -1, 16, -1, 15, -1, 14, -1, 17,
1802 -1, 50, -1, 207, -1, 208, 181, 163, -1, 242,
1803 -1, 164, 4, -1, 208, 159, 212, 160, 199, -1,
1804 10, 159, 212, 160, 199, -1, 165, 4, 166, 208,
1805 167, -1, 168, 4, 166, 208, 169, -1, 170, 213,
1806 171, -1, 170, 171, -1, 168, 170, 213, 171, 169,
1807 -1, 168, 170, 171, 169, -1, 208, 195, -1, 208,
1808 -1, 10, -1, 209, -1, 211, 162, 209, -1, 211,
1809 -1, 211, 162, 39, -1, 39, -1, -1, 208, -1,
1810 213, 162, 208, -1, 208, 165, 216, 167, -1, 208,
1811 165, 167, -1, 208, 172, 22, -1, 208, 168, 216,
1812 169, -1, 208, 170, 216, 171, -1, 208, 170, 171,
1813 -1, 208, 168, 170, 216, 171, 169, -1, 208, 168,
1814 170, 171, 169, -1, 208, 40, -1, 208, 41, -1,
1815 208, 242, -1, 208, 215, -1, 208, 25, -1, 208,
1816 3, -1, 208, 5, -1, 208, 4, -1, 208, 6,
1817 -1, 208, 26, -1, 208, 27, -1, 208, 9, -1,
1818 176, 159, 214, 38, 208, 160, -1, 119, 159, 214,
1819 254, 160, -1, 133, 159, 214, 162, 214, 162, 214,
1820 160, -1, 174, 159, 214, 162, 214, 160, -1, 175,
1821 159, 214, 162, 214, 160, -1, 90, 177, 159, 214,
1822 162, 214, 160, -1, 91, 178, 159, 214, 162, 214,
1823 160, -1, 92, 177, 159, 214, 162, 214, 160, -1,
1824 93, 178, 159, 214, 162, 214, 160, -1, 135, 159,
1825 214, 162, 214, 160, -1, 136, 159, 214, 162, 214,
1826 162, 214, 160, -1, 137, 159, 214, 162, 214, 162,
1827 214, 160, -1, 139, 159, 214, 255, 160, -1, 140,
1828 159, 214, 162, 214, 255, 160, -1, 216, 162, 214,
1829 -1, 214, -1, 32, -1, 33, -1, 37, -1, -1,
1830 210, 242, -1, 125, 159, 219, 38, 208, 160, -1,
1831 221, -1, -1, 222, -1, 221, 222, -1, -1, 31,
1832 223, 238, -1, -1, 30, 224, 239, -1, 60, 59,
1833 228, -1, 182, 18, 208, -1, 182, 18, 10, -1,
1834 -1, 185, 189, 218, 217, 214, 181, 225, 205, -1,
1835 -1, 185, 187, 189, 218, 217, 214, 181, 226, 205,
1836 -1, -1, 185, 188, 189, 218, 217, 208, 181, 227,
1837 205, -1, 185, 189, 35, 192, 219, -1, 52, 229,
1838 -1, 56, 161, 230, -1, 22, -1, 53, 161, 22,
1839 -1, 68, 161, 22, -1, 165, 231, 167, -1, 231,
1840 162, 22, -1, 22, -1, -1, 232, 162, 208, 195,
1841 180, -1, 208, 195, 180, -1, 232, -1, 232, 162,
1842 39, -1, 39, -1, -1, 193, 197, 210, 184, 159,
1843 233, 160, 199, 204, 201, 200, -1, 28, -1, 170,
1844 -1, 191, 189, 234, 235, -1, 29, -1, 171, -1,
1845 246, 237, -1, 190, 189, 234, -1, -1, 61, -1,
1846 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1847 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1848 168, 216, 169, -1, 165, 216, 167, -1, 165, 167,
1849 -1, 172, 22, -1, 170, 216, 171, -1, 170, 171,
1850 -1, 168, 170, 216, 171, 169, -1, 168, 170, 171,
1851 169, -1, 215, -1, 59, 240, 22, 162, 22, -1,
1852 7, -1, 8, -1, 179, -1, 184, -1, 242, -1,
1853 241, -1, 208, 243, -1, 244, -1, 245, 162, 244,
1854 -1, 246, 247, -1, 236, 247, -1, 248, 182, 249,
1855 -1, 248, 183, 249, -1, 248, 251, -1, -1, 21,
1856 -1, 69, 245, -1, 69, 10, -1, 70, 17, 243,
1857 -1, 70, 11, 243, 162, 17, 243, 162, 17, 243,
1858 -1, 71, 11, 243, 162, 17, 243, 165, 250, 167,
1859 -1, 71, 11, 243, 162, 17, 243, 165, 167, -1,
1860 72, 193, 197, 210, 243, 159, 253, 160, 199, 38,
1861 17, 243, 73, 17, 243, -1, 73, -1, 74, -1,
1862 250, 11, 241, 162, 17, 243, -1, 11, 241, 162,
1863 17, 243, -1, 182, 257, -1, 183, 257, -1, 208,
1864 165, 243, 162, 243, 167, -1, 252, 162, 165, 243,
1865 162, 243, 167, -1, 208, 195, 243, 195, -1, 17,
1866 195, 243, 195, -1, 253, 162, 208, 195, 243, 195,
1867 -1, 253, 162, 17, 195, 243, 195, -1, -1, -1,
1868 254, 162, 244, -1, 162, 4, -1, 255, 162, 4,
1869 -1, 58, 57, -1, 57, -1, 174, 208, 243, 162,
1870 243, -1, 175, 208, 243, 162, 243, -1, 90, 177,
1871 208, 243, 162, 243, -1, 91, 178, 208, 243, 162,
1872 243, -1, 92, 177, 208, 243, 162, 243, -1, 93,
1873 178, 208, 243, 162, 243, -1, 176, 244, 38, 208,
1874 -1, 133, 244, 162, 244, 162, 244, -1, 134, 244,
1875 162, 208, -1, 135, 244, 162, 244, -1, 136, 244,
1876 162, 244, 162, 244, -1, 137, 244, 162, 244, 162,
1877 244, -1, 132, 252, -1, 256, 193, 197, 210, 243,
1878 159, 253, 160, 199, -1, 259, -1, 36, -1, -1,
1879 114, 208, 202, -1, 114, 208, 162, 11, 243, 202,
1880 -1, 115, 208, 202, -1, 115, 208, 162, 11, 243,
1881 202, -1, 116, 244, -1, 258, 117, 208, 243, 202,
1882 -1, 258, 118, 244, 162, 208, 243, 202, -1, 138,
1883 208, 243, 162, 4, -1, 119, 208, 243, 254, -1,
1884 139, 208, 243, 255, -1, 140, 208, 243, 162, 208,
1888 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1889 static const yytype_uint16 yyrline[] =
1891 0, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147,
1892 1147, 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149,
1893 1149, 1149, 1149, 1150, 1150, 1150, 1150, 1150, 1150, 1153,
1894 1153, 1154, 1154, 1155, 1155, 1156, 1156, 1157, 1157, 1161,
1895 1161, 1162, 1162, 1163, 1163, 1164, 1164, 1165, 1165, 1166,
1896 1166, 1167, 1167, 1168, 1169, 1172, 1172, 1172, 1173, 1173,
1897 1175, 1176, 1180, 1184, 1189, 1195, 1195, 1197, 1198, 1203,
1898 1209, 1210, 1211, 1212, 1213, 1214, 1218, 1219, 1220, 1224,
1899 1225, 1226, 1227, 1231, 1232, 1233, 1237, 1238, 1239, 1240,
1900 1241, 1245, 1246, 1247, 1250, 1251, 1252, 1253, 1254, 1255,
1901 1256, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271,
1902 1272, 1276, 1277, 1282, 1283, 1284, 1287, 1288, 1294, 1295,
1903 1296, 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1306, 1307,
1904 1313, 1314, 1321, 1322, 1328, 1329, 1338, 1346, 1347, 1352,
1905 1353, 1354, 1359, 1372, 1372, 1372, 1372, 1372, 1372, 1372,
1906 1375, 1379, 1383, 1390, 1395, 1403, 1438, 1469, 1474, 1484,
1907 1494, 1498, 1508, 1515, 1524, 1531, 1536, 1541, 1548, 1549,
1908 1556, 1563, 1571, 1577, 1589, 1617, 1633, 1660, 1688, 1714,
1909 1734, 1760, 1780, 1792, 1799, 1865, 1875, 1885, 1896, 1909,
1910 1920, 1934, 1941, 1948, 1966, 1978, 1999, 2007, 2013, 2024,
1911 2029, 2034, 2039, 2044, 2050, 2056, 2062, 2070, 2081, 2085,
1912 2093, 2093, 2096, 2096, 2099, 2111, 2132, 2137, 2145, 2146,
1913 2150, 2150, 2154, 2154, 2157, 2160, 2184, 2196, 2195, 2207,
1914 2206, 2216, 2215, 2226, 2266, 2269, 2275, 2285, 2289, 2294,
1915 2296, 2301, 2306, 2315, 2325, 2336, 2340, 2349, 2358, 2363,
1916 2512, 2512, 2514, 2523, 2523, 2525, 2530, 2542, 2546, 2551,
1917 2555, 2559, 2564, 2569, 2573, 2577, 2581, 2585, 2589, 2593,
1918 2615, 2637, 2643, 2656, 2668, 2673, 2685, 2691, 2695, 2705,
1919 2709, 2713, 2718, 2725, 2725, 2731, 2740, 2745, 2750, 2754,
1920 2763, 2772, 2785, 2794, 2798, 2806, 2826, 2830, 2835, 2846,
1921 2865, 2874, 2978, 2982, 2989, 3000, 3013, 3022, 3035, 3046,
1922 3056, 3067, 3075, 3085, 3092, 3095, 3096, 3104, 3110, 3119,
1923 3123, 3128, 3144, 3161, 3173, 3185, 3199, 3213, 3225, 3246,
1924 3253, 3259, 3265, 3271, 3286, 3396, 3401, 3405, 3412, 3419,
1925 3429, 3436, 3446, 3454, 3468, 3485, 3499, 3514, 3529
1929 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1930 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1931 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1932 static const char *const yytname[] =
1934 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1935 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1936 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1937 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1938 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1939 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1940 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1941 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1942 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1943 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1944 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1945 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1946 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1947 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1948 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1949 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1950 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1951 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1952 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1953 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1954 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1955 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1956 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1957 "READNONE", "READONLY", "GC", "OPTSIZE", "NOINLINE", "ALWAYSINLINE",
1958 "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'",
1959 "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'",
1960 "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates",
1961 "FPredicates", "LocalName", "OptLocalName", "OptAddrSpace",
1962 "OptLocalAssign", "LocalNumber", "GlobalName", "OptGlobalAssign",
1963 "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage",
1964 "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage",
1965 "AliasLinkage", "OptCallingConv", "Attribute", "OptAttributes",
1966 "RetAttr", "OptRetAttrs", "FuncAttr", "OptFuncAttrs", "OptGC",
1967 "OptAlign", "OptCAlign", "SectionString", "OptSection",
1968 "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types",
1969 "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI",
1970 "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal",
1971 "AliaseeRef", "Module", "DefinitionList", "Definition", "@1", "@2", "@3",
1972 "@4", "@5", "AsmBlock", "TargetDefinition", "LibrariesDefinition",
1973 "LibList", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1974 "FunctionHeader", "END", "Function", "FunctionProto", "OptSideEffect",
1975 "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal",
1976 "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1977 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ParamList",
1978 "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1979 "OptVolatile", "MemoryInst", 0
1984 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1986 static const yytype_uint16 yytoknum[] =
1988 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1989 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1990 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1991 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1992 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1993 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1994 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1995 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1996 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1997 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1998 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1999 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
2000 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2001 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2002 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2003 405, 406, 407, 408, 409, 410, 411, 412, 413, 40,
2004 41, 61, 44, 42, 92, 91, 120, 93, 60, 62,
2009 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2010 static const yytype_uint16 yyr1[] =
2012 0, 173, 174, 174, 174, 174, 174, 174, 174, 174,
2013 174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
2014 176, 176, 176, 176, 176, 176, 176, 176, 176, 177,
2015 177, 177, 177, 177, 177, 177, 177, 177, 177, 178,
2016 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
2017 178, 178, 178, 178, 178, 179, 179, 179, 180, 180,
2018 181, 181, 182, 182, 183, 184, 184, 185, 185, 186,
2019 187, 187, 187, 187, 187, 187, 188, 188, 188, 189,
2020 189, 189, 189, 190, 190, 190, 191, 191, 191, 191,
2021 191, 192, 192, 192, 193, 193, 193, 193, 193, 193,
2022 193, 194, 194, 194, 194, 194, 194, 194, 194, 194,
2023 194, 195, 195, 196, 196, 196, 197, 197, 198, 198,
2024 198, 198, 198, 198, 198, 198, 198, 198, 199, 199,
2025 200, 200, 201, 201, 202, 202, 203, 204, 204, 205,
2026 205, 206, 206, 207, 207, 207, 207, 207, 207, 207,
2027 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
2028 208, 208, 208, 209, 210, 210, 211, 211, 212, 212,
2029 212, 212, 213, 213, 214, 214, 214, 214, 214, 214,
2030 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2031 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
2032 215, 215, 215, 215, 215, 215, 215, 215, 216, 216,
2033 217, 217, 218, 218, 219, 219, 220, 220, 221, 221,
2034 223, 222, 224, 222, 222, 222, 222, 225, 222, 226,
2035 222, 227, 222, 222, 222, 222, 228, 229, 229, 230,
2036 231, 231, 231, 232, 232, 233, 233, 233, 233, 234,
2037 235, 235, 236, 237, 237, 238, 239, 240, 240, 241,
2038 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
2039 241, 241, 241, 241, 241, 241, 241, 241, 241, 242,
2040 242, 242, 242, 243, 243, 244, 245, 245, 246, 246,
2041 247, 247, 248, 248, 248, 249, 249, 249, 249, 249,
2042 249, 249, 249, 249, 250, 250, 251, 251, 252, 252,
2043 253, 253, 253, 253, 253, 254, 254, 255, 255, 256,
2044 256, 257, 257, 257, 257, 257, 257, 257, 257, 257,
2045 257, 257, 257, 257, 257, 257, 258, 258, 259, 259,
2046 259, 259, 259, 259, 259, 259, 259, 259, 259
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, 0,
2058 4, 0, 2, 0, 2, 1, 1, 1, 0, 2,
2059 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2060 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
2061 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
2062 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2063 2, 0, 2, 1, 1, 1, 0, 2, 1, 1,
2064 1, 1, 1, 1, 1, 1, 1, 1, 0, 2,
2065 0, 2, 0, 2, 0, 3, 2, 0, 1, 0,
2066 3, 1, 2, 1, 1, 1, 1, 1, 1, 1,
2067 1, 1, 3, 1, 2, 5, 5, 5, 5, 3,
2068 2, 5, 4, 2, 1, 1, 1, 3, 1, 3,
2069 1, 0, 1, 3, 4, 3, 3, 4, 4, 3,
2070 6, 5, 2, 2, 2, 2, 2, 2, 2, 2,
2071 2, 2, 2, 2, 6, 5, 8, 6, 6, 7,
2072 7, 7, 7, 6, 8, 8, 5, 7, 3, 1,
2073 1, 1, 1, 0, 2, 6, 1, 0, 1, 2,
2074 0, 3, 0, 3, 3, 3, 3, 0, 8, 0,
2075 9, 0, 9, 5, 2, 3, 1, 3, 3, 3,
2076 3, 1, 0, 5, 3, 1, 3, 1, 0, 11,
2077 1, 1, 4, 1, 1, 2, 3, 0, 1, 1,
2078 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2079 3, 2, 2, 3, 2, 5, 4, 1, 5, 1,
2080 1, 1, 1, 1, 1, 2, 1, 3, 2, 2,
2081 3, 3, 2, 0, 1, 2, 2, 3, 9, 9,
2082 8, 15, 1, 1, 6, 5, 2, 2, 6, 7,
2083 4, 4, 6, 6, 0, 0, 3, 2, 3, 2,
2084 1, 5, 5, 6, 6, 6, 6, 4, 6, 4,
2085 4, 6, 6, 2, 9, 1, 1, 0, 3, 6,
2086 3, 6, 2, 5, 7, 5, 4, 4, 7
2089 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2090 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2091 means the default is an error. */
2092 static const yytype_uint16 yydefact[] =
2094 68, 55, 65, 56, 66, 57, 222, 220, 0, 0,
2095 0, 0, 0, 0, 79, 67, 0, 68, 218, 83,
2096 86, 0, 0, 234, 0, 0, 62, 0, 69, 70,
2097 72, 71, 73, 76, 74, 77, 75, 78, 80, 81,
2098 82, 79, 79, 213, 1, 219, 84, 85, 79, 223,
2099 87, 88, 89, 90, 79, 293, 221, 293, 0, 0,
2100 242, 235, 236, 224, 279, 280, 226, 143, 144, 145,
2101 148, 147, 146, 149, 150, 0, 0, 0, 0, 281,
2102 282, 151, 225, 153, 213, 213, 91, 212, 0, 94,
2103 94, 294, 289, 63, 253, 254, 255, 288, 237, 238,
2104 241, 0, 171, 154, 0, 0, 0, 0, 160, 172,
2105 0, 0, 171, 0, 0, 0, 93, 92, 0, 210,
2106 211, 0, 0, 95, 96, 97, 98, 99, 116, 256,
2107 0, 0, 337, 337, 292, 0, 239, 170, 111, 166,
2108 168, 0, 0, 0, 0, 0, 0, 159, 0, 0,
2109 152, 0, 0, 165, 0, 164, 0, 233, 61, 61,
2110 100, 0, 250, 251, 252, 64, 336, 320, 0, 0,
2111 0, 0, 94, 302, 303, 2, 3, 4, 5, 6,
2112 7, 8, 9, 10, 14, 15, 16, 11, 12, 13,
2113 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
2114 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
2115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2116 0, 0, 290, 94, 306, 0, 335, 291, 307, 240,
2117 163, 0, 128, 61, 61, 162, 0, 173, 0, 128,
2118 61, 61, 0, 214, 187, 189, 188, 190, 193, 186,
2119 191, 192, 182, 183, 0, 0, 0, 0, 0, 0,
2120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2121 0, 0, 185, 184, 227, 115, 114, 113, 117, 0,
2122 319, 296, 61, 286, 295, 0, 0, 0, 116, 29,
2123 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2124 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2125 43, 44, 45, 46, 47, 48, 0, 0, 0, 134,
2126 134, 342, 61, 61, 333, 0, 0, 0, 0, 0,
2127 61, 61, 61, 61, 61, 0, 116, 0, 0, 0,
2128 102, 104, 103, 101, 105, 106, 107, 108, 109, 112,
2129 169, 167, 156, 157, 158, 161, 60, 155, 229, 231,
2130 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2131 0, 0, 175, 209, 0, 0, 0, 179, 0, 176,
2132 0, 0, 0, 139, 0, 259, 260, 261, 262, 263,
2133 268, 264, 265, 266, 267, 257, 0, 0, 0, 0,
2134 277, 284, 283, 285, 0, 0, 297, 0, 0, 61,
2135 61, 61, 61, 0, 338, 0, 340, 315, 0, 0,
2136 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2137 0, 0, 61, 0, 110, 122, 121, 118, 120, 119,
2138 123, 124, 127, 125, 126, 129, 139, 139, 0, 0,
2139 0, 0, 0, 315, 0, 0, 0, 0, 0, 0,
2140 0, 174, 160, 172, 0, 177, 178, 0, 0, 0,
2141 0, 228, 248, 258, 0, 271, 0, 0, 0, 274,
2142 0, 272, 287, 0, 0, 0, 0, 0, 0, 0,
2143 0, 0, 0, 346, 0, 0, 0, 329, 330, 0,
2144 0, 0, 0, 347, 0, 0, 0, 327, 0, 134,
2145 0, 230, 232, 61, 0, 0, 0, 0, 0, 0,
2146 0, 0, 0, 0, 0, 208, 181, 0, 0, 0,
2147 0, 0, 0, 141, 139, 247, 111, 245, 0, 0,
2148 270, 160, 0, 269, 273, 0, 0, 0, 0, 0,
2149 0, 0, 134, 135, 134, 0, 0, 0, 0, 0,
2150 0, 345, 317, 0, 61, 321, 322, 0, 0, 343,
2151 61, 215, 0, 0, 0, 0, 195, 0, 0, 0,
2152 0, 206, 0, 180, 0, 0, 61, 136, 142, 140,
2153 59, 0, 128, 0, 276, 0, 0, 0, 314, 323,
2154 324, 325, 326, 339, 341, 316, 0, 0, 328, 331,
2155 332, 318, 0, 314, 134, 0, 0, 0, 0, 0,
2156 203, 0, 0, 0, 197, 198, 194, 58, 244, 246,
2157 111, 137, 278, 275, 0, 0, 111, 111, 0, 308,
2158 0, 348, 0, 344, 199, 200, 201, 202, 0, 0,
2159 0, 207, 59, 138, 132, 0, 0, 300, 0, 0,
2160 0, 128, 0, 309, 128, 196, 204, 205, 243, 0,
2161 130, 298, 0, 0, 299, 102, 104, 111, 111, 0,
2162 111, 111, 334, 133, 0, 249, 0, 0, 311, 310,
2163 0, 0, 0, 131, 0, 0, 0, 111, 111, 305,
2164 0, 0, 313, 312, 304, 0, 0, 301
2167 /* YYDEFGOTO[NTERM-NUM]. */
2168 static const yytype_int16 yydefgoto[] =
2170 -1, 269, 270, 271, 299, 316, 79, 628, 113, 12,
2171 133, 80, 14, 15, 41, 42, 43, 48, 54, 118,
2172 128, 349, 230, 278, 161, 445, 352, 685, 670, 414,
2173 533, 654, 471, 534, 81, 158, 139, 156, 140, 141,
2174 110, 373, 400, 374, 121, 88, 157, 16, 17, 18,
2175 20, 19, 383, 446, 447, 63, 23, 61, 101, 537,
2176 538, 129, 164, 55, 96, 56, 49, 474, 401, 83,
2177 403, 283, 284, 57, 92, 93, 222, 658, 134, 324,
2178 638, 493, 503, 223, 224, 225, 226
2181 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2183 #define YYPACT_NINF -624
2184 static const yytype_int16 yypact[] =
2186 815, -624, -624, -624, -624, -624, -624, -624, 14, -114,
2187 16, -73, 78, -31, 299, -624, 163, 2187, -624, 164,
2188 80, 19, 22, -624, 2, 179, -624, 1912, -624, -624,
2189 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2190 -624, 68, 68, 201, -624, -624, -624, -624, 68, -624,
2191 -624, -624, -624, -624, 68, 200, -624, 5, 215, 222,
2192 225, -624, -624, -624, -624, -624, 117, -624, -624, -624,
2193 -624, -624, -624, -624, -624, 264, 277, 7, 49, -624,
2194 -624, -624, -12, -624, 252, 252, 198, -624, 79, 231,
2195 231, -624, -624, 83, -624, -624, -624, -624, -624, -624,
2196 -624, -21, 649, -624, 138, 149, 627, 117, -624, -12,
2197 -120, 159, 649, 158, 79, 79, -624, -624, 1557, -624,
2198 -624, 2012, 320, -624, -624, -624, -624, -624, -624, -624,
2199 -13, 173, 2237, 2237, -624, 313, -624, -624, -12, -624,
2200 174, 177, 2012, 2012, 169, -118, 2012, -624, 336, 191,
2201 -624, 2012, 2012, 117, 193, -12, 226, -624, 1296, 308,
2202 -624, 1516, -624, -624, -624, -624, -624, -624, 307, 2031,
2203 108, 357, 231, -624, -624, -624, -624, -624, -624, -624,
2204 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2205 454, 958, 454, 958, 2012, 2012, 2012, 2012, -624, -624,
2206 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2207 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012,
2208 2012, 2012, -624, 231, -624, 55, -624, -624, -624, -624,
2209 161, 1748, -624, -23, -41, -624, 203, -12, 214, -624,
2210 308, -20, 1557, -624, -624, -624, -624, -624, -624, -624,
2211 -624, -624, -624, -624, 454, 958, 454, 958, 216, 217,
2212 218, 220, 221, 224, 227, 1789, 2076, 732, 351, 228,
2213 229, 230, -624, -624, -624, -624, -624, -624, -624, 109,
2214 -624, 117, 956, -624, 219, 1466, 1466, 1466, -624, -624,
2215 -624, -624, -624, -624, -624, -624, -624, -624, -624, 2012,
2216 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2217 -624, -624, -624, -624, -624, -624, 2012, 2012, 2012, -10,
2218 3, -624, 956, -17, 223, 237, 238, 239, 240, 241,
2219 956, 956, 956, 956, 956, 352, -624, 2012, 2012, 387,
2220 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2221 -624, -624, 539, -624, -624, -624, -624, 539, -624, 158,
2222 354, 234, 248, 249, 250, 2012, 2012, 2012, 2012, 2012,
2223 2012, 2012, -624, -624, 42, 1006, -121, -624, -116, -624,
2224 2012, 2012, 2012, 253, 251, -624, -624, -624, -624, -624,
2225 -624, -624, -624, -624, -624, 353, 1807, 2094, 1175, 390,
2226 -624, -624, -624, -624, 2012, 255, -624, 256, 1516, 956,
2227 956, 956, 956, 20, -624, 29, -624, -624, 1466, 254,
2228 2012, 2012, 2012, 2012, 2012, 258, 259, 261, 262, 263,
2229 2012, 1516, 956, 266, -624, -624, -624, -624, -624, -624,
2230 -624, -624, -624, -624, -624, -624, 253, 253, 2012, 2012,
2231 2012, 2012, 2012, -624, 269, 270, 272, 273, 259, 274,
2232 2012, -624, 268, 1126, -84, -624, -624, 280, 281, 406,
2233 -5, -624, 1830, -624, 423, -624, 61, 1345, -56, -624,
2234 -77, -624, -624, 430, 431, 1466, 288, 290, 291, 292,
2235 1466, 455, 1466, 296, 298, 1466, 300, -12, -624, 301,
2236 302, 457, 461, 306, 2012, 1466, 1466, -12, 1466, 311,
2237 2012, -624, -624, -1, 312, 314, 317, 319, 101, 2012,
2238 2012, 2012, 2012, 112, 2012, -624, -624, 318, 2012, 2012,
2239 2012, 453, 478, -624, 253, -624, -12, 321, 326, 327,
2240 -624, 323, -67, -624, -624, 1466, 1466, 329, 1466, 1466,
2241 1466, 1466, 311, -624, 311, 2012, 1466, 328, 2012, 2012,
2242 2012, -624, -624, 489, 956, -624, -624, 335, 441, -624,
2243 956, -624, 2012, 2012, 2012, 2012, -624, 334, 337, 339,
2244 340, -624, 259, -624, 343, 345, 15, -624, -624, -624,
2245 178, 1848, -624, 484, -624, 338, 350, 349, 2117, -624,
2246 -624, -624, -624, -624, -624, -624, 348, 1466, -624, -624,
2247 -624, -624, 259, 2117, 311, 356, 359, 360, 361, 2012,
2248 -624, 2012, 2012, 115, -624, -624, -624, -624, -624, -624,
2249 -12, 116, -624, -624, 505, -7, 59, -12, 118, -624,
2250 358, 306, 124, -624, -624, -624, -624, -624, 363, 364,
2251 366, -624, 178, -624, 473, 1466, 1614, -624, -6, 802,
2252 802, -624, 2135, -624, -624, -624, -624, -624, -624, 526,
2253 379, -624, 374, 1614, -624, 378, 380, -624, -624, 442,
2254 59, -12, 539, -624, 516, -624, 523, 396, 161, 161,
2255 524, 802, 802, -624, 1466, 525, 1466, -624, -624, -624,
2256 1466, 486, 161, 161, -624, 543, 1466, -624
2259 /* YYPGOTO[NTERM-NUM]. */
2260 static const yytype_int16 yypgoto[] =
2262 -624, 132, 155, 181, -165, -154, 0, -86, -143, 474,
2263 -624, 6, -624, -624, -624, -624, 67, -624, -624, -624,
2264 -142, -624, -499, -624, -252, -624, -231, -624, -624, -313,
2265 -63, -624, -434, -624, -624, -26, 342, -152, -624, 458,
2266 463, -11, -156, -242, 202, 244, 332, -624, -624, 554,
2267 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2268 -624, 485, -624, -624, -624, -624, -624, -624, -623, -79,
2269 213, -193, -624, -624, 520, -624, 445, -624, -624, -624,
2270 -34, 129, -448, -624, 456, -624, -624
2273 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2274 positive, shift that token. If negative, reduce the rule which
2275 number is the opposite. If zero, do what YYDEFACT says.
2276 If YYTABLE_NINF, syntax error. */
2277 #define YYTABLE_NINF -218
2278 static const yytype_int16 yytable[] =
2280 11, 82, 272, 321, 656, 673, 13, 416, 357, 279,
2281 523, 105, 511, 512, 111, 162, 274, 11, 325, 326,
2282 327, 328, 329, 13, 376, 378, 91, 317, 335, 531,
2283 288, 490, 111, 672, 94, 111, 408, 590, 111, 318,
2284 492, 460, 146, 111, 146, 111, 460, 24, 465, 532,
2285 687, 147, 109, 236, 111, 466, 64, 65, 111, 107,
2286 67, 68, 69, 70, 71, 72, 73, 21, 1, 2,
2287 111, 3, 4, 5, 491, 25, 138, 243, 460, 273,
2288 109, 336, 22, 491, 431, 460, 138, 527, 26, 361,
2289 131, 363, 155, 11, 544, 460, 27, 358, 359, 74,
2290 589, 362, 1, 364, 595, 3, 460, 5, 84, 85,
2291 159, 119, 120, 543, -149, 89, 233, 234, 112, 285,
2292 237, 90, 50, 51, 52, 286, 241, 53, 354, 2,
2293 28, 652, 4, 464, 623, 155, 112, 659, 660, 112,
2294 240, 135, 112, 282, 353, 433, 136, 112, 418, 112,
2295 531, -61, 413, -61, 476, 478, 480, 163, 112, 571,
2296 657, 674, 112, 44, 641, 415, -61, 60, 319, 320,
2297 282, 322, 337, 338, 112, 626, 95, 106, 688, 689,
2298 58, 691, 692, 59, 323, 282, 282, 282, 282, 282,
2299 330, 331, 332, 333, 334, 282, 569, 1, 702, 703,
2300 3, 62, 5, 402, 460, 138, 402, 402, 402, 461,
2301 46, 482, 47, 75, 76, 339, 155, 77, -149, 78,
2302 108, 91, -149, 460, 38, 39, 40, 496, 540, 498,
2303 499, 500, 339, 64, 65, 542, 86, 98, 87, 603,
2304 116, 604, 117, 402, 99, 1, 2, 100, 3, 4,
2305 5, 402, 402, 402, 402, 402, 485, 435, 436, 437,
2306 438, 576, 439, 555, 219, 219, 440, 441, 103, 442,
2307 443, 444, 581, 409, 563, 651, 102, 563, 661, 508,
2308 662, 104, 340, 341, 664, 384, 662, 220, 220, 87,
2309 410, 411, 412, 122, 123, 124, 125, 126, 127, 340,
2310 341, 643, 342, 343, 142, 344, 345, 272, 346, 347,
2311 348, 432, 282, 221, 221, 143, 151, 152, 148, 342,
2312 343, 150, 344, 345, 160, 346, 347, 348, 114, 115,
2313 402, 402, 402, 402, 165, 229, 231, 232, 235, 402,
2314 238, 29, 30, 31, 32, 33, 34, 35, 36, 463,
2315 37, 239, 242, 402, 453, 454, 455, 456, 457, 458,
2316 459, 631, 605, 111, 280, 608, 609, 610, 287, 467,
2317 468, 469, 355, 379, 356, 365, 366, 367, 282, 368,
2318 369, 404, 155, 370, 273, 419, 371, 380, 381, 382,
2319 430, 434, 448, 449, 282, 497, 282, 282, 282, 420,
2320 421, 422, 423, 424, 507, 155, 402, 450, 451, 452,
2321 472, 402, 481, 402, 473, 470, 402, 483, 484, 495,
2322 501, 502, 513, 504, 505, 506, 402, 402, 510, 402,
2323 679, 519, 520, 682, 521, 522, 524, 526, 514, 515,
2324 516, 517, 528, 529, 530, 539, 536, 545, 546, 525,
2325 548, 463, 549, 550, 551, 38, 39, 40, 555, 553,
2326 556, 561, 558, 559, 560, 562, 402, 402, 563, 402,
2327 402, 402, 402, 568, 572, 587, 573, 402, 564, 574,
2328 690, 575, 588, 591, 570, 402, 592, 583, 598, 593,
2329 607, 402, 594, 611, 613, 491, 619, 620, 405, 406,
2330 407, 621, 622, 624, 586, 625, 632, 633, 577, 578,
2331 579, 580, 634, 582, 635, 639, 644, 584, 585, 645,
2332 646, 647, 655, 665, 666, 663, 667, 669, 402, 282,
2333 683, 684, 282, 282, 282, 417, 686, -18, 693, -19,
2334 694, 696, 700, 425, 426, 427, 428, 429, 289, 290,
2335 291, 292, 293, 294, 295, 296, 297, 298, 695, 705,
2336 706, 615, 616, 617, 618, 630, 668, 132, 653, 145,
2337 149, 45, 637, 351, 360, 130, 402, 97, 227, 642,
2338 402, 402, 518, 435, 436, 437, 438, 637, 439, 228,
2339 627, 0, 440, 441, 0, 442, 443, 444, 0, 0,
2340 0, 0, 0, 0, 0, 0, 0, 0, 648, 0,
2341 649, 650, 402, 402, 0, 402, 0, 402, 0, 0,
2342 0, 402, 486, 487, 488, 489, 0, 402, 0, 0,
2343 0, 494, 0, 0, 64, 65, 681, 107, 67, 68,
2344 69, 70, 71, 72, 73, 509, 1, 2, 0, 3,
2345 4, 5, 627, 0, 0, 0, 64, 65, 0, 107,
2346 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2347 0, 3, 4, 5, 0, 0, 0, 74, 0, 0,
2348 435, 436, 437, 438, 0, 439, 0, 0, 137, 440,
2349 441, 0, 442, 443, 444, 0, 0, 0, 547, 74,
2350 0, 0, 0, 552, 0, 554, 0, 0, 557, 0,
2351 0, 0, 0, 0, 0, 0, 0, 0, 565, 566,
2352 0, 567, 0, 0, 0, 0, 0, 0, 0, 0,
2353 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,
2354 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2355 0, 1, 2, 0, 3, 4, 5, 0, 596, 597,
2356 0, 599, 600, 601, 602, 0, 0, 0, 0, 606,
2357 0, 0, 0, 0, 0, 0, 0, 612, 0, 0,
2358 0, 0, 74, 614, 0, 0, 0, 0, 0, 0,
2359 0, 75, 76, 0, 0, 77, 0, 78, 144, 0,
2360 0, 0, 0, 0, 0, 385, 386, 387, 388, 64,
2361 65, 389, 0, 75, 76, -217, 0, 77, 0, 78,
2362 640, 1, 2, 0, 3, 4, 5, 390, 391, 392,
2363 0, 0, 0, -63, 1, 2, 0, 3, 4, 5,
2364 0, 0, 393, 394, 0, 6, 7, 0, 0, 0,
2365 0, 0, 0, 0, 0, 0, 339, 0, 0, 0,
2366 0, 395, 0, 0, 0, 0, 0, 8, 671, 0,
2367 0, 9, 677, 678, 0, 10, 0, 175, 176, 177,
2368 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
2369 188, 189, 254, 255, 256, 257, 75, 76, 0, 0,
2370 77, 0, 78, 377, 697, 698, 0, 699, 0, 701,
2371 0, 0, 0, 704, 0, 0, 0, 0, 0, 707,
2372 0, 258, 198, 675, 676, 201, 202, 203, 204, 205,
2373 206, 207, 208, 209, 0, 259, 0, 260, 261, 262,
2374 0, 263, 264, 342, 343, 0, 344, 345, 0, 346,
2375 347, 348, 0, 0, 0, 0, 0, 0, 0, 385,
2376 386, 387, 388, 64, 65, 389, 0, 396, 0, 0,
2377 397, 0, 398, 0, 399, 1, 2, 0, 3, 4,
2378 5, 390, 391, 392, 300, 301, 0, 0, 0, 0,
2379 0, 0, 0, 0, 0, 0, 393, 394, 0, 0,
2380 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2381 0, 111, 0, 64, 65, 395, 107, 67, 68, 69,
2382 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2383 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2384 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2385 0, 0, 0, 0, 0, 0, 74, 0, 302, 303,
2386 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
2387 314, 315, 0, 0, 0, 258, 198, 199, 200, 201,
2388 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2389 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2390 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2391 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2392 0, 396, 0, 0, 397, 0, 398, 0, 399, 244,
2393 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2394 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2395 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2396 0, 0, 0, 0, 0, 0, 252, 253, 0, 0,
2397 75, 76, 0, 0, 77, 0, 78, 462, 0, 0,
2398 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2399 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2400 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2401 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2402 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2403 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2404 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2405 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2406 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2407 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2408 0, 0, 0, 0, 0, 112, 0, 0, 0, -61,
2409 0, 265, 0, 0, 266, 0, 267, 0, 268, 244,
2410 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2411 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2412 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2413 0, 0, 0, 0, 0, 0, 252, 253, 0, 75,
2414 76, 0, 0, 77, 0, 78, 479, 0, 0, 0,
2415 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2416 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2417 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2418 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2419 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2421 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2422 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2423 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2424 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2425 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2426 0, 265, 0, 0, 266, 0, 267, 0, 268, 385,
2427 386, 387, 388, 64, 65, 389, 0, 0, 0, 0,
2428 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2429 5, 390, 391, 392, 0, 0, 0, 0, 0, 0,
2430 0, 0, 0, 0, 0, 0, 393, 394, 0, 75,
2431 76, 0, 0, 77, 0, 78, 541, 0, 0, 0,
2432 0, 0, 0, 64, 65, 395, 153, 67, 68, 69,
2433 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2434 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2435 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2436 0, 0, 0, 0, 64, 65, 74, 153, 67, 68,
2437 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2438 4, 5, 0, 0, 0, 258, 198, 199, 200, 201,
2439 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2440 0, 260, 261, 262, 0, 263, 264, 74, 0, 0,
2441 0, 0, 0, 0, 0, 0, 0, 385, 386, 387,
2442 388, 0, 0, 389, 0, 0, 0, 0, 0, 0,
2443 0, 396, 0, 0, 397, 0, 398, 0, 399, 390,
2444 391, 392, 0, 0, 0, 0, 0, 0, 0, 0,
2445 0, 0, 0, 0, 393, 394, 0, 275, 276, 0,
2446 277, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2447 0, 0, 0, 395, 0, 0, 0, 0, 0, 0,
2448 75, 76, 154, 0, 77, 0, 78, 0, 0, 175,
2449 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
2450 186, 187, 188, 189, 254, 255, 256, 257, 0, 0,
2451 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2452 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2453 0, 0, 0, 258, 198, 199, 200, 201, 202, 203,
2454 204, 205, 206, 207, 208, 209, 0, 259, 0, 260,
2455 261, 262, 0, 263, 264, 64, 65, 0, 107, 67,
2456 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2457 3, 4, 5, 0, 0, 0, 0, 0, 0, 396,
2458 0, 0, 397, 0, 398, 0, 399, 350, 0, 0,
2459 0, 0, 0, 0, 0, 0, 64, 65, 74, 107,
2460 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2461 0, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2462 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2463 4, 5, 0, 0, 0, 0, 0, 64, 65, 74,
2464 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2465 2, 0, 3, 4, 5, 64, 65, 74, 107, 67,
2466 68, 69, 70, 71, 72, 73, 0, 1, 2, 535,
2467 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2468 74, 0, 0, 0, 0, 0, 0, 629, 0, 0,
2469 0, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2470 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2471 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2472 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
2473 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2475 0, 0, 0, 75, 76, 0, 372, 77, 0, 78,
2476 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2477 0, 75, 76, 0, 475, 77, 0, 78, 0, 0,
2478 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2479 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2480 78, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2481 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2482 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2483 0, 1, 2, 0, 3, 4, 5, 0, 64, 65,
2484 0, 281, 67, 68, 69, 70, 71, 72, 73, 0,
2485 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2486 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2487 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2488 77, 74, 78, 64, 65, 0, 107, 67, 68, 69,
2489 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2490 5, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2491 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2492 0, 0, 0, 0, 64, 65, 74, 107, 67, 68,
2493 69, 70, 71, 72, 636, 0, 1, 2, 0, 3,
2494 4, 5, 64, 65, 74, 107, 67, 68, 69, 70,
2495 71, 72, 680, 0, 1, 2, 0, 3, 4, 5,
2496 0, 0, 0, 0, 0, 0, 0, 74, 0, 0,
2497 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2498 77, 0, 78, 0, 0, 74, 0, -216, 0, 0,
2499 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2500 0, 78, 0, 0, 0, -63, 1, 2, 0, 3,
2501 4, 5, 0, 0, 0, 0, 0, 6, 7, 0,
2502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2503 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
2504 75, 76, 0, 9, 77, 0, 375, 10, 0, 0,
2505 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2506 0, 0, 77, 0, 477, 0, 0, 0, 0, 0,
2507 0, 0, 0, 166, 0, 0, 0, 0, 0, 0,
2508 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2509 0, 0, 0, 0, 167, 168, 0, 0, 0, 75,
2510 76, 0, 0, 77, 0, 78, 169, 170, 171, 172,
2511 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
2512 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2513 193, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2514 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2515 0, 194, 195, 196, 0, 0, 197, 198, 199, 200,
2516 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
2517 211, 212, 213, 214, 215, 216, 217, 218
2520 static const yytype_int16 yycheck[] =
2522 0, 27, 158, 196, 11, 11, 0, 320, 239, 161,
2523 458, 4, 446, 447, 55, 28, 159, 17, 211, 212,
2524 213, 214, 215, 17, 266, 267, 21, 192, 221, 34,
2525 172, 11, 55, 656, 29, 55, 288, 536, 55, 193,
2526 11, 162, 162, 55, 162, 55, 162, 161, 169, 54,
2527 673, 171, 78, 171, 55, 171, 7, 8, 55, 10,
2528 11, 12, 13, 14, 15, 16, 17, 53, 19, 20,
2529 55, 22, 23, 24, 54, 59, 102, 156, 162, 158,
2530 106, 223, 68, 54, 336, 162, 112, 171, 161, 254,
2531 7, 256, 118, 93, 171, 162, 18, 240, 241, 50,
2532 534, 255, 19, 257, 171, 22, 162, 24, 41, 42,
2533 121, 32, 33, 169, 55, 48, 142, 143, 159, 11,
2534 146, 54, 42, 43, 44, 17, 152, 47, 169, 20,
2535 161, 630, 23, 375, 582, 161, 159, 636, 637, 159,
2536 151, 162, 159, 169, 167, 338, 167, 159, 165, 159,
2537 34, 163, 162, 163, 396, 397, 398, 170, 159, 160,
2538 167, 167, 159, 0, 612, 162, 163, 165, 194, 195,
2539 196, 197, 117, 118, 159, 160, 171, 170, 677, 678,
2540 161, 680, 681, 161, 210, 211, 212, 213, 214, 215,
2541 216, 217, 218, 219, 220, 221, 509, 19, 697, 698,
2542 22, 22, 24, 282, 162, 231, 285, 286, 287, 167,
2543 46, 404, 48, 164, 165, 54, 242, 168, 159, 170,
2544 171, 21, 163, 162, 156, 157, 158, 420, 167, 422,
2545 423, 424, 54, 7, 8, 477, 35, 22, 37, 552,
2546 42, 554, 44, 322, 22, 19, 20, 22, 22, 23,
2547 24, 330, 331, 332, 333, 334, 408, 141, 142, 143,
2548 144, 160, 146, 162, 132, 133, 150, 151, 4, 153,
2549 154, 155, 160, 299, 162, 160, 159, 162, 160, 431,
2550 162, 4, 121, 122, 160, 279, 162, 132, 133, 37,
2551 316, 317, 318, 62, 63, 64, 65, 66, 67, 121,
2552 122, 614, 141, 142, 166, 144, 145, 463, 147, 148,
2553 149, 337, 338, 132, 133, 166, 114, 115, 159, 141,
2554 142, 163, 144, 145, 4, 147, 148, 149, 84, 85,
2555 409, 410, 411, 412, 161, 22, 162, 160, 169, 418,
2556 4, 42, 43, 44, 45, 46, 47, 48, 49, 375,
2557 51, 160, 159, 432, 365, 366, 367, 368, 369, 370,
2558 371, 592, 555, 55, 57, 558, 559, 560, 11, 380,
2559 381, 382, 169, 22, 160, 159, 159, 159, 404, 159,
2560 159, 162, 408, 159, 463, 162, 159, 159, 159, 159,
2561 38, 4, 38, 159, 420, 421, 422, 423, 424, 162,
2562 162, 162, 162, 162, 430, 431, 485, 159, 159, 159,
2563 159, 490, 22, 492, 61, 162, 495, 162, 162, 165,
2564 162, 162, 448, 162, 162, 162, 505, 506, 162, 508,
2565 661, 162, 162, 664, 162, 162, 162, 169, 449, 450,
2566 451, 452, 162, 162, 38, 22, 472, 17, 17, 460,
2567 162, 477, 162, 162, 162, 156, 157, 158, 162, 4,
2568 162, 4, 162, 162, 162, 4, 545, 546, 162, 548,
2569 549, 550, 551, 162, 162, 22, 162, 556, 504, 162,
2570 38, 162, 4, 162, 510, 564, 160, 169, 159, 162,
2571 162, 570, 169, 4, 159, 54, 162, 160, 285, 286,
2572 287, 162, 162, 160, 530, 160, 22, 169, 519, 520,
2573 521, 522, 162, 524, 165, 167, 160, 528, 529, 160,
2574 160, 160, 17, 160, 160, 167, 160, 54, 607, 555,
2575 4, 152, 558, 559, 560, 322, 162, 159, 22, 159,
2576 17, 17, 17, 330, 331, 332, 333, 334, 94, 95,
2577 96, 97, 98, 99, 100, 101, 102, 103, 162, 73,
2578 17, 572, 573, 574, 575, 591, 652, 93, 631, 106,
2579 112, 17, 598, 231, 242, 90, 655, 57, 133, 613,
2580 659, 660, 453, 141, 142, 143, 144, 613, 146, 133,
2581 590, -1, 150, 151, -1, 153, 154, 155, -1, -1,
2582 -1, -1, -1, -1, -1, -1, -1, -1, 619, -1,
2583 621, 622, 691, 692, -1, 694, -1, 696, -1, -1,
2584 -1, 700, 409, 410, 411, 412, -1, 706, -1, -1,
2585 -1, 418, -1, -1, 7, 8, 662, 10, 11, 12,
2586 13, 14, 15, 16, 17, 432, 19, 20, -1, 22,
2587 23, 24, 652, -1, -1, -1, 7, 8, -1, 10,
2588 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2589 -1, 22, 23, 24, -1, -1, -1, 50, -1, -1,
2590 141, 142, 143, 144, -1, 146, -1, -1, 39, 150,
2591 151, -1, 153, 154, 155, -1, -1, -1, 485, 50,
2592 -1, -1, -1, 490, -1, 492, -1, -1, 495, -1,
2593 -1, -1, -1, -1, -1, -1, -1, -1, 505, 506,
2594 -1, 508, -1, -1, -1, -1, -1, -1, -1, -1,
2595 -1, -1, -1, -1, -1, -1, -1, -1, -1, 7,
2596 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2597 -1, 19, 20, -1, 22, 23, 24, -1, 545, 546,
2598 -1, 548, 549, 550, 551, -1, -1, -1, -1, 556,
2599 -1, -1, -1, -1, -1, -1, -1, 564, -1, -1,
2600 -1, -1, 50, 570, -1, -1, -1, -1, -1, -1,
2601 -1, 164, 165, -1, -1, 168, -1, 170, 171, -1,
2602 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
2603 8, 9, -1, 164, 165, 0, -1, 168, -1, 170,
2604 607, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2605 -1, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2606 -1, -1, 40, 41, -1, 30, 31, -1, -1, -1,
2607 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
2608 -1, 59, -1, -1, -1, -1, -1, 52, 655, -1,
2609 -1, 56, 659, 660, -1, 60, -1, 75, 76, 77,
2610 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2611 88, 89, 90, 91, 92, 93, 164, 165, -1, -1,
2612 168, -1, 170, 171, 691, 692, -1, 694, -1, 696,
2613 -1, -1, -1, 700, -1, -1, -1, -1, -1, 706,
2614 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2615 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2616 -1, 139, 140, 141, 142, -1, 144, 145, -1, 147,
2617 148, 149, -1, -1, -1, -1, -1, -1, -1, 3,
2618 4, 5, 6, 7, 8, 9, -1, 165, -1, -1,
2619 168, -1, 170, -1, 172, 19, 20, -1, 22, 23,
2620 24, 25, 26, 27, 26, 27, -1, -1, -1, -1,
2621 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2622 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2623 -1, 55, -1, 7, 8, 59, 10, 11, 12, 13,
2624 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2625 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2626 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2627 -1, -1, -1, -1, -1, -1, 50, -1, 100, 101,
2628 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
2629 112, 113, -1, -1, -1, 119, 120, 121, 122, 123,
2630 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2631 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2632 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2633 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2634 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2635 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2636 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2637 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2638 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2639 164, 165, -1, -1, 168, -1, 170, 171, -1, -1,
2640 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2641 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2642 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2643 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2644 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2645 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2646 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2647 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2648 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2649 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2650 -1, -1, -1, -1, -1, 159, -1, -1, -1, 163,
2651 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2652 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2653 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2654 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2655 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2656 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2657 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2658 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2659 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2660 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2661 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2663 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2664 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2665 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2667 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2668 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2669 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2670 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2671 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2672 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2673 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2674 -1, -1, -1, 7, 8, 59, 10, 11, 12, 13,
2675 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2676 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2677 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2678 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2679 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2680 23, 24, -1, -1, -1, 119, 120, 121, 122, 123,
2681 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2682 -1, 135, 136, 137, -1, 139, 140, 50, -1, -1,
2683 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
2684 6, -1, -1, 9, -1, -1, -1, -1, -1, -1,
2685 -1, 165, -1, -1, 168, -1, 170, -1, 172, 25,
2686 26, 27, -1, -1, -1, -1, -1, -1, -1, -1,
2687 -1, -1, -1, -1, 40, 41, -1, 141, 142, -1,
2688 144, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2689 -1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
2690 164, 165, 125, -1, 168, -1, 170, -1, -1, 75,
2691 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2692 86, 87, 88, 89, 90, 91, 92, 93, -1, -1,
2693 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2694 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2695 -1, -1, -1, 119, 120, 121, 122, 123, 124, 125,
2696 126, 127, 128, 129, 130, 131, -1, 133, -1, 135,
2697 136, 137, -1, 139, 140, 7, 8, -1, 10, 11,
2698 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2699 22, 23, 24, -1, -1, -1, -1, -1, -1, 165,
2700 -1, -1, 168, -1, 170, -1, 172, 39, -1, -1,
2701 -1, -1, -1, -1, -1, -1, 7, 8, 50, 10,
2702 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2703 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2704 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2705 23, 24, -1, -1, -1, -1, -1, 7, 8, 50,
2706 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2707 20, -1, 22, 23, 24, 7, 8, 50, 10, 11,
2708 12, 13, 14, 15, 16, 17, -1, 19, 20, 39,
2709 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2710 50, -1, -1, -1, -1, -1, -1, 39, -1, -1,
2711 -1, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2712 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2713 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2714 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2715 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2716 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2717 -1, -1, -1, 164, 165, -1, 167, 168, -1, 170,
2718 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2719 -1, 164, 165, -1, 167, 168, -1, 170, -1, -1,
2720 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2721 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2722 170, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2723 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2724 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2725 -1, 19, 20, -1, 22, 23, 24, -1, 7, 8,
2726 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2727 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2728 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2729 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2730 168, 50, 170, 7, 8, -1, 10, 11, 12, 13,
2731 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2732 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2733 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2734 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2735 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2736 23, 24, 7, 8, 50, 10, 11, 12, 13, 14,
2737 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2738 -1, -1, -1, -1, -1, -1, -1, 50, -1, -1,
2739 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2740 168, -1, 170, -1, -1, 50, -1, 0, -1, -1,
2741 -1, -1, -1, -1, -1, 164, 165, -1, -1, 168,
2742 -1, 170, -1, -1, -1, 18, 19, 20, -1, 22,
2743 23, 24, -1, -1, -1, -1, -1, 30, 31, -1,
2744 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2745 -1, -1, -1, -1, -1, -1, -1, -1, -1, 52,
2746 164, 165, -1, 56, 168, -1, 170, 60, -1, -1,
2747 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2748 -1, -1, 168, -1, 170, -1, -1, -1, -1, -1,
2749 -1, -1, -1, 36, -1, -1, -1, -1, -1, -1,
2750 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2751 -1, -1, -1, -1, 57, 58, -1, -1, -1, 164,
2752 165, -1, -1, 168, -1, 170, 69, 70, 71, 72,
2753 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
2754 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2755 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2756 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2757 -1, 114, 115, 116, -1, -1, 119, 120, 121, 122,
2758 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
2759 133, 134, 135, 136, 137, 138, 139, 140
2762 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2763 symbol of state STATE-NUM. */
2764 static const yytype_uint16 yystos[] =
2766 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2767 60, 179, 182, 184, 185, 186, 220, 221, 222, 224,
2768 223, 53, 68, 229, 161, 59, 161, 18, 161, 42,
2769 43, 44, 45, 46, 47, 48, 49, 51, 156, 157,
2770 158, 187, 188, 189, 0, 222, 46, 48, 190, 239,
2771 42, 43, 44, 47, 191, 236, 238, 246, 161, 161,
2772 165, 230, 22, 228, 7, 8, 10, 11, 12, 13,
2773 14, 15, 16, 17, 50, 164, 165, 168, 170, 179,
2774 184, 207, 208, 242, 189, 189, 35, 37, 218, 189,
2775 189, 21, 247, 248, 29, 171, 237, 247, 22, 22,
2776 22, 231, 159, 4, 4, 4, 170, 10, 171, 208,
2777 213, 55, 159, 181, 218, 218, 42, 44, 192, 32,
2778 33, 217, 62, 63, 64, 65, 66, 67, 193, 234,
2779 234, 7, 182, 183, 251, 162, 167, 39, 208, 209,
2780 211, 212, 166, 166, 171, 213, 162, 171, 159, 212,
2781 163, 217, 217, 10, 125, 208, 210, 219, 208, 214,
2782 4, 197, 28, 170, 235, 161, 36, 57, 58, 69,
2783 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2784 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2785 90, 91, 92, 93, 114, 115, 116, 119, 120, 121,
2786 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2787 132, 133, 134, 135, 136, 137, 138, 139, 140, 174,
2788 175, 176, 249, 256, 257, 258, 259, 249, 257, 22,
2789 195, 162, 160, 208, 208, 169, 171, 208, 4, 160,
2790 214, 208, 159, 242, 3, 4, 5, 6, 9, 25,
2791 26, 27, 40, 41, 90, 91, 92, 93, 119, 133,
2792 135, 136, 137, 139, 140, 165, 168, 170, 172, 174,
2793 175, 176, 215, 242, 181, 141, 142, 144, 196, 210,
2794 57, 10, 208, 244, 245, 11, 17, 11, 193, 94,
2795 95, 96, 97, 98, 99, 100, 101, 102, 103, 177,
2796 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2797 108, 109, 110, 111, 112, 113, 178, 177, 178, 208,
2798 208, 244, 208, 208, 252, 244, 244, 244, 244, 244,
2799 208, 208, 208, 208, 208, 244, 193, 117, 118, 54,
2800 121, 122, 141, 142, 144, 145, 147, 148, 149, 194,
2801 39, 209, 199, 167, 169, 169, 160, 199, 181, 181,
2802 219, 177, 178, 177, 178, 159, 159, 159, 159, 159,
2803 159, 159, 167, 214, 216, 170, 216, 171, 216, 22,
2804 159, 159, 159, 225, 184, 3, 4, 5, 6, 9,
2805 25, 26, 27, 40, 41, 59, 165, 168, 170, 172,
2806 215, 241, 242, 243, 162, 243, 243, 243, 197, 208,
2807 208, 208, 208, 162, 202, 162, 202, 243, 165, 162,
2808 162, 162, 162, 162, 162, 243, 243, 243, 243, 243,
2809 38, 197, 208, 244, 4, 141, 142, 143, 144, 146,
2810 150, 151, 153, 154, 155, 198, 226, 227, 38, 159,
2811 159, 159, 159, 214, 214, 214, 214, 214, 214, 214,
2812 162, 167, 171, 208, 216, 169, 171, 214, 214, 214,
2813 162, 205, 159, 61, 240, 167, 216, 170, 216, 171,
2814 216, 22, 244, 162, 162, 210, 243, 243, 243, 243,
2815 11, 54, 11, 254, 243, 165, 244, 208, 244, 244,
2816 244, 162, 162, 255, 162, 162, 162, 208, 210, 243,
2817 162, 205, 205, 208, 214, 214, 214, 214, 254, 162,
2818 162, 162, 162, 255, 162, 214, 169, 171, 162, 162,
2819 38, 34, 54, 203, 206, 39, 208, 232, 233, 22,
2820 167, 171, 216, 169, 171, 17, 17, 243, 162, 162,
2821 162, 162, 243, 4, 243, 162, 162, 243, 162, 162,
2822 162, 4, 4, 162, 208, 243, 243, 243, 162, 202,
2823 208, 160, 162, 162, 162, 162, 160, 214, 214, 214,
2824 214, 160, 214, 169, 214, 214, 208, 22, 4, 205,
2825 195, 162, 160, 162, 169, 171, 243, 243, 159, 243,
2826 243, 243, 243, 202, 202, 244, 243, 162, 244, 244,
2827 244, 4, 243, 159, 243, 214, 214, 214, 214, 162,
2828 160, 162, 162, 255, 160, 160, 160, 179, 180, 39,
2829 208, 199, 22, 169, 162, 165, 17, 208, 253, 167,
2830 243, 255, 253, 202, 160, 160, 160, 160, 214, 214,
2831 214, 160, 195, 203, 204, 17, 11, 167, 250, 195,
2832 195, 160, 162, 167, 160, 160, 160, 160, 180, 54,
2833 201, 243, 241, 11, 167, 121, 122, 243, 243, 199,
2834 17, 208, 199, 4, 152, 200, 162, 241, 195, 195,
2835 38, 195, 195, 22, 17, 162, 17, 243, 243, 243,
2836 17, 243, 195, 195, 243, 73, 17, 243
2839 #define yyerrok (yyerrstatus = 0)
2840 #define yyclearin (yychar = YYEMPTY)
2841 #define YYEMPTY (-2)
2844 #define YYACCEPT goto yyacceptlab
2845 #define YYABORT goto yyabortlab
2846 #define YYERROR goto yyerrorlab
2849 /* Like YYERROR except do call yyerror. This remains here temporarily
2850 to ease the transition to the new meaning of YYERROR, for GCC.
2851 Once GCC version 2 has supplanted version 1, this can go. */
2853 #define YYFAIL goto yyerrlab
2855 #define YYRECOVERING() (!!yyerrstatus)
2857 #define YYBACKUP(Token, Value) \
2859 if (yychar == YYEMPTY && yylen == 1) \
2863 yytoken = YYTRANSLATE (yychar); \
2869 yyerror (YY_("syntax error: cannot back up")); \
2876 #define YYERRCODE 256
2879 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2880 If N is 0, then set CURRENT to the empty location which ends
2881 the previous symbol: RHS[0] (always defined). */
2883 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2884 #ifndef YYLLOC_DEFAULT
2885 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2889 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2890 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2891 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2892 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2896 (Current).first_line = (Current).last_line = \
2897 YYRHSLOC (Rhs, 0).last_line; \
2898 (Current).first_column = (Current).last_column = \
2899 YYRHSLOC (Rhs, 0).last_column; \
2905 /* YY_LOCATION_PRINT -- Print the location on the stream.
2906 This macro was not mandated originally: define only if we know
2907 we won't break user code: when these are the locations we know. */
2909 #ifndef YY_LOCATION_PRINT
2910 # if YYLTYPE_IS_TRIVIAL
2911 # define YY_LOCATION_PRINT(File, Loc) \
2912 fprintf (File, "%d.%d-%d.%d", \
2913 (Loc).first_line, (Loc).first_column, \
2914 (Loc).last_line, (Loc).last_column)
2916 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2921 /* YYLEX -- calling `yylex' with the right arguments. */
2924 # define YYLEX yylex (YYLEX_PARAM)
2926 # define YYLEX yylex ()
2929 /* Enable debugging if requested. */
2933 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2934 # define YYFPRINTF fprintf
2937 # define YYDPRINTF(Args) \
2943 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2947 YYFPRINTF (stderr, "%s ", Title); \
2948 yy_symbol_print (stderr, \
2950 YYFPRINTF (stderr, "\n"); \
2955 /*--------------------------------.
2956 | Print this symbol on YYOUTPUT. |
2957 `--------------------------------*/
2960 #if (defined __STDC__ || defined __C99__FUNC__ \
2961 || defined __cplusplus || defined _MSC_VER)
2963 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2966 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2969 YYSTYPE const * const yyvaluep;
2975 if (yytype < YYNTOKENS)
2976 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2988 /*--------------------------------.
2989 | Print this symbol on YYOUTPUT. |
2990 `--------------------------------*/
2992 #if (defined __STDC__ || defined __C99__FUNC__ \
2993 || defined __cplusplus || defined _MSC_VER)
2995 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2998 yy_symbol_print (yyoutput, yytype, yyvaluep)
3001 YYSTYPE const * const yyvaluep;
3004 if (yytype < YYNTOKENS)
3005 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3007 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3009 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3010 YYFPRINTF (yyoutput, ")");
3013 /*------------------------------------------------------------------.
3014 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3016 `------------------------------------------------------------------*/
3018 #if (defined __STDC__ || defined __C99__FUNC__ \
3019 || defined __cplusplus || defined _MSC_VER)
3021 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3024 yy_stack_print (bottom, top)
3025 yytype_int16 *bottom;
3029 YYFPRINTF (stderr, "Stack now");
3030 for (; bottom <= top; ++bottom)
3031 YYFPRINTF (stderr, " %d", *bottom);
3032 YYFPRINTF (stderr, "\n");
3035 # define YY_STACK_PRINT(Bottom, Top) \
3038 yy_stack_print ((Bottom), (Top)); \
3042 /*------------------------------------------------.
3043 | Report that the YYRULE is going to be reduced. |
3044 `------------------------------------------------*/
3046 #if (defined __STDC__ || defined __C99__FUNC__ \
3047 || defined __cplusplus || defined _MSC_VER)
3049 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3052 yy_reduce_print (yyvsp, yyrule)
3057 int yynrhs = yyr2[yyrule];
3059 unsigned long int yylno = yyrline[yyrule];
3060 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3062 /* The symbols being reduced. */
3063 for (yyi = 0; yyi < yynrhs; yyi++)
3065 fprintf (stderr, " $%d = ", yyi + 1);
3066 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3067 &(yyvsp[(yyi + 1) - (yynrhs)])
3069 fprintf (stderr, "\n");
3073 # define YY_REDUCE_PRINT(Rule) \
3076 yy_reduce_print (yyvsp, Rule); \
3079 /* Nonzero means print parse trace. It is left uninitialized so that
3080 multiple parsers can coexist. */
3082 #else /* !YYDEBUG */
3083 # define YYDPRINTF(Args)
3084 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3085 # define YY_STACK_PRINT(Bottom, Top)
3086 # define YY_REDUCE_PRINT(Rule)
3087 #endif /* !YYDEBUG */
3090 /* YYINITDEPTH -- initial size of the parser's stacks. */
3092 # define YYINITDEPTH 200
3095 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3096 if the built-in stack extension method is used).
3098 Do not make this value too large; the results are undefined if
3099 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3100 evaluated with infinite-precision integer arithmetic. */
3103 # define YYMAXDEPTH 10000
3111 # if defined __GLIBC__ && defined _STRING_H
3112 # define yystrlen strlen
3114 /* Return the length of YYSTR. */
3115 #if (defined __STDC__ || defined __C99__FUNC__ \
3116 || defined __cplusplus || defined _MSC_VER)
3118 yystrlen (const char *yystr)
3126 for (yylen = 0; yystr[yylen]; yylen++)
3134 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3135 # define yystpcpy stpcpy
3137 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3139 #if (defined __STDC__ || defined __C99__FUNC__ \
3140 || defined __cplusplus || defined _MSC_VER)
3142 yystpcpy (char *yydest, const char *yysrc)
3145 yystpcpy (yydest, yysrc)
3151 const char *yys = yysrc;
3153 while ((*yyd++ = *yys++) != '\0')
3162 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3163 quotes and backslashes, so that it's suitable for yyerror. The
3164 heuristic is that double-quoting is unnecessary unless the string
3165 contains an apostrophe, a comma, or backslash (other than
3166 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3167 null, do not copy; instead, return the length of what the result
3170 yytnamerr (char *yyres, const char *yystr)
3175 char const *yyp = yystr;
3182 goto do_not_strip_quotes;
3186 goto do_not_strip_quotes;
3199 do_not_strip_quotes: ;
3203 return yystrlen (yystr);
3205 return yystpcpy (yyres, yystr) - yyres;
3209 /* Copy into YYRESULT an error message about the unexpected token
3210 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3211 including the terminating null byte. If YYRESULT is null, do not
3212 copy anything; just return the number of bytes that would be
3213 copied. As a special case, return 0 if an ordinary "syntax error"
3214 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3215 size calculation. */
3217 yysyntax_error (char *yyresult, int yystate, int yychar)
3219 int yyn = yypact[yystate];
3221 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3225 int yytype = YYTRANSLATE (yychar);
3226 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3227 YYSIZE_T yysize = yysize0;
3229 int yysize_overflow = 0;
3230 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3231 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3235 /* This is so xgettext sees the translatable formats that are
3236 constructed on the fly. */
3237 YY_("syntax error, unexpected %s");
3238 YY_("syntax error, unexpected %s, expecting %s");
3239 YY_("syntax error, unexpected %s, expecting %s or %s");
3240 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3241 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3245 static char const yyunexpected[] = "syntax error, unexpected %s";
3246 static char const yyexpecting[] = ", expecting %s";
3247 static char const yyor[] = " or %s";
3248 char yyformat[sizeof yyunexpected
3249 + sizeof yyexpecting - 1
3250 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3251 * (sizeof yyor - 1))];
3252 char const *yyprefix = yyexpecting;
3254 /* Start YYX at -YYN if negative to avoid negative indexes in
3256 int yyxbegin = yyn < 0 ? -yyn : 0;
3258 /* Stay within bounds of both yycheck and yytname. */
3259 int yychecklim = YYLAST - yyn + 1;
3260 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3263 yyarg[0] = yytname[yytype];
3264 yyfmt = yystpcpy (yyformat, yyunexpected);
3266 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3267 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3269 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3273 yyformat[sizeof yyunexpected - 1] = '\0';
3276 yyarg[yycount++] = yytname[yyx];
3277 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3278 yysize_overflow |= (yysize1 < yysize);
3280 yyfmt = yystpcpy (yyfmt, yyprefix);
3284 yyf = YY_(yyformat);
3285 yysize1 = yysize + yystrlen (yyf);
3286 yysize_overflow |= (yysize1 < yysize);
3289 if (yysize_overflow)
3290 return YYSIZE_MAXIMUM;
3294 /* Avoid sprintf, as that infringes on the user's name space.
3295 Don't have undefined behavior even if the translation
3296 produced a string with the wrong number of "%s"s. */
3297 char *yyp = yyresult;
3299 while ((*yyp = *yyf) != '\0')
3301 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3303 yyp += yytnamerr (yyp, yyarg[yyi++]);
3316 #endif /* YYERROR_VERBOSE */
3319 /*-----------------------------------------------.
3320 | Release the memory associated to this symbol. |
3321 `-----------------------------------------------*/
3324 #if (defined __STDC__ || defined __C99__FUNC__ \
3325 || defined __cplusplus || defined _MSC_VER)
3327 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3330 yydestruct (yymsg, yytype, yyvaluep)
3340 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3351 /* Prevent warnings from -Wmissing-prototypes. */
3353 #ifdef YYPARSE_PARAM
3354 #if defined __STDC__ || defined __cplusplus
3355 int yyparse (void *YYPARSE_PARAM);
3359 #else /* ! YYPARSE_PARAM */
3360 #if defined __STDC__ || defined __cplusplus
3365 #endif /* ! YYPARSE_PARAM */
3369 /* The look-ahead symbol. */
3372 /* The semantic value of the look-ahead symbol. */
3375 /* Number of syntax errors so far. */
3384 #ifdef YYPARSE_PARAM
3385 #if (defined __STDC__ || defined __C99__FUNC__ \
3386 || defined __cplusplus || defined _MSC_VER)
3388 yyparse (void *YYPARSE_PARAM)
3391 yyparse (YYPARSE_PARAM)
3392 void *YYPARSE_PARAM;
3394 #else /* ! YYPARSE_PARAM */
3395 #if (defined __STDC__ || defined __C99__FUNC__ \
3396 || defined __cplusplus || defined _MSC_VER)
3410 /* Number of tokens to shift before error messages enabled. */
3412 /* Look-ahead token as an internal (translated) token number. */
3415 /* Buffer for error messages, and its allocated size. */
3417 char *yymsg = yymsgbuf;
3418 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3421 /* Three stacks and their tools:
3422 `yyss': related to states,
3423 `yyvs': related to semantic values,
3424 `yyls': related to locations.
3426 Refer to the stacks thru separate pointers, to allow yyoverflow
3427 to reallocate them elsewhere. */
3429 /* The state stack. */
3430 yytype_int16 yyssa[YYINITDEPTH];
3431 yytype_int16 *yyss = yyssa;
3432 yytype_int16 *yyssp;
3434 /* The semantic value stack. */
3435 YYSTYPE yyvsa[YYINITDEPTH];
3436 YYSTYPE *yyvs = yyvsa;
3441 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3443 YYSIZE_T yystacksize = YYINITDEPTH;
3445 /* The variables used to return semantic value and location from the
3450 /* The number of symbols on the RHS of the reduced rule.
3451 Keep to zero when no symbol should be popped. */
3454 YYDPRINTF ((stderr, "Starting parse\n"));
3459 yychar = YYEMPTY; /* Cause a token to be read. */
3461 /* Initialize stack pointers.
3462 Waste one element of value and location stack
3463 so that they stay on the same level as the state stack.
3464 The wasted elements are never initialized. */
3471 /*------------------------------------------------------------.
3472 | yynewstate -- Push a new state, which is found in yystate. |
3473 `------------------------------------------------------------*/
3475 /* In all cases, when you get here, the value and location stacks
3476 have just been pushed. So pushing a state here evens the stacks. */
3482 if (yyss + yystacksize - 1 <= yyssp)
3484 /* Get the current used size of the three stacks, in elements. */
3485 YYSIZE_T yysize = yyssp - yyss + 1;
3489 /* Give user a chance to reallocate the stack. Use copies of
3490 these so that the &'s don't force the real ones into
3492 YYSTYPE *yyvs1 = yyvs;
3493 yytype_int16 *yyss1 = yyss;
3496 /* Each stack pointer address is followed by the size of the
3497 data in use in that stack, in bytes. This used to be a
3498 conditional around just the two extra args, but that might
3499 be undefined if yyoverflow is a macro. */
3500 yyoverflow (YY_("memory exhausted"),
3501 &yyss1, yysize * sizeof (*yyssp),
3502 &yyvs1, yysize * sizeof (*yyvsp),
3509 #else /* no yyoverflow */
3510 # ifndef YYSTACK_RELOCATE
3511 goto yyexhaustedlab;
3513 /* Extend the stack our own way. */
3514 if (YYMAXDEPTH <= yystacksize)
3515 goto yyexhaustedlab;
3517 if (YYMAXDEPTH < yystacksize)
3518 yystacksize = YYMAXDEPTH;
3521 yytype_int16 *yyss1 = yyss;
3522 union yyalloc *yyptr =
3523 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3525 goto yyexhaustedlab;
3526 YYSTACK_RELOCATE (yyss);
3527 YYSTACK_RELOCATE (yyvs);
3529 # undef YYSTACK_RELOCATE
3531 YYSTACK_FREE (yyss1);
3534 #endif /* no yyoverflow */
3536 yyssp = yyss + yysize - 1;
3537 yyvsp = yyvs + yysize - 1;
3540 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3541 (unsigned long int) yystacksize));
3543 if (yyss + yystacksize - 1 <= yyssp)
3547 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3556 /* Do appropriate processing given the current state. Read a
3557 look-ahead token if we need one and don't already have one. */
3559 /* First try to decide what to do without reference to look-ahead token. */
3560 yyn = yypact[yystate];
3561 if (yyn == YYPACT_NINF)
3564 /* Not known => get a look-ahead token if don't already have one. */
3566 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3567 if (yychar == YYEMPTY)
3569 YYDPRINTF ((stderr, "Reading a token: "));
3573 if (yychar <= YYEOF)
3575 yychar = yytoken = YYEOF;
3576 YYDPRINTF ((stderr, "Now at end of input.\n"));
3580 yytoken = YYTRANSLATE (yychar);
3581 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3584 /* If the proper action on seeing token YYTOKEN is to reduce or to
3585 detect an error, take that action. */
3587 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3592 if (yyn == 0 || yyn == YYTABLE_NINF)
3601 /* Count tokens shifted since error; after three, turn off error
3606 /* Shift the look-ahead token. */
3607 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3609 /* Discard the shifted token unless it is eof. */
3610 if (yychar != YYEOF)
3619 /*-----------------------------------------------------------.
3620 | yydefault -- do the default action for the current state. |
3621 `-----------------------------------------------------------*/
3623 yyn = yydefact[yystate];
3629 /*-----------------------------.
3630 | yyreduce -- Do a reduction. |
3631 `-----------------------------*/
3633 /* yyn is the number of a rule to reduce with. */
3636 /* If YYLEN is nonzero, implement the default value of the action:
3639 Otherwise, the following line sets YYVAL to garbage.
3640 This behavior is undocumented and Bison
3641 users should not rely upon it. Assigning to YYVAL
3642 unconditionally makes the parser a bit smaller, and it avoids a
3643 GCC warning that YYVAL may be used uninitialized. */
3644 yyval = yyvsp[1-yylen];
3647 YY_REDUCE_PRINT (yyn);
3651 #line 1153 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3652 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3656 #line 1153 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3657 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3661 #line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3662 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3666 #line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3667 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3671 #line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3672 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3676 #line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3677 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3681 #line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3682 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3686 #line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3687 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3691 #line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3692 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3696 #line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3697 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3701 #line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3702 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3706 #line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3707 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3711 #line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3712 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3716 #line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3717 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3721 #line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3722 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3726 #line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3727 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3731 #line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3732 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3736 #line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3737 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3741 #line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3746 #line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3747 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3751 #line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3752 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3756 #line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3757 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3761 #line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3762 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3766 #line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3767 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3771 #line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3772 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3776 #line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3777 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3781 #line 1173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3782 { (yyval.StrVal) = 0; ;}
3786 #line 1175 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3787 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3791 #line 1176 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3792 { (yyval.UIntVal)=0; ;}
3796 #line 1180 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3798 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3804 #line 1184 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3812 #line 1189 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3814 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3820 #line 1198 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3828 #line 1203 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3830 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3836 #line 1209 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3837 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3841 #line 1210 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3842 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3846 #line 1211 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3847 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3851 #line 1212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3852 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3856 #line 1213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3857 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3861 #line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3866 #line 1218 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3871 #line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3876 #line 1220 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3881 #line 1224 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3886 #line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3891 #line 1226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3892 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3896 #line 1227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3897 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3901 #line 1231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3906 #line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3907 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3911 #line 1233 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3912 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3916 #line 1237 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3917 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3921 #line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3922 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3926 #line 1239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3931 #line 1240 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3932 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3936 #line 1241 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3937 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3941 #line 1245 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3946 #line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3947 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3951 #line 1247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3952 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3956 #line 1250 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3957 { (yyval.UIntVal) = CallingConv::C; ;}
3961 #line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3962 { (yyval.UIntVal) = CallingConv::C; ;}
3966 #line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3967 { (yyval.UIntVal) = CallingConv::Fast; ;}
3971 #line 1253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3972 { (yyval.UIntVal) = CallingConv::Cold; ;}
3976 #line 1254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3977 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3981 #line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3982 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3986 #line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3988 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3989 GEN_ERROR("Calling conv too large");
3990 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3996 #line 1263 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3997 { (yyval.Attributes) = Attribute::ZExt; ;}
4001 #line 1264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4002 { (yyval.Attributes) = Attribute::ZExt; ;}
4006 #line 1265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4007 { (yyval.Attributes) = Attribute::SExt; ;}
4011 #line 1266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4012 { (yyval.Attributes) = Attribute::SExt; ;}
4016 #line 1267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4017 { (yyval.Attributes) = Attribute::InReg; ;}
4021 #line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4022 { (yyval.Attributes) = Attribute::StructRet; ;}
4026 #line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4027 { (yyval.Attributes) = Attribute::NoAlias; ;}
4031 #line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4032 { (yyval.Attributes) = Attribute::ByVal; ;}
4036 #line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4037 { (yyval.Attributes) = Attribute::Nest; ;}
4041 #line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4042 { (yyval.Attributes) =
4043 Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4047 #line 1276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4048 { (yyval.Attributes) = Attribute::None; ;}
4052 #line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4054 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4059 #line 1282 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4060 { (yyval.Attributes) = Attribute::InReg; ;}
4064 #line 1283 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4065 { (yyval.Attributes) = Attribute::ZExt; ;}
4069 #line 1284 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4070 { (yyval.Attributes) = Attribute::SExt; ;}
4074 #line 1287 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4075 { (yyval.Attributes) = Attribute::None; ;}
4079 #line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4081 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4086 #line 1294 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4087 { (yyval.Attributes) = Attribute::NoReturn; ;}
4091 #line 1295 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4092 { (yyval.Attributes) = Attribute::NoUnwind; ;}
4096 #line 1296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4097 { (yyval.Attributes) = Attribute::InReg; ;}
4101 #line 1297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4102 { (yyval.Attributes) = Attribute::ZExt; ;}
4106 #line 1298 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4107 { (yyval.Attributes) = Attribute::SExt; ;}
4111 #line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4112 { (yyval.Attributes) = Attribute::ReadNone; ;}
4116 #line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4117 { (yyval.Attributes) = Attribute::ReadOnly; ;}
4121 #line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4122 { (yyval.Attributes) = Attribute::NoInline; ;}
4126 #line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4127 { (yyval.Attributes) = Attribute::AlwaysInline; ;}
4131 #line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4132 { (yyval.Attributes) = Attribute::OptimizeForSize; ;}
4136 #line 1306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4137 { (yyval.Attributes) = Attribute::None; ;}
4141 #line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4143 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4148 #line 1313 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4149 { (yyval.StrVal) = 0; ;}
4153 #line 1314 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4155 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4160 #line 1321 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4161 { (yyval.UIntVal) = 0; ;}
4165 #line 1322 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4167 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4168 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4169 GEN_ERROR("Alignment must be a power of two");
4175 #line 1328 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4176 { (yyval.UIntVal) = 0; ;}
4180 #line 1329 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4182 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4183 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4184 GEN_ERROR("Alignment must be a power of two");
4190 #line 1338 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4192 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4193 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4194 GEN_ERROR("Invalid character in section name");
4195 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4201 #line 1346 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4202 { (yyval.StrVal) = 0; ;}
4206 #line 1347 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4207 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4211 #line 1352 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4216 #line 1353 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4221 #line 1354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4223 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4224 delete (yyvsp[(1) - (1)].StrVal);
4230 #line 1359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4232 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4233 GEN_ERROR("Alignment must be a power of two");
4234 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4240 #line 1375 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4242 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4248 #line 1379 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4250 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4256 #line 1383 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4258 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4259 GEN_ERROR("Cannot form a pointer to a basic block");
4260 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4261 delete (yyvsp[(1) - (3)].TypeVal);
4267 #line 1390 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4268 { // Named types are also simple types...
4269 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4271 (yyval.TypeVal) = new PATypeHolder(tmp);
4276 #line 1395 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4277 { // Type UpReference
4278 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4279 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4280 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4281 (yyval.TypeVal) = new PATypeHolder(OT);
4282 UR_OUT("New Upreference!\n");
4288 #line 1403 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4290 // Allow but ignore attributes on function types; this permits auto-upgrade.
4291 // FIXME: remove in LLVM 3.0.
4292 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4293 if (!FunctionType::isValidReturnType(RetTy))
4294 GEN_ERROR("Invalid result type for LLVM function");
4296 std::vector<const Type*> Params;
4297 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4298 for (; I != E; ++I ) {
4299 const Type *Ty = I->Ty->get();
4300 Params.push_back(Ty);
4303 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4304 if (isVarArg) Params.pop_back();
4306 for (unsigned i = 0; i != Params.size(); ++i)
4307 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4308 GEN_ERROR("Function arguments must be value types!");
4312 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4313 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4314 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4316 // Delete the argument list
4317 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4320 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4327 #line 1438 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4329 // Allow but ignore attributes on function types; this permits auto-upgrade.
4330 // FIXME: remove in LLVM 3.0.
4331 std::vector<const Type*> Params;
4332 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4333 for ( ; I != E; ++I ) {
4334 const Type* Ty = I->Ty->get();
4335 Params.push_back(Ty);
4338 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4339 if (isVarArg) Params.pop_back();
4341 for (unsigned i = 0; i != Params.size(); ++i)
4342 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4343 GEN_ERROR("Function arguments must be value types!");
4347 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4348 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4350 // Delete the argument list
4351 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4354 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4361 #line 1469 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4362 { // Sized array type?
4363 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4364 delete (yyvsp[(4) - (5)].TypeVal);
4370 #line 1474 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4372 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4373 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4374 GEN_ERROR("Unsigned result not equal to signed result");
4375 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4376 GEN_ERROR("Element type of a VectorType must be primitive");
4377 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4378 delete (yyvsp[(4) - (5)].TypeVal);
4384 #line 1484 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4385 { // Structure type?
4386 std::vector<const Type*> Elements;
4387 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4388 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4389 Elements.push_back(*I);
4391 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4392 delete (yyvsp[(2) - (3)].TypeList);
4398 #line 1494 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4399 { // Empty structure type?
4400 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4406 #line 1498 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4408 std::vector<const Type*> Elements;
4409 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4410 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4411 Elements.push_back(*I);
4413 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4414 delete (yyvsp[(3) - (5)].TypeList);
4420 #line 1508 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4421 { // Empty structure type?
4422 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4428 #line 1515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4430 // Allow but ignore attributes on function types; this permits auto-upgrade.
4431 // FIXME: remove in LLVM 3.0.
4432 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4433 (yyval.TypeWithAttrs).Attrs = Attribute::None;
4438 #line 1524 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4440 if (!UpRefs.empty())
4441 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4442 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4443 GEN_ERROR("LLVM functions cannot return aggregate types");
4444 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4449 #line 1531 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4451 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4456 #line 1536 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4458 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4459 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4465 #line 1541 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4467 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4473 #line 1549 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4475 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4476 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4477 TWA.Ty = new PATypeHolder(Type::VoidTy);
4478 (yyval.TypeWithAttrsList)->push_back(TWA);
4484 #line 1556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4486 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4487 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4488 TWA.Ty = new PATypeHolder(Type::VoidTy);
4489 (yyval.TypeWithAttrsList)->push_back(TWA);
4495 #line 1563 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4497 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4503 #line 1571 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4505 (yyval.TypeList) = new std::list<PATypeHolder>();
4506 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4507 delete (yyvsp[(1) - (1)].TypeVal);
4513 #line 1577 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4515 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4516 delete (yyvsp[(3) - (3)].TypeVal);
4522 #line 1589 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4523 { // Nonempty unsized arr
4524 if (!UpRefs.empty())
4525 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4526 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4528 GEN_ERROR("Cannot make array constant with type: '" +
4529 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4530 const Type *ETy = ATy->getElementType();
4531 uint64_t NumElements = ATy->getNumElements();
4533 // Verify that we have the correct size...
4534 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4535 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4536 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4537 utostr(NumElements) + "");
4539 // Verify all elements are correct type!
4540 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4541 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4542 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4543 ETy->getDescription() +"' as required!\nIt is of type '"+
4544 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4547 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4548 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4554 #line 1617 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4556 if (!UpRefs.empty())
4557 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4558 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4560 GEN_ERROR("Cannot make array constant with type: '" +
4561 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4563 uint64_t NumElements = ATy->getNumElements();
4564 if (NumElements != uint64_t(-1) && NumElements != 0)
4565 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4566 " arguments, but has size of " + utostr(NumElements) +"");
4567 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4568 delete (yyvsp[(1) - (3)].TypeVal);
4574 #line 1633 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4576 if (!UpRefs.empty())
4577 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4578 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4580 GEN_ERROR("Cannot make array constant with type: '" +
4581 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4583 uint64_t NumElements = ATy->getNumElements();
4584 const Type *ETy = ATy->getElementType();
4585 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4586 GEN_ERROR("Can't build string constant of size " +
4587 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4588 " when array has size " + utostr(NumElements) + "");
4589 std::vector<Constant*> Vals;
4590 if (ETy == Type::Int8Ty) {
4591 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4592 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4594 delete (yyvsp[(3) - (3)].StrVal);
4595 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4597 delete (yyvsp[(3) - (3)].StrVal);
4598 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4599 delete (yyvsp[(1) - (3)].TypeVal);
4605 #line 1660 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4606 { // Nonempty unsized arr
4607 if (!UpRefs.empty())
4608 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4609 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4611 GEN_ERROR("Cannot make packed constant with type: '" +
4612 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4613 const Type *ETy = PTy->getElementType();
4614 unsigned NumElements = PTy->getNumElements();
4616 // Verify that we have the correct size...
4617 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4618 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4619 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4620 utostr(NumElements) + "");
4622 // Verify all elements are correct type!
4623 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4624 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4625 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4626 ETy->getDescription() +"' as required!\nIt is of type '"+
4627 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4630 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4631 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4637 #line 1688 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4639 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4641 GEN_ERROR("Cannot make struct constant with type: '" +
4642 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4644 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4645 GEN_ERROR("Illegal number of initializers for structure type");
4647 // Check to ensure that constants are compatible with the type initializer!
4648 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4649 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4650 GEN_ERROR("Expected type '" +
4651 STy->getElementType(i)->getDescription() +
4652 "' for element #" + utostr(i) +
4653 " of structure initializer");
4655 // Check to ensure that Type is not packed
4656 if (STy->isPacked())
4657 GEN_ERROR("Unpacked Initializer to vector type '" +
4658 STy->getDescription() + "'");
4660 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4661 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4667 #line 1714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4669 if (!UpRefs.empty())
4670 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4671 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4673 GEN_ERROR("Cannot make struct constant with type: '" +
4674 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4676 if (STy->getNumContainedTypes() != 0)
4677 GEN_ERROR("Illegal number of initializers for structure type");
4679 // Check to ensure that Type is not packed
4680 if (STy->isPacked())
4681 GEN_ERROR("Unpacked Initializer to vector type '" +
4682 STy->getDescription() + "'");
4684 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4685 delete (yyvsp[(1) - (3)].TypeVal);
4691 #line 1734 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4693 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4695 GEN_ERROR("Cannot make struct constant with type: '" +
4696 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4698 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4699 GEN_ERROR("Illegal number of initializers for structure type");
4701 // Check to ensure that constants are compatible with the type initializer!
4702 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4703 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4704 GEN_ERROR("Expected type '" +
4705 STy->getElementType(i)->getDescription() +
4706 "' for element #" + utostr(i) +
4707 " of structure initializer");
4709 // Check to ensure that Type is packed
4710 if (!STy->isPacked())
4711 GEN_ERROR("Vector initializer to non-vector type '" +
4712 STy->getDescription() + "'");
4714 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4715 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4721 #line 1760 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4723 if (!UpRefs.empty())
4724 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4725 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4727 GEN_ERROR("Cannot make struct constant with type: '" +
4728 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4730 if (STy->getNumContainedTypes() != 0)
4731 GEN_ERROR("Illegal number of initializers for structure type");
4733 // Check to ensure that Type is packed
4734 if (!STy->isPacked())
4735 GEN_ERROR("Vector initializer to non-vector type '" +
4736 STy->getDescription() + "'");
4738 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4739 delete (yyvsp[(1) - (5)].TypeVal);
4745 #line 1780 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4747 if (!UpRefs.empty())
4748 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4749 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4751 GEN_ERROR("Cannot make null pointer constant with type: '" +
4752 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4754 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4755 delete (yyvsp[(1) - (2)].TypeVal);
4761 #line 1792 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4763 if (!UpRefs.empty())
4764 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4765 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4766 delete (yyvsp[(1) - (2)].TypeVal);
4772 #line 1799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4774 if (!UpRefs.empty())
4775 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4776 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4778 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4780 // ConstExprs can exist in the body of a function, thus creating
4781 // GlobalValues whenever they refer to a variable. Because we are in
4782 // the context of a function, getExistingVal will search the functions
4783 // symbol table instead of the module symbol table for the global symbol,
4784 // which throws things all off. To get around this, we just tell
4785 // getExistingVal that we are at global scope here.
4787 Function *SavedCurFn = CurFun.CurrentFunction;
4788 CurFun.CurrentFunction = 0;
4790 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4793 CurFun.CurrentFunction = SavedCurFn;
4795 // If this is an initializer for a constant pointer, which is referencing a
4796 // (currently) undefined variable, create a stub now that shall be replaced
4797 // in the future with the right type of variable.
4800 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4801 const PointerType *PT = cast<PointerType>(Ty);
4803 // First check to see if the forward references value is already created!
4804 PerModuleInfo::GlobalRefsType::iterator I =
4805 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4807 if (I != CurModule.GlobalRefs.end()) {
4808 V = I->second; // Placeholder already exists, use it...
4809 (yyvsp[(2) - (2)].ValIDVal).destroy();
4812 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4813 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4814 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4815 GEN_ERROR("Invalid reference to global");
4817 // Create the forward referenced global.
4819 if (const FunctionType *FTy =
4820 dyn_cast<FunctionType>(PT->getElementType())) {
4821 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4822 CurModule.CurrentModule);
4824 GV = new GlobalVariable(PT->getElementType(), false,
4825 GlobalValue::ExternalWeakLinkage, 0,
4826 Name, CurModule.CurrentModule);
4829 // Keep track of the fact that we have a forward ref to recycle it
4830 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4835 (yyval.ConstVal) = cast<GlobalValue>(V);
4836 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4842 #line 1865 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4844 if (!UpRefs.empty())
4845 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4846 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4847 GEN_ERROR("Mismatched types for constant expression: " +
4848 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4849 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4850 delete (yyvsp[(1) - (2)].TypeVal);
4856 #line 1875 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4858 if (!UpRefs.empty())
4859 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4860 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4861 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4862 GEN_ERROR("Cannot create a null initialized value of this type");
4863 (yyval.ConstVal) = Constant::getNullValue(Ty);
4864 delete (yyvsp[(1) - (2)].TypeVal);
4870 #line 1885 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4871 { // integral constants
4872 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4873 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val)))
4874 GEN_ERROR("Constant value doesn't fit in type");
4875 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].SInt64Val), true);
4877 GEN_ERROR("integer constant must have integer type");
4879 delete (yyvsp[(1) - (2)].TypeVal);
4885 #line 1896 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4886 { // arbitrary precision integer constants
4887 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4888 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4889 GEN_ERROR("Constant value does not fit in type");
4890 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(IT->getBitWidth());
4891 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4893 GEN_ERROR("integer constant must have integer type");
4895 delete (yyvsp[(1) - (2)].TypeVal);
4896 delete (yyvsp[(2) - (2)].APIntVal);
4902 #line 1909 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4903 { // integral constants
4904 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4905 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val)))
4906 GEN_ERROR("Constant value doesn't fit in type");
4907 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].UInt64Val), false);
4909 GEN_ERROR("integer constant must have integer type");
4911 delete (yyvsp[(1) - (2)].TypeVal);
4917 #line 1920 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4918 { // arbitrary precision integer constants
4919 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4920 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4921 GEN_ERROR("Constant value does not fit in type");
4922 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(IT->getBitWidth());
4923 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4925 GEN_ERROR("integer constant must have integer type");
4928 delete (yyvsp[(2) - (2)].APIntVal);
4929 delete (yyvsp[(1) - (2)].TypeVal);
4935 #line 1934 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4936 { // Boolean constants
4937 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4938 GEN_ERROR("Constant true must have type i1");
4939 (yyval.ConstVal) = ConstantInt::getTrue();
4940 delete (yyvsp[(1) - (2)].TypeVal);
4946 #line 1941 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4947 { // Boolean constants
4948 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4949 GEN_ERROR("Constant false must have type i1");
4950 (yyval.ConstVal) = ConstantInt::getFalse();
4951 delete (yyvsp[(1) - (2)].TypeVal);
4957 #line 1948 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4958 { // Floating point constants
4959 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal)))
4960 GEN_ERROR("Floating point constant invalid for type");
4962 // Lexer has no type info, so builds all float and double FP constants
4963 // as double. Fix this here. Long double is done right.
4964 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].TypeVal)->get()==Type::FloatTy) {
4966 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
4969 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4970 delete (yyvsp[(1) - (2)].TypeVal);
4971 delete (yyvsp[(2) - (2)].FPVal);
4977 #line 1966 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4979 if (!UpRefs.empty())
4980 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4981 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4982 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4983 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4984 GEN_ERROR("invalid cast opcode for cast from '" +
4985 Val->getType()->getDescription() + "' to '" +
4986 DestTy->getDescription() + "'");
4987 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4988 delete (yyvsp[(5) - (6)].TypeVal);
4993 #line 1978 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4995 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4996 GEN_ERROR("GetElementPtr requires a pointer operand");
4999 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
5001 GEN_ERROR("Index list invalid for constant getelementptr");
5003 SmallVector<Constant*, 8> IdxVec;
5004 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
5005 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
5006 IdxVec.push_back(C);
5008 GEN_ERROR("Indices to constant getelementptr must be constants");
5010 delete (yyvsp[(4) - (5)].ValueList);
5012 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5018 #line 1999 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5020 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5021 GEN_ERROR("Select condition must be of boolean type");
5022 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5023 GEN_ERROR("Select operand types must match");
5024 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5030 #line 2007 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5032 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5033 GEN_ERROR("Binary operator types must match");
5035 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5040 #line 2013 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5042 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5043 GEN_ERROR("Logical operator types must match");
5044 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5045 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5046 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5047 GEN_ERROR("Logical operator requires integral operands");
5049 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5055 #line 2024 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5057 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5058 GEN_ERROR("icmp operand types must match");
5059 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5064 #line 2029 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5066 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5067 GEN_ERROR("fcmp operand types must match");
5068 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5073 #line 2034 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5075 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5076 GEN_ERROR("vicmp operand types must match");
5077 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5082 #line 2039 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5084 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5085 GEN_ERROR("vfcmp operand types must match");
5086 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5091 #line 2044 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5093 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5094 GEN_ERROR("Invalid extractelement operands");
5095 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5101 #line 2050 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5103 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5104 GEN_ERROR("Invalid insertelement operands");
5105 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5111 #line 2056 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5113 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5114 GEN_ERROR("Invalid shufflevector operands");
5115 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5121 #line 2062 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5123 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5124 GEN_ERROR("ExtractValue requires an aggregate operand");
5126 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5127 delete (yyvsp[(4) - (5)].ConstantList);
5133 #line 2070 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5135 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5136 GEN_ERROR("InsertValue requires an aggregate operand");
5138 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5139 delete (yyvsp[(6) - (7)].ConstantList);
5145 #line 2081 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5147 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5153 #line 2085 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5155 (yyval.ConstVector) = new std::vector<Constant*>();
5156 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5162 #line 2093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5163 { (yyval.BoolVal) = false; ;}
5167 #line 2093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5168 { (yyval.BoolVal) = true; ;}
5172 #line 2096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5173 { (yyval.BoolVal) = true; ;}
5177 #line 2096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5178 { (yyval.BoolVal) = false; ;}
5182 #line 2099 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5184 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5185 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5187 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5189 GEN_ERROR("Aliases can be created only to global values");
5191 (yyval.ConstVal) = Aliasee;
5193 delete (yyvsp[(1) - (2)].TypeVal);
5198 #line 2111 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5200 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5201 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5202 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5203 GEN_ERROR("invalid cast opcode for cast from '" +
5204 Val->getType()->getDescription() + "' to '" +
5205 DestTy->getDescription() + "'");
5207 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5209 delete (yyvsp[(5) - (6)].TypeVal);
5214 #line 2132 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5216 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5217 CurModule.ModuleDone();
5223 #line 2137 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5225 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5226 CurModule.ModuleDone();
5232 #line 2150 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5233 { CurFun.isDeclare = false; ;}
5237 #line 2150 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5239 CurFun.FunctionDone();
5245 #line 2154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5246 { CurFun.isDeclare = true; ;}
5250 #line 2154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5257 #line 2157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5264 #line 2160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5266 if (!UpRefs.empty())
5267 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5268 // Eagerly resolve types. This is not an optimization, this is a
5269 // requirement that is due to the fact that we could have this:
5271 // %list = type { %list * }
5272 // %list = type { %list * } ; repeated type decl
5274 // If types are not resolved eagerly, then the two types will not be
5275 // determined to be the same type!
5277 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5279 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5281 // If this is a named type that is not a redefinition, add it to the slot
5283 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5286 delete (yyvsp[(3) - (3)].TypeVal);
5292 #line 2184 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5294 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5296 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5298 // If this is a named type that is not a redefinition, add it to the slot
5300 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5307 #line 2196 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5309 /* "Externally Visible" Linkage */
5310 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5311 GEN_ERROR("Global value initializer is not a constant");
5312 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5313 (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));
5319 #line 2203 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5326 #line 2207 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5328 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5329 GEN_ERROR("Global value initializer is not a constant");
5330 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));
5336 #line 2212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5343 #line 2216 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5345 if (!UpRefs.empty())
5346 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5347 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));
5349 delete (yyvsp[(6) - (7)].TypeVal);
5354 #line 2222 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5362 #line 2226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5365 if ((yyvsp[(1) - (5)].StrVal)) {
5366 Name = *(yyvsp[(1) - (5)].StrVal);
5367 delete (yyvsp[(1) - (5)].StrVal);
5370 GEN_ERROR("Alias name cannot be empty");
5372 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5374 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5376 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5377 CurModule.CurrentModule);
5378 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5379 InsertValue(GA, CurModule.Values);
5382 // If there was a forward reference of this alias, resolve it now.
5386 ID = ValID::createGlobalName(Name);
5388 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5390 if (GlobalValue *FWGV =
5391 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5392 // Replace uses of the fwdref with the actual alias.
5393 FWGV->replaceAllUsesWith(GA);
5394 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5395 GV->eraseFromParent();
5397 cast<Function>(FWGV)->eraseFromParent();
5406 #line 2266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5413 #line 2269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5420 #line 2275 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5422 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5423 if (AsmSoFar.empty())
5424 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5426 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5427 delete (yyvsp[(1) - (1)].StrVal);
5433 #line 2285 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5435 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5436 delete (yyvsp[(3) - (3)].StrVal);
5441 #line 2289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5443 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5444 delete (yyvsp[(3) - (3)].StrVal);
5449 #line 2296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5451 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5452 delete (yyvsp[(3) - (3)].StrVal);
5458 #line 2301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5460 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5461 delete (yyvsp[(1) - (1)].StrVal);
5467 #line 2306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5474 #line 2315 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5476 if (!UpRefs.empty())
5477 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5478 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5479 GEN_ERROR("Argument types must be first-class");
5480 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].Attributes); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5481 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5482 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5488 #line 2325 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5490 if (!UpRefs.empty())
5491 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5492 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5493 GEN_ERROR("Argument types must be first-class");
5494 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].Attributes); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5495 (yyval.ArgList) = new ArgListType;
5496 (yyval.ArgList)->push_back(E);
5502 #line 2336 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5504 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5510 #line 2340 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5512 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5513 struct ArgListEntry E;
5514 E.Ty = new PATypeHolder(Type::VoidTy);
5516 E.Attrs = Attribute::None;
5517 (yyval.ArgList)->push_back(E);
5523 #line 2349 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5525 (yyval.ArgList) = new ArgListType;
5526 struct ArgListEntry E;
5527 E.Ty = new PATypeHolder(Type::VoidTy);
5529 E.Attrs = Attribute::None;
5530 (yyval.ArgList)->push_back(E);
5536 #line 2358 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5538 (yyval.ArgList) = 0;
5544 #line 2364 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5546 std::string FunctionName(*(yyvsp[(4) - (11)].StrVal));
5547 delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory!
5549 // Check the function result for abstractness if this is a define. We should
5550 // have no abstract types at this point
5551 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(3) - (11)].TypeVal)))
5552 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(3) - (11)].TypeVal)->get()->getDescription());
5554 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (11)].TypeVal)))
5555 GEN_ERROR("Invalid result type for LLVM function");
5557 std::vector<const Type*> ParamTypeList;
5558 SmallVector<AttributeWithIndex, 8> Attrs;
5559 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
5561 Attributes RetAttrs = (yyvsp[(2) - (11)].Attributes);
5562 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None) {
5563 if ((yyvsp[(8) - (11)].Attributes) & Attribute::ZExt) {
5564 RetAttrs = RetAttrs | Attribute::ZExt;
5565 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::ZExt;
5567 if ((yyvsp[(8) - (11)].Attributes) & Attribute::SExt) {
5568 RetAttrs = RetAttrs | Attribute::SExt;
5569 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::SExt;
5571 if ((yyvsp[(8) - (11)].Attributes) & Attribute::InReg) {
5572 RetAttrs = RetAttrs | Attribute::InReg;
5573 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::InReg;
5576 if (RetAttrs != Attribute::None)
5577 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
5578 if ((yyvsp[(6) - (11)].ArgList)) { // If there are arguments...
5580 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin(); I != (yyvsp[(6) - (11)].ArgList)->end(); ++I, ++index) {
5581 const Type* Ty = I->Ty->get();
5582 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5583 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5584 ParamTypeList.push_back(Ty);
5585 if (Ty != Type::VoidTy && I->Attrs != Attribute::None)
5586 Attrs.push_back(AttributeWithIndex::get(index, I->Attrs));
5589 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None)
5590 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(8) - (11)].Attributes)));
5592 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5593 if (isVarArg) ParamTypeList.pop_back();
5597 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
5599 FunctionType *FT = FunctionType::get(*(yyvsp[(3) - (11)].TypeVal), ParamTypeList, isVarArg);
5600 const PointerType *PFT = PointerType::getUnqual(FT);
5601 delete (yyvsp[(3) - (11)].TypeVal);
5604 if (!FunctionName.empty()) {
5605 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5607 ID = ValID::createGlobalID(CurModule.Values.size());
5611 // See if this function was forward referenced. If so, recycle the object.
5612 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5613 // Move the function to the end of the list, from whereever it was
5614 // previously inserted.
5615 Fn = cast<Function>(FWRef);
5616 assert(Fn->getAttributes().isEmpty() &&
5617 "Forward reference has parameter attributes!");
5618 CurModule.CurrentModule->getFunctionList().remove(Fn);
5619 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5620 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5621 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5622 if (Fn->getFunctionType() != FT ) {
5623 // The existing function doesn't have the same type. This is an overload
5625 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5626 } else if (Fn->getAttributes() != PAL) {
5627 // The existing function doesn't have the same parameter attributes.
5628 // This is an overload error.
5629 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5630 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5631 // Neither the existing or the current function is a declaration and they
5632 // have the same name and same type. Clearly this is a redefinition.
5633 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5634 } else if (Fn->isDeclaration()) {
5635 // Make sure to strip off any argument names so we can't get conflicts.
5636 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5640 } else { // Not already defined?
5641 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5642 CurModule.CurrentModule);
5643 InsertValue(Fn, CurModule.Values);
5647 CurFun.FunctionStart(Fn);
5649 if (CurFun.isDeclare) {
5650 // If we have declaration, always overwrite linkage. This will allow us to
5651 // correctly handle cases, when pointer to function is passed as argument to
5652 // another function.
5653 Fn->setLinkage(CurFun.Linkage);
5654 Fn->setVisibility(CurFun.Visibility);
5656 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5657 Fn->setAttributes(PAL);
5658 Fn->setAlignment((yyvsp[(10) - (11)].UIntVal));
5659 if ((yyvsp[(9) - (11)].StrVal)) {
5660 Fn->setSection(*(yyvsp[(9) - (11)].StrVal));
5661 delete (yyvsp[(9) - (11)].StrVal);
5663 if ((yyvsp[(11) - (11)].StrVal)) {
5664 Fn->setGC((yyvsp[(11) - (11)].StrVal)->c_str());
5665 delete (yyvsp[(11) - (11)].StrVal);
5668 // Add all of the arguments we parsed to the function...
5669 if ((yyvsp[(6) - (11)].ArgList)) { // Is null if empty...
5670 if (isVarArg) { // Nuke the last entry
5671 assert((yyvsp[(6) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(6) - (11)].ArgList)->back().Name == 0 &&
5672 "Not a varargs marker!");
5673 delete (yyvsp[(6) - (11)].ArgList)->back().Ty;
5674 (yyvsp[(6) - (11)].ArgList)->pop_back(); // Delete the last entry
5676 Function::arg_iterator ArgIt = Fn->arg_begin();
5677 Function::arg_iterator ArgEnd = Fn->arg_end();
5679 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin();
5680 I != (yyvsp[(6) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5681 delete I->Ty; // Delete the typeholder...
5682 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5688 delete (yyvsp[(6) - (11)].ArgList); // We're now done with the argument list
5695 #line 2514 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5697 (yyval.FunctionVal) = CurFun.CurrentFunction;
5699 // Make sure that we keep track of the linkage type even if there was a
5700 // previous "declare".
5701 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5702 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5707 #line 2525 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5709 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5715 #line 2530 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5717 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5718 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5719 (yyval.FunctionVal) = CurFun.CurrentFunction;
5720 CurFun.FunctionDone();
5726 #line 2542 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5728 (yyval.BoolVal) = false;
5734 #line 2546 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5736 (yyval.BoolVal) = true;
5742 #line 2551 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5743 { // A reference to a direct constant
5744 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5750 #line 2555 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5752 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5758 #line 2559 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5759 { // arbitrary precision integer constants
5760 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5761 delete (yyvsp[(1) - (1)].APIntVal);
5767 #line 2564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5768 { // arbitrary precision integer constants
5769 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5770 delete (yyvsp[(1) - (1)].APIntVal);
5776 #line 2569 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5777 { // Perhaps it's an FP constant?
5778 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5784 #line 2573 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5786 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5792 #line 2577 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5794 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5800 #line 2581 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5802 (yyval.ValIDVal) = ValID::createNull();
5808 #line 2585 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5810 (yyval.ValIDVal) = ValID::createUndef();
5816 #line 2589 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5817 { // A vector zero constant.
5818 (yyval.ValIDVal) = ValID::createZeroInit();
5824 #line 2593 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5825 { // Nonempty unsized packed vector
5826 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5827 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5829 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5830 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5832 VectorType* pt = VectorType::get(ETy, NumElements);
5833 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5835 // Verify all elements are correct type!
5836 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5837 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5838 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5839 ETy->getDescription() +"' as required!\nIt is of type '" +
5840 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5843 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5844 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5850 #line 2615 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5851 { // Nonempty unsized arr
5852 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5853 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5855 if (!ETy->isFirstClassType())
5856 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5858 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5859 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5861 // Verify all elements are correct type!
5862 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5863 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5864 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5865 ETy->getDescription() +"' as required!\nIt is of type '"+
5866 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5869 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5870 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5876 #line 2637 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5878 // Use undef instead of an array because it's inconvenient to determine
5879 // the element type at this point, there being no elements to examine.
5880 (yyval.ValIDVal) = ValID::createUndef();
5886 #line 2643 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5888 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5889 const Type *ETy = Type::Int8Ty;
5891 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5893 std::vector<Constant*> Vals;
5894 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5895 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5896 delete (yyvsp[(2) - (2)].StrVal);
5897 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5903 #line 2656 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5905 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5906 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5907 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5909 const StructType *STy = StructType::get(Elements);
5910 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5912 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5913 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5919 #line 2668 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5921 const StructType *STy = StructType::get(std::vector<const Type*>());
5922 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5928 #line 2673 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5930 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5931 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5932 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5934 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5935 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5937 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5938 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5944 #line 2685 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5946 const StructType *STy = StructType::get(std::vector<const Type*>(),
5948 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5954 #line 2691 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5956 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5962 #line 2695 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5964 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5965 delete (yyvsp[(3) - (5)].StrVal);
5966 delete (yyvsp[(5) - (5)].StrVal);
5972 #line 2705 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5973 { // Is it an integer reference...?
5974 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5980 #line 2709 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5982 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5988 #line 2713 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5989 { // Is it a named reference...?
5990 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5991 delete (yyvsp[(1) - (1)].StrVal);
5997 #line 2718 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5998 { // Is it a named reference...?
5999 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
6000 delete (yyvsp[(1) - (1)].StrVal);
6006 #line 2731 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6008 if (!UpRefs.empty())
6009 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
6010 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
6011 delete (yyvsp[(1) - (2)].TypeVal);
6017 #line 2740 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6019 (yyval.ValueList) = new std::vector<Value *>();
6020 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
6026 #line 2745 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6028 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6034 #line 2750 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6036 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6042 #line 2754 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6043 { // Do not allow functions with 0 basic blocks
6044 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6050 #line 2763 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6052 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6054 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6055 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6056 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6062 #line 2772 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6065 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6066 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6067 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6068 " is incorrect, expected %" + utostr((unsigned)ValNum));
6070 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6071 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6077 #line 2785 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6079 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6080 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6081 if (CI2->getParent() == 0)
6082 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6083 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6084 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6090 #line 2794 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6091 { // Empty space between instruction lists
6092 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6098 #line 2798 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6099 { // Labelled (named) basic block
6100 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6101 delete (yyvsp[(1) - (1)].StrVal);
6108 #line 2806 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6109 { // Return with a result...
6110 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6111 assert(!VL.empty() && "Invalid ret operands!");
6112 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6113 if (VL.size() > 1 ||
6114 (isa<StructType>(ReturnType) &&
6115 (VL.empty() || VL[0]->getType() != ReturnType))) {
6116 Value *RV = UndefValue::get(ReturnType);
6117 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6118 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6119 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6122 (yyval.TermInstVal) = ReturnInst::Create(RV);
6124 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6126 delete (yyvsp[(2) - (2)].ValueList);
6132 #line 2826 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6133 { // Return with no result...
6134 (yyval.TermInstVal) = ReturnInst::Create();
6140 #line 2830 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6141 { // Unconditional Branch...
6142 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6144 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6149 #line 2835 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6151 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6152 GEN_ERROR("Branch condition must have type i1");
6153 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6155 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6157 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6159 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6164 #line 2846 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6166 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6168 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6170 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6171 (yyval.TermInstVal) = S;
6173 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6174 E = (yyvsp[(8) - (9)].JumpTable)->end();
6175 for (; I != E; ++I) {
6176 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6177 S->addCase(CI, I->second);
6179 GEN_ERROR("Switch case is constant, but not a simple integer");
6181 delete (yyvsp[(8) - (9)].JumpTable);
6187 #line 2865 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6189 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6191 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6193 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6194 (yyval.TermInstVal) = S;
6200 #line 2875 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6203 // Handle the short syntax
6204 const PointerType *PFTy = 0;
6205 const FunctionType *Ty = 0;
6206 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (15)].TypeVal)->get())) ||
6207 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6208 // Pull out the types of all of the arguments...
6209 std::vector<const Type*> ParamTypes;
6210 ParamList::iterator I = (yyvsp[(7) - (15)].ParamList)->begin(), E = (yyvsp[(7) - (15)].ParamList)->end();
6211 for (; I != E; ++I) {
6212 const Type *Ty = I->Val->getType();
6213 if (Ty == Type::VoidTy)
6214 GEN_ERROR("Short call syntax cannot be used with varargs");
6215 ParamTypes.push_back(Ty);
6218 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (15)].TypeVal)))
6219 GEN_ERROR("Invalid result type for LLVM function");
6221 Ty = FunctionType::get((yyvsp[(4) - (15)].TypeVal)->get(), ParamTypes, false);
6222 PFTy = PointerType::getUnqual(Ty);
6225 delete (yyvsp[(4) - (15)].TypeVal);
6227 Value *V = getVal(PFTy, (yyvsp[(5) - (15)].ValIDVal)); // Get the function we're calling...
6229 BasicBlock *Normal = getBBVal((yyvsp[(12) - (15)].ValIDVal));
6231 BasicBlock *Except = getBBVal((yyvsp[(15) - (15)].ValIDVal));
6234 SmallVector<AttributeWithIndex, 8> Attrs;
6235 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6237 Attributes RetAttrs = (yyvsp[(3) - (15)].Attributes);
6238 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None) {
6239 if ((yyvsp[(9) - (15)].Attributes) & Attribute::ZExt) {
6240 RetAttrs = RetAttrs | Attribute::ZExt;
6241 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::ZExt;
6243 if ((yyvsp[(9) - (15)].Attributes) & Attribute::SExt) {
6244 RetAttrs = RetAttrs | Attribute::SExt;
6245 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::SExt;
6247 if ((yyvsp[(9) - (15)].Attributes) & Attribute::InReg) {
6248 RetAttrs = RetAttrs | Attribute::InReg;
6249 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::InReg;
6252 if (RetAttrs != Attribute::None)
6253 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6255 // Check the arguments
6257 if ((yyvsp[(7) - (15)].ParamList)->empty()) { // Has no arguments?
6258 // Make sure no arguments is a good thing!
6259 if (Ty->getNumParams() != 0)
6260 GEN_ERROR("No arguments passed to a function that "
6261 "expects arguments");
6262 } else { // Has arguments?
6263 // Loop through FunctionType's arguments and ensure they are specified
6265 FunctionType::param_iterator I = Ty->param_begin();
6266 FunctionType::param_iterator E = Ty->param_end();
6267 ParamList::iterator ArgI = (yyvsp[(7) - (15)].ParamList)->begin(), ArgE = (yyvsp[(7) - (15)].ParamList)->end();
6270 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6271 if (ArgI->Val->getType() != *I)
6272 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6273 (*I)->getDescription() + "'");
6274 Args.push_back(ArgI->Val);
6275 if (ArgI->Attrs != Attribute::None)
6276 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6279 if (Ty->isVarArg()) {
6281 for (; ArgI != ArgE; ++ArgI, ++index) {
6282 Args.push_back(ArgI->Val); // push the remaining varargs
6283 if (ArgI->Attrs != Attribute::None)
6284 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6286 } else if (I != E || ArgI != ArgE)
6287 GEN_ERROR("Invalid number of parameters detected");
6289 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None)
6290 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (15)].Attributes)));
6293 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6295 // Create the InvokeInst
6296 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6297 Args.begin(), Args.end());
6298 II->setCallingConv((yyvsp[(2) - (15)].UIntVal));
6299 II->setAttributes(PAL);
6300 (yyval.TermInstVal) = II;
6301 delete (yyvsp[(7) - (15)].ParamList);
6307 #line 2978 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6309 (yyval.TermInstVal) = new UnwindInst();
6315 #line 2982 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6317 (yyval.TermInstVal) = new UnreachableInst();
6323 #line 2989 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6325 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6326 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6329 GEN_ERROR("May only switch on a constant pool value");
6331 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6333 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6338 #line 3000 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6340 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6341 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6345 GEN_ERROR("May only switch on a constant pool value");
6347 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6349 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6354 #line 3013 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6356 // Is this definition named?? if so, assign the name...
6357 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6359 InsertValue((yyvsp[(2) - (2)].InstVal));
6360 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6366 #line 3022 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6369 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6371 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6372 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6373 " is incorrect, expected %" + utostr((unsigned)ValNum));
6375 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6381 #line 3035 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6382 { // Used for PHI nodes
6383 if (!UpRefs.empty())
6384 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6385 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6386 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6388 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6390 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6391 delete (yyvsp[(1) - (6)].TypeVal);
6396 #line 3046 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6398 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6399 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6401 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6403 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6408 #line 3056 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6410 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6411 if (!UpRefs.empty())
6412 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6413 // Used for call and invoke instructions
6414 (yyval.ParamList) = new ParamList();
6415 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6416 (yyval.ParamList)->push_back(E);
6417 delete (yyvsp[(1) - (4)].TypeVal);
6423 #line 3067 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6425 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6426 // Labels are only valid in ASMs
6427 (yyval.ParamList) = new ParamList();
6428 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6429 (yyval.ParamList)->push_back(E);
6435 #line 3075 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6437 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6438 if (!UpRefs.empty())
6439 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6440 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6441 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6442 (yyval.ParamList)->push_back(E);
6443 delete (yyvsp[(3) - (6)].TypeVal);
6449 #line 3085 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6451 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6452 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6453 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6454 (yyval.ParamList)->push_back(E);
6460 #line 3092 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6461 { (yyval.ParamList) = new ParamList(); ;}
6465 #line 3095 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6466 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6470 #line 3096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6472 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6473 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6479 #line 3104 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6481 (yyval.ConstantList) = new std::vector<unsigned>();
6482 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6483 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6484 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6489 #line 3110 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6491 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6492 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6493 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6494 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6500 #line 3119 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6502 (yyval.BoolVal) = true;
6508 #line 3123 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6510 (yyval.BoolVal) = false;
6516 #line 3128 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6518 if (!UpRefs.empty())
6519 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6520 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6521 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6523 "Arithmetic operator requires integer, FP, or packed operands");
6524 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6526 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6528 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6529 if ((yyval.InstVal) == 0)
6530 GEN_ERROR("binary operator returned null");
6531 delete (yyvsp[(2) - (5)].TypeVal);
6536 #line 3144 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6538 if (!UpRefs.empty())
6539 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6540 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6541 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6542 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6543 GEN_ERROR("Logical operator requires integral operands");
6545 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6547 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6549 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6550 if ((yyval.InstVal) == 0)
6551 GEN_ERROR("binary operator returned null");
6552 delete (yyvsp[(2) - (5)].TypeVal);
6557 #line 3161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6559 if (!UpRefs.empty())
6560 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6561 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6563 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6565 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6566 if ((yyval.InstVal) == 0)
6567 GEN_ERROR("icmp operator returned null");
6568 delete (yyvsp[(3) - (6)].TypeVal);
6573 #line 3173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6575 if (!UpRefs.empty())
6576 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6577 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6579 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6581 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6582 if ((yyval.InstVal) == 0)
6583 GEN_ERROR("fcmp operator returned null");
6584 delete (yyvsp[(3) - (6)].TypeVal);
6589 #line 3185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6591 if (!UpRefs.empty())
6592 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6593 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6594 GEN_ERROR("Scalar types not supported by vicmp instruction");
6595 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6597 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6599 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6600 if ((yyval.InstVal) == 0)
6601 GEN_ERROR("vicmp operator returned null");
6602 delete (yyvsp[(3) - (6)].TypeVal);
6607 #line 3199 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6609 if (!UpRefs.empty())
6610 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6611 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6612 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6613 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6615 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6617 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6618 if ((yyval.InstVal) == 0)
6619 GEN_ERROR("vfcmp operator returned null");
6620 delete (yyvsp[(3) - (6)].TypeVal);
6625 #line 3213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6627 if (!UpRefs.empty())
6628 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6629 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6630 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6631 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6632 GEN_ERROR("invalid cast opcode for cast from '" +
6633 Val->getType()->getDescription() + "' to '" +
6634 DestTy->getDescription() + "'");
6635 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6636 delete (yyvsp[(4) - (4)].TypeVal);
6641 #line 3225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6643 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6645 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6646 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6647 GEN_ERROR("vector select value types must be vector types");
6648 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6649 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6650 if (cond_type->getElementType() != Type::Int1Ty)
6651 GEN_ERROR("vector select condition element type must be boolean");
6652 if (cond_type->getNumElements() != select_type->getNumElements())
6653 GEN_ERROR("vector select number of elements must be the same");
6655 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6656 GEN_ERROR("select condition must be boolean");
6658 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6659 GEN_ERROR("select value types must match");
6660 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6666 #line 3246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6668 if (!UpRefs.empty())
6669 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6670 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6671 delete (yyvsp[(4) - (4)].TypeVal);
6677 #line 3253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6679 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6680 GEN_ERROR("Invalid extractelement operands");
6681 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6687 #line 3259 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6689 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6690 GEN_ERROR("Invalid insertelement operands");
6691 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6697 #line 3265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6699 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6700 GEN_ERROR("Invalid shufflevector operands");
6701 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6707 #line 3271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6709 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6710 if (!Ty->isFirstClassType())
6711 GEN_ERROR("PHI node operands must be of first class type");
6712 (yyval.InstVal) = PHINode::Create(Ty);
6713 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6714 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6715 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6716 GEN_ERROR("All elements of a PHI node must be of the same type");
6717 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6718 (yyvsp[(2) - (2)].PHIList)->pop_front();
6720 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6726 #line 3287 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6729 // Handle the short syntax
6730 const PointerType *PFTy = 0;
6731 const FunctionType *Ty = 0;
6732 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (9)].TypeVal)->get())) ||
6733 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6734 // Pull out the types of all of the arguments...
6735 std::vector<const Type*> ParamTypes;
6736 ParamList::iterator I = (yyvsp[(7) - (9)].ParamList)->begin(), E = (yyvsp[(7) - (9)].ParamList)->end();
6737 for (; I != E; ++I) {
6738 const Type *Ty = I->Val->getType();
6739 if (Ty == Type::VoidTy)
6740 GEN_ERROR("Short call syntax cannot be used with varargs");
6741 ParamTypes.push_back(Ty);
6744 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (9)].TypeVal)))
6745 GEN_ERROR("Invalid result type for LLVM function");
6747 Ty = FunctionType::get((yyvsp[(4) - (9)].TypeVal)->get(), ParamTypes, false);
6748 PFTy = PointerType::getUnqual(Ty);
6751 Value *V = getVal(PFTy, (yyvsp[(5) - (9)].ValIDVal)); // Get the function we're calling...
6754 // Check for call to invalid intrinsic to avoid crashing later.
6755 if (Function *theF = dyn_cast<Function>(V)) {
6756 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6757 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6758 !theF->getIntrinsicID(true))
6759 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6760 theF->getName() + "'");
6763 // Set up the Attributes for the function
6764 SmallVector<AttributeWithIndex, 8> Attrs;
6765 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6767 Attributes RetAttrs = (yyvsp[(3) - (9)].Attributes);
6768 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None) {
6769 if ((yyvsp[(9) - (9)].Attributes) & Attribute::ZExt) {
6770 RetAttrs = RetAttrs | Attribute::ZExt;
6771 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::ZExt;
6773 if ((yyvsp[(9) - (9)].Attributes) & Attribute::SExt) {
6774 RetAttrs = RetAttrs | Attribute::SExt;
6775 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::SExt;
6777 if ((yyvsp[(9) - (9)].Attributes) & Attribute::InReg) {
6778 RetAttrs = RetAttrs | Attribute::InReg;
6779 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::InReg;
6782 if (RetAttrs != Attribute::None)
6783 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6785 // Check the arguments
6787 if ((yyvsp[(7) - (9)].ParamList)->empty()) { // Has no arguments?
6788 // Make sure no arguments is a good thing!
6789 if (Ty->getNumParams() != 0)
6790 GEN_ERROR("No arguments passed to a function that "
6791 "expects arguments");
6792 } else { // Has arguments?
6793 // Loop through FunctionType's arguments and ensure they are specified
6794 // correctly. Also, gather any parameter attributes.
6795 FunctionType::param_iterator I = Ty->param_begin();
6796 FunctionType::param_iterator E = Ty->param_end();
6797 ParamList::iterator ArgI = (yyvsp[(7) - (9)].ParamList)->begin(), ArgE = (yyvsp[(7) - (9)].ParamList)->end();
6800 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6801 if (ArgI->Val->getType() != *I)
6802 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6803 (*I)->getDescription() + "'");
6804 Args.push_back(ArgI->Val);
6805 if (ArgI->Attrs != Attribute::None)
6806 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6808 if (Ty->isVarArg()) {
6810 for (; ArgI != ArgE; ++ArgI, ++index) {
6811 Args.push_back(ArgI->Val); // push the remaining varargs
6812 if (ArgI->Attrs != Attribute::None)
6813 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6815 } else if (I != E || ArgI != ArgE)
6816 GEN_ERROR("Invalid number of parameters detected");
6818 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None)
6819 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (9)].Attributes)));
6821 // Finish off the Attributes and check them
6824 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6826 // Create the call node
6827 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6828 CI->setTailCall((yyvsp[(1) - (9)].BoolVal));
6829 CI->setCallingConv((yyvsp[(2) - (9)].UIntVal));
6830 CI->setAttributes(PAL);
6831 (yyval.InstVal) = CI;
6832 delete (yyvsp[(7) - (9)].ParamList);
6833 delete (yyvsp[(4) - (9)].TypeVal);
6839 #line 3396 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6841 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6847 #line 3401 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6849 (yyval.BoolVal) = true;
6855 #line 3405 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6857 (yyval.BoolVal) = false;
6863 #line 3412 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6865 if (!UpRefs.empty())
6866 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6867 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6868 delete (yyvsp[(2) - (3)].TypeVal);
6874 #line 3419 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6876 if (!UpRefs.empty())
6877 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6878 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6879 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6880 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6882 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6883 delete (yyvsp[(2) - (6)].TypeVal);
6888 #line 3429 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6890 if (!UpRefs.empty())
6891 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6892 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6893 delete (yyvsp[(2) - (3)].TypeVal);
6899 #line 3436 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6901 if (!UpRefs.empty())
6902 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6903 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6904 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6905 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6907 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6908 delete (yyvsp[(2) - (6)].TypeVal);
6913 #line 3446 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6915 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6916 GEN_ERROR("Trying to free nonpointer type " +
6917 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6918 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6924 #line 3454 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6926 if (!UpRefs.empty())
6927 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6928 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6929 GEN_ERROR("Can't load from nonpointer type: " +
6930 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6931 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6932 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6933 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6934 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6936 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6937 delete (yyvsp[(3) - (5)].TypeVal);
6942 #line 3468 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6944 if (!UpRefs.empty())
6945 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6946 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6948 GEN_ERROR("Can't store to a nonpointer type: " +
6949 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6950 const Type *ElTy = PT->getElementType();
6951 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6952 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6953 "' into space of type '" + ElTy->getDescription() + "'");
6955 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6957 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6958 delete (yyvsp[(5) - (7)].TypeVal);
6963 #line 3485 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6965 if (!UpRefs.empty())
6966 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6967 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6968 GEN_ERROR("getresult insn requires an aggregate operand");
6969 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6970 GEN_ERROR("Invalid getresult index for type '" +
6971 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6973 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6975 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6976 delete (yyvsp[(2) - (5)].TypeVal);
6981 #line 3499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6983 if (!UpRefs.empty())
6984 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6985 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6986 GEN_ERROR("getelementptr insn requires pointer operand");
6988 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6989 GEN_ERROR("Invalid getelementptr indices for type '" +
6990 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6991 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6993 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6994 delete (yyvsp[(2) - (4)].TypeVal);
6995 delete (yyvsp[(4) - (4)].ValueList);
7000 #line 3514 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7002 if (!UpRefs.empty())
7003 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
7004 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
7005 GEN_ERROR("extractvalue insn requires an aggregate operand");
7007 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
7008 GEN_ERROR("Invalid extractvalue indices for type '" +
7009 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7010 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7012 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
7013 delete (yyvsp[(2) - (4)].TypeVal);
7014 delete (yyvsp[(4) - (4)].ConstantList);
7019 #line 3529 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7021 if (!UpRefs.empty())
7022 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
7023 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
7024 GEN_ERROR("extractvalue insn requires an aggregate operand");
7026 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
7027 GEN_ERROR("Invalid insertvalue indices for type '" +
7028 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
7029 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
7030 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
7032 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
7033 delete (yyvsp[(2) - (7)].TypeVal);
7034 delete (yyvsp[(5) - (7)].TypeVal);
7035 delete (yyvsp[(7) - (7)].ConstantList);
7040 /* Line 1267 of yacc.c. */
7041 #line 7042 "llvmAsmParser.tab.c"
7044 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7048 YY_STACK_PRINT (yyss, yyssp);
7053 /* Now `shift' the result of the reduction. Determine what state
7054 that goes to, based on the state we popped back to and the rule
7055 number reduced by. */
7059 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7060 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7061 yystate = yytable[yystate];
7063 yystate = yydefgoto[yyn - YYNTOKENS];
7068 /*------------------------------------.
7069 | yyerrlab -- here on detecting error |
7070 `------------------------------------*/
7072 /* If not already recovering from an error, report this error. */
7076 #if ! YYERROR_VERBOSE
7077 yyerror (YY_("syntax error"));
7080 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7081 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7083 YYSIZE_T yyalloc = 2 * yysize;
7084 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7085 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7086 if (yymsg != yymsgbuf)
7087 YYSTACK_FREE (yymsg);
7088 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7090 yymsg_alloc = yyalloc;
7094 yymsg_alloc = sizeof yymsgbuf;
7098 if (0 < yysize && yysize <= yymsg_alloc)
7100 (void) yysyntax_error (yymsg, yystate, yychar);
7105 yyerror (YY_("syntax error"));
7107 goto yyexhaustedlab;
7115 if (yyerrstatus == 3)
7117 /* If just tried and failed to reuse look-ahead token after an
7118 error, discard it. */
7120 if (yychar <= YYEOF)
7122 /* Return failure if at end of input. */
7123 if (yychar == YYEOF)
7128 yydestruct ("Error: discarding",
7134 /* Else will try to reuse look-ahead token after shifting the error
7139 /*---------------------------------------------------.
7140 | yyerrorlab -- error raised explicitly by YYERROR. |
7141 `---------------------------------------------------*/
7144 /* Pacify compilers like GCC when the user code never invokes
7145 YYERROR and the label yyerrorlab therefore never appears in user
7147 if (/*CONSTCOND*/ 0)
7150 /* Do not reclaim the symbols of the rule which action triggered
7154 YY_STACK_PRINT (yyss, yyssp);
7159 /*-------------------------------------------------------------.
7160 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7161 `-------------------------------------------------------------*/
7163 yyerrstatus = 3; /* Each real token shifted decrements this. */
7167 yyn = yypact[yystate];
7168 if (yyn != YYPACT_NINF)
7171 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7179 /* Pop the current state because it cannot handle the error token. */
7184 yydestruct ("Error: popping",
7185 yystos[yystate], yyvsp);
7188 YY_STACK_PRINT (yyss, yyssp);
7197 /* Shift the error token. */
7198 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7204 /*-------------------------------------.
7205 | yyacceptlab -- YYACCEPT comes here. |
7206 `-------------------------------------*/
7211 /*-----------------------------------.
7212 | yyabortlab -- YYABORT comes here. |
7213 `-----------------------------------*/
7219 /*-------------------------------------------------.
7220 | yyexhaustedlab -- memory exhaustion comes here. |
7221 `-------------------------------------------------*/
7223 yyerror (YY_("memory exhausted"));
7229 if (yychar != YYEOF && yychar != YYEMPTY)
7230 yydestruct ("Cleanup: discarding lookahead",
7232 /* Do not reclaim the symbols of the rule which action triggered
7233 this YYABORT or YYACCEPT. */
7235 YY_STACK_PRINT (yyss, yyssp);
7236 while (yyssp != yyss)
7238 yydestruct ("Cleanup: popping",
7239 yystos[*yyssp], yyvsp);
7244 YYSTACK_FREE (yyss);
7247 if (yymsg != yymsgbuf)
7248 YYSTACK_FREE (yymsg);
7250 /* Make sure YYID is used. */
7251 return YYID (yyresult);
7255 #line 3548 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7258 // common code from the two 'RunVMAsmParser' functions
7259 static Module* RunParser(Module * M) {
7260 CurModule.CurrentModule = M;
7261 // Check to make sure the parser succeeded
7264 delete ParserResult;
7268 // Emit an error if there are any unresolved types left.
7269 if (!CurModule.LateResolveTypes.empty()) {
7270 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7271 if (DID.Type == ValID::LocalName) {
7272 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7274 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7277 delete ParserResult;
7281 // Emit an error if there are any unresolved values left.
7282 if (!CurModule.LateResolveValues.empty()) {
7283 Value *V = CurModule.LateResolveValues.back();
7284 std::map<Value*, std::pair<ValID, int> >::iterator I =
7285 CurModule.PlaceHolderInfo.find(V);
7287 if (I != CurModule.PlaceHolderInfo.end()) {
7288 ValID &DID = I->second.first;
7289 if (DID.Type == ValID::LocalName) {
7290 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7292 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7295 delete ParserResult;
7300 // Check to make sure that parsing produced a result
7304 // Reset ParserResult variable while saving its value for the result.
7305 Module *Result = ParserResult;
7311 void llvm::GenerateError(const std::string &message, int LineNo) {
7312 if (LineNo == -1) LineNo = LLLgetLineNo();
7313 // TODO: column number in exception
7315 TheParseError->setError(LLLgetFilename(), message, LineNo);
7319 int yyerror(const char *ErrorMsg) {
7320 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7321 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7322 if (yychar != YYEMPTY && yychar != 0) {
7323 errMsg += " while reading token: '";
7324 errMsg += std::string(LLLgetTokenStart(),
7325 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7327 GenerateError(errMsg);