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;
806 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
807 return ConstantInt::get(Tmp);
810 case ValID::ConstFPVal: // Is it a floating point const pool reference?
811 if (!Ty->isFloatingPoint() ||
812 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
813 GenerateError("FP constant invalid for type");
816 // Lexer has no type info, so builds all float and double FP constants
817 // as double. Fix this here. Long double does not need this.
818 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
821 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
825 ConstantFP *tmp = ConstantFP::get(*D.ConstPoolFP);
830 case ValID::ConstNullVal: // Is it a null value?
831 if (!isa<PointerType>(Ty)) {
832 GenerateError("Cannot create a a non pointer null");
835 return ConstantPointerNull::get(cast<PointerType>(Ty));
837 case ValID::ConstUndefVal: // Is it an undef value?
838 return UndefValue::get(Ty);
840 case ValID::ConstZeroVal: // Is it a zero value?
841 return Constant::getNullValue(Ty);
843 case ValID::ConstantVal: // Fully resolved constant?
844 if (D.ConstantValue->getType() != Ty) {
845 GenerateError("Constant expression type different from required type");
848 return D.ConstantValue;
850 case ValID::InlineAsmVal: { // Inline asm expression
851 const PointerType *PTy = dyn_cast<PointerType>(Ty);
852 const FunctionType *FTy =
853 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
854 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
855 GenerateError("Invalid type for asm constraint string");
858 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
859 D.IAD->HasSideEffects);
860 D.destroy(); // Free InlineAsmDescriptor.
864 assert(0 && "Unhandled case!");
868 assert(0 && "Unhandled case!");
872 // getVal - This function is identical to getExistingVal, except that if a
873 // value is not already defined, it "improvises" by creating a placeholder var
874 // that looks and acts just like the requested variable. When the value is
875 // defined later, all uses of the placeholder variable are replaced with the
878 static Value *getVal(const Type *Ty, const ValID &ID) {
879 if (Ty == Type::LabelTy) {
880 GenerateError("Cannot use a basic block here");
884 // See if the value has already been defined.
885 Value *V = getExistingVal(Ty, ID);
887 if (TriggerError) return 0;
889 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
890 GenerateError("Invalid use of a non-first-class type");
894 // If we reached here, we referenced either a symbol that we don't know about
895 // or an id number that hasn't been read yet. We may be referencing something
896 // forward, so just create an entry to be resolved later and get to it...
899 case ValID::GlobalName:
900 case ValID::GlobalID: {
901 const PointerType *PTy = dyn_cast<PointerType>(Ty);
903 GenerateError("Invalid type for reference to global" );
906 const Type* ElTy = PTy->getElementType();
907 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
908 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
910 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
911 (Module*)0, false, PTy->getAddressSpace());
915 V = new Argument(Ty);
918 // Remember where this forward reference came from. FIXME, shouldn't we try
919 // to recycle these things??
920 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
923 if (inFunctionScope())
924 InsertValue(V, CurFun.LateResolveValues);
926 InsertValue(V, CurModule.LateResolveValues);
930 /// defineBBVal - This is a definition of a new basic block with the specified
931 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
932 static BasicBlock *defineBBVal(const ValID &ID) {
933 assert(inFunctionScope() && "Can't get basic block at global scope!");
937 // First, see if this was forward referenced
939 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
940 if (BBI != CurFun.BBForwardRefs.end()) {
942 // The forward declaration could have been inserted anywhere in the
943 // function: insert it into the correct place now.
944 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
945 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
947 // We're about to erase the entry, save the key so we can clean it up.
948 ValID Tmp = BBI->first;
950 // Erase the forward ref from the map as its no longer "forward"
951 CurFun.BBForwardRefs.erase(ID);
953 // The key has been removed from the map but so we don't want to leave
954 // strdup'd memory around so destroy it too.
957 // If its a numbered definition, bump the number and set the BB value.
958 if (ID.Type == ValID::LocalID) {
959 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
963 // We haven't seen this BB before and its first mention is a definition.
964 // Just create it and return it.
965 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
966 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
967 if (ID.Type == ValID::LocalID) {
968 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
977 /// getBBVal - get an existing BB value or create a forward reference for it.
979 static BasicBlock *getBBVal(const ValID &ID) {
980 assert(inFunctionScope() && "Can't get basic block at global scope!");
984 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
985 if (BBI != CurFun.BBForwardRefs.end()) {
987 } if (ID.Type == ValID::LocalName) {
988 std::string Name = ID.getName();
989 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
991 if (N->getType()->getTypeID() == Type::LabelTyID)
992 BB = cast<BasicBlock>(N);
994 GenerateError("Reference to label '" + Name + "' is actually of type '"+
995 N->getType()->getDescription() + "'");
997 } else if (ID.Type == ValID::LocalID) {
998 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
999 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
1000 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
1002 GenerateError("Reference to label '%" + utostr(ID.Num) +
1003 "' is actually of type '"+
1004 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
1007 GenerateError("Illegal label reference " + ID.getName());
1011 // If its already been defined, return it now.
1013 ID.destroy(); // Free strdup'd memory.
1017 // Otherwise, this block has not been seen before, create it.
1019 if (ID.Type == ValID::LocalName)
1020 Name = ID.getName();
1021 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1023 // Insert it in the forward refs map.
1024 CurFun.BBForwardRefs[ID] = BB;
1030 //===----------------------------------------------------------------------===//
1031 // Code to handle forward references in instructions
1032 //===----------------------------------------------------------------------===//
1034 // This code handles the late binding needed with statements that reference
1035 // values not defined yet... for example, a forward branch, or the PHI node for
1038 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1039 // and back patchs after we are done.
1042 // ResolveDefinitions - If we could not resolve some defs at parsing
1043 // time (forward branches, phi functions for loops, etc...) resolve the
1047 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1048 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1049 while (!LateResolvers.empty()) {
1050 Value *V = LateResolvers.back();
1051 LateResolvers.pop_back();
1053 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1054 CurModule.PlaceHolderInfo.find(V);
1055 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1057 ValID &DID = PHI->second.first;
1059 Value *TheRealValue = getExistingVal(V->getType(), DID);
1063 V->replaceAllUsesWith(TheRealValue);
1065 CurModule.PlaceHolderInfo.erase(PHI);
1066 } else if (FutureLateResolvers) {
1067 // Functions have their unresolved items forwarded to the module late
1069 InsertValue(V, *FutureLateResolvers);
1071 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1072 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1073 "' of type '" + V->getType()->getDescription() + "'",
1074 PHI->second.second);
1077 GenerateError("Reference to an invalid definition: #" +
1078 itostr(DID.Num) + " of type '" +
1079 V->getType()->getDescription() + "'",
1080 PHI->second.second);
1085 LateResolvers.clear();
1088 // ResolveTypeTo - A brand new type was just declared. This means that (if
1089 // name is not null) things referencing Name can be resolved. Otherwise, things
1090 // refering to the number can be resolved. Do this now.
1092 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1095 D = ValID::createLocalName(*Name);
1097 D = ValID::createLocalID(CurModule.Types.size());
1099 std::map<ValID, PATypeHolder>::iterator I =
1100 CurModule.LateResolveTypes.find(D);
1101 if (I != CurModule.LateResolveTypes.end()) {
1102 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1104 CurModule.LateResolveTypes.erase(I);
1109 // setValueName - Set the specified value to the name given. The name may be
1110 // null potentially, in which case this is a noop. The string passed in is
1111 // assumed to be a malloc'd string buffer, and is free'd by this function.
1113 static void setValueName(Value *V, std::string *NameStr) {
1114 if (!NameStr) return;
1115 std::string Name(*NameStr); // Copy string
1116 delete NameStr; // Free old string
1118 if (V->getType() == Type::VoidTy) {
1119 GenerateError("Can't assign name '" + Name+"' to value with void type");
1123 assert(inFunctionScope() && "Must be in function scope!");
1124 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1125 if (ST.lookup(Name)) {
1126 GenerateError("Redefinition of value '" + Name + "' of type '" +
1127 V->getType()->getDescription() + "'");
1135 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1136 /// this is a declaration, otherwise it is a definition.
1137 static GlobalVariable *
1138 ParseGlobalVariable(std::string *NameStr,
1139 GlobalValue::LinkageTypes Linkage,
1140 GlobalValue::VisibilityTypes Visibility,
1141 bool isConstantGlobal, const Type *Ty,
1142 Constant *Initializer, bool IsThreadLocal,
1143 unsigned AddressSpace = 0) {
1144 if (isa<FunctionType>(Ty)) {
1145 GenerateError("Cannot declare global vars of function type");
1148 if (Ty == Type::LabelTy) {
1149 GenerateError("Cannot declare global vars of label type");
1153 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1157 Name = *NameStr; // Copy string
1158 delete NameStr; // Free old string
1161 // See if this global value was forward referenced. If so, recycle the
1164 if (!Name.empty()) {
1165 ID = ValID::createGlobalName(Name);
1167 ID = ValID::createGlobalID(CurModule.Values.size());
1170 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1171 // Move the global to the end of the list, from whereever it was
1172 // previously inserted.
1173 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1174 CurModule.CurrentModule->getGlobalList().remove(GV);
1175 CurModule.CurrentModule->getGlobalList().push_back(GV);
1176 GV->setInitializer(Initializer);
1177 GV->setLinkage(Linkage);
1178 GV->setVisibility(Visibility);
1179 GV->setConstant(isConstantGlobal);
1180 GV->setThreadLocal(IsThreadLocal);
1181 InsertValue(GV, CurModule.Values);
1188 // If this global has a name
1189 if (!Name.empty()) {
1190 // if the global we're parsing has an initializer (is a definition) and
1191 // has external linkage.
1192 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1193 // If there is already a global with external linkage with this name
1194 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1195 // If we allow this GVar to get created, it will be renamed in the
1196 // symbol table because it conflicts with an existing GVar. We can't
1197 // allow redefinition of GVars whose linking indicates that their name
1198 // must stay the same. Issue the error.
1199 GenerateError("Redefinition of global variable named '" + Name +
1200 "' of type '" + Ty->getDescription() + "'");
1205 // Otherwise there is no existing GV to use, create one now.
1206 GlobalVariable *GV =
1207 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1208 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1209 GV->setVisibility(Visibility);
1210 InsertValue(GV, CurModule.Values);
1214 // setTypeName - Set the specified type to the name given. The name may be
1215 // null potentially, in which case this is a noop. The string passed in is
1216 // assumed to be a malloc'd string buffer, and is freed by this function.
1218 // This function returns true if the type has already been defined, but is
1219 // allowed to be redefined in the specified context. If the name is a new name
1220 // for the type plane, it is inserted and false is returned.
1221 static bool setTypeName(const Type *T, std::string *NameStr) {
1222 assert(!inFunctionScope() && "Can't give types function-local names!");
1223 if (NameStr == 0) return false;
1225 std::string Name(*NameStr); // Copy string
1226 delete NameStr; // Free old string
1228 // We don't allow assigning names to void type
1229 if (T == Type::VoidTy) {
1230 GenerateError("Can't assign name '" + Name + "' to the void type");
1234 // Set the type name, checking for conflicts as we do so.
1235 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1237 if (AlreadyExists) { // Inserting a name that is already defined???
1238 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1239 assert(Existing && "Conflict but no matching type?!");
1241 // There is only one case where this is allowed: when we are refining an
1242 // opaque type. In this case, Existing will be an opaque type.
1243 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1244 // We ARE replacing an opaque type!
1245 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1249 // Otherwise, this is an attempt to redefine a type. That's okay if
1250 // the redefinition is identical to the original. This will be so if
1251 // Existing and T point to the same Type object. In this one case we
1252 // allow the equivalent redefinition.
1253 if (Existing == T) return true; // Yes, it's equal.
1255 // Any other kind of (non-equivalent) redefinition is an error.
1256 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1257 T->getDescription() + "'");
1263 //===----------------------------------------------------------------------===//
1264 // Code for handling upreferences in type names...
1267 // TypeContains - Returns true if Ty directly contains E in it.
1269 static bool TypeContains(const Type *Ty, const Type *E) {
1270 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1271 E) != Ty->subtype_end();
1275 struct UpRefRecord {
1276 // NestingLevel - The number of nesting levels that need to be popped before
1277 // this type is resolved.
1278 unsigned NestingLevel;
1280 // LastContainedTy - This is the type at the current binding level for the
1281 // type. Every time we reduce the nesting level, this gets updated.
1282 const Type *LastContainedTy;
1284 // UpRefTy - This is the actual opaque type that the upreference is
1285 // represented with.
1286 OpaqueType *UpRefTy;
1288 UpRefRecord(unsigned NL, OpaqueType *URTy)
1289 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1293 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1294 static std::vector<UpRefRecord> UpRefs;
1296 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1297 /// called. It loops through the UpRefs vector, which is a list of the
1298 /// currently active types. For each type, if the up reference is contained in
1299 /// the newly completed type, we decrement the level count. When the level
1300 /// count reaches zero, the upreferenced type is the type that is passed in:
1301 /// thus we can complete the cycle.
1303 static PATypeHolder HandleUpRefs(const Type *ty) {
1304 // If Ty isn't abstract, or if there are no up-references in it, then there is
1305 // nothing to resolve here.
1306 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1308 PATypeHolder Ty(ty);
1309 UR_OUT("Type '" << Ty->getDescription() <<
1310 "' newly formed. Resolving upreferences.\n" <<
1311 UpRefs.size() << " upreferences active!\n");
1313 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1314 // to zero), we resolve them all together before we resolve them to Ty. At
1315 // the end of the loop, if there is anything to resolve to Ty, it will be in
1317 OpaqueType *TypeToResolve = 0;
1319 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1320 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1321 << UpRefs[i].second->getDescription() << ") = "
1322 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1323 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1324 // Decrement level of upreference
1325 unsigned Level = --UpRefs[i].NestingLevel;
1326 UpRefs[i].LastContainedTy = Ty;
1327 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1328 if (Level == 0) { // Upreference should be resolved!
1329 if (!TypeToResolve) {
1330 TypeToResolve = UpRefs[i].UpRefTy;
1332 UR_OUT(" * Resolving upreference for "
1333 << UpRefs[i].second->getDescription() << "\n";
1334 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1335 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1336 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1337 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1339 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1340 --i; // Do not skip the next element...
1345 if (TypeToResolve) {
1346 UR_OUT(" * Resolving upreference for "
1347 << UpRefs[i].second->getDescription() << "\n";
1348 std::string OldName = TypeToResolve->getDescription());
1349 TypeToResolve->refineAbstractTypeTo(Ty);
1355 //===----------------------------------------------------------------------===//
1356 // RunVMAsmParser - Define an interface to this parser
1357 //===----------------------------------------------------------------------===//
1359 static Module* RunParser(Module * M);
1361 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1363 Module *M = RunParser(new Module(LLLgetFilename()));
1370 /* Enabling traces. */
1375 /* Enabling verbose error messages. */
1376 #ifdef YYERROR_VERBOSE
1377 # undef YYERROR_VERBOSE
1378 # define YYERROR_VERBOSE 1
1380 # define YYERROR_VERBOSE 0
1383 /* Enabling the token table. */
1384 #ifndef YYTOKEN_TABLE
1385 # define YYTOKEN_TABLE 0
1388 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1389 typedef union YYSTYPE
1390 #line 986 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
1392 llvm::Module *ModuleVal;
1393 llvm::Function *FunctionVal;
1394 llvm::BasicBlock *BasicBlockVal;
1395 llvm::TerminatorInst *TermInstVal;
1396 llvm::Instruction *InstVal;
1397 llvm::Constant *ConstVal;
1399 const llvm::Type *PrimType;
1400 std::list<llvm::PATypeHolder> *TypeList;
1401 llvm::PATypeHolder *TypeVal;
1402 llvm::Value *ValueVal;
1403 std::vector<llvm::Value*> *ValueList;
1404 std::vector<unsigned> *ConstantList;
1405 llvm::ArgListType *ArgList;
1406 llvm::TypeWithAttrs TypeWithAttrs;
1407 llvm::TypeWithAttrsList *TypeWithAttrsList;
1408 llvm::ParamList *ParamList;
1410 // Represent the RHS of PHI node
1411 std::list<std::pair<llvm::Value*,
1412 llvm::BasicBlock*> > *PHIList;
1413 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1414 std::vector<llvm::Constant*> *ConstVector;
1416 llvm::GlobalValue::LinkageTypes Linkage;
1417 llvm::GlobalValue::VisibilityTypes Visibility;
1418 llvm::Attributes Attributes;
1419 llvm::APInt *APIntVal;
1424 llvm::APFloat *FPVal;
1427 std::string *StrVal; // This memory must be deleted
1428 llvm::ValID ValIDVal;
1430 llvm::Instruction::BinaryOps BinaryOpVal;
1431 llvm::Instruction::TermOps TermOpVal;
1432 llvm::Instruction::MemoryOps MemOpVal;
1433 llvm::Instruction::CastOps CastOpVal;
1434 llvm::Instruction::OtherOps OtherOpVal;
1435 llvm::ICmpInst::Predicate IPredicate;
1436 llvm::FCmpInst::Predicate FPredicate;
1438 /* Line 187 of yacc.c. */
1439 #line 1440 "llvmAsmParser.tab.c"
1441 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1442 # define YYSTYPE_IS_DECLARED 1
1443 # define YYSTYPE_IS_TRIVIAL 1
1448 /* Copy the second part of user declarations. */
1451 /* Line 216 of yacc.c. */
1452 #line 1453 "llvmAsmParser.tab.c"
1459 typedef YYTYPE_UINT8 yytype_uint8;
1461 typedef unsigned char yytype_uint8;
1465 typedef YYTYPE_INT8 yytype_int8;
1466 #elif (defined __STDC__ || defined __C99__FUNC__ \
1467 || defined __cplusplus || defined _MSC_VER)
1468 typedef signed char yytype_int8;
1470 typedef short int yytype_int8;
1473 #ifdef YYTYPE_UINT16
1474 typedef YYTYPE_UINT16 yytype_uint16;
1476 typedef unsigned short int yytype_uint16;
1480 typedef YYTYPE_INT16 yytype_int16;
1482 typedef short int yytype_int16;
1486 # ifdef __SIZE_TYPE__
1487 # define YYSIZE_T __SIZE_TYPE__
1488 # elif defined size_t
1489 # define YYSIZE_T size_t
1490 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1491 || defined __cplusplus || defined _MSC_VER)
1492 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1493 # define YYSIZE_T size_t
1495 # define YYSIZE_T unsigned int
1499 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1504 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1505 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1509 # define YY_(msgid) msgid
1513 /* Suppress unused-variable warnings by "using" E. */
1514 #if ! defined lint || defined __GNUC__
1515 # define YYUSE(e) ((void) (e))
1517 # define YYUSE(e) /* empty */
1520 /* Identity function, used to suppress warnings about constant conditions. */
1522 # define YYID(n) (n)
1524 #if (defined __STDC__ || defined __C99__FUNC__ \
1525 || defined __cplusplus || defined _MSC_VER)
1538 #if ! defined yyoverflow || YYERROR_VERBOSE
1540 /* The parser invokes alloca or malloc; define the necessary symbols. */
1542 # ifdef YYSTACK_USE_ALLOCA
1543 # if YYSTACK_USE_ALLOCA
1545 # define YYSTACK_ALLOC __builtin_alloca
1546 # elif defined __BUILTIN_VA_ARG_INCR
1547 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1549 # define YYSTACK_ALLOC __alloca
1550 # elif defined _MSC_VER
1551 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1552 # define alloca _alloca
1554 # define YYSTACK_ALLOC alloca
1555 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1556 || defined __cplusplus || defined _MSC_VER)
1557 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1559 # define _STDLIB_H 1
1566 # ifdef YYSTACK_ALLOC
1567 /* Pacify GCC's `empty if-body' warning. */
1568 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1569 # ifndef YYSTACK_ALLOC_MAXIMUM
1570 /* The OS might guarantee only one guard page at the bottom of the stack,
1571 and a page size can be as small as 4096 bytes. So we cannot safely
1572 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1573 to allow for a few compiler-allocated temporary stack slots. */
1574 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1577 # define YYSTACK_ALLOC YYMALLOC
1578 # define YYSTACK_FREE YYFREE
1579 # ifndef YYSTACK_ALLOC_MAXIMUM
1580 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1582 # if (defined __cplusplus && ! defined _STDLIB_H \
1583 && ! ((defined YYMALLOC || defined malloc) \
1584 && (defined YYFREE || defined free)))
1585 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1587 # define _STDLIB_H 1
1591 # define YYMALLOC malloc
1592 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1593 || defined __cplusplus || defined _MSC_VER)
1594 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1598 # define YYFREE free
1599 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1600 || defined __cplusplus || defined _MSC_VER)
1601 void free (void *); /* INFRINGES ON USER NAME SPACE */
1605 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1608 #if (! defined yyoverflow \
1609 && (! defined __cplusplus \
1610 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1612 /* A type that is properly aligned for any stack member. */
1619 /* The size of the maximum gap between one aligned stack and the next. */
1620 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1622 /* The size of an array large to enough to hold all stacks, each with
1624 # define YYSTACK_BYTES(N) \
1625 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1626 + YYSTACK_GAP_MAXIMUM)
1628 /* Copy COUNT objects from FROM to TO. The source and destination do
1631 # if defined __GNUC__ && 1 < __GNUC__
1632 # define YYCOPY(To, From, Count) \
1633 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1635 # define YYCOPY(To, From, Count) \
1639 for (yyi = 0; yyi < (Count); yyi++) \
1640 (To)[yyi] = (From)[yyi]; \
1646 /* Relocate STACK from its old location to the new one. The
1647 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1648 elements in the stack, and YYPTR gives the new location of the
1649 stack. Advance YYPTR to a properly aligned location for the next
1651 # define YYSTACK_RELOCATE(Stack) \
1654 YYSIZE_T yynewbytes; \
1655 YYCOPY (&yyptr->Stack, Stack, yysize); \
1656 Stack = &yyptr->Stack; \
1657 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1658 yyptr += yynewbytes / sizeof (*yyptr); \
1664 /* YYFINAL -- State number of the termination state. */
1666 /* YYLAST -- Last index in YYTABLE. */
1669 /* YYNTOKENS -- Number of terminals. */
1670 #define YYNTOKENS 173
1671 /* YYNNTS -- Number of nonterminals. */
1673 /* YYNRULES -- Number of rules. */
1674 #define YYNRULES 348
1675 /* YYNRULES -- Number of states. */
1676 #define YYNSTATES 708
1678 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1679 #define YYUNDEFTOK 2
1680 #define YYMAXUTOK 413
1682 #define YYTRANSLATE(YYX) \
1683 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1685 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1686 static const yytype_uint8 yytranslate[] =
1688 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1692 159, 160, 163, 2, 162, 2, 2, 2, 2, 2,
1693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1694 168, 161, 169, 2, 2, 2, 2, 2, 2, 2,
1695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1697 2, 165, 164, 167, 2, 2, 2, 2, 2, 172,
1698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1700 166, 2, 2, 170, 2, 171, 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, 2, 2, 2, 2,
1709 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1710 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1711 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1712 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1713 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1714 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1715 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1716 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1717 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1718 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1719 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1720 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1721 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1722 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1723 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1724 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1725 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1726 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1727 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1728 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1733 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1735 static const yytype_uint16 yyprhs[] =
1737 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1738 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1739 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1740 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1741 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1742 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1743 118, 123, 124, 127, 128, 131, 133, 135, 137, 138,
1744 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
1745 160, 162, 164, 166, 167, 169, 171, 172, 174, 176,
1746 178, 180, 181, 183, 185, 186, 188, 190, 192, 194,
1747 196, 199, 201, 203, 205, 207, 209, 211, 213, 215,
1748 217, 220, 221, 224, 226, 228, 230, 231, 234, 236,
1749 238, 240, 242, 244, 246, 248, 250, 252, 254, 255,
1750 258, 259, 262, 263, 266, 267, 271, 274, 275, 277,
1751 278, 282, 284, 287, 289, 291, 293, 295, 297, 299,
1752 301, 303, 305, 309, 311, 314, 320, 326, 332, 338,
1753 342, 345, 351, 356, 359, 361, 363, 365, 369, 371,
1754 375, 377, 378, 380, 384, 389, 393, 397, 402, 407,
1755 411, 418, 424, 427, 430, 433, 436, 439, 442, 445,
1756 448, 451, 454, 457, 460, 467, 473, 482, 489, 496,
1757 504, 512, 520, 528, 535, 544, 553, 559, 567, 571,
1758 573, 575, 577, 579, 580, 583, 590, 592, 593, 595,
1759 598, 599, 603, 604, 608, 612, 616, 620, 621, 630,
1760 631, 641, 642, 652, 658, 661, 665, 667, 671, 675,
1761 679, 683, 685, 686, 692, 696, 698, 702, 704, 705,
1762 717, 719, 721, 726, 728, 730, 733, 737, 738, 740,
1763 742, 744, 746, 748, 750, 752, 754, 756, 758, 760,
1764 764, 768, 771, 774, 778, 781, 787, 792, 794, 800,
1765 802, 804, 806, 808, 810, 812, 815, 817, 821, 824,
1766 827, 831, 835, 838, 839, 841, 844, 847, 851, 861,
1767 871, 880, 896, 898, 900, 907, 913, 916, 919, 926,
1768 934, 939, 944, 951, 958, 959, 960, 964, 967, 971,
1769 974, 976, 982, 988, 995, 1002, 1009, 1016, 1021, 1028,
1770 1033, 1038, 1045, 1052, 1055, 1065, 1067, 1069, 1070, 1074,
1771 1081, 1085, 1092, 1095, 1101, 1109, 1115, 1120, 1125
1774 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1775 static const yytype_int16 yyrhs[] =
1777 220, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1778 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1779 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1780 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1781 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1782 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1783 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1784 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1785 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1786 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1787 -1, 102, -1, 103, -1, 26, -1, 27, -1, 19,
1788 -1, 22, -1, 24, -1, 179, -1, -1, 55, 159,
1789 4, 160, -1, -1, 179, 161, -1, -1, 7, 161,
1790 -1, 20, -1, 23, -1, 186, -1, -1, 184, 161,
1791 -1, 42, -1, 44, -1, 43, -1, 45, -1, 47,
1792 -1, 49, -1, 46, -1, 48, -1, 51, -1, -1,
1793 156, -1, 157, -1, 158, -1, -1, 46, -1, 48,
1794 -1, -1, 42, -1, 43, -1, 44, -1, 47, -1,
1795 -1, 44, -1, 42, -1, -1, 63, -1, 64, -1,
1796 65, -1, 66, -1, 67, -1, 62, 4, -1, 142,
1797 -1, 121, -1, 141, -1, 122, -1, 144, -1, 145,
1798 -1, 147, -1, 148, -1, 149, -1, 54, 4, -1,
1799 -1, 195, 194, -1, 144, -1, 142, -1, 141, -1,
1800 -1, 197, 196, -1, 143, -1, 146, -1, 144, -1,
1801 142, -1, 141, -1, 150, -1, 151, -1, 154, -1,
1802 155, -1, 153, -1, -1, 199, 198, -1, -1, 152,
1803 22, -1, -1, 54, 4, -1, -1, 162, 54, 4,
1804 -1, 34, 22, -1, -1, 203, -1, -1, 162, 206,
1805 205, -1, 203, -1, 54, 4, -1, 11, -1, 12,
1806 -1, 13, -1, 16, -1, 15, -1, 14, -1, 17,
1807 -1, 50, -1, 207, -1, 208, 181, 163, -1, 242,
1808 -1, 164, 4, -1, 208, 159, 212, 160, 199, -1,
1809 10, 159, 212, 160, 199, -1, 165, 4, 166, 208,
1810 167, -1, 168, 4, 166, 208, 169, -1, 170, 213,
1811 171, -1, 170, 171, -1, 168, 170, 213, 171, 169,
1812 -1, 168, 170, 171, 169, -1, 208, 195, -1, 208,
1813 -1, 10, -1, 209, -1, 211, 162, 209, -1, 211,
1814 -1, 211, 162, 39, -1, 39, -1, -1, 208, -1,
1815 213, 162, 208, -1, 208, 165, 216, 167, -1, 208,
1816 165, 167, -1, 208, 172, 22, -1, 208, 168, 216,
1817 169, -1, 208, 170, 216, 171, -1, 208, 170, 171,
1818 -1, 208, 168, 170, 216, 171, 169, -1, 208, 168,
1819 170, 171, 169, -1, 208, 40, -1, 208, 41, -1,
1820 208, 242, -1, 208, 215, -1, 208, 25, -1, 208,
1821 3, -1, 208, 5, -1, 208, 4, -1, 208, 6,
1822 -1, 208, 26, -1, 208, 27, -1, 208, 9, -1,
1823 176, 159, 214, 38, 208, 160, -1, 119, 159, 214,
1824 254, 160, -1, 133, 159, 214, 162, 214, 162, 214,
1825 160, -1, 174, 159, 214, 162, 214, 160, -1, 175,
1826 159, 214, 162, 214, 160, -1, 90, 177, 159, 214,
1827 162, 214, 160, -1, 91, 178, 159, 214, 162, 214,
1828 160, -1, 92, 177, 159, 214, 162, 214, 160, -1,
1829 93, 178, 159, 214, 162, 214, 160, -1, 135, 159,
1830 214, 162, 214, 160, -1, 136, 159, 214, 162, 214,
1831 162, 214, 160, -1, 137, 159, 214, 162, 214, 162,
1832 214, 160, -1, 139, 159, 214, 255, 160, -1, 140,
1833 159, 214, 162, 214, 255, 160, -1, 216, 162, 214,
1834 -1, 214, -1, 32, -1, 33, -1, 37, -1, -1,
1835 210, 242, -1, 125, 159, 219, 38, 208, 160, -1,
1836 221, -1, -1, 222, -1, 221, 222, -1, -1, 31,
1837 223, 238, -1, -1, 30, 224, 239, -1, 60, 59,
1838 228, -1, 182, 18, 208, -1, 182, 18, 10, -1,
1839 -1, 185, 189, 218, 217, 214, 181, 225, 205, -1,
1840 -1, 185, 187, 189, 218, 217, 214, 181, 226, 205,
1841 -1, -1, 185, 188, 189, 218, 217, 208, 181, 227,
1842 205, -1, 185, 189, 35, 192, 219, -1, 52, 229,
1843 -1, 56, 161, 230, -1, 22, -1, 53, 161, 22,
1844 -1, 68, 161, 22, -1, 165, 231, 167, -1, 231,
1845 162, 22, -1, 22, -1, -1, 232, 162, 208, 195,
1846 180, -1, 208, 195, 180, -1, 232, -1, 232, 162,
1847 39, -1, 39, -1, -1, 193, 197, 210, 184, 159,
1848 233, 160, 199, 204, 201, 200, -1, 28, -1, 170,
1849 -1, 191, 189, 234, 235, -1, 29, -1, 171, -1,
1850 246, 237, -1, 190, 189, 234, -1, -1, 61, -1,
1851 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1852 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1853 168, 216, 169, -1, 165, 216, 167, -1, 165, 167,
1854 -1, 172, 22, -1, 170, 216, 171, -1, 170, 171,
1855 -1, 168, 170, 216, 171, 169, -1, 168, 170, 171,
1856 169, -1, 215, -1, 59, 240, 22, 162, 22, -1,
1857 7, -1, 8, -1, 179, -1, 184, -1, 242, -1,
1858 241, -1, 208, 243, -1, 244, -1, 245, 162, 244,
1859 -1, 246, 247, -1, 236, 247, -1, 248, 182, 249,
1860 -1, 248, 183, 249, -1, 248, 251, -1, -1, 21,
1861 -1, 69, 245, -1, 69, 10, -1, 70, 17, 243,
1862 -1, 70, 11, 243, 162, 17, 243, 162, 17, 243,
1863 -1, 71, 11, 243, 162, 17, 243, 165, 250, 167,
1864 -1, 71, 11, 243, 162, 17, 243, 165, 167, -1,
1865 72, 193, 197, 210, 243, 159, 253, 160, 199, 38,
1866 17, 243, 73, 17, 243, -1, 73, -1, 74, -1,
1867 250, 11, 241, 162, 17, 243, -1, 11, 241, 162,
1868 17, 243, -1, 182, 257, -1, 183, 257, -1, 208,
1869 165, 243, 162, 243, 167, -1, 252, 162, 165, 243,
1870 162, 243, 167, -1, 208, 195, 243, 195, -1, 17,
1871 195, 243, 195, -1, 253, 162, 208, 195, 243, 195,
1872 -1, 253, 162, 17, 195, 243, 195, -1, -1, -1,
1873 254, 162, 244, -1, 162, 4, -1, 255, 162, 4,
1874 -1, 58, 57, -1, 57, -1, 174, 208, 243, 162,
1875 243, -1, 175, 208, 243, 162, 243, -1, 90, 177,
1876 208, 243, 162, 243, -1, 91, 178, 208, 243, 162,
1877 243, -1, 92, 177, 208, 243, 162, 243, -1, 93,
1878 178, 208, 243, 162, 243, -1, 176, 244, 38, 208,
1879 -1, 133, 244, 162, 244, 162, 244, -1, 134, 244,
1880 162, 208, -1, 135, 244, 162, 244, -1, 136, 244,
1881 162, 244, 162, 244, -1, 137, 244, 162, 244, 162,
1882 244, -1, 132, 252, -1, 256, 193, 197, 210, 243,
1883 159, 253, 160, 199, -1, 259, -1, 36, -1, -1,
1884 114, 208, 202, -1, 114, 208, 162, 11, 243, 202,
1885 -1, 115, 208, 202, -1, 115, 208, 162, 11, 243,
1886 202, -1, 116, 244, -1, 258, 117, 208, 243, 202,
1887 -1, 258, 118, 244, 162, 208, 243, 202, -1, 138,
1888 208, 243, 162, 4, -1, 119, 208, 243, 254, -1,
1889 139, 208, 243, 255, -1, 140, 208, 243, 162, 208,
1893 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1894 static const yytype_uint16 yyrline[] =
1896 0, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152,
1897 1152, 1153, 1153, 1153, 1153, 1153, 1153, 1154, 1154, 1154,
1898 1154, 1154, 1154, 1155, 1155, 1155, 1155, 1155, 1155, 1158,
1899 1158, 1159, 1159, 1160, 1160, 1161, 1161, 1162, 1162, 1166,
1900 1166, 1167, 1167, 1168, 1168, 1169, 1169, 1170, 1170, 1171,
1901 1171, 1172, 1172, 1173, 1174, 1177, 1177, 1177, 1178, 1178,
1902 1180, 1181, 1185, 1189, 1194, 1200, 1200, 1202, 1203, 1208,
1903 1214, 1215, 1216, 1217, 1218, 1219, 1223, 1224, 1225, 1229,
1904 1230, 1231, 1232, 1236, 1237, 1238, 1242, 1243, 1244, 1245,
1905 1246, 1250, 1251, 1252, 1255, 1256, 1257, 1258, 1259, 1260,
1906 1261, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276,
1907 1277, 1281, 1282, 1287, 1288, 1289, 1292, 1293, 1299, 1300,
1908 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1311, 1312,
1909 1318, 1319, 1326, 1327, 1333, 1334, 1343, 1351, 1352, 1357,
1910 1358, 1359, 1364, 1377, 1377, 1377, 1377, 1377, 1377, 1377,
1911 1380, 1384, 1388, 1395, 1400, 1408, 1443, 1474, 1479, 1489,
1912 1499, 1503, 1513, 1520, 1529, 1536, 1541, 1546, 1553, 1554,
1913 1561, 1568, 1576, 1582, 1594, 1622, 1638, 1665, 1693, 1719,
1914 1739, 1765, 1785, 1797, 1804, 1870, 1880, 1890, 1901, 1914,
1915 1925, 1939, 1946, 1953, 1971, 1983, 2004, 2012, 2018, 2029,
1916 2034, 2039, 2044, 2049, 2055, 2061, 2067, 2075, 2086, 2090,
1917 2098, 2098, 2101, 2101, 2104, 2116, 2137, 2142, 2150, 2151,
1918 2155, 2155, 2159, 2159, 2162, 2165, 2189, 2201, 2200, 2212,
1919 2211, 2221, 2220, 2231, 2271, 2274, 2280, 2290, 2294, 2299,
1920 2301, 2306, 2311, 2320, 2330, 2341, 2345, 2354, 2363, 2368,
1921 2517, 2517, 2519, 2528, 2528, 2530, 2535, 2547, 2551, 2556,
1922 2560, 2564, 2569, 2574, 2578, 2582, 2586, 2590, 2594, 2598,
1923 2620, 2642, 2648, 2661, 2673, 2678, 2690, 2696, 2700, 2710,
1924 2714, 2718, 2723, 2730, 2730, 2736, 2745, 2750, 2755, 2759,
1925 2768, 2777, 2790, 2799, 2803, 2811, 2831, 2835, 2840, 2851,
1926 2870, 2879, 2983, 2987, 2994, 3005, 3018, 3027, 3040, 3051,
1927 3061, 3072, 3080, 3090, 3097, 3100, 3101, 3109, 3115, 3124,
1928 3128, 3133, 3149, 3166, 3178, 3190, 3204, 3218, 3230, 3251,
1929 3258, 3264, 3270, 3276, 3291, 3401, 3406, 3410, 3417, 3424,
1930 3434, 3441, 3451, 3459, 3473, 3490, 3504, 3519, 3534
1934 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1935 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1936 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1937 static const char *const yytname[] =
1939 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1940 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1941 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1942 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1943 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1944 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1945 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1946 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1947 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1948 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1949 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1950 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1951 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1952 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1953 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1954 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1955 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1956 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1957 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1958 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1959 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1960 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1961 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1962 "READNONE", "READONLY", "GC", "OPTSIZE", "NOINLINE", "ALWAYSINLINE",
1963 "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'",
1964 "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'",
1965 "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates",
1966 "FPredicates", "LocalName", "OptLocalName", "OptAddrSpace",
1967 "OptLocalAssign", "LocalNumber", "GlobalName", "OptGlobalAssign",
1968 "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage",
1969 "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage",
1970 "AliasLinkage", "OptCallingConv", "Attribute", "OptAttributes",
1971 "RetAttr", "OptRetAttrs", "FuncAttr", "OptFuncAttrs", "OptGC",
1972 "OptAlign", "OptCAlign", "SectionString", "OptSection",
1973 "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types",
1974 "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI",
1975 "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal",
1976 "AliaseeRef", "Module", "DefinitionList", "Definition", "@1", "@2", "@3",
1977 "@4", "@5", "AsmBlock", "TargetDefinition", "LibrariesDefinition",
1978 "LibList", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1979 "FunctionHeader", "END", "Function", "FunctionProto", "OptSideEffect",
1980 "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal",
1981 "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1982 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ParamList",
1983 "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1984 "OptVolatile", "MemoryInst", 0
1989 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1991 static const yytype_uint16 yytoknum[] =
1993 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1994 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1995 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1996 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1997 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1998 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1999 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2000 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2001 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2002 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2003 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
2004 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
2005 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2006 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2007 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2008 405, 406, 407, 408, 409, 410, 411, 412, 413, 40,
2009 41, 61, 44, 42, 92, 91, 120, 93, 60, 62,
2014 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2015 static const yytype_uint16 yyr1[] =
2017 0, 173, 174, 174, 174, 174, 174, 174, 174, 174,
2018 174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
2019 176, 176, 176, 176, 176, 176, 176, 176, 176, 177,
2020 177, 177, 177, 177, 177, 177, 177, 177, 177, 178,
2021 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
2022 178, 178, 178, 178, 178, 179, 179, 179, 180, 180,
2023 181, 181, 182, 182, 183, 184, 184, 185, 185, 186,
2024 187, 187, 187, 187, 187, 187, 188, 188, 188, 189,
2025 189, 189, 189, 190, 190, 190, 191, 191, 191, 191,
2026 191, 192, 192, 192, 193, 193, 193, 193, 193, 193,
2027 193, 194, 194, 194, 194, 194, 194, 194, 194, 194,
2028 194, 195, 195, 196, 196, 196, 197, 197, 198, 198,
2029 198, 198, 198, 198, 198, 198, 198, 198, 199, 199,
2030 200, 200, 201, 201, 202, 202, 203, 204, 204, 205,
2031 205, 206, 206, 207, 207, 207, 207, 207, 207, 207,
2032 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
2033 208, 208, 208, 209, 210, 210, 211, 211, 212, 212,
2034 212, 212, 213, 213, 214, 214, 214, 214, 214, 214,
2035 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2036 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
2037 215, 215, 215, 215, 215, 215, 215, 215, 216, 216,
2038 217, 217, 218, 218, 219, 219, 220, 220, 221, 221,
2039 223, 222, 224, 222, 222, 222, 222, 225, 222, 226,
2040 222, 227, 222, 222, 222, 222, 228, 229, 229, 230,
2041 231, 231, 231, 232, 232, 233, 233, 233, 233, 234,
2042 235, 235, 236, 237, 237, 238, 239, 240, 240, 241,
2043 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
2044 241, 241, 241, 241, 241, 241, 241, 241, 241, 242,
2045 242, 242, 242, 243, 243, 244, 245, 245, 246, 246,
2046 247, 247, 248, 248, 248, 249, 249, 249, 249, 249,
2047 249, 249, 249, 249, 250, 250, 251, 251, 252, 252,
2048 253, 253, 253, 253, 253, 254, 254, 255, 255, 256,
2049 256, 257, 257, 257, 257, 257, 257, 257, 257, 257,
2050 257, 257, 257, 257, 257, 257, 258, 258, 259, 259,
2051 259, 259, 259, 259, 259, 259, 259, 259, 259
2054 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2055 static const yytype_uint8 yyr2[] =
2057 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2058 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2059 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2060 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2061 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2062 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2063 4, 0, 2, 0, 2, 1, 1, 1, 0, 2,
2064 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2065 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
2066 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
2067 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2068 2, 0, 2, 1, 1, 1, 0, 2, 1, 1,
2069 1, 1, 1, 1, 1, 1, 1, 1, 0, 2,
2070 0, 2, 0, 2, 0, 3, 2, 0, 1, 0,
2071 3, 1, 2, 1, 1, 1, 1, 1, 1, 1,
2072 1, 1, 3, 1, 2, 5, 5, 5, 5, 3,
2073 2, 5, 4, 2, 1, 1, 1, 3, 1, 3,
2074 1, 0, 1, 3, 4, 3, 3, 4, 4, 3,
2075 6, 5, 2, 2, 2, 2, 2, 2, 2, 2,
2076 2, 2, 2, 2, 6, 5, 8, 6, 6, 7,
2077 7, 7, 7, 6, 8, 8, 5, 7, 3, 1,
2078 1, 1, 1, 0, 2, 6, 1, 0, 1, 2,
2079 0, 3, 0, 3, 3, 3, 3, 0, 8, 0,
2080 9, 0, 9, 5, 2, 3, 1, 3, 3, 3,
2081 3, 1, 0, 5, 3, 1, 3, 1, 0, 11,
2082 1, 1, 4, 1, 1, 2, 3, 0, 1, 1,
2083 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2084 3, 2, 2, 3, 2, 5, 4, 1, 5, 1,
2085 1, 1, 1, 1, 1, 2, 1, 3, 2, 2,
2086 3, 3, 2, 0, 1, 2, 2, 3, 9, 9,
2087 8, 15, 1, 1, 6, 5, 2, 2, 6, 7,
2088 4, 4, 6, 6, 0, 0, 3, 2, 3, 2,
2089 1, 5, 5, 6, 6, 6, 6, 4, 6, 4,
2090 4, 6, 6, 2, 9, 1, 1, 0, 3, 6,
2091 3, 6, 2, 5, 7, 5, 4, 4, 7
2094 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2095 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2096 means the default is an error. */
2097 static const yytype_uint16 yydefact[] =
2099 68, 55, 65, 56, 66, 57, 222, 220, 0, 0,
2100 0, 0, 0, 0, 79, 67, 0, 68, 218, 83,
2101 86, 0, 0, 234, 0, 0, 62, 0, 69, 70,
2102 72, 71, 73, 76, 74, 77, 75, 78, 80, 81,
2103 82, 79, 79, 213, 1, 219, 84, 85, 79, 223,
2104 87, 88, 89, 90, 79, 293, 221, 293, 0, 0,
2105 242, 235, 236, 224, 279, 280, 226, 143, 144, 145,
2106 148, 147, 146, 149, 150, 0, 0, 0, 0, 281,
2107 282, 151, 225, 153, 213, 213, 91, 212, 0, 94,
2108 94, 294, 289, 63, 253, 254, 255, 288, 237, 238,
2109 241, 0, 171, 154, 0, 0, 0, 0, 160, 172,
2110 0, 0, 171, 0, 0, 0, 93, 92, 0, 210,
2111 211, 0, 0, 95, 96, 97, 98, 99, 116, 256,
2112 0, 0, 337, 337, 292, 0, 239, 170, 111, 166,
2113 168, 0, 0, 0, 0, 0, 0, 159, 0, 0,
2114 152, 0, 0, 165, 0, 164, 0, 233, 61, 61,
2115 100, 0, 250, 251, 252, 64, 336, 320, 0, 0,
2116 0, 0, 94, 302, 303, 2, 3, 4, 5, 6,
2117 7, 8, 9, 10, 14, 15, 16, 11, 12, 13,
2118 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
2119 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
2120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2121 0, 0, 290, 94, 306, 0, 335, 291, 307, 240,
2122 163, 0, 128, 61, 61, 162, 0, 173, 0, 128,
2123 61, 61, 0, 214, 187, 189, 188, 190, 193, 186,
2124 191, 192, 182, 183, 0, 0, 0, 0, 0, 0,
2125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2126 0, 0, 185, 184, 227, 115, 114, 113, 117, 0,
2127 319, 296, 61, 286, 295, 0, 0, 0, 116, 29,
2128 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2129 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2130 43, 44, 45, 46, 47, 48, 0, 0, 0, 134,
2131 134, 342, 61, 61, 333, 0, 0, 0, 0, 0,
2132 61, 61, 61, 61, 61, 0, 116, 0, 0, 0,
2133 102, 104, 103, 101, 105, 106, 107, 108, 109, 112,
2134 169, 167, 156, 157, 158, 161, 60, 155, 229, 231,
2135 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2136 0, 0, 175, 209, 0, 0, 0, 179, 0, 176,
2137 0, 0, 0, 139, 0, 259, 260, 261, 262, 263,
2138 268, 264, 265, 266, 267, 257, 0, 0, 0, 0,
2139 277, 284, 283, 285, 0, 0, 297, 0, 0, 61,
2140 61, 61, 61, 0, 338, 0, 340, 315, 0, 0,
2141 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2142 0, 0, 61, 0, 110, 122, 121, 118, 120, 119,
2143 123, 124, 127, 125, 126, 129, 139, 139, 0, 0,
2144 0, 0, 0, 315, 0, 0, 0, 0, 0, 0,
2145 0, 174, 160, 172, 0, 177, 178, 0, 0, 0,
2146 0, 228, 248, 258, 0, 271, 0, 0, 0, 274,
2147 0, 272, 287, 0, 0, 0, 0, 0, 0, 0,
2148 0, 0, 0, 346, 0, 0, 0, 329, 330, 0,
2149 0, 0, 0, 347, 0, 0, 0, 327, 0, 134,
2150 0, 230, 232, 61, 0, 0, 0, 0, 0, 0,
2151 0, 0, 0, 0, 0, 208, 181, 0, 0, 0,
2152 0, 0, 0, 141, 139, 247, 111, 245, 0, 0,
2153 270, 160, 0, 269, 273, 0, 0, 0, 0, 0,
2154 0, 0, 134, 135, 134, 0, 0, 0, 0, 0,
2155 0, 345, 317, 0, 61, 321, 322, 0, 0, 343,
2156 61, 215, 0, 0, 0, 0, 195, 0, 0, 0,
2157 0, 206, 0, 180, 0, 0, 61, 136, 142, 140,
2158 59, 0, 128, 0, 276, 0, 0, 0, 314, 323,
2159 324, 325, 326, 339, 341, 316, 0, 0, 328, 331,
2160 332, 318, 0, 314, 134, 0, 0, 0, 0, 0,
2161 203, 0, 0, 0, 197, 198, 194, 58, 244, 246,
2162 111, 137, 278, 275, 0, 0, 111, 111, 0, 308,
2163 0, 348, 0, 344, 199, 200, 201, 202, 0, 0,
2164 0, 207, 59, 138, 132, 0, 0, 300, 0, 0,
2165 0, 128, 0, 309, 128, 196, 204, 205, 243, 0,
2166 130, 298, 0, 0, 299, 102, 104, 111, 111, 0,
2167 111, 111, 334, 133, 0, 249, 0, 0, 311, 310,
2168 0, 0, 0, 131, 0, 0, 0, 111, 111, 305,
2169 0, 0, 313, 312, 304, 0, 0, 301
2172 /* YYDEFGOTO[NTERM-NUM]. */
2173 static const yytype_int16 yydefgoto[] =
2175 -1, 269, 270, 271, 299, 316, 79, 628, 113, 12,
2176 133, 80, 14, 15, 41, 42, 43, 48, 54, 118,
2177 128, 349, 230, 278, 161, 445, 352, 685, 670, 414,
2178 533, 654, 471, 534, 81, 158, 139, 156, 140, 141,
2179 110, 373, 400, 374, 121, 88, 157, 16, 17, 18,
2180 20, 19, 383, 446, 447, 63, 23, 61, 101, 537,
2181 538, 129, 164, 55, 96, 56, 49, 474, 401, 83,
2182 403, 283, 284, 57, 92, 93, 222, 658, 134, 324,
2183 638, 493, 503, 223, 224, 225, 226
2186 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2188 #define YYPACT_NINF -624
2189 static const yytype_int16 yypact[] =
2191 815, -624, -624, -624, -624, -624, -624, -624, 14, -114,
2192 16, -73, 78, -31, 299, -624, 163, 2187, -624, 164,
2193 80, 19, 22, -624, 2, 179, -624, 1912, -624, -624,
2194 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2195 -624, 68, 68, 201, -624, -624, -624, -624, 68, -624,
2196 -624, -624, -624, -624, 68, 200, -624, 5, 215, 222,
2197 225, -624, -624, -624, -624, -624, 117, -624, -624, -624,
2198 -624, -624, -624, -624, -624, 264, 277, 7, 49, -624,
2199 -624, -624, -12, -624, 252, 252, 198, -624, 79, 231,
2200 231, -624, -624, 83, -624, -624, -624, -624, -624, -624,
2201 -624, -21, 649, -624, 138, 149, 627, 117, -624, -12,
2202 -120, 159, 649, 158, 79, 79, -624, -624, 1557, -624,
2203 -624, 2012, 320, -624, -624, -624, -624, -624, -624, -624,
2204 -13, 173, 2237, 2237, -624, 313, -624, -624, -12, -624,
2205 174, 177, 2012, 2012, 169, -118, 2012, -624, 336, 191,
2206 -624, 2012, 2012, 117, 193, -12, 226, -624, 1296, 308,
2207 -624, 1516, -624, -624, -624, -624, -624, -624, 307, 2031,
2208 108, 357, 231, -624, -624, -624, -624, -624, -624, -624,
2209 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2210 454, 958, 454, 958, 2012, 2012, 2012, 2012, -624, -624,
2211 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2212 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012,
2213 2012, 2012, -624, 231, -624, 55, -624, -624, -624, -624,
2214 161, 1748, -624, -23, -41, -624, 203, -12, 214, -624,
2215 308, -20, 1557, -624, -624, -624, -624, -624, -624, -624,
2216 -624, -624, -624, -624, 454, 958, 454, 958, 216, 217,
2217 218, 220, 221, 224, 227, 1789, 2076, 732, 351, 228,
2218 229, 230, -624, -624, -624, -624, -624, -624, -624, 109,
2219 -624, 117, 956, -624, 219, 1466, 1466, 1466, -624, -624,
2220 -624, -624, -624, -624, -624, -624, -624, -624, -624, 2012,
2221 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2222 -624, -624, -624, -624, -624, -624, 2012, 2012, 2012, -10,
2223 3, -624, 956, -17, 223, 237, 238, 239, 240, 241,
2224 956, 956, 956, 956, 956, 352, -624, 2012, 2012, 387,
2225 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2226 -624, -624, 539, -624, -624, -624, -624, 539, -624, 158,
2227 354, 234, 248, 249, 250, 2012, 2012, 2012, 2012, 2012,
2228 2012, 2012, -624, -624, 42, 1006, -121, -624, -116, -624,
2229 2012, 2012, 2012, 253, 251, -624, -624, -624, -624, -624,
2230 -624, -624, -624, -624, -624, 353, 1807, 2094, 1175, 390,
2231 -624, -624, -624, -624, 2012, 255, -624, 256, 1516, 956,
2232 956, 956, 956, 20, -624, 29, -624, -624, 1466, 254,
2233 2012, 2012, 2012, 2012, 2012, 258, 259, 261, 262, 263,
2234 2012, 1516, 956, 266, -624, -624, -624, -624, -624, -624,
2235 -624, -624, -624, -624, -624, -624, 253, 253, 2012, 2012,
2236 2012, 2012, 2012, -624, 269, 270, 272, 273, 259, 274,
2237 2012, -624, 268, 1126, -84, -624, -624, 280, 281, 406,
2238 -5, -624, 1830, -624, 423, -624, 61, 1345, -56, -624,
2239 -77, -624, -624, 430, 431, 1466, 288, 290, 291, 292,
2240 1466, 455, 1466, 296, 298, 1466, 300, -12, -624, 301,
2241 302, 457, 461, 306, 2012, 1466, 1466, -12, 1466, 311,
2242 2012, -624, -624, -1, 312, 314, 317, 319, 101, 2012,
2243 2012, 2012, 2012, 112, 2012, -624, -624, 318, 2012, 2012,
2244 2012, 453, 478, -624, 253, -624, -12, 321, 326, 327,
2245 -624, 323, -67, -624, -624, 1466, 1466, 329, 1466, 1466,
2246 1466, 1466, 311, -624, 311, 2012, 1466, 328, 2012, 2012,
2247 2012, -624, -624, 489, 956, -624, -624, 335, 441, -624,
2248 956, -624, 2012, 2012, 2012, 2012, -624, 334, 337, 339,
2249 340, -624, 259, -624, 343, 345, 15, -624, -624, -624,
2250 178, 1848, -624, 484, -624, 338, 350, 349, 2117, -624,
2251 -624, -624, -624, -624, -624, -624, 348, 1466, -624, -624,
2252 -624, -624, 259, 2117, 311, 356, 359, 360, 361, 2012,
2253 -624, 2012, 2012, 115, -624, -624, -624, -624, -624, -624,
2254 -12, 116, -624, -624, 505, -7, 59, -12, 118, -624,
2255 358, 306, 124, -624, -624, -624, -624, -624, 363, 364,
2256 366, -624, 178, -624, 473, 1466, 1614, -624, -6, 802,
2257 802, -624, 2135, -624, -624, -624, -624, -624, -624, 526,
2258 379, -624, 374, 1614, -624, 378, 380, -624, -624, 442,
2259 59, -12, 539, -624, 516, -624, 523, 396, 161, 161,
2260 524, 802, 802, -624, 1466, 525, 1466, -624, -624, -624,
2261 1466, 486, 161, 161, -624, 543, 1466, -624
2264 /* YYPGOTO[NTERM-NUM]. */
2265 static const yytype_int16 yypgoto[] =
2267 -624, 132, 155, 181, -165, -154, 0, -86, -143, 474,
2268 -624, 6, -624, -624, -624, -624, 67, -624, -624, -624,
2269 -142, -624, -499, -624, -252, -624, -231, -624, -624, -313,
2270 -63, -624, -434, -624, -624, -26, 342, -152, -624, 458,
2271 463, -11, -156, -242, 202, 244, 332, -624, -624, 554,
2272 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2273 -624, 485, -624, -624, -624, -624, -624, -624, -623, -79,
2274 213, -193, -624, -624, 520, -624, 445, -624, -624, -624,
2275 -34, 129, -448, -624, 456, -624, -624
2278 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2279 positive, shift that token. If negative, reduce the rule which
2280 number is the opposite. If zero, do what YYDEFACT says.
2281 If YYTABLE_NINF, syntax error. */
2282 #define YYTABLE_NINF -218
2283 static const yytype_int16 yytable[] =
2285 11, 82, 272, 321, 656, 673, 13, 416, 357, 279,
2286 523, 105, 511, 512, 111, 162, 274, 11, 325, 326,
2287 327, 328, 329, 13, 376, 378, 91, 317, 335, 531,
2288 288, 490, 111, 672, 94, 111, 408, 590, 111, 318,
2289 492, 460, 146, 111, 146, 111, 460, 24, 465, 532,
2290 687, 147, 109, 236, 111, 466, 64, 65, 111, 107,
2291 67, 68, 69, 70, 71, 72, 73, 21, 1, 2,
2292 111, 3, 4, 5, 491, 25, 138, 243, 460, 273,
2293 109, 336, 22, 491, 431, 460, 138, 527, 26, 361,
2294 131, 363, 155, 11, 544, 460, 27, 358, 359, 74,
2295 589, 362, 1, 364, 595, 3, 460, 5, 84, 85,
2296 159, 119, 120, 543, -149, 89, 233, 234, 112, 285,
2297 237, 90, 50, 51, 52, 286, 241, 53, 354, 2,
2298 28, 652, 4, 464, 623, 155, 112, 659, 660, 112,
2299 240, 135, 112, 282, 353, 433, 136, 112, 418, 112,
2300 531, -61, 413, -61, 476, 478, 480, 163, 112, 571,
2301 657, 674, 112, 44, 641, 415, -61, 60, 319, 320,
2302 282, 322, 337, 338, 112, 626, 95, 106, 688, 689,
2303 58, 691, 692, 59, 323, 282, 282, 282, 282, 282,
2304 330, 331, 332, 333, 334, 282, 569, 1, 702, 703,
2305 3, 62, 5, 402, 460, 138, 402, 402, 402, 461,
2306 46, 482, 47, 75, 76, 339, 155, 77, -149, 78,
2307 108, 91, -149, 460, 38, 39, 40, 496, 540, 498,
2308 499, 500, 339, 64, 65, 542, 86, 98, 87, 603,
2309 116, 604, 117, 402, 99, 1, 2, 100, 3, 4,
2310 5, 402, 402, 402, 402, 402, 485, 435, 436, 437,
2311 438, 576, 439, 555, 219, 219, 440, 441, 103, 442,
2312 443, 444, 581, 409, 563, 651, 102, 563, 661, 508,
2313 662, 104, 340, 341, 664, 384, 662, 220, 220, 87,
2314 410, 411, 412, 122, 123, 124, 125, 126, 127, 340,
2315 341, 643, 342, 343, 142, 344, 345, 272, 346, 347,
2316 348, 432, 282, 221, 221, 143, 151, 152, 148, 342,
2317 343, 150, 344, 345, 160, 346, 347, 348, 114, 115,
2318 402, 402, 402, 402, 165, 229, 231, 232, 235, 402,
2319 238, 29, 30, 31, 32, 33, 34, 35, 36, 463,
2320 37, 239, 242, 402, 453, 454, 455, 456, 457, 458,
2321 459, 631, 605, 111, 280, 608, 609, 610, 287, 467,
2322 468, 469, 355, 379, 356, 365, 366, 367, 282, 368,
2323 369, 404, 155, 370, 273, 419, 371, 380, 381, 382,
2324 430, 434, 448, 449, 282, 497, 282, 282, 282, 420,
2325 421, 422, 423, 424, 507, 155, 402, 450, 451, 452,
2326 472, 402, 481, 402, 473, 470, 402, 483, 484, 495,
2327 501, 502, 513, 504, 505, 506, 402, 402, 510, 402,
2328 679, 519, 520, 682, 521, 522, 524, 526, 514, 515,
2329 516, 517, 528, 529, 530, 539, 536, 545, 546, 525,
2330 548, 463, 549, 550, 551, 38, 39, 40, 555, 553,
2331 556, 561, 558, 559, 560, 562, 402, 402, 563, 402,
2332 402, 402, 402, 568, 572, 587, 573, 402, 564, 574,
2333 690, 575, 588, 591, 570, 402, 592, 583, 598, 593,
2334 607, 402, 594, 611, 613, 491, 619, 620, 405, 406,
2335 407, 621, 622, 624, 586, 625, 632, 633, 577, 578,
2336 579, 580, 634, 582, 635, 639, 644, 584, 585, 645,
2337 646, 647, 655, 665, 666, 663, 667, 669, 402, 282,
2338 683, 684, 282, 282, 282, 417, 686, -18, 693, -19,
2339 694, 696, 700, 425, 426, 427, 428, 429, 289, 290,
2340 291, 292, 293, 294, 295, 296, 297, 298, 695, 705,
2341 706, 615, 616, 617, 618, 630, 668, 132, 653, 145,
2342 149, 45, 637, 351, 360, 130, 402, 97, 227, 642,
2343 402, 402, 518, 435, 436, 437, 438, 637, 439, 228,
2344 627, 0, 440, 441, 0, 442, 443, 444, 0, 0,
2345 0, 0, 0, 0, 0, 0, 0, 0, 648, 0,
2346 649, 650, 402, 402, 0, 402, 0, 402, 0, 0,
2347 0, 402, 486, 487, 488, 489, 0, 402, 0, 0,
2348 0, 494, 0, 0, 64, 65, 681, 107, 67, 68,
2349 69, 70, 71, 72, 73, 509, 1, 2, 0, 3,
2350 4, 5, 627, 0, 0, 0, 64, 65, 0, 107,
2351 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2352 0, 3, 4, 5, 0, 0, 0, 74, 0, 0,
2353 435, 436, 437, 438, 0, 439, 0, 0, 137, 440,
2354 441, 0, 442, 443, 444, 0, 0, 0, 547, 74,
2355 0, 0, 0, 552, 0, 554, 0, 0, 557, 0,
2356 0, 0, 0, 0, 0, 0, 0, 0, 565, 566,
2357 0, 567, 0, 0, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,
2359 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2360 0, 1, 2, 0, 3, 4, 5, 0, 596, 597,
2361 0, 599, 600, 601, 602, 0, 0, 0, 0, 606,
2362 0, 0, 0, 0, 0, 0, 0, 612, 0, 0,
2363 0, 0, 74, 614, 0, 0, 0, 0, 0, 0,
2364 0, 75, 76, 0, 0, 77, 0, 78, 144, 0,
2365 0, 0, 0, 0, 0, 385, 386, 387, 388, 64,
2366 65, 389, 0, 75, 76, -217, 0, 77, 0, 78,
2367 640, 1, 2, 0, 3, 4, 5, 390, 391, 392,
2368 0, 0, 0, -63, 1, 2, 0, 3, 4, 5,
2369 0, 0, 393, 394, 0, 6, 7, 0, 0, 0,
2370 0, 0, 0, 0, 0, 0, 339, 0, 0, 0,
2371 0, 395, 0, 0, 0, 0, 0, 8, 671, 0,
2372 0, 9, 677, 678, 0, 10, 0, 175, 176, 177,
2373 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
2374 188, 189, 254, 255, 256, 257, 75, 76, 0, 0,
2375 77, 0, 78, 377, 697, 698, 0, 699, 0, 701,
2376 0, 0, 0, 704, 0, 0, 0, 0, 0, 707,
2377 0, 258, 198, 675, 676, 201, 202, 203, 204, 205,
2378 206, 207, 208, 209, 0, 259, 0, 260, 261, 262,
2379 0, 263, 264, 342, 343, 0, 344, 345, 0, 346,
2380 347, 348, 0, 0, 0, 0, 0, 0, 0, 385,
2381 386, 387, 388, 64, 65, 389, 0, 396, 0, 0,
2382 397, 0, 398, 0, 399, 1, 2, 0, 3, 4,
2383 5, 390, 391, 392, 300, 301, 0, 0, 0, 0,
2384 0, 0, 0, 0, 0, 0, 393, 394, 0, 0,
2385 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2386 0, 111, 0, 64, 65, 395, 107, 67, 68, 69,
2387 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2388 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2389 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2390 0, 0, 0, 0, 0, 0, 74, 0, 302, 303,
2391 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
2392 314, 315, 0, 0, 0, 258, 198, 199, 200, 201,
2393 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2394 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2395 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2396 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2397 0, 396, 0, 0, 397, 0, 398, 0, 399, 244,
2398 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2399 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2400 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2401 0, 0, 0, 0, 0, 0, 252, 253, 0, 0,
2402 75, 76, 0, 0, 77, 0, 78, 462, 0, 0,
2403 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2404 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2405 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2406 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2407 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2408 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2409 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2410 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2411 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2412 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2413 0, 0, 0, 0, 0, 112, 0, 0, 0, -61,
2414 0, 265, 0, 0, 266, 0, 267, 0, 268, 244,
2415 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2416 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2417 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2418 0, 0, 0, 0, 0, 0, 252, 253, 0, 75,
2419 76, 0, 0, 77, 0, 78, 479, 0, 0, 0,
2420 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2421 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2422 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2423 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2424 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2426 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2427 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2428 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2429 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2430 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2431 0, 265, 0, 0, 266, 0, 267, 0, 268, 385,
2432 386, 387, 388, 64, 65, 389, 0, 0, 0, 0,
2433 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2434 5, 390, 391, 392, 0, 0, 0, 0, 0, 0,
2435 0, 0, 0, 0, 0, 0, 393, 394, 0, 75,
2436 76, 0, 0, 77, 0, 78, 541, 0, 0, 0,
2437 0, 0, 0, 64, 65, 395, 153, 67, 68, 69,
2438 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2439 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2440 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2441 0, 0, 0, 0, 64, 65, 74, 153, 67, 68,
2442 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2443 4, 5, 0, 0, 0, 258, 198, 199, 200, 201,
2444 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2445 0, 260, 261, 262, 0, 263, 264, 74, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 385, 386, 387,
2447 388, 0, 0, 389, 0, 0, 0, 0, 0, 0,
2448 0, 396, 0, 0, 397, 0, 398, 0, 399, 390,
2449 391, 392, 0, 0, 0, 0, 0, 0, 0, 0,
2450 0, 0, 0, 0, 393, 394, 0, 275, 276, 0,
2451 277, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2452 0, 0, 0, 395, 0, 0, 0, 0, 0, 0,
2453 75, 76, 154, 0, 77, 0, 78, 0, 0, 175,
2454 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
2455 186, 187, 188, 189, 254, 255, 256, 257, 0, 0,
2456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2457 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2458 0, 0, 0, 258, 198, 199, 200, 201, 202, 203,
2459 204, 205, 206, 207, 208, 209, 0, 259, 0, 260,
2460 261, 262, 0, 263, 264, 64, 65, 0, 107, 67,
2461 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2462 3, 4, 5, 0, 0, 0, 0, 0, 0, 396,
2463 0, 0, 397, 0, 398, 0, 399, 350, 0, 0,
2464 0, 0, 0, 0, 0, 0, 64, 65, 74, 107,
2465 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2466 0, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2467 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2468 4, 5, 0, 0, 0, 0, 0, 64, 65, 74,
2469 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2470 2, 0, 3, 4, 5, 64, 65, 74, 107, 67,
2471 68, 69, 70, 71, 72, 73, 0, 1, 2, 535,
2472 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2473 74, 0, 0, 0, 0, 0, 0, 629, 0, 0,
2474 0, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2475 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2476 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2477 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
2478 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2480 0, 0, 0, 75, 76, 0, 372, 77, 0, 78,
2481 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2482 0, 75, 76, 0, 475, 77, 0, 78, 0, 0,
2483 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2484 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2485 78, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2486 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2487 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2488 0, 1, 2, 0, 3, 4, 5, 0, 64, 65,
2489 0, 281, 67, 68, 69, 70, 71, 72, 73, 0,
2490 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2491 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2492 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2493 77, 74, 78, 64, 65, 0, 107, 67, 68, 69,
2494 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2495 5, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2496 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2497 0, 0, 0, 0, 64, 65, 74, 107, 67, 68,
2498 69, 70, 71, 72, 636, 0, 1, 2, 0, 3,
2499 4, 5, 64, 65, 74, 107, 67, 68, 69, 70,
2500 71, 72, 680, 0, 1, 2, 0, 3, 4, 5,
2501 0, 0, 0, 0, 0, 0, 0, 74, 0, 0,
2502 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2503 77, 0, 78, 0, 0, 74, 0, -216, 0, 0,
2504 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2505 0, 78, 0, 0, 0, -63, 1, 2, 0, 3,
2506 4, 5, 0, 0, 0, 0, 0, 6, 7, 0,
2507 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2508 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
2509 75, 76, 0, 9, 77, 0, 375, 10, 0, 0,
2510 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2511 0, 0, 77, 0, 477, 0, 0, 0, 0, 0,
2512 0, 0, 0, 166, 0, 0, 0, 0, 0, 0,
2513 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2514 0, 0, 0, 0, 167, 168, 0, 0, 0, 75,
2515 76, 0, 0, 77, 0, 78, 169, 170, 171, 172,
2516 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
2517 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2518 193, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2519 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2520 0, 194, 195, 196, 0, 0, 197, 198, 199, 200,
2521 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
2522 211, 212, 213, 214, 215, 216, 217, 218
2525 static const yytype_int16 yycheck[] =
2527 0, 27, 158, 196, 11, 11, 0, 320, 239, 161,
2528 458, 4, 446, 447, 55, 28, 159, 17, 211, 212,
2529 213, 214, 215, 17, 266, 267, 21, 192, 221, 34,
2530 172, 11, 55, 656, 29, 55, 288, 536, 55, 193,
2531 11, 162, 162, 55, 162, 55, 162, 161, 169, 54,
2532 673, 171, 78, 171, 55, 171, 7, 8, 55, 10,
2533 11, 12, 13, 14, 15, 16, 17, 53, 19, 20,
2534 55, 22, 23, 24, 54, 59, 102, 156, 162, 158,
2535 106, 223, 68, 54, 336, 162, 112, 171, 161, 254,
2536 7, 256, 118, 93, 171, 162, 18, 240, 241, 50,
2537 534, 255, 19, 257, 171, 22, 162, 24, 41, 42,
2538 121, 32, 33, 169, 55, 48, 142, 143, 159, 11,
2539 146, 54, 42, 43, 44, 17, 152, 47, 169, 20,
2540 161, 630, 23, 375, 582, 161, 159, 636, 637, 159,
2541 151, 162, 159, 169, 167, 338, 167, 159, 165, 159,
2542 34, 163, 162, 163, 396, 397, 398, 170, 159, 160,
2543 167, 167, 159, 0, 612, 162, 163, 165, 194, 195,
2544 196, 197, 117, 118, 159, 160, 171, 170, 677, 678,
2545 161, 680, 681, 161, 210, 211, 212, 213, 214, 215,
2546 216, 217, 218, 219, 220, 221, 509, 19, 697, 698,
2547 22, 22, 24, 282, 162, 231, 285, 286, 287, 167,
2548 46, 404, 48, 164, 165, 54, 242, 168, 159, 170,
2549 171, 21, 163, 162, 156, 157, 158, 420, 167, 422,
2550 423, 424, 54, 7, 8, 477, 35, 22, 37, 552,
2551 42, 554, 44, 322, 22, 19, 20, 22, 22, 23,
2552 24, 330, 331, 332, 333, 334, 408, 141, 142, 143,
2553 144, 160, 146, 162, 132, 133, 150, 151, 4, 153,
2554 154, 155, 160, 299, 162, 160, 159, 162, 160, 431,
2555 162, 4, 121, 122, 160, 279, 162, 132, 133, 37,
2556 316, 317, 318, 62, 63, 64, 65, 66, 67, 121,
2557 122, 614, 141, 142, 166, 144, 145, 463, 147, 148,
2558 149, 337, 338, 132, 133, 166, 114, 115, 159, 141,
2559 142, 163, 144, 145, 4, 147, 148, 149, 84, 85,
2560 409, 410, 411, 412, 161, 22, 162, 160, 169, 418,
2561 4, 42, 43, 44, 45, 46, 47, 48, 49, 375,
2562 51, 160, 159, 432, 365, 366, 367, 368, 369, 370,
2563 371, 592, 555, 55, 57, 558, 559, 560, 11, 380,
2564 381, 382, 169, 22, 160, 159, 159, 159, 404, 159,
2565 159, 162, 408, 159, 463, 162, 159, 159, 159, 159,
2566 38, 4, 38, 159, 420, 421, 422, 423, 424, 162,
2567 162, 162, 162, 162, 430, 431, 485, 159, 159, 159,
2568 159, 490, 22, 492, 61, 162, 495, 162, 162, 165,
2569 162, 162, 448, 162, 162, 162, 505, 506, 162, 508,
2570 661, 162, 162, 664, 162, 162, 162, 169, 449, 450,
2571 451, 452, 162, 162, 38, 22, 472, 17, 17, 460,
2572 162, 477, 162, 162, 162, 156, 157, 158, 162, 4,
2573 162, 4, 162, 162, 162, 4, 545, 546, 162, 548,
2574 549, 550, 551, 162, 162, 22, 162, 556, 504, 162,
2575 38, 162, 4, 162, 510, 564, 160, 169, 159, 162,
2576 162, 570, 169, 4, 159, 54, 162, 160, 285, 286,
2577 287, 162, 162, 160, 530, 160, 22, 169, 519, 520,
2578 521, 522, 162, 524, 165, 167, 160, 528, 529, 160,
2579 160, 160, 17, 160, 160, 167, 160, 54, 607, 555,
2580 4, 152, 558, 559, 560, 322, 162, 159, 22, 159,
2581 17, 17, 17, 330, 331, 332, 333, 334, 94, 95,
2582 96, 97, 98, 99, 100, 101, 102, 103, 162, 73,
2583 17, 572, 573, 574, 575, 591, 652, 93, 631, 106,
2584 112, 17, 598, 231, 242, 90, 655, 57, 133, 613,
2585 659, 660, 453, 141, 142, 143, 144, 613, 146, 133,
2586 590, -1, 150, 151, -1, 153, 154, 155, -1, -1,
2587 -1, -1, -1, -1, -1, -1, -1, -1, 619, -1,
2588 621, 622, 691, 692, -1, 694, -1, 696, -1, -1,
2589 -1, 700, 409, 410, 411, 412, -1, 706, -1, -1,
2590 -1, 418, -1, -1, 7, 8, 662, 10, 11, 12,
2591 13, 14, 15, 16, 17, 432, 19, 20, -1, 22,
2592 23, 24, 652, -1, -1, -1, 7, 8, -1, 10,
2593 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2594 -1, 22, 23, 24, -1, -1, -1, 50, -1, -1,
2595 141, 142, 143, 144, -1, 146, -1, -1, 39, 150,
2596 151, -1, 153, 154, 155, -1, -1, -1, 485, 50,
2597 -1, -1, -1, 490, -1, 492, -1, -1, 495, -1,
2598 -1, -1, -1, -1, -1, -1, -1, -1, 505, 506,
2599 -1, 508, -1, -1, -1, -1, -1, -1, -1, -1,
2600 -1, -1, -1, -1, -1, -1, -1, -1, -1, 7,
2601 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2602 -1, 19, 20, -1, 22, 23, 24, -1, 545, 546,
2603 -1, 548, 549, 550, 551, -1, -1, -1, -1, 556,
2604 -1, -1, -1, -1, -1, -1, -1, 564, -1, -1,
2605 -1, -1, 50, 570, -1, -1, -1, -1, -1, -1,
2606 -1, 164, 165, -1, -1, 168, -1, 170, 171, -1,
2607 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
2608 8, 9, -1, 164, 165, 0, -1, 168, -1, 170,
2609 607, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2610 -1, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2611 -1, -1, 40, 41, -1, 30, 31, -1, -1, -1,
2612 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
2613 -1, 59, -1, -1, -1, -1, -1, 52, 655, -1,
2614 -1, 56, 659, 660, -1, 60, -1, 75, 76, 77,
2615 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2616 88, 89, 90, 91, 92, 93, 164, 165, -1, -1,
2617 168, -1, 170, 171, 691, 692, -1, 694, -1, 696,
2618 -1, -1, -1, 700, -1, -1, -1, -1, -1, 706,
2619 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2620 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2621 -1, 139, 140, 141, 142, -1, 144, 145, -1, 147,
2622 148, 149, -1, -1, -1, -1, -1, -1, -1, 3,
2623 4, 5, 6, 7, 8, 9, -1, 165, -1, -1,
2624 168, -1, 170, -1, 172, 19, 20, -1, 22, 23,
2625 24, 25, 26, 27, 26, 27, -1, -1, -1, -1,
2626 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2628 -1, 55, -1, 7, 8, 59, 10, 11, 12, 13,
2629 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2630 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2631 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2632 -1, -1, -1, -1, -1, -1, 50, -1, 100, 101,
2633 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
2634 112, 113, -1, -1, -1, 119, 120, 121, 122, 123,
2635 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2636 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2637 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2638 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2639 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2640 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2641 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2642 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2643 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2644 164, 165, -1, -1, 168, -1, 170, 171, -1, -1,
2645 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2646 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2647 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2648 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2649 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2650 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2651 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2652 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2653 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2654 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2655 -1, -1, -1, -1, -1, 159, -1, -1, -1, 163,
2656 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2657 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2658 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2659 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2660 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2661 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2662 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2663 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2664 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2665 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2666 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2667 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2668 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2669 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2670 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2671 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2672 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2673 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2674 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2675 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2676 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2677 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2678 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2679 -1, -1, -1, 7, 8, 59, 10, 11, 12, 13,
2680 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2681 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2682 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2683 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2684 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2685 23, 24, -1, -1, -1, 119, 120, 121, 122, 123,
2686 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2687 -1, 135, 136, 137, -1, 139, 140, 50, -1, -1,
2688 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
2689 6, -1, -1, 9, -1, -1, -1, -1, -1, -1,
2690 -1, 165, -1, -1, 168, -1, 170, -1, 172, 25,
2691 26, 27, -1, -1, -1, -1, -1, -1, -1, -1,
2692 -1, -1, -1, -1, 40, 41, -1, 141, 142, -1,
2693 144, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2694 -1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
2695 164, 165, 125, -1, 168, -1, 170, -1, -1, 75,
2696 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2697 86, 87, 88, 89, 90, 91, 92, 93, -1, -1,
2698 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2699 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2700 -1, -1, -1, 119, 120, 121, 122, 123, 124, 125,
2701 126, 127, 128, 129, 130, 131, -1, 133, -1, 135,
2702 136, 137, -1, 139, 140, 7, 8, -1, 10, 11,
2703 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2704 22, 23, 24, -1, -1, -1, -1, -1, -1, 165,
2705 -1, -1, 168, -1, 170, -1, 172, 39, -1, -1,
2706 -1, -1, -1, -1, -1, -1, 7, 8, 50, 10,
2707 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2708 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2709 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2710 23, 24, -1, -1, -1, -1, -1, 7, 8, 50,
2711 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2712 20, -1, 22, 23, 24, 7, 8, 50, 10, 11,
2713 12, 13, 14, 15, 16, 17, -1, 19, 20, 39,
2714 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2715 50, -1, -1, -1, -1, -1, -1, 39, -1, -1,
2716 -1, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2717 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2718 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2719 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2720 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2721 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2722 -1, -1, -1, 164, 165, -1, 167, 168, -1, 170,
2723 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2724 -1, 164, 165, -1, 167, 168, -1, 170, -1, -1,
2725 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2726 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2727 170, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2728 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2729 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2730 -1, 19, 20, -1, 22, 23, 24, -1, 7, 8,
2731 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2732 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2733 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2734 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2735 168, 50, 170, 7, 8, -1, 10, 11, 12, 13,
2736 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2737 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2738 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2739 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2740 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2741 23, 24, 7, 8, 50, 10, 11, 12, 13, 14,
2742 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2743 -1, -1, -1, -1, -1, -1, -1, 50, -1, -1,
2744 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2745 168, -1, 170, -1, -1, 50, -1, 0, -1, -1,
2746 -1, -1, -1, -1, -1, 164, 165, -1, -1, 168,
2747 -1, 170, -1, -1, -1, 18, 19, 20, -1, 22,
2748 23, 24, -1, -1, -1, -1, -1, 30, 31, -1,
2749 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2750 -1, -1, -1, -1, -1, -1, -1, -1, -1, 52,
2751 164, 165, -1, 56, 168, -1, 170, 60, -1, -1,
2752 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2753 -1, -1, 168, -1, 170, -1, -1, -1, -1, -1,
2754 -1, -1, -1, 36, -1, -1, -1, -1, -1, -1,
2755 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2756 -1, -1, -1, -1, 57, 58, -1, -1, -1, 164,
2757 165, -1, -1, 168, -1, 170, 69, 70, 71, 72,
2758 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
2759 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2760 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2761 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2762 -1, 114, 115, 116, -1, -1, 119, 120, 121, 122,
2763 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
2764 133, 134, 135, 136, 137, 138, 139, 140
2767 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2768 symbol of state STATE-NUM. */
2769 static const yytype_uint16 yystos[] =
2771 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2772 60, 179, 182, 184, 185, 186, 220, 221, 222, 224,
2773 223, 53, 68, 229, 161, 59, 161, 18, 161, 42,
2774 43, 44, 45, 46, 47, 48, 49, 51, 156, 157,
2775 158, 187, 188, 189, 0, 222, 46, 48, 190, 239,
2776 42, 43, 44, 47, 191, 236, 238, 246, 161, 161,
2777 165, 230, 22, 228, 7, 8, 10, 11, 12, 13,
2778 14, 15, 16, 17, 50, 164, 165, 168, 170, 179,
2779 184, 207, 208, 242, 189, 189, 35, 37, 218, 189,
2780 189, 21, 247, 248, 29, 171, 237, 247, 22, 22,
2781 22, 231, 159, 4, 4, 4, 170, 10, 171, 208,
2782 213, 55, 159, 181, 218, 218, 42, 44, 192, 32,
2783 33, 217, 62, 63, 64, 65, 66, 67, 193, 234,
2784 234, 7, 182, 183, 251, 162, 167, 39, 208, 209,
2785 211, 212, 166, 166, 171, 213, 162, 171, 159, 212,
2786 163, 217, 217, 10, 125, 208, 210, 219, 208, 214,
2787 4, 197, 28, 170, 235, 161, 36, 57, 58, 69,
2788 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2789 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2790 90, 91, 92, 93, 114, 115, 116, 119, 120, 121,
2791 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2792 132, 133, 134, 135, 136, 137, 138, 139, 140, 174,
2793 175, 176, 249, 256, 257, 258, 259, 249, 257, 22,
2794 195, 162, 160, 208, 208, 169, 171, 208, 4, 160,
2795 214, 208, 159, 242, 3, 4, 5, 6, 9, 25,
2796 26, 27, 40, 41, 90, 91, 92, 93, 119, 133,
2797 135, 136, 137, 139, 140, 165, 168, 170, 172, 174,
2798 175, 176, 215, 242, 181, 141, 142, 144, 196, 210,
2799 57, 10, 208, 244, 245, 11, 17, 11, 193, 94,
2800 95, 96, 97, 98, 99, 100, 101, 102, 103, 177,
2801 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2802 108, 109, 110, 111, 112, 113, 178, 177, 178, 208,
2803 208, 244, 208, 208, 252, 244, 244, 244, 244, 244,
2804 208, 208, 208, 208, 208, 244, 193, 117, 118, 54,
2805 121, 122, 141, 142, 144, 145, 147, 148, 149, 194,
2806 39, 209, 199, 167, 169, 169, 160, 199, 181, 181,
2807 219, 177, 178, 177, 178, 159, 159, 159, 159, 159,
2808 159, 159, 167, 214, 216, 170, 216, 171, 216, 22,
2809 159, 159, 159, 225, 184, 3, 4, 5, 6, 9,
2810 25, 26, 27, 40, 41, 59, 165, 168, 170, 172,
2811 215, 241, 242, 243, 162, 243, 243, 243, 197, 208,
2812 208, 208, 208, 162, 202, 162, 202, 243, 165, 162,
2813 162, 162, 162, 162, 162, 243, 243, 243, 243, 243,
2814 38, 197, 208, 244, 4, 141, 142, 143, 144, 146,
2815 150, 151, 153, 154, 155, 198, 226, 227, 38, 159,
2816 159, 159, 159, 214, 214, 214, 214, 214, 214, 214,
2817 162, 167, 171, 208, 216, 169, 171, 214, 214, 214,
2818 162, 205, 159, 61, 240, 167, 216, 170, 216, 171,
2819 216, 22, 244, 162, 162, 210, 243, 243, 243, 243,
2820 11, 54, 11, 254, 243, 165, 244, 208, 244, 244,
2821 244, 162, 162, 255, 162, 162, 162, 208, 210, 243,
2822 162, 205, 205, 208, 214, 214, 214, 214, 254, 162,
2823 162, 162, 162, 255, 162, 214, 169, 171, 162, 162,
2824 38, 34, 54, 203, 206, 39, 208, 232, 233, 22,
2825 167, 171, 216, 169, 171, 17, 17, 243, 162, 162,
2826 162, 162, 243, 4, 243, 162, 162, 243, 162, 162,
2827 162, 4, 4, 162, 208, 243, 243, 243, 162, 202,
2828 208, 160, 162, 162, 162, 162, 160, 214, 214, 214,
2829 214, 160, 214, 169, 214, 214, 208, 22, 4, 205,
2830 195, 162, 160, 162, 169, 171, 243, 243, 159, 243,
2831 243, 243, 243, 202, 202, 244, 243, 162, 244, 244,
2832 244, 4, 243, 159, 243, 214, 214, 214, 214, 162,
2833 160, 162, 162, 255, 160, 160, 160, 179, 180, 39,
2834 208, 199, 22, 169, 162, 165, 17, 208, 253, 167,
2835 243, 255, 253, 202, 160, 160, 160, 160, 214, 214,
2836 214, 160, 195, 203, 204, 17, 11, 167, 250, 195,
2837 195, 160, 162, 167, 160, 160, 160, 160, 180, 54,
2838 201, 243, 241, 11, 167, 121, 122, 243, 243, 199,
2839 17, 208, 199, 4, 152, 200, 162, 241, 195, 195,
2840 38, 195, 195, 22, 17, 162, 17, 243, 243, 243,
2841 17, 243, 195, 195, 243, 73, 17, 243
2844 #define yyerrok (yyerrstatus = 0)
2845 #define yyclearin (yychar = YYEMPTY)
2846 #define YYEMPTY (-2)
2849 #define YYACCEPT goto yyacceptlab
2850 #define YYABORT goto yyabortlab
2851 #define YYERROR goto yyerrorlab
2854 /* Like YYERROR except do call yyerror. This remains here temporarily
2855 to ease the transition to the new meaning of YYERROR, for GCC.
2856 Once GCC version 2 has supplanted version 1, this can go. */
2858 #define YYFAIL goto yyerrlab
2860 #define YYRECOVERING() (!!yyerrstatus)
2862 #define YYBACKUP(Token, Value) \
2864 if (yychar == YYEMPTY && yylen == 1) \
2868 yytoken = YYTRANSLATE (yychar); \
2874 yyerror (YY_("syntax error: cannot back up")); \
2881 #define YYERRCODE 256
2884 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2885 If N is 0, then set CURRENT to the empty location which ends
2886 the previous symbol: RHS[0] (always defined). */
2888 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2889 #ifndef YYLLOC_DEFAULT
2890 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2894 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2895 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2896 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2897 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2901 (Current).first_line = (Current).last_line = \
2902 YYRHSLOC (Rhs, 0).last_line; \
2903 (Current).first_column = (Current).last_column = \
2904 YYRHSLOC (Rhs, 0).last_column; \
2910 /* YY_LOCATION_PRINT -- Print the location on the stream.
2911 This macro was not mandated originally: define only if we know
2912 we won't break user code: when these are the locations we know. */
2914 #ifndef YY_LOCATION_PRINT
2915 # if YYLTYPE_IS_TRIVIAL
2916 # define YY_LOCATION_PRINT(File, Loc) \
2917 fprintf (File, "%d.%d-%d.%d", \
2918 (Loc).first_line, (Loc).first_column, \
2919 (Loc).last_line, (Loc).last_column)
2921 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2926 /* YYLEX -- calling `yylex' with the right arguments. */
2929 # define YYLEX yylex (YYLEX_PARAM)
2931 # define YYLEX yylex ()
2934 /* Enable debugging if requested. */
2938 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2939 # define YYFPRINTF fprintf
2942 # define YYDPRINTF(Args) \
2948 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2952 YYFPRINTF (stderr, "%s ", Title); \
2953 yy_symbol_print (stderr, \
2955 YYFPRINTF (stderr, "\n"); \
2960 /*--------------------------------.
2961 | Print this symbol on YYOUTPUT. |
2962 `--------------------------------*/
2965 #if (defined __STDC__ || defined __C99__FUNC__ \
2966 || defined __cplusplus || defined _MSC_VER)
2968 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2971 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2974 YYSTYPE const * const yyvaluep;
2980 if (yytype < YYNTOKENS)
2981 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2993 /*--------------------------------.
2994 | Print this symbol on YYOUTPUT. |
2995 `--------------------------------*/
2997 #if (defined __STDC__ || defined __C99__FUNC__ \
2998 || defined __cplusplus || defined _MSC_VER)
3000 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3003 yy_symbol_print (yyoutput, yytype, yyvaluep)
3006 YYSTYPE const * const yyvaluep;
3009 if (yytype < YYNTOKENS)
3010 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3012 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3014 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3015 YYFPRINTF (yyoutput, ")");
3018 /*------------------------------------------------------------------.
3019 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3021 `------------------------------------------------------------------*/
3023 #if (defined __STDC__ || defined __C99__FUNC__ \
3024 || defined __cplusplus || defined _MSC_VER)
3026 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3029 yy_stack_print (bottom, top)
3030 yytype_int16 *bottom;
3034 YYFPRINTF (stderr, "Stack now");
3035 for (; bottom <= top; ++bottom)
3036 YYFPRINTF (stderr, " %d", *bottom);
3037 YYFPRINTF (stderr, "\n");
3040 # define YY_STACK_PRINT(Bottom, Top) \
3043 yy_stack_print ((Bottom), (Top)); \
3047 /*------------------------------------------------.
3048 | Report that the YYRULE is going to be reduced. |
3049 `------------------------------------------------*/
3051 #if (defined __STDC__ || defined __C99__FUNC__ \
3052 || defined __cplusplus || defined _MSC_VER)
3054 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3057 yy_reduce_print (yyvsp, yyrule)
3062 int yynrhs = yyr2[yyrule];
3064 unsigned long int yylno = yyrline[yyrule];
3065 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3067 /* The symbols being reduced. */
3068 for (yyi = 0; yyi < yynrhs; yyi++)
3070 fprintf (stderr, " $%d = ", yyi + 1);
3071 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3072 &(yyvsp[(yyi + 1) - (yynrhs)])
3074 fprintf (stderr, "\n");
3078 # define YY_REDUCE_PRINT(Rule) \
3081 yy_reduce_print (yyvsp, Rule); \
3084 /* Nonzero means print parse trace. It is left uninitialized so that
3085 multiple parsers can coexist. */
3087 #else /* !YYDEBUG */
3088 # define YYDPRINTF(Args)
3089 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3090 # define YY_STACK_PRINT(Bottom, Top)
3091 # define YY_REDUCE_PRINT(Rule)
3092 #endif /* !YYDEBUG */
3095 /* YYINITDEPTH -- initial size of the parser's stacks. */
3097 # define YYINITDEPTH 200
3100 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3101 if the built-in stack extension method is used).
3103 Do not make this value too large; the results are undefined if
3104 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3105 evaluated with infinite-precision integer arithmetic. */
3108 # define YYMAXDEPTH 10000
3116 # if defined __GLIBC__ && defined _STRING_H
3117 # define yystrlen strlen
3119 /* Return the length of YYSTR. */
3120 #if (defined __STDC__ || defined __C99__FUNC__ \
3121 || defined __cplusplus || defined _MSC_VER)
3123 yystrlen (const char *yystr)
3131 for (yylen = 0; yystr[yylen]; yylen++)
3139 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3140 # define yystpcpy stpcpy
3142 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3144 #if (defined __STDC__ || defined __C99__FUNC__ \
3145 || defined __cplusplus || defined _MSC_VER)
3147 yystpcpy (char *yydest, const char *yysrc)
3150 yystpcpy (yydest, yysrc)
3156 const char *yys = yysrc;
3158 while ((*yyd++ = *yys++) != '\0')
3167 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3168 quotes and backslashes, so that it's suitable for yyerror. The
3169 heuristic is that double-quoting is unnecessary unless the string
3170 contains an apostrophe, a comma, or backslash (other than
3171 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3172 null, do not copy; instead, return the length of what the result
3175 yytnamerr (char *yyres, const char *yystr)
3180 char const *yyp = yystr;
3187 goto do_not_strip_quotes;
3191 goto do_not_strip_quotes;
3204 do_not_strip_quotes: ;
3208 return yystrlen (yystr);
3210 return yystpcpy (yyres, yystr) - yyres;
3214 /* Copy into YYRESULT an error message about the unexpected token
3215 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3216 including the terminating null byte. If YYRESULT is null, do not
3217 copy anything; just return the number of bytes that would be
3218 copied. As a special case, return 0 if an ordinary "syntax error"
3219 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3220 size calculation. */
3222 yysyntax_error (char *yyresult, int yystate, int yychar)
3224 int yyn = yypact[yystate];
3226 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3230 int yytype = YYTRANSLATE (yychar);
3231 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3232 YYSIZE_T yysize = yysize0;
3234 int yysize_overflow = 0;
3235 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3236 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3240 /* This is so xgettext sees the translatable formats that are
3241 constructed on the fly. */
3242 YY_("syntax error, unexpected %s");
3243 YY_("syntax error, unexpected %s, expecting %s");
3244 YY_("syntax error, unexpected %s, expecting %s or %s");
3245 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3246 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3250 static char const yyunexpected[] = "syntax error, unexpected %s";
3251 static char const yyexpecting[] = ", expecting %s";
3252 static char const yyor[] = " or %s";
3253 char yyformat[sizeof yyunexpected
3254 + sizeof yyexpecting - 1
3255 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3256 * (sizeof yyor - 1))];
3257 char const *yyprefix = yyexpecting;
3259 /* Start YYX at -YYN if negative to avoid negative indexes in
3261 int yyxbegin = yyn < 0 ? -yyn : 0;
3263 /* Stay within bounds of both yycheck and yytname. */
3264 int yychecklim = YYLAST - yyn + 1;
3265 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3268 yyarg[0] = yytname[yytype];
3269 yyfmt = yystpcpy (yyformat, yyunexpected);
3271 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3272 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3274 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3278 yyformat[sizeof yyunexpected - 1] = '\0';
3281 yyarg[yycount++] = yytname[yyx];
3282 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3283 yysize_overflow |= (yysize1 < yysize);
3285 yyfmt = yystpcpy (yyfmt, yyprefix);
3289 yyf = YY_(yyformat);
3290 yysize1 = yysize + yystrlen (yyf);
3291 yysize_overflow |= (yysize1 < yysize);
3294 if (yysize_overflow)
3295 return YYSIZE_MAXIMUM;
3299 /* Avoid sprintf, as that infringes on the user's name space.
3300 Don't have undefined behavior even if the translation
3301 produced a string with the wrong number of "%s"s. */
3302 char *yyp = yyresult;
3304 while ((*yyp = *yyf) != '\0')
3306 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3308 yyp += yytnamerr (yyp, yyarg[yyi++]);
3321 #endif /* YYERROR_VERBOSE */
3324 /*-----------------------------------------------.
3325 | Release the memory associated to this symbol. |
3326 `-----------------------------------------------*/
3329 #if (defined __STDC__ || defined __C99__FUNC__ \
3330 || defined __cplusplus || defined _MSC_VER)
3332 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3335 yydestruct (yymsg, yytype, yyvaluep)
3345 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3356 /* Prevent warnings from -Wmissing-prototypes. */
3358 #ifdef YYPARSE_PARAM
3359 #if defined __STDC__ || defined __cplusplus
3360 int yyparse (void *YYPARSE_PARAM);
3364 #else /* ! YYPARSE_PARAM */
3365 #if defined __STDC__ || defined __cplusplus
3370 #endif /* ! YYPARSE_PARAM */
3374 /* The look-ahead symbol. */
3377 /* The semantic value of the look-ahead symbol. */
3380 /* Number of syntax errors so far. */
3389 #ifdef YYPARSE_PARAM
3390 #if (defined __STDC__ || defined __C99__FUNC__ \
3391 || defined __cplusplus || defined _MSC_VER)
3393 yyparse (void *YYPARSE_PARAM)
3396 yyparse (YYPARSE_PARAM)
3397 void *YYPARSE_PARAM;
3399 #else /* ! YYPARSE_PARAM */
3400 #if (defined __STDC__ || defined __C99__FUNC__ \
3401 || defined __cplusplus || defined _MSC_VER)
3415 /* Number of tokens to shift before error messages enabled. */
3417 /* Look-ahead token as an internal (translated) token number. */
3420 /* Buffer for error messages, and its allocated size. */
3422 char *yymsg = yymsgbuf;
3423 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3426 /* Three stacks and their tools:
3427 `yyss': related to states,
3428 `yyvs': related to semantic values,
3429 `yyls': related to locations.
3431 Refer to the stacks thru separate pointers, to allow yyoverflow
3432 to reallocate them elsewhere. */
3434 /* The state stack. */
3435 yytype_int16 yyssa[YYINITDEPTH];
3436 yytype_int16 *yyss = yyssa;
3437 yytype_int16 *yyssp;
3439 /* The semantic value stack. */
3440 YYSTYPE yyvsa[YYINITDEPTH];
3441 YYSTYPE *yyvs = yyvsa;
3446 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3448 YYSIZE_T yystacksize = YYINITDEPTH;
3450 /* The variables used to return semantic value and location from the
3455 /* The number of symbols on the RHS of the reduced rule.
3456 Keep to zero when no symbol should be popped. */
3459 YYDPRINTF ((stderr, "Starting parse\n"));
3464 yychar = YYEMPTY; /* Cause a token to be read. */
3466 /* Initialize stack pointers.
3467 Waste one element of value and location stack
3468 so that they stay on the same level as the state stack.
3469 The wasted elements are never initialized. */
3476 /*------------------------------------------------------------.
3477 | yynewstate -- Push a new state, which is found in yystate. |
3478 `------------------------------------------------------------*/
3480 /* In all cases, when you get here, the value and location stacks
3481 have just been pushed. So pushing a state here evens the stacks. */
3487 if (yyss + yystacksize - 1 <= yyssp)
3489 /* Get the current used size of the three stacks, in elements. */
3490 YYSIZE_T yysize = yyssp - yyss + 1;
3494 /* Give user a chance to reallocate the stack. Use copies of
3495 these so that the &'s don't force the real ones into
3497 YYSTYPE *yyvs1 = yyvs;
3498 yytype_int16 *yyss1 = yyss;
3501 /* Each stack pointer address is followed by the size of the
3502 data in use in that stack, in bytes. This used to be a
3503 conditional around just the two extra args, but that might
3504 be undefined if yyoverflow is a macro. */
3505 yyoverflow (YY_("memory exhausted"),
3506 &yyss1, yysize * sizeof (*yyssp),
3507 &yyvs1, yysize * sizeof (*yyvsp),
3514 #else /* no yyoverflow */
3515 # ifndef YYSTACK_RELOCATE
3516 goto yyexhaustedlab;
3518 /* Extend the stack our own way. */
3519 if (YYMAXDEPTH <= yystacksize)
3520 goto yyexhaustedlab;
3522 if (YYMAXDEPTH < yystacksize)
3523 yystacksize = YYMAXDEPTH;
3526 yytype_int16 *yyss1 = yyss;
3527 union yyalloc *yyptr =
3528 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3530 goto yyexhaustedlab;
3531 YYSTACK_RELOCATE (yyss);
3532 YYSTACK_RELOCATE (yyvs);
3534 # undef YYSTACK_RELOCATE
3536 YYSTACK_FREE (yyss1);
3539 #endif /* no yyoverflow */
3541 yyssp = yyss + yysize - 1;
3542 yyvsp = yyvs + yysize - 1;
3545 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3546 (unsigned long int) yystacksize));
3548 if (yyss + yystacksize - 1 <= yyssp)
3552 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3561 /* Do appropriate processing given the current state. Read a
3562 look-ahead token if we need one and don't already have one. */
3564 /* First try to decide what to do without reference to look-ahead token. */
3565 yyn = yypact[yystate];
3566 if (yyn == YYPACT_NINF)
3569 /* Not known => get a look-ahead token if don't already have one. */
3571 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3572 if (yychar == YYEMPTY)
3574 YYDPRINTF ((stderr, "Reading a token: "));
3578 if (yychar <= YYEOF)
3580 yychar = yytoken = YYEOF;
3581 YYDPRINTF ((stderr, "Now at end of input.\n"));
3585 yytoken = YYTRANSLATE (yychar);
3586 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3589 /* If the proper action on seeing token YYTOKEN is to reduce or to
3590 detect an error, take that action. */
3592 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3597 if (yyn == 0 || yyn == YYTABLE_NINF)
3606 /* Count tokens shifted since error; after three, turn off error
3611 /* Shift the look-ahead token. */
3612 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3614 /* Discard the shifted token unless it is eof. */
3615 if (yychar != YYEOF)
3624 /*-----------------------------------------------------------.
3625 | yydefault -- do the default action for the current state. |
3626 `-----------------------------------------------------------*/
3628 yyn = yydefact[yystate];
3634 /*-----------------------------.
3635 | yyreduce -- Do a reduction. |
3636 `-----------------------------*/
3638 /* yyn is the number of a rule to reduce with. */
3641 /* If YYLEN is nonzero, implement the default value of the action:
3644 Otherwise, the following line sets YYVAL to garbage.
3645 This behavior is undocumented and Bison
3646 users should not rely upon it. Assigning to YYVAL
3647 unconditionally makes the parser a bit smaller, and it avoids a
3648 GCC warning that YYVAL may be used uninitialized. */
3649 yyval = yyvsp[1-yylen];
3652 YY_REDUCE_PRINT (yyn);
3656 #line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3657 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3661 #line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3662 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3666 #line 1159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3667 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3671 #line 1159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3672 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3676 #line 1160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3677 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3681 #line 1160 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3682 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3686 #line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3687 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3691 #line 1161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3692 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3696 #line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3697 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3701 #line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3702 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3706 #line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3707 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3711 #line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3712 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3716 #line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3717 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3721 #line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3722 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3726 #line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3727 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3731 #line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3732 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3736 #line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3737 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3741 #line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3746 #line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3747 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3751 #line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3752 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3756 #line 1171 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3757 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3761 #line 1171 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3762 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3766 #line 1172 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3767 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3771 #line 1172 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3772 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3776 #line 1173 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3777 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3781 #line 1174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3782 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3786 #line 1178 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3787 { (yyval.StrVal) = 0; ;}
3791 #line 1180 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3792 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3796 #line 1181 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3797 { (yyval.UIntVal)=0; ;}
3801 #line 1185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3803 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3809 #line 1189 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3817 #line 1194 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3819 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3825 #line 1203 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3833 #line 1208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3835 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3841 #line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3842 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3846 #line 1215 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3847 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3851 #line 1216 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3852 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3856 #line 1217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3857 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3861 #line 1218 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3866 #line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3871 #line 1223 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3876 #line 1224 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3881 #line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3886 #line 1229 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3891 #line 1230 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3892 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3896 #line 1231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3897 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3901 #line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3906 #line 1236 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3907 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3911 #line 1237 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3912 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3916 #line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3917 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3921 #line 1242 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3922 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3926 #line 1243 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3931 #line 1244 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3932 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3936 #line 1245 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3937 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3941 #line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3946 #line 1250 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3947 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3951 #line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3952 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3956 #line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3957 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3961 #line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3962 { (yyval.UIntVal) = CallingConv::C; ;}
3966 #line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3967 { (yyval.UIntVal) = CallingConv::C; ;}
3971 #line 1257 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3972 { (yyval.UIntVal) = CallingConv::Fast; ;}
3976 #line 1258 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3977 { (yyval.UIntVal) = CallingConv::Cold; ;}
3981 #line 1259 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3982 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3986 #line 1260 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3987 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3991 #line 1261 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3993 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3994 GEN_ERROR("Calling conv too large");
3995 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4001 #line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4002 { (yyval.Attributes) = Attribute::ZExt; ;}
4006 #line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4007 { (yyval.Attributes) = Attribute::ZExt; ;}
4011 #line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4012 { (yyval.Attributes) = Attribute::SExt; ;}
4016 #line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4017 { (yyval.Attributes) = Attribute::SExt; ;}
4021 #line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4022 { (yyval.Attributes) = Attribute::InReg; ;}
4026 #line 1273 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4027 { (yyval.Attributes) = Attribute::StructRet; ;}
4031 #line 1274 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4032 { (yyval.Attributes) = Attribute::NoAlias; ;}
4036 #line 1275 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4037 { (yyval.Attributes) = Attribute::ByVal; ;}
4041 #line 1276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4042 { (yyval.Attributes) = Attribute::Nest; ;}
4046 #line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4047 { (yyval.Attributes) =
4048 Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4052 #line 1281 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4053 { (yyval.Attributes) = Attribute::None; ;}
4057 #line 1282 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4059 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4064 #line 1287 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4065 { (yyval.Attributes) = Attribute::InReg; ;}
4069 #line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4070 { (yyval.Attributes) = Attribute::ZExt; ;}
4074 #line 1289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4075 { (yyval.Attributes) = Attribute::SExt; ;}
4079 #line 1292 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4080 { (yyval.Attributes) = Attribute::None; ;}
4084 #line 1293 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4086 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4091 #line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4092 { (yyval.Attributes) = Attribute::NoReturn; ;}
4096 #line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4097 { (yyval.Attributes) = Attribute::NoUnwind; ;}
4101 #line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4102 { (yyval.Attributes) = Attribute::InReg; ;}
4106 #line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4107 { (yyval.Attributes) = Attribute::ZExt; ;}
4111 #line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4112 { (yyval.Attributes) = Attribute::SExt; ;}
4116 #line 1304 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4117 { (yyval.Attributes) = Attribute::ReadNone; ;}
4121 #line 1305 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4122 { (yyval.Attributes) = Attribute::ReadOnly; ;}
4126 #line 1306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4127 { (yyval.Attributes) = Attribute::NoInline; ;}
4131 #line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4132 { (yyval.Attributes) = Attribute::AlwaysInline; ;}
4136 #line 1308 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4137 { (yyval.Attributes) = Attribute::OptimizeForSize; ;}
4141 #line 1311 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4142 { (yyval.Attributes) = Attribute::None; ;}
4146 #line 1312 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4148 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4153 #line 1318 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4154 { (yyval.StrVal) = 0; ;}
4158 #line 1319 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4160 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4165 #line 1326 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4166 { (yyval.UIntVal) = 0; ;}
4170 #line 1327 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4172 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4173 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4174 GEN_ERROR("Alignment must be a power of two");
4180 #line 1333 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4181 { (yyval.UIntVal) = 0; ;}
4185 #line 1334 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4187 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4188 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4189 GEN_ERROR("Alignment must be a power of two");
4195 #line 1343 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4197 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4198 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4199 GEN_ERROR("Invalid character in section name");
4200 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4206 #line 1351 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4207 { (yyval.StrVal) = 0; ;}
4211 #line 1352 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4212 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4216 #line 1357 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4221 #line 1358 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4226 #line 1359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4228 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4229 delete (yyvsp[(1) - (1)].StrVal);
4235 #line 1364 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4237 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4238 GEN_ERROR("Alignment must be a power of two");
4239 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4245 #line 1380 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4247 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4253 #line 1384 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4255 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4261 #line 1388 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4263 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4264 GEN_ERROR("Cannot form a pointer to a basic block");
4265 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4266 delete (yyvsp[(1) - (3)].TypeVal);
4272 #line 1395 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4273 { // Named types are also simple types...
4274 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4276 (yyval.TypeVal) = new PATypeHolder(tmp);
4281 #line 1400 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4282 { // Type UpReference
4283 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4284 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4285 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4286 (yyval.TypeVal) = new PATypeHolder(OT);
4287 UR_OUT("New Upreference!\n");
4293 #line 1408 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4295 // Allow but ignore attributes on function types; this permits auto-upgrade.
4296 // FIXME: remove in LLVM 3.0.
4297 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4298 if (!FunctionType::isValidReturnType(RetTy))
4299 GEN_ERROR("Invalid result type for LLVM function");
4301 std::vector<const Type*> Params;
4302 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4303 for (; I != E; ++I ) {
4304 const Type *Ty = I->Ty->get();
4305 Params.push_back(Ty);
4308 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4309 if (isVarArg) Params.pop_back();
4311 for (unsigned i = 0; i != Params.size(); ++i)
4312 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4313 GEN_ERROR("Function arguments must be value types!");
4317 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4318 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4319 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4321 // Delete the argument list
4322 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4325 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4332 #line 1443 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4334 // Allow but ignore attributes on function types; this permits auto-upgrade.
4335 // FIXME: remove in LLVM 3.0.
4336 std::vector<const Type*> Params;
4337 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4338 for ( ; I != E; ++I ) {
4339 const Type* Ty = I->Ty->get();
4340 Params.push_back(Ty);
4343 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4344 if (isVarArg) Params.pop_back();
4346 for (unsigned i = 0; i != Params.size(); ++i)
4347 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4348 GEN_ERROR("Function arguments must be value types!");
4352 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4353 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4355 // Delete the argument list
4356 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4359 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4366 #line 1474 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4367 { // Sized array type?
4368 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4369 delete (yyvsp[(4) - (5)].TypeVal);
4375 #line 1479 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4377 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4378 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4379 GEN_ERROR("Unsigned result not equal to signed result");
4380 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4381 GEN_ERROR("Element type of a VectorType must be primitive");
4382 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4383 delete (yyvsp[(4) - (5)].TypeVal);
4389 #line 1489 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4390 { // Structure type?
4391 std::vector<const Type*> Elements;
4392 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4393 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4394 Elements.push_back(*I);
4396 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4397 delete (yyvsp[(2) - (3)].TypeList);
4403 #line 1499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4404 { // Empty structure type?
4405 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4411 #line 1503 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4413 std::vector<const Type*> Elements;
4414 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4415 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4416 Elements.push_back(*I);
4418 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4419 delete (yyvsp[(3) - (5)].TypeList);
4425 #line 1513 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4426 { // Empty structure type?
4427 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4433 #line 1520 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4435 // Allow but ignore attributes on function types; this permits auto-upgrade.
4436 // FIXME: remove in LLVM 3.0.
4437 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4438 (yyval.TypeWithAttrs).Attrs = Attribute::None;
4443 #line 1529 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4445 if (!UpRefs.empty())
4446 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4447 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4448 GEN_ERROR("LLVM functions cannot return aggregate types");
4449 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4454 #line 1536 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4456 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4461 #line 1541 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4463 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4464 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4470 #line 1546 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4472 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4478 #line 1554 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4480 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4481 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4482 TWA.Ty = new PATypeHolder(Type::VoidTy);
4483 (yyval.TypeWithAttrsList)->push_back(TWA);
4489 #line 1561 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4491 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4492 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4493 TWA.Ty = new PATypeHolder(Type::VoidTy);
4494 (yyval.TypeWithAttrsList)->push_back(TWA);
4500 #line 1568 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4502 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4508 #line 1576 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4510 (yyval.TypeList) = new std::list<PATypeHolder>();
4511 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4512 delete (yyvsp[(1) - (1)].TypeVal);
4518 #line 1582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4520 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4521 delete (yyvsp[(3) - (3)].TypeVal);
4527 #line 1594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4528 { // Nonempty unsized arr
4529 if (!UpRefs.empty())
4530 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4531 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4533 GEN_ERROR("Cannot make array constant with type: '" +
4534 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4535 const Type *ETy = ATy->getElementType();
4536 uint64_t NumElements = ATy->getNumElements();
4538 // Verify that we have the correct size...
4539 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4540 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4541 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4542 utostr(NumElements) + "");
4544 // Verify all elements are correct type!
4545 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4546 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4547 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4548 ETy->getDescription() +"' as required!\nIt is of type '"+
4549 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4552 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4553 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4559 #line 1622 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4561 if (!UpRefs.empty())
4562 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4563 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4565 GEN_ERROR("Cannot make array constant with type: '" +
4566 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4568 uint64_t NumElements = ATy->getNumElements();
4569 if (NumElements != uint64_t(-1) && NumElements != 0)
4570 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4571 " arguments, but has size of " + utostr(NumElements) +"");
4572 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4573 delete (yyvsp[(1) - (3)].TypeVal);
4579 #line 1638 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4581 if (!UpRefs.empty())
4582 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4583 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4585 GEN_ERROR("Cannot make array constant with type: '" +
4586 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4588 uint64_t NumElements = ATy->getNumElements();
4589 const Type *ETy = ATy->getElementType();
4590 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4591 GEN_ERROR("Can't build string constant of size " +
4592 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4593 " when array has size " + utostr(NumElements) + "");
4594 std::vector<Constant*> Vals;
4595 if (ETy == Type::Int8Ty) {
4596 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4597 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4599 delete (yyvsp[(3) - (3)].StrVal);
4600 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4602 delete (yyvsp[(3) - (3)].StrVal);
4603 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4604 delete (yyvsp[(1) - (3)].TypeVal);
4610 #line 1665 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4611 { // Nonempty unsized arr
4612 if (!UpRefs.empty())
4613 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4614 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4616 GEN_ERROR("Cannot make packed constant with type: '" +
4617 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4618 const Type *ETy = PTy->getElementType();
4619 unsigned NumElements = PTy->getNumElements();
4621 // Verify that we have the correct size...
4622 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4623 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4624 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4625 utostr(NumElements) + "");
4627 // Verify all elements are correct type!
4628 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4629 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4630 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4631 ETy->getDescription() +"' as required!\nIt is of type '"+
4632 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4635 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4636 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4642 #line 1693 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4644 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4646 GEN_ERROR("Cannot make struct constant with type: '" +
4647 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4649 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4650 GEN_ERROR("Illegal number of initializers for structure type");
4652 // Check to ensure that constants are compatible with the type initializer!
4653 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4654 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4655 GEN_ERROR("Expected type '" +
4656 STy->getElementType(i)->getDescription() +
4657 "' for element #" + utostr(i) +
4658 " of structure initializer");
4660 // Check to ensure that Type is not packed
4661 if (STy->isPacked())
4662 GEN_ERROR("Unpacked Initializer to vector type '" +
4663 STy->getDescription() + "'");
4665 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4666 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4672 #line 1719 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4674 if (!UpRefs.empty())
4675 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4676 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4678 GEN_ERROR("Cannot make struct constant with type: '" +
4679 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4681 if (STy->getNumContainedTypes() != 0)
4682 GEN_ERROR("Illegal number of initializers for structure type");
4684 // Check to ensure that Type is not packed
4685 if (STy->isPacked())
4686 GEN_ERROR("Unpacked Initializer to vector type '" +
4687 STy->getDescription() + "'");
4689 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4690 delete (yyvsp[(1) - (3)].TypeVal);
4696 #line 1739 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4698 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4700 GEN_ERROR("Cannot make struct constant with type: '" +
4701 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4703 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4704 GEN_ERROR("Illegal number of initializers for structure type");
4706 // Check to ensure that constants are compatible with the type initializer!
4707 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4708 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4709 GEN_ERROR("Expected type '" +
4710 STy->getElementType(i)->getDescription() +
4711 "' for element #" + utostr(i) +
4712 " of structure initializer");
4714 // Check to ensure that Type is packed
4715 if (!STy->isPacked())
4716 GEN_ERROR("Vector initializer to non-vector type '" +
4717 STy->getDescription() + "'");
4719 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4720 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4726 #line 1765 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4728 if (!UpRefs.empty())
4729 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4730 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4732 GEN_ERROR("Cannot make struct constant with type: '" +
4733 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4735 if (STy->getNumContainedTypes() != 0)
4736 GEN_ERROR("Illegal number of initializers for structure type");
4738 // Check to ensure that Type is packed
4739 if (!STy->isPacked())
4740 GEN_ERROR("Vector initializer to non-vector type '" +
4741 STy->getDescription() + "'");
4743 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4744 delete (yyvsp[(1) - (5)].TypeVal);
4750 #line 1785 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4752 if (!UpRefs.empty())
4753 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4754 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4756 GEN_ERROR("Cannot make null pointer constant with type: '" +
4757 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4759 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4760 delete (yyvsp[(1) - (2)].TypeVal);
4766 #line 1797 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4768 if (!UpRefs.empty())
4769 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4770 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4771 delete (yyvsp[(1) - (2)].TypeVal);
4777 #line 1804 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4779 if (!UpRefs.empty())
4780 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4781 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4783 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4785 // ConstExprs can exist in the body of a function, thus creating
4786 // GlobalValues whenever they refer to a variable. Because we are in
4787 // the context of a function, getExistingVal will search the functions
4788 // symbol table instead of the module symbol table for the global symbol,
4789 // which throws things all off. To get around this, we just tell
4790 // getExistingVal that we are at global scope here.
4792 Function *SavedCurFn = CurFun.CurrentFunction;
4793 CurFun.CurrentFunction = 0;
4795 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4798 CurFun.CurrentFunction = SavedCurFn;
4800 // If this is an initializer for a constant pointer, which is referencing a
4801 // (currently) undefined variable, create a stub now that shall be replaced
4802 // in the future with the right type of variable.
4805 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4806 const PointerType *PT = cast<PointerType>(Ty);
4808 // First check to see if the forward references value is already created!
4809 PerModuleInfo::GlobalRefsType::iterator I =
4810 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4812 if (I != CurModule.GlobalRefs.end()) {
4813 V = I->second; // Placeholder already exists, use it...
4814 (yyvsp[(2) - (2)].ValIDVal).destroy();
4817 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4818 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4819 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4820 GEN_ERROR("Invalid reference to global");
4822 // Create the forward referenced global.
4824 if (const FunctionType *FTy =
4825 dyn_cast<FunctionType>(PT->getElementType())) {
4826 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4827 CurModule.CurrentModule);
4829 GV = new GlobalVariable(PT->getElementType(), false,
4830 GlobalValue::ExternalWeakLinkage, 0,
4831 Name, CurModule.CurrentModule);
4834 // Keep track of the fact that we have a forward ref to recycle it
4835 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4840 (yyval.ConstVal) = cast<GlobalValue>(V);
4841 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4847 #line 1870 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4849 if (!UpRefs.empty())
4850 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4851 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4852 GEN_ERROR("Mismatched types for constant expression: " +
4853 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4854 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4855 delete (yyvsp[(1) - (2)].TypeVal);
4861 #line 1880 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4863 if (!UpRefs.empty())
4864 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4865 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4866 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4867 GEN_ERROR("Cannot create a null initialized value of this type");
4868 (yyval.ConstVal) = Constant::getNullValue(Ty);
4869 delete (yyvsp[(1) - (2)].TypeVal);
4875 #line 1890 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4876 { // integral constants
4877 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4878 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val)))
4879 GEN_ERROR("Constant value doesn't fit in type");
4880 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].SInt64Val), true);
4882 GEN_ERROR("integer constant must have integer type");
4884 delete (yyvsp[(1) - (2)].TypeVal);
4890 #line 1901 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4891 { // arbitrary precision integer constants
4892 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4893 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4894 GEN_ERROR("Constant value does not fit in type");
4895 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(IT->getBitWidth());
4896 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4898 GEN_ERROR("integer constant must have integer type");
4900 delete (yyvsp[(1) - (2)].TypeVal);
4901 delete (yyvsp[(2) - (2)].APIntVal);
4907 #line 1914 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4908 { // integral constants
4909 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4910 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val)))
4911 GEN_ERROR("Constant value doesn't fit in type");
4912 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].UInt64Val), false);
4914 GEN_ERROR("integer constant must have integer type");
4916 delete (yyvsp[(1) - (2)].TypeVal);
4922 #line 1925 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4923 { // arbitrary precision integer constants
4924 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4925 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4926 GEN_ERROR("Constant value does not fit in type");
4927 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(IT->getBitWidth());
4928 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4930 GEN_ERROR("integer constant must have integer type");
4933 delete (yyvsp[(2) - (2)].APIntVal);
4934 delete (yyvsp[(1) - (2)].TypeVal);
4940 #line 1939 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4941 { // Boolean constants
4942 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4943 GEN_ERROR("Constant true must have type i1");
4944 (yyval.ConstVal) = ConstantInt::getTrue();
4945 delete (yyvsp[(1) - (2)].TypeVal);
4951 #line 1946 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4952 { // Boolean constants
4953 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4954 GEN_ERROR("Constant false must have type i1");
4955 (yyval.ConstVal) = ConstantInt::getFalse();
4956 delete (yyvsp[(1) - (2)].TypeVal);
4962 #line 1953 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4963 { // Floating point constants
4964 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal)))
4965 GEN_ERROR("Floating point constant invalid for type");
4967 // Lexer has no type info, so builds all float and double FP constants
4968 // as double. Fix this here. Long double is done right.
4969 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].TypeVal)->get()==Type::FloatTy) {
4971 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
4974 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4975 delete (yyvsp[(1) - (2)].TypeVal);
4976 delete (yyvsp[(2) - (2)].FPVal);
4982 #line 1971 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4984 if (!UpRefs.empty())
4985 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4986 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4987 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4988 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4989 GEN_ERROR("invalid cast opcode for cast from '" +
4990 Val->getType()->getDescription() + "' to '" +
4991 DestTy->getDescription() + "'");
4992 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4993 delete (yyvsp[(5) - (6)].TypeVal);
4998 #line 1983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5000 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5001 GEN_ERROR("GetElementPtr requires a pointer operand");
5004 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
5006 GEN_ERROR("Index list invalid for constant getelementptr");
5008 SmallVector<Constant*, 8> IdxVec;
5009 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
5010 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
5011 IdxVec.push_back(C);
5013 GEN_ERROR("Indices to constant getelementptr must be constants");
5015 delete (yyvsp[(4) - (5)].ValueList);
5017 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5023 #line 2004 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5025 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5026 GEN_ERROR("Select condition must be of boolean type");
5027 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5028 GEN_ERROR("Select operand types must match");
5029 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5035 #line 2012 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5037 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5038 GEN_ERROR("Binary operator types must match");
5040 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5045 #line 2018 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5047 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5048 GEN_ERROR("Logical operator types must match");
5049 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5050 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5051 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5052 GEN_ERROR("Logical operator requires integral operands");
5054 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5060 #line 2029 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5062 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5063 GEN_ERROR("icmp operand types must match");
5064 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5069 #line 2034 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5071 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5072 GEN_ERROR("fcmp operand types must match");
5073 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5078 #line 2039 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5080 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5081 GEN_ERROR("vicmp operand types must match");
5082 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5087 #line 2044 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5089 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5090 GEN_ERROR("vfcmp operand types must match");
5091 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5096 #line 2049 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5098 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5099 GEN_ERROR("Invalid extractelement operands");
5100 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5106 #line 2055 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5108 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5109 GEN_ERROR("Invalid insertelement operands");
5110 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5116 #line 2061 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5118 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5119 GEN_ERROR("Invalid shufflevector operands");
5120 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5126 #line 2067 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5128 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5129 GEN_ERROR("ExtractValue requires an aggregate operand");
5131 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5132 delete (yyvsp[(4) - (5)].ConstantList);
5138 #line 2075 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5140 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5141 GEN_ERROR("InsertValue requires an aggregate operand");
5143 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5144 delete (yyvsp[(6) - (7)].ConstantList);
5150 #line 2086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5152 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5158 #line 2090 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5160 (yyval.ConstVector) = new std::vector<Constant*>();
5161 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5167 #line 2098 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5168 { (yyval.BoolVal) = false; ;}
5172 #line 2098 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5173 { (yyval.BoolVal) = true; ;}
5177 #line 2101 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5178 { (yyval.BoolVal) = true; ;}
5182 #line 2101 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5183 { (yyval.BoolVal) = false; ;}
5187 #line 2104 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5189 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5190 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5192 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5194 GEN_ERROR("Aliases can be created only to global values");
5196 (yyval.ConstVal) = Aliasee;
5198 delete (yyvsp[(1) - (2)].TypeVal);
5203 #line 2116 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5205 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5206 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5207 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5208 GEN_ERROR("invalid cast opcode for cast from '" +
5209 Val->getType()->getDescription() + "' to '" +
5210 DestTy->getDescription() + "'");
5212 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5214 delete (yyvsp[(5) - (6)].TypeVal);
5219 #line 2137 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5221 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5222 CurModule.ModuleDone();
5228 #line 2142 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5230 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5231 CurModule.ModuleDone();
5237 #line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5238 { CurFun.isDeclare = false; ;}
5242 #line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5244 CurFun.FunctionDone();
5250 #line 2159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5251 { CurFun.isDeclare = true; ;}
5255 #line 2159 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5262 #line 2162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5269 #line 2165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5271 if (!UpRefs.empty())
5272 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5273 // Eagerly resolve types. This is not an optimization, this is a
5274 // requirement that is due to the fact that we could have this:
5276 // %list = type { %list * }
5277 // %list = type { %list * } ; repeated type decl
5279 // If types are not resolved eagerly, then the two types will not be
5280 // determined to be the same type!
5282 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5284 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5286 // If this is a named type that is not a redefinition, add it to the slot
5288 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5291 delete (yyvsp[(3) - (3)].TypeVal);
5297 #line 2189 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5299 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5301 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5303 // If this is a named type that is not a redefinition, add it to the slot
5305 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5312 #line 2201 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5314 /* "Externally Visible" Linkage */
5315 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5316 GEN_ERROR("Global value initializer is not a constant");
5317 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5318 (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));
5324 #line 2208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5331 #line 2212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5333 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5334 GEN_ERROR("Global value initializer is not a constant");
5335 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));
5341 #line 2217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5348 #line 2221 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5350 if (!UpRefs.empty())
5351 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5352 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));
5354 delete (yyvsp[(6) - (7)].TypeVal);
5359 #line 2227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5367 #line 2231 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5370 if ((yyvsp[(1) - (5)].StrVal)) {
5371 Name = *(yyvsp[(1) - (5)].StrVal);
5372 delete (yyvsp[(1) - (5)].StrVal);
5375 GEN_ERROR("Alias name cannot be empty");
5377 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5379 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5381 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5382 CurModule.CurrentModule);
5383 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5384 InsertValue(GA, CurModule.Values);
5387 // If there was a forward reference of this alias, resolve it now.
5391 ID = ValID::createGlobalName(Name);
5393 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5395 if (GlobalValue *FWGV =
5396 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5397 // Replace uses of the fwdref with the actual alias.
5398 FWGV->replaceAllUsesWith(GA);
5399 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5400 GV->eraseFromParent();
5402 cast<Function>(FWGV)->eraseFromParent();
5411 #line 2271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5418 #line 2274 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5425 #line 2280 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5427 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5428 if (AsmSoFar.empty())
5429 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5431 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5432 delete (yyvsp[(1) - (1)].StrVal);
5438 #line 2290 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5440 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5441 delete (yyvsp[(3) - (3)].StrVal);
5446 #line 2294 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5448 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5449 delete (yyvsp[(3) - (3)].StrVal);
5454 #line 2301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5456 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5457 delete (yyvsp[(3) - (3)].StrVal);
5463 #line 2306 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5465 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5466 delete (yyvsp[(1) - (1)].StrVal);
5472 #line 2311 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5479 #line 2320 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5481 if (!UpRefs.empty())
5482 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5483 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5484 GEN_ERROR("Argument types must be first-class");
5485 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].Attributes); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5486 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5487 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5493 #line 2330 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5495 if (!UpRefs.empty())
5496 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5497 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5498 GEN_ERROR("Argument types must be first-class");
5499 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].Attributes); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5500 (yyval.ArgList) = new ArgListType;
5501 (yyval.ArgList)->push_back(E);
5507 #line 2341 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5509 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5515 #line 2345 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5517 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5518 struct ArgListEntry E;
5519 E.Ty = new PATypeHolder(Type::VoidTy);
5521 E.Attrs = Attribute::None;
5522 (yyval.ArgList)->push_back(E);
5528 #line 2354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5530 (yyval.ArgList) = new ArgListType;
5531 struct ArgListEntry E;
5532 E.Ty = new PATypeHolder(Type::VoidTy);
5534 E.Attrs = Attribute::None;
5535 (yyval.ArgList)->push_back(E);
5541 #line 2363 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5543 (yyval.ArgList) = 0;
5549 #line 2369 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5551 std::string FunctionName(*(yyvsp[(4) - (11)].StrVal));
5552 delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory!
5554 // Check the function result for abstractness if this is a define. We should
5555 // have no abstract types at this point
5556 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(3) - (11)].TypeVal)))
5557 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(3) - (11)].TypeVal)->get()->getDescription());
5559 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (11)].TypeVal)))
5560 GEN_ERROR("Invalid result type for LLVM function");
5562 std::vector<const Type*> ParamTypeList;
5563 SmallVector<AttributeWithIndex, 8> Attrs;
5564 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
5566 Attributes RetAttrs = (yyvsp[(2) - (11)].Attributes);
5567 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None) {
5568 if ((yyvsp[(8) - (11)].Attributes) & Attribute::ZExt) {
5569 RetAttrs = RetAttrs | Attribute::ZExt;
5570 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::ZExt;
5572 if ((yyvsp[(8) - (11)].Attributes) & Attribute::SExt) {
5573 RetAttrs = RetAttrs | Attribute::SExt;
5574 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::SExt;
5576 if ((yyvsp[(8) - (11)].Attributes) & Attribute::InReg) {
5577 RetAttrs = RetAttrs | Attribute::InReg;
5578 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::InReg;
5581 if (RetAttrs != Attribute::None)
5582 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
5583 if ((yyvsp[(6) - (11)].ArgList)) { // If there are arguments...
5585 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin(); I != (yyvsp[(6) - (11)].ArgList)->end(); ++I, ++index) {
5586 const Type* Ty = I->Ty->get();
5587 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5588 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5589 ParamTypeList.push_back(Ty);
5590 if (Ty != Type::VoidTy && I->Attrs != Attribute::None)
5591 Attrs.push_back(AttributeWithIndex::get(index, I->Attrs));
5594 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None)
5595 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(8) - (11)].Attributes)));
5597 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5598 if (isVarArg) ParamTypeList.pop_back();
5602 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
5604 FunctionType *FT = FunctionType::get(*(yyvsp[(3) - (11)].TypeVal), ParamTypeList, isVarArg);
5605 const PointerType *PFT = PointerType::getUnqual(FT);
5606 delete (yyvsp[(3) - (11)].TypeVal);
5609 if (!FunctionName.empty()) {
5610 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5612 ID = ValID::createGlobalID(CurModule.Values.size());
5616 // See if this function was forward referenced. If so, recycle the object.
5617 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5618 // Move the function to the end of the list, from whereever it was
5619 // previously inserted.
5620 Fn = cast<Function>(FWRef);
5621 assert(Fn->getAttributes().isEmpty() &&
5622 "Forward reference has parameter attributes!");
5623 CurModule.CurrentModule->getFunctionList().remove(Fn);
5624 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5625 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5626 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5627 if (Fn->getFunctionType() != FT ) {
5628 // The existing function doesn't have the same type. This is an overload
5630 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5631 } else if (Fn->getAttributes() != PAL) {
5632 // The existing function doesn't have the same parameter attributes.
5633 // This is an overload error.
5634 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5635 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5636 // Neither the existing or the current function is a declaration and they
5637 // have the same name and same type. Clearly this is a redefinition.
5638 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5639 } else if (Fn->isDeclaration()) {
5640 // Make sure to strip off any argument names so we can't get conflicts.
5641 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5645 } else { // Not already defined?
5646 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5647 CurModule.CurrentModule);
5648 InsertValue(Fn, CurModule.Values);
5652 CurFun.FunctionStart(Fn);
5654 if (CurFun.isDeclare) {
5655 // If we have declaration, always overwrite linkage. This will allow us to
5656 // correctly handle cases, when pointer to function is passed as argument to
5657 // another function.
5658 Fn->setLinkage(CurFun.Linkage);
5659 Fn->setVisibility(CurFun.Visibility);
5661 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5662 Fn->setAttributes(PAL);
5663 Fn->setAlignment((yyvsp[(10) - (11)].UIntVal));
5664 if ((yyvsp[(9) - (11)].StrVal)) {
5665 Fn->setSection(*(yyvsp[(9) - (11)].StrVal));
5666 delete (yyvsp[(9) - (11)].StrVal);
5668 if ((yyvsp[(11) - (11)].StrVal)) {
5669 Fn->setGC((yyvsp[(11) - (11)].StrVal)->c_str());
5670 delete (yyvsp[(11) - (11)].StrVal);
5673 // Add all of the arguments we parsed to the function...
5674 if ((yyvsp[(6) - (11)].ArgList)) { // Is null if empty...
5675 if (isVarArg) { // Nuke the last entry
5676 assert((yyvsp[(6) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(6) - (11)].ArgList)->back().Name == 0 &&
5677 "Not a varargs marker!");
5678 delete (yyvsp[(6) - (11)].ArgList)->back().Ty;
5679 (yyvsp[(6) - (11)].ArgList)->pop_back(); // Delete the last entry
5681 Function::arg_iterator ArgIt = Fn->arg_begin();
5682 Function::arg_iterator ArgEnd = Fn->arg_end();
5684 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin();
5685 I != (yyvsp[(6) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5686 delete I->Ty; // Delete the typeholder...
5687 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5693 delete (yyvsp[(6) - (11)].ArgList); // We're now done with the argument list
5700 #line 2519 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5702 (yyval.FunctionVal) = CurFun.CurrentFunction;
5704 // Make sure that we keep track of the linkage type even if there was a
5705 // previous "declare".
5706 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5707 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5712 #line 2530 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5714 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5720 #line 2535 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5722 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5723 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5724 (yyval.FunctionVal) = CurFun.CurrentFunction;
5725 CurFun.FunctionDone();
5731 #line 2547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5733 (yyval.BoolVal) = false;
5739 #line 2551 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5741 (yyval.BoolVal) = true;
5747 #line 2556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5748 { // A reference to a direct constant
5749 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5755 #line 2560 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5757 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5763 #line 2564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5764 { // arbitrary precision integer constants
5765 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5766 delete (yyvsp[(1) - (1)].APIntVal);
5772 #line 2569 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5773 { // arbitrary precision integer constants
5774 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5775 delete (yyvsp[(1) - (1)].APIntVal);
5781 #line 2574 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5782 { // Perhaps it's an FP constant?
5783 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5789 #line 2578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5791 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5797 #line 2582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5799 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5805 #line 2586 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5807 (yyval.ValIDVal) = ValID::createNull();
5813 #line 2590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5815 (yyval.ValIDVal) = ValID::createUndef();
5821 #line 2594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5822 { // A vector zero constant.
5823 (yyval.ValIDVal) = ValID::createZeroInit();
5829 #line 2598 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5830 { // Nonempty unsized packed vector
5831 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5832 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5834 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5835 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5837 VectorType* pt = VectorType::get(ETy, NumElements);
5838 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5840 // Verify all elements are correct type!
5841 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5842 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5843 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5844 ETy->getDescription() +"' as required!\nIt is of type '" +
5845 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5848 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5849 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5855 #line 2620 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5856 { // Nonempty unsized arr
5857 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5858 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5860 if (!ETy->isFirstClassType())
5861 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5863 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5864 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5866 // Verify all elements are correct type!
5867 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5868 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5869 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5870 ETy->getDescription() +"' as required!\nIt is of type '"+
5871 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5874 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5875 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5881 #line 2642 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5883 // Use undef instead of an array because it's inconvenient to determine
5884 // the element type at this point, there being no elements to examine.
5885 (yyval.ValIDVal) = ValID::createUndef();
5891 #line 2648 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5893 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5894 const Type *ETy = Type::Int8Ty;
5896 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5898 std::vector<Constant*> Vals;
5899 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5900 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5901 delete (yyvsp[(2) - (2)].StrVal);
5902 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5908 #line 2661 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5910 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5911 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5912 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5914 const StructType *STy = StructType::get(Elements);
5915 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5917 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5918 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5924 #line 2673 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5926 const StructType *STy = StructType::get(std::vector<const Type*>());
5927 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5933 #line 2678 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5935 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5936 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5937 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5939 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5940 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5942 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5943 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5949 #line 2690 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5951 const StructType *STy = StructType::get(std::vector<const Type*>(),
5953 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5959 #line 2696 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5961 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5967 #line 2700 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5969 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5970 delete (yyvsp[(3) - (5)].StrVal);
5971 delete (yyvsp[(5) - (5)].StrVal);
5977 #line 2710 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5978 { // Is it an integer reference...?
5979 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5985 #line 2714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5987 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5993 #line 2718 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5994 { // Is it a named reference...?
5995 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5996 delete (yyvsp[(1) - (1)].StrVal);
6002 #line 2723 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6003 { // Is it a named reference...?
6004 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
6005 delete (yyvsp[(1) - (1)].StrVal);
6011 #line 2736 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6013 if (!UpRefs.empty())
6014 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
6015 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
6016 delete (yyvsp[(1) - (2)].TypeVal);
6022 #line 2745 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6024 (yyval.ValueList) = new std::vector<Value *>();
6025 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
6031 #line 2750 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6033 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6039 #line 2755 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6041 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6047 #line 2759 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6048 { // Do not allow functions with 0 basic blocks
6049 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6055 #line 2768 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6057 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6059 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6060 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6061 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6067 #line 2777 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6070 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6071 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6072 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6073 " is incorrect, expected %" + utostr((unsigned)ValNum));
6075 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6076 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6082 #line 2790 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6084 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6085 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6086 if (CI2->getParent() == 0)
6087 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6088 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6089 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6095 #line 2799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6096 { // Empty space between instruction lists
6097 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6103 #line 2803 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6104 { // Labelled (named) basic block
6105 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6106 delete (yyvsp[(1) - (1)].StrVal);
6113 #line 2811 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6114 { // Return with a result...
6115 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6116 assert(!VL.empty() && "Invalid ret operands!");
6117 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6118 if (VL.size() > 1 ||
6119 (isa<StructType>(ReturnType) &&
6120 (VL.empty() || VL[0]->getType() != ReturnType))) {
6121 Value *RV = UndefValue::get(ReturnType);
6122 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6123 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6124 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6127 (yyval.TermInstVal) = ReturnInst::Create(RV);
6129 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6131 delete (yyvsp[(2) - (2)].ValueList);
6137 #line 2831 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6138 { // Return with no result...
6139 (yyval.TermInstVal) = ReturnInst::Create();
6145 #line 2835 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6146 { // Unconditional Branch...
6147 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6149 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6154 #line 2840 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6156 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6157 GEN_ERROR("Branch condition must have type i1");
6158 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6160 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6162 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6164 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6169 #line 2851 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6171 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6173 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6175 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6176 (yyval.TermInstVal) = S;
6178 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6179 E = (yyvsp[(8) - (9)].JumpTable)->end();
6180 for (; I != E; ++I) {
6181 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6182 S->addCase(CI, I->second);
6184 GEN_ERROR("Switch case is constant, but not a simple integer");
6186 delete (yyvsp[(8) - (9)].JumpTable);
6192 #line 2870 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6194 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6196 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6198 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6199 (yyval.TermInstVal) = S;
6205 #line 2880 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6208 // Handle the short syntax
6209 const PointerType *PFTy = 0;
6210 const FunctionType *Ty = 0;
6211 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (15)].TypeVal)->get())) ||
6212 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6213 // Pull out the types of all of the arguments...
6214 std::vector<const Type*> ParamTypes;
6215 ParamList::iterator I = (yyvsp[(7) - (15)].ParamList)->begin(), E = (yyvsp[(7) - (15)].ParamList)->end();
6216 for (; I != E; ++I) {
6217 const Type *Ty = I->Val->getType();
6218 if (Ty == Type::VoidTy)
6219 GEN_ERROR("Short call syntax cannot be used with varargs");
6220 ParamTypes.push_back(Ty);
6223 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (15)].TypeVal)))
6224 GEN_ERROR("Invalid result type for LLVM function");
6226 Ty = FunctionType::get((yyvsp[(4) - (15)].TypeVal)->get(), ParamTypes, false);
6227 PFTy = PointerType::getUnqual(Ty);
6230 delete (yyvsp[(4) - (15)].TypeVal);
6232 Value *V = getVal(PFTy, (yyvsp[(5) - (15)].ValIDVal)); // Get the function we're calling...
6234 BasicBlock *Normal = getBBVal((yyvsp[(12) - (15)].ValIDVal));
6236 BasicBlock *Except = getBBVal((yyvsp[(15) - (15)].ValIDVal));
6239 SmallVector<AttributeWithIndex, 8> Attrs;
6240 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6242 Attributes RetAttrs = (yyvsp[(3) - (15)].Attributes);
6243 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None) {
6244 if ((yyvsp[(9) - (15)].Attributes) & Attribute::ZExt) {
6245 RetAttrs = RetAttrs | Attribute::ZExt;
6246 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::ZExt;
6248 if ((yyvsp[(9) - (15)].Attributes) & Attribute::SExt) {
6249 RetAttrs = RetAttrs | Attribute::SExt;
6250 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::SExt;
6252 if ((yyvsp[(9) - (15)].Attributes) & Attribute::InReg) {
6253 RetAttrs = RetAttrs | Attribute::InReg;
6254 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::InReg;
6257 if (RetAttrs != Attribute::None)
6258 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6260 // Check the arguments
6262 if ((yyvsp[(7) - (15)].ParamList)->empty()) { // Has no arguments?
6263 // Make sure no arguments is a good thing!
6264 if (Ty->getNumParams() != 0)
6265 GEN_ERROR("No arguments passed to a function that "
6266 "expects arguments");
6267 } else { // Has arguments?
6268 // Loop through FunctionType's arguments and ensure they are specified
6270 FunctionType::param_iterator I = Ty->param_begin();
6271 FunctionType::param_iterator E = Ty->param_end();
6272 ParamList::iterator ArgI = (yyvsp[(7) - (15)].ParamList)->begin(), ArgE = (yyvsp[(7) - (15)].ParamList)->end();
6275 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6276 if (ArgI->Val->getType() != *I)
6277 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6278 (*I)->getDescription() + "'");
6279 Args.push_back(ArgI->Val);
6280 if (ArgI->Attrs != Attribute::None)
6281 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6284 if (Ty->isVarArg()) {
6286 for (; ArgI != ArgE; ++ArgI, ++index) {
6287 Args.push_back(ArgI->Val); // push the remaining varargs
6288 if (ArgI->Attrs != Attribute::None)
6289 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6291 } else if (I != E || ArgI != ArgE)
6292 GEN_ERROR("Invalid number of parameters detected");
6294 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None)
6295 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (15)].Attributes)));
6298 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6300 // Create the InvokeInst
6301 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6302 Args.begin(), Args.end());
6303 II->setCallingConv((yyvsp[(2) - (15)].UIntVal));
6304 II->setAttributes(PAL);
6305 (yyval.TermInstVal) = II;
6306 delete (yyvsp[(7) - (15)].ParamList);
6312 #line 2983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6314 (yyval.TermInstVal) = new UnwindInst();
6320 #line 2987 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6322 (yyval.TermInstVal) = new UnreachableInst();
6328 #line 2994 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6330 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6331 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6334 GEN_ERROR("May only switch on a constant pool value");
6336 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6338 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6343 #line 3005 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6345 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6346 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6350 GEN_ERROR("May only switch on a constant pool value");
6352 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6354 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6359 #line 3018 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6361 // Is this definition named?? if so, assign the name...
6362 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6364 InsertValue((yyvsp[(2) - (2)].InstVal));
6365 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6371 #line 3027 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6374 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6376 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6377 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6378 " is incorrect, expected %" + utostr((unsigned)ValNum));
6380 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6386 #line 3040 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6387 { // Used for PHI nodes
6388 if (!UpRefs.empty())
6389 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6390 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6391 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6393 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6395 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6396 delete (yyvsp[(1) - (6)].TypeVal);
6401 #line 3051 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6403 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6404 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6406 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6408 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6413 #line 3061 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6415 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6416 if (!UpRefs.empty())
6417 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6418 // Used for call and invoke instructions
6419 (yyval.ParamList) = new ParamList();
6420 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6421 (yyval.ParamList)->push_back(E);
6422 delete (yyvsp[(1) - (4)].TypeVal);
6428 #line 3072 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6430 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6431 // Labels are only valid in ASMs
6432 (yyval.ParamList) = new ParamList();
6433 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6434 (yyval.ParamList)->push_back(E);
6440 #line 3080 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6442 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6443 if (!UpRefs.empty())
6444 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6445 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6446 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6447 (yyval.ParamList)->push_back(E);
6448 delete (yyvsp[(3) - (6)].TypeVal);
6454 #line 3090 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6456 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6457 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6458 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6459 (yyval.ParamList)->push_back(E);
6465 #line 3097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6466 { (yyval.ParamList) = new ParamList(); ;}
6470 #line 3100 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6471 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6475 #line 3101 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6477 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6478 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6484 #line 3109 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6486 (yyval.ConstantList) = new std::vector<unsigned>();
6487 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6488 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6489 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6494 #line 3115 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6496 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6497 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6498 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6499 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6505 #line 3124 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6507 (yyval.BoolVal) = true;
6513 #line 3128 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6515 (yyval.BoolVal) = false;
6521 #line 3133 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6523 if (!UpRefs.empty())
6524 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6525 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6526 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6528 "Arithmetic operator requires integer, FP, or packed operands");
6529 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6531 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6533 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6534 if ((yyval.InstVal) == 0)
6535 GEN_ERROR("binary operator returned null");
6536 delete (yyvsp[(2) - (5)].TypeVal);
6541 #line 3149 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6543 if (!UpRefs.empty())
6544 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6545 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6546 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6547 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6548 GEN_ERROR("Logical operator requires integral operands");
6550 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6552 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6554 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6555 if ((yyval.InstVal) == 0)
6556 GEN_ERROR("binary operator returned null");
6557 delete (yyvsp[(2) - (5)].TypeVal);
6562 #line 3166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6564 if (!UpRefs.empty())
6565 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6566 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6568 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6570 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6571 if ((yyval.InstVal) == 0)
6572 GEN_ERROR("icmp operator returned null");
6573 delete (yyvsp[(3) - (6)].TypeVal);
6578 #line 3178 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6580 if (!UpRefs.empty())
6581 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6582 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6584 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6586 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6587 if ((yyval.InstVal) == 0)
6588 GEN_ERROR("fcmp operator returned null");
6589 delete (yyvsp[(3) - (6)].TypeVal);
6594 #line 3190 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6596 if (!UpRefs.empty())
6597 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6598 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6599 GEN_ERROR("Scalar types not supported by vicmp instruction");
6600 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6602 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6604 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6605 if ((yyval.InstVal) == 0)
6606 GEN_ERROR("vicmp operator returned null");
6607 delete (yyvsp[(3) - (6)].TypeVal);
6612 #line 3204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6614 if (!UpRefs.empty())
6615 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6616 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6617 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6618 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6620 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6622 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6623 if ((yyval.InstVal) == 0)
6624 GEN_ERROR("vfcmp operator returned null");
6625 delete (yyvsp[(3) - (6)].TypeVal);
6630 #line 3218 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6632 if (!UpRefs.empty())
6633 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6634 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6635 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6636 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6637 GEN_ERROR("invalid cast opcode for cast from '" +
6638 Val->getType()->getDescription() + "' to '" +
6639 DestTy->getDescription() + "'");
6640 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6641 delete (yyvsp[(4) - (4)].TypeVal);
6646 #line 3230 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6648 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6650 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6651 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6652 GEN_ERROR("vector select value types must be vector types");
6653 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6654 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6655 if (cond_type->getElementType() != Type::Int1Ty)
6656 GEN_ERROR("vector select condition element type must be boolean");
6657 if (cond_type->getNumElements() != select_type->getNumElements())
6658 GEN_ERROR("vector select number of elements must be the same");
6660 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6661 GEN_ERROR("select condition must be boolean");
6663 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6664 GEN_ERROR("select value types must match");
6665 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6671 #line 3251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6673 if (!UpRefs.empty())
6674 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6675 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6676 delete (yyvsp[(4) - (4)].TypeVal);
6682 #line 3258 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6684 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6685 GEN_ERROR("Invalid extractelement operands");
6686 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6692 #line 3264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6694 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6695 GEN_ERROR("Invalid insertelement operands");
6696 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6702 #line 3270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6704 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6705 GEN_ERROR("Invalid shufflevector operands");
6706 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6712 #line 3276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6714 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6715 if (!Ty->isFirstClassType())
6716 GEN_ERROR("PHI node operands must be of first class type");
6717 (yyval.InstVal) = PHINode::Create(Ty);
6718 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6719 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6720 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6721 GEN_ERROR("All elements of a PHI node must be of the same type");
6722 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6723 (yyvsp[(2) - (2)].PHIList)->pop_front();
6725 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6731 #line 3292 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6734 // Handle the short syntax
6735 const PointerType *PFTy = 0;
6736 const FunctionType *Ty = 0;
6737 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (9)].TypeVal)->get())) ||
6738 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6739 // Pull out the types of all of the arguments...
6740 std::vector<const Type*> ParamTypes;
6741 ParamList::iterator I = (yyvsp[(7) - (9)].ParamList)->begin(), E = (yyvsp[(7) - (9)].ParamList)->end();
6742 for (; I != E; ++I) {
6743 const Type *Ty = I->Val->getType();
6744 if (Ty == Type::VoidTy)
6745 GEN_ERROR("Short call syntax cannot be used with varargs");
6746 ParamTypes.push_back(Ty);
6749 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (9)].TypeVal)))
6750 GEN_ERROR("Invalid result type for LLVM function");
6752 Ty = FunctionType::get((yyvsp[(4) - (9)].TypeVal)->get(), ParamTypes, false);
6753 PFTy = PointerType::getUnqual(Ty);
6756 Value *V = getVal(PFTy, (yyvsp[(5) - (9)].ValIDVal)); // Get the function we're calling...
6759 // Check for call to invalid intrinsic to avoid crashing later.
6760 if (Function *theF = dyn_cast<Function>(V)) {
6761 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6762 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6763 !theF->getIntrinsicID(true))
6764 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6765 theF->getName() + "'");
6768 // Set up the Attributes for the function
6769 SmallVector<AttributeWithIndex, 8> Attrs;
6770 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6772 Attributes RetAttrs = (yyvsp[(3) - (9)].Attributes);
6773 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None) {
6774 if ((yyvsp[(9) - (9)].Attributes) & Attribute::ZExt) {
6775 RetAttrs = RetAttrs | Attribute::ZExt;
6776 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::ZExt;
6778 if ((yyvsp[(9) - (9)].Attributes) & Attribute::SExt) {
6779 RetAttrs = RetAttrs | Attribute::SExt;
6780 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::SExt;
6782 if ((yyvsp[(9) - (9)].Attributes) & Attribute::InReg) {
6783 RetAttrs = RetAttrs | Attribute::InReg;
6784 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::InReg;
6787 if (RetAttrs != Attribute::None)
6788 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6790 // Check the arguments
6792 if ((yyvsp[(7) - (9)].ParamList)->empty()) { // Has no arguments?
6793 // Make sure no arguments is a good thing!
6794 if (Ty->getNumParams() != 0)
6795 GEN_ERROR("No arguments passed to a function that "
6796 "expects arguments");
6797 } else { // Has arguments?
6798 // Loop through FunctionType's arguments and ensure they are specified
6799 // correctly. Also, gather any parameter attributes.
6800 FunctionType::param_iterator I = Ty->param_begin();
6801 FunctionType::param_iterator E = Ty->param_end();
6802 ParamList::iterator ArgI = (yyvsp[(7) - (9)].ParamList)->begin(), ArgE = (yyvsp[(7) - (9)].ParamList)->end();
6805 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6806 if (ArgI->Val->getType() != *I)
6807 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6808 (*I)->getDescription() + "'");
6809 Args.push_back(ArgI->Val);
6810 if (ArgI->Attrs != Attribute::None)
6811 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6813 if (Ty->isVarArg()) {
6815 for (; ArgI != ArgE; ++ArgI, ++index) {
6816 Args.push_back(ArgI->Val); // push the remaining varargs
6817 if (ArgI->Attrs != Attribute::None)
6818 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6820 } else if (I != E || ArgI != ArgE)
6821 GEN_ERROR("Invalid number of parameters detected");
6823 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None)
6824 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (9)].Attributes)));
6826 // Finish off the Attributes and check them
6829 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6831 // Create the call node
6832 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6833 CI->setTailCall((yyvsp[(1) - (9)].BoolVal));
6834 CI->setCallingConv((yyvsp[(2) - (9)].UIntVal));
6835 CI->setAttributes(PAL);
6836 (yyval.InstVal) = CI;
6837 delete (yyvsp[(7) - (9)].ParamList);
6838 delete (yyvsp[(4) - (9)].TypeVal);
6844 #line 3401 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6846 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6852 #line 3406 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6854 (yyval.BoolVal) = true;
6860 #line 3410 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6862 (yyval.BoolVal) = false;
6868 #line 3417 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6870 if (!UpRefs.empty())
6871 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6872 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6873 delete (yyvsp[(2) - (3)].TypeVal);
6879 #line 3424 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6881 if (!UpRefs.empty())
6882 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6883 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6884 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6885 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6887 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6888 delete (yyvsp[(2) - (6)].TypeVal);
6893 #line 3434 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6895 if (!UpRefs.empty())
6896 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6897 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6898 delete (yyvsp[(2) - (3)].TypeVal);
6904 #line 3441 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6906 if (!UpRefs.empty())
6907 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6908 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6909 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6910 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6912 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6913 delete (yyvsp[(2) - (6)].TypeVal);
6918 #line 3451 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6920 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6921 GEN_ERROR("Trying to free nonpointer type " +
6922 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6923 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6929 #line 3459 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6931 if (!UpRefs.empty())
6932 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6933 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6934 GEN_ERROR("Can't load from nonpointer type: " +
6935 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6936 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6937 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6938 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6939 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6941 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6942 delete (yyvsp[(3) - (5)].TypeVal);
6947 #line 3473 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6949 if (!UpRefs.empty())
6950 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6951 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6953 GEN_ERROR("Can't store to a nonpointer type: " +
6954 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6955 const Type *ElTy = PT->getElementType();
6956 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6957 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6958 "' into space of type '" + ElTy->getDescription() + "'");
6960 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6962 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6963 delete (yyvsp[(5) - (7)].TypeVal);
6968 #line 3490 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6970 if (!UpRefs.empty())
6971 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6972 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6973 GEN_ERROR("getresult insn requires an aggregate operand");
6974 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6975 GEN_ERROR("Invalid getresult index for type '" +
6976 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6978 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6980 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6981 delete (yyvsp[(2) - (5)].TypeVal);
6986 #line 3504 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6988 if (!UpRefs.empty())
6989 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6990 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6991 GEN_ERROR("getelementptr insn requires pointer operand");
6993 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6994 GEN_ERROR("Invalid getelementptr indices for type '" +
6995 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6996 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6998 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6999 delete (yyvsp[(2) - (4)].TypeVal);
7000 delete (yyvsp[(4) - (4)].ValueList);
7005 #line 3519 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7007 if (!UpRefs.empty())
7008 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
7009 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
7010 GEN_ERROR("extractvalue insn requires an aggregate operand");
7012 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
7013 GEN_ERROR("Invalid extractvalue indices for type '" +
7014 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7015 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7017 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
7018 delete (yyvsp[(2) - (4)].TypeVal);
7019 delete (yyvsp[(4) - (4)].ConstantList);
7024 #line 3534 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7026 if (!UpRefs.empty())
7027 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
7028 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
7029 GEN_ERROR("extractvalue insn requires an aggregate operand");
7031 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
7032 GEN_ERROR("Invalid insertvalue indices for type '" +
7033 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
7034 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
7035 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
7037 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
7038 delete (yyvsp[(2) - (7)].TypeVal);
7039 delete (yyvsp[(5) - (7)].TypeVal);
7040 delete (yyvsp[(7) - (7)].ConstantList);
7045 /* Line 1267 of yacc.c. */
7046 #line 7047 "llvmAsmParser.tab.c"
7049 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7053 YY_STACK_PRINT (yyss, yyssp);
7058 /* Now `shift' the result of the reduction. Determine what state
7059 that goes to, based on the state we popped back to and the rule
7060 number reduced by. */
7064 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7065 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7066 yystate = yytable[yystate];
7068 yystate = yydefgoto[yyn - YYNTOKENS];
7073 /*------------------------------------.
7074 | yyerrlab -- here on detecting error |
7075 `------------------------------------*/
7077 /* If not already recovering from an error, report this error. */
7081 #if ! YYERROR_VERBOSE
7082 yyerror (YY_("syntax error"));
7085 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7086 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7088 YYSIZE_T yyalloc = 2 * yysize;
7089 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7090 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7091 if (yymsg != yymsgbuf)
7092 YYSTACK_FREE (yymsg);
7093 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7095 yymsg_alloc = yyalloc;
7099 yymsg_alloc = sizeof yymsgbuf;
7103 if (0 < yysize && yysize <= yymsg_alloc)
7105 (void) yysyntax_error (yymsg, yystate, yychar);
7110 yyerror (YY_("syntax error"));
7112 goto yyexhaustedlab;
7120 if (yyerrstatus == 3)
7122 /* If just tried and failed to reuse look-ahead token after an
7123 error, discard it. */
7125 if (yychar <= YYEOF)
7127 /* Return failure if at end of input. */
7128 if (yychar == YYEOF)
7133 yydestruct ("Error: discarding",
7139 /* Else will try to reuse look-ahead token after shifting the error
7144 /*---------------------------------------------------.
7145 | yyerrorlab -- error raised explicitly by YYERROR. |
7146 `---------------------------------------------------*/
7149 /* Pacify compilers like GCC when the user code never invokes
7150 YYERROR and the label yyerrorlab therefore never appears in user
7152 if (/*CONSTCOND*/ 0)
7155 /* Do not reclaim the symbols of the rule which action triggered
7159 YY_STACK_PRINT (yyss, yyssp);
7164 /*-------------------------------------------------------------.
7165 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7166 `-------------------------------------------------------------*/
7168 yyerrstatus = 3; /* Each real token shifted decrements this. */
7172 yyn = yypact[yystate];
7173 if (yyn != YYPACT_NINF)
7176 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7184 /* Pop the current state because it cannot handle the error token. */
7189 yydestruct ("Error: popping",
7190 yystos[yystate], yyvsp);
7193 YY_STACK_PRINT (yyss, yyssp);
7202 /* Shift the error token. */
7203 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7209 /*-------------------------------------.
7210 | yyacceptlab -- YYACCEPT comes here. |
7211 `-------------------------------------*/
7216 /*-----------------------------------.
7217 | yyabortlab -- YYABORT comes here. |
7218 `-----------------------------------*/
7224 /*-------------------------------------------------.
7225 | yyexhaustedlab -- memory exhaustion comes here. |
7226 `-------------------------------------------------*/
7228 yyerror (YY_("memory exhausted"));
7234 if (yychar != YYEOF && yychar != YYEMPTY)
7235 yydestruct ("Cleanup: discarding lookahead",
7237 /* Do not reclaim the symbols of the rule which action triggered
7238 this YYABORT or YYACCEPT. */
7240 YY_STACK_PRINT (yyss, yyssp);
7241 while (yyssp != yyss)
7243 yydestruct ("Cleanup: popping",
7244 yystos[*yyssp], yyvsp);
7249 YYSTACK_FREE (yyss);
7252 if (yymsg != yymsgbuf)
7253 YYSTACK_FREE (yymsg);
7255 /* Make sure YYID is used. */
7256 return YYID (yyresult);
7260 #line 3553 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7263 // common code from the two 'RunVMAsmParser' functions
7264 static Module* RunParser(Module * M) {
7265 CurModule.CurrentModule = M;
7266 // Check to make sure the parser succeeded
7269 delete ParserResult;
7273 // Emit an error if there are any unresolved types left.
7274 if (!CurModule.LateResolveTypes.empty()) {
7275 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7276 if (DID.Type == ValID::LocalName) {
7277 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7279 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7282 delete ParserResult;
7286 // Emit an error if there are any unresolved values left.
7287 if (!CurModule.LateResolveValues.empty()) {
7288 Value *V = CurModule.LateResolveValues.back();
7289 std::map<Value*, std::pair<ValID, int> >::iterator I =
7290 CurModule.PlaceHolderInfo.find(V);
7292 if (I != CurModule.PlaceHolderInfo.end()) {
7293 ValID &DID = I->second.first;
7294 if (DID.Type == ValID::LocalName) {
7295 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7297 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7300 delete ParserResult;
7305 // Check to make sure that parsing produced a result
7309 // Reset ParserResult variable while saving its value for the result.
7310 Module *Result = ParserResult;
7316 void llvm::GenerateError(const std::string &message, int LineNo) {
7317 if (LineNo == -1) LineNo = LLLgetLineNo();
7318 // TODO: column number in exception
7320 TheParseError->setError(LLLgetFilename(), message, LineNo);
7324 int yyerror(const char *ErrorMsg) {
7325 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7326 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7327 if (yychar != YYEMPTY && yychar != 0) {
7328 errMsg += " while reading token: '";
7329 errMsg += std::string(LLLgetTokenStart(),
7330 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7332 GenerateError(errMsg);