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,
824 return ConstantFP::get(*D.ConstPoolFP);
826 case ValID::ConstNullVal: // Is it a null value?
827 if (!isa<PointerType>(Ty)) {
828 GenerateError("Cannot create a a non pointer null");
831 return ConstantPointerNull::get(cast<PointerType>(Ty));
833 case ValID::ConstUndefVal: // Is it an undef value?
834 return UndefValue::get(Ty);
836 case ValID::ConstZeroVal: // Is it a zero value?
837 return Constant::getNullValue(Ty);
839 case ValID::ConstantVal: // Fully resolved constant?
840 if (D.ConstantValue->getType() != Ty) {
841 GenerateError("Constant expression type different from required type");
844 return D.ConstantValue;
846 case ValID::InlineAsmVal: { // Inline asm expression
847 const PointerType *PTy = dyn_cast<PointerType>(Ty);
848 const FunctionType *FTy =
849 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
850 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
851 GenerateError("Invalid type for asm constraint string");
854 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
855 D.IAD->HasSideEffects);
856 D.destroy(); // Free InlineAsmDescriptor.
860 assert(0 && "Unhandled case!");
864 assert(0 && "Unhandled case!");
868 // getVal - This function is identical to getExistingVal, except that if a
869 // value is not already defined, it "improvises" by creating a placeholder var
870 // that looks and acts just like the requested variable. When the value is
871 // defined later, all uses of the placeholder variable are replaced with the
874 static Value *getVal(const Type *Ty, const ValID &ID) {
875 if (Ty == Type::LabelTy) {
876 GenerateError("Cannot use a basic block here");
880 // See if the value has already been defined.
881 Value *V = getExistingVal(Ty, ID);
883 if (TriggerError) return 0;
885 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
886 GenerateError("Invalid use of a non-first-class type");
890 // If we reached here, we referenced either a symbol that we don't know about
891 // or an id number that hasn't been read yet. We may be referencing something
892 // forward, so just create an entry to be resolved later and get to it...
895 case ValID::GlobalName:
896 case ValID::GlobalID: {
897 const PointerType *PTy = dyn_cast<PointerType>(Ty);
899 GenerateError("Invalid type for reference to global" );
902 const Type* ElTy = PTy->getElementType();
903 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
904 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
906 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
907 (Module*)0, false, PTy->getAddressSpace());
911 V = new Argument(Ty);
914 // Remember where this forward reference came from. FIXME, shouldn't we try
915 // to recycle these things??
916 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
919 if (inFunctionScope())
920 InsertValue(V, CurFun.LateResolveValues);
922 InsertValue(V, CurModule.LateResolveValues);
926 /// defineBBVal - This is a definition of a new basic block with the specified
927 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
928 static BasicBlock *defineBBVal(const ValID &ID) {
929 assert(inFunctionScope() && "Can't get basic block at global scope!");
933 // First, see if this was forward referenced
935 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
936 if (BBI != CurFun.BBForwardRefs.end()) {
938 // The forward declaration could have been inserted anywhere in the
939 // function: insert it into the correct place now.
940 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
941 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
943 // We're about to erase the entry, save the key so we can clean it up.
944 ValID Tmp = BBI->first;
946 // Erase the forward ref from the map as its no longer "forward"
947 CurFun.BBForwardRefs.erase(ID);
949 // The key has been removed from the map but so we don't want to leave
950 // strdup'd memory around so destroy it too.
953 // If its a numbered definition, bump the number and set the BB value.
954 if (ID.Type == ValID::LocalID) {
955 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
959 // We haven't seen this BB before and its first mention is a definition.
960 // Just create it and return it.
961 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
962 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
963 if (ID.Type == ValID::LocalID) {
964 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
973 /// getBBVal - get an existing BB value or create a forward reference for it.
975 static BasicBlock *getBBVal(const ValID &ID) {
976 assert(inFunctionScope() && "Can't get basic block at global scope!");
980 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
981 if (BBI != CurFun.BBForwardRefs.end()) {
983 } if (ID.Type == ValID::LocalName) {
984 std::string Name = ID.getName();
985 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
987 if (N->getType()->getTypeID() == Type::LabelTyID)
988 BB = cast<BasicBlock>(N);
990 GenerateError("Reference to label '" + Name + "' is actually of type '"+
991 N->getType()->getDescription() + "'");
993 } else if (ID.Type == ValID::LocalID) {
994 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
995 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
996 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
998 GenerateError("Reference to label '%" + utostr(ID.Num) +
999 "' is actually of type '"+
1000 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
1003 GenerateError("Illegal label reference " + ID.getName());
1007 // If its already been defined, return it now.
1009 ID.destroy(); // Free strdup'd memory.
1013 // Otherwise, this block has not been seen before, create it.
1015 if (ID.Type == ValID::LocalName)
1016 Name = ID.getName();
1017 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1019 // Insert it in the forward refs map.
1020 CurFun.BBForwardRefs[ID] = BB;
1026 //===----------------------------------------------------------------------===//
1027 // Code to handle forward references in instructions
1028 //===----------------------------------------------------------------------===//
1030 // This code handles the late binding needed with statements that reference
1031 // values not defined yet... for example, a forward branch, or the PHI node for
1034 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1035 // and back patchs after we are done.
1038 // ResolveDefinitions - If we could not resolve some defs at parsing
1039 // time (forward branches, phi functions for loops, etc...) resolve the
1043 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1044 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1045 while (!LateResolvers.empty()) {
1046 Value *V = LateResolvers.back();
1047 LateResolvers.pop_back();
1049 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1050 CurModule.PlaceHolderInfo.find(V);
1051 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1053 ValID &DID = PHI->second.first;
1055 Value *TheRealValue = getExistingVal(V->getType(), DID);
1059 V->replaceAllUsesWith(TheRealValue);
1061 CurModule.PlaceHolderInfo.erase(PHI);
1062 } else if (FutureLateResolvers) {
1063 // Functions have their unresolved items forwarded to the module late
1065 InsertValue(V, *FutureLateResolvers);
1067 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1068 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1069 "' of type '" + V->getType()->getDescription() + "'",
1070 PHI->second.second);
1073 GenerateError("Reference to an invalid definition: #" +
1074 itostr(DID.Num) + " of type '" +
1075 V->getType()->getDescription() + "'",
1076 PHI->second.second);
1081 LateResolvers.clear();
1084 // ResolveTypeTo - A brand new type was just declared. This means that (if
1085 // name is not null) things referencing Name can be resolved. Otherwise, things
1086 // refering to the number can be resolved. Do this now.
1088 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1091 D = ValID::createLocalName(*Name);
1093 D = ValID::createLocalID(CurModule.Types.size());
1095 std::map<ValID, PATypeHolder>::iterator I =
1096 CurModule.LateResolveTypes.find(D);
1097 if (I != CurModule.LateResolveTypes.end()) {
1098 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1100 CurModule.LateResolveTypes.erase(I);
1105 // setValueName - Set the specified value to the name given. The name may be
1106 // null potentially, in which case this is a noop. The string passed in is
1107 // assumed to be a malloc'd string buffer, and is free'd by this function.
1109 static void setValueName(Value *V, std::string *NameStr) {
1110 if (!NameStr) return;
1111 std::string Name(*NameStr); // Copy string
1112 delete NameStr; // Free old string
1114 if (V->getType() == Type::VoidTy) {
1115 GenerateError("Can't assign name '" + Name+"' to value with void type");
1119 assert(inFunctionScope() && "Must be in function scope!");
1120 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1121 if (ST.lookup(Name)) {
1122 GenerateError("Redefinition of value '" + Name + "' of type '" +
1123 V->getType()->getDescription() + "'");
1131 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1132 /// this is a declaration, otherwise it is a definition.
1133 static GlobalVariable *
1134 ParseGlobalVariable(std::string *NameStr,
1135 GlobalValue::LinkageTypes Linkage,
1136 GlobalValue::VisibilityTypes Visibility,
1137 bool isConstantGlobal, const Type *Ty,
1138 Constant *Initializer, bool IsThreadLocal,
1139 unsigned AddressSpace = 0) {
1140 if (isa<FunctionType>(Ty)) {
1141 GenerateError("Cannot declare global vars of function type");
1144 if (Ty == Type::LabelTy) {
1145 GenerateError("Cannot declare global vars of label type");
1149 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1153 Name = *NameStr; // Copy string
1154 delete NameStr; // Free old string
1157 // See if this global value was forward referenced. If so, recycle the
1160 if (!Name.empty()) {
1161 ID = ValID::createGlobalName(Name);
1163 ID = ValID::createGlobalID(CurModule.Values.size());
1166 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1167 // Move the global to the end of the list, from whereever it was
1168 // previously inserted.
1169 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1170 CurModule.CurrentModule->getGlobalList().remove(GV);
1171 CurModule.CurrentModule->getGlobalList().push_back(GV);
1172 GV->setInitializer(Initializer);
1173 GV->setLinkage(Linkage);
1174 GV->setVisibility(Visibility);
1175 GV->setConstant(isConstantGlobal);
1176 GV->setThreadLocal(IsThreadLocal);
1177 InsertValue(GV, CurModule.Values);
1184 // If this global has a name
1185 if (!Name.empty()) {
1186 // if the global we're parsing has an initializer (is a definition) and
1187 // has external linkage.
1188 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1189 // If there is already a global with external linkage with this name
1190 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1191 // If we allow this GVar to get created, it will be renamed in the
1192 // symbol table because it conflicts with an existing GVar. We can't
1193 // allow redefinition of GVars whose linking indicates that their name
1194 // must stay the same. Issue the error.
1195 GenerateError("Redefinition of global variable named '" + Name +
1196 "' of type '" + Ty->getDescription() + "'");
1201 // Otherwise there is no existing GV to use, create one now.
1202 GlobalVariable *GV =
1203 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1204 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1205 GV->setVisibility(Visibility);
1206 InsertValue(GV, CurModule.Values);
1210 // setTypeName - Set the specified type to the name given. The name may be
1211 // null potentially, in which case this is a noop. The string passed in is
1212 // assumed to be a malloc'd string buffer, and is freed by this function.
1214 // This function returns true if the type has already been defined, but is
1215 // allowed to be redefined in the specified context. If the name is a new name
1216 // for the type plane, it is inserted and false is returned.
1217 static bool setTypeName(const Type *T, std::string *NameStr) {
1218 assert(!inFunctionScope() && "Can't give types function-local names!");
1219 if (NameStr == 0) return false;
1221 std::string Name(*NameStr); // Copy string
1222 delete NameStr; // Free old string
1224 // We don't allow assigning names to void type
1225 if (T == Type::VoidTy) {
1226 GenerateError("Can't assign name '" + Name + "' to the void type");
1230 // Set the type name, checking for conflicts as we do so.
1231 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1233 if (AlreadyExists) { // Inserting a name that is already defined???
1234 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1235 assert(Existing && "Conflict but no matching type?!");
1237 // There is only one case where this is allowed: when we are refining an
1238 // opaque type. In this case, Existing will be an opaque type.
1239 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1240 // We ARE replacing an opaque type!
1241 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1245 // Otherwise, this is an attempt to redefine a type. That's okay if
1246 // the redefinition is identical to the original. This will be so if
1247 // Existing and T point to the same Type object. In this one case we
1248 // allow the equivalent redefinition.
1249 if (Existing == T) return true; // Yes, it's equal.
1251 // Any other kind of (non-equivalent) redefinition is an error.
1252 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1253 T->getDescription() + "'");
1259 //===----------------------------------------------------------------------===//
1260 // Code for handling upreferences in type names...
1263 // TypeContains - Returns true if Ty directly contains E in it.
1265 static bool TypeContains(const Type *Ty, const Type *E) {
1266 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1267 E) != Ty->subtype_end();
1271 struct UpRefRecord {
1272 // NestingLevel - The number of nesting levels that need to be popped before
1273 // this type is resolved.
1274 unsigned NestingLevel;
1276 // LastContainedTy - This is the type at the current binding level for the
1277 // type. Every time we reduce the nesting level, this gets updated.
1278 const Type *LastContainedTy;
1280 // UpRefTy - This is the actual opaque type that the upreference is
1281 // represented with.
1282 OpaqueType *UpRefTy;
1284 UpRefRecord(unsigned NL, OpaqueType *URTy)
1285 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1289 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1290 static std::vector<UpRefRecord> UpRefs;
1292 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1293 /// called. It loops through the UpRefs vector, which is a list of the
1294 /// currently active types. For each type, if the up reference is contained in
1295 /// the newly completed type, we decrement the level count. When the level
1296 /// count reaches zero, the upreferenced type is the type that is passed in:
1297 /// thus we can complete the cycle.
1299 static PATypeHolder HandleUpRefs(const Type *ty) {
1300 // If Ty isn't abstract, or if there are no up-references in it, then there is
1301 // nothing to resolve here.
1302 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1304 PATypeHolder Ty(ty);
1305 UR_OUT("Type '" << Ty->getDescription() <<
1306 "' newly formed. Resolving upreferences.\n" <<
1307 UpRefs.size() << " upreferences active!\n");
1309 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1310 // to zero), we resolve them all together before we resolve them to Ty. At
1311 // the end of the loop, if there is anything to resolve to Ty, it will be in
1313 OpaqueType *TypeToResolve = 0;
1315 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1316 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1317 << UpRefs[i].second->getDescription() << ") = "
1318 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1319 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1320 // Decrement level of upreference
1321 unsigned Level = --UpRefs[i].NestingLevel;
1322 UpRefs[i].LastContainedTy = Ty;
1323 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1324 if (Level == 0) { // Upreference should be resolved!
1325 if (!TypeToResolve) {
1326 TypeToResolve = UpRefs[i].UpRefTy;
1328 UR_OUT(" * Resolving upreference for "
1329 << UpRefs[i].second->getDescription() << "\n";
1330 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1331 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1332 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1333 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1335 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1336 --i; // Do not skip the next element...
1341 if (TypeToResolve) {
1342 UR_OUT(" * Resolving upreference for "
1343 << UpRefs[i].second->getDescription() << "\n";
1344 std::string OldName = TypeToResolve->getDescription());
1345 TypeToResolve->refineAbstractTypeTo(Ty);
1351 //===----------------------------------------------------------------------===//
1352 // RunVMAsmParser - Define an interface to this parser
1353 //===----------------------------------------------------------------------===//
1355 static Module* RunParser(Module * M);
1357 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1359 Module *M = RunParser(new Module(LLLgetFilename()));
1366 /* Enabling traces. */
1371 /* Enabling verbose error messages. */
1372 #ifdef YYERROR_VERBOSE
1373 # undef YYERROR_VERBOSE
1374 # define YYERROR_VERBOSE 1
1376 # define YYERROR_VERBOSE 0
1379 /* Enabling the token table. */
1380 #ifndef YYTOKEN_TABLE
1381 # define YYTOKEN_TABLE 0
1384 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1385 typedef union YYSTYPE
1386 #line 982 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
1388 llvm::Module *ModuleVal;
1389 llvm::Function *FunctionVal;
1390 llvm::BasicBlock *BasicBlockVal;
1391 llvm::TerminatorInst *TermInstVal;
1392 llvm::Instruction *InstVal;
1393 llvm::Constant *ConstVal;
1395 const llvm::Type *PrimType;
1396 std::list<llvm::PATypeHolder> *TypeList;
1397 llvm::PATypeHolder *TypeVal;
1398 llvm::Value *ValueVal;
1399 std::vector<llvm::Value*> *ValueList;
1400 std::vector<unsigned> *ConstantList;
1401 llvm::ArgListType *ArgList;
1402 llvm::TypeWithAttrs TypeWithAttrs;
1403 llvm::TypeWithAttrsList *TypeWithAttrsList;
1404 llvm::ParamList *ParamList;
1406 // Represent the RHS of PHI node
1407 std::list<std::pair<llvm::Value*,
1408 llvm::BasicBlock*> > *PHIList;
1409 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1410 std::vector<llvm::Constant*> *ConstVector;
1412 llvm::GlobalValue::LinkageTypes Linkage;
1413 llvm::GlobalValue::VisibilityTypes Visibility;
1414 llvm::Attributes Attributes;
1415 llvm::APInt *APIntVal;
1420 llvm::APFloat *FPVal;
1423 std::string *StrVal; // This memory must be deleted
1424 llvm::ValID ValIDVal;
1426 llvm::Instruction::BinaryOps BinaryOpVal;
1427 llvm::Instruction::TermOps TermOpVal;
1428 llvm::Instruction::MemoryOps MemOpVal;
1429 llvm::Instruction::CastOps CastOpVal;
1430 llvm::Instruction::OtherOps OtherOpVal;
1431 llvm::ICmpInst::Predicate IPredicate;
1432 llvm::FCmpInst::Predicate FPredicate;
1434 /* Line 187 of yacc.c. */
1435 #line 1436 "llvmAsmParser.tab.c"
1437 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1438 # define YYSTYPE_IS_DECLARED 1
1439 # define YYSTYPE_IS_TRIVIAL 1
1444 /* Copy the second part of user declarations. */
1447 /* Line 216 of yacc.c. */
1448 #line 1449 "llvmAsmParser.tab.c"
1455 typedef YYTYPE_UINT8 yytype_uint8;
1457 typedef unsigned char yytype_uint8;
1461 typedef YYTYPE_INT8 yytype_int8;
1462 #elif (defined __STDC__ || defined __C99__FUNC__ \
1463 || defined __cplusplus || defined _MSC_VER)
1464 typedef signed char yytype_int8;
1466 typedef short int yytype_int8;
1469 #ifdef YYTYPE_UINT16
1470 typedef YYTYPE_UINT16 yytype_uint16;
1472 typedef unsigned short int yytype_uint16;
1476 typedef YYTYPE_INT16 yytype_int16;
1478 typedef short int yytype_int16;
1482 # ifdef __SIZE_TYPE__
1483 # define YYSIZE_T __SIZE_TYPE__
1484 # elif defined size_t
1485 # define YYSIZE_T size_t
1486 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1487 || defined __cplusplus || defined _MSC_VER)
1488 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1489 # define YYSIZE_T size_t
1491 # define YYSIZE_T unsigned int
1495 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1500 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1501 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1505 # define YY_(msgid) msgid
1509 /* Suppress unused-variable warnings by "using" E. */
1510 #if ! defined lint || defined __GNUC__
1511 # define YYUSE(e) ((void) (e))
1513 # define YYUSE(e) /* empty */
1516 /* Identity function, used to suppress warnings about constant conditions. */
1518 # define YYID(n) (n)
1520 #if (defined __STDC__ || defined __C99__FUNC__ \
1521 || defined __cplusplus || defined _MSC_VER)
1534 #if ! defined yyoverflow || YYERROR_VERBOSE
1536 /* The parser invokes alloca or malloc; define the necessary symbols. */
1538 # ifdef YYSTACK_USE_ALLOCA
1539 # if YYSTACK_USE_ALLOCA
1541 # define YYSTACK_ALLOC __builtin_alloca
1542 # elif defined __BUILTIN_VA_ARG_INCR
1543 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1545 # define YYSTACK_ALLOC __alloca
1546 # elif defined _MSC_VER
1547 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1548 # define alloca _alloca
1550 # define YYSTACK_ALLOC alloca
1551 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1552 || defined __cplusplus || defined _MSC_VER)
1553 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1555 # define _STDLIB_H 1
1562 # ifdef YYSTACK_ALLOC
1563 /* Pacify GCC's `empty if-body' warning. */
1564 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1565 # ifndef YYSTACK_ALLOC_MAXIMUM
1566 /* The OS might guarantee only one guard page at the bottom of the stack,
1567 and a page size can be as small as 4096 bytes. So we cannot safely
1568 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1569 to allow for a few compiler-allocated temporary stack slots. */
1570 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1573 # define YYSTACK_ALLOC YYMALLOC
1574 # define YYSTACK_FREE YYFREE
1575 # ifndef YYSTACK_ALLOC_MAXIMUM
1576 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1578 # if (defined __cplusplus && ! defined _STDLIB_H \
1579 && ! ((defined YYMALLOC || defined malloc) \
1580 && (defined YYFREE || defined free)))
1581 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1583 # define _STDLIB_H 1
1587 # define YYMALLOC malloc
1588 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1589 || defined __cplusplus || defined _MSC_VER)
1590 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1594 # define YYFREE free
1595 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1596 || defined __cplusplus || defined _MSC_VER)
1597 void free (void *); /* INFRINGES ON USER NAME SPACE */
1601 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1604 #if (! defined yyoverflow \
1605 && (! defined __cplusplus \
1606 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1608 /* A type that is properly aligned for any stack member. */
1615 /* The size of the maximum gap between one aligned stack and the next. */
1616 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1618 /* The size of an array large to enough to hold all stacks, each with
1620 # define YYSTACK_BYTES(N) \
1621 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1622 + YYSTACK_GAP_MAXIMUM)
1624 /* Copy COUNT objects from FROM to TO. The source and destination do
1627 # if defined __GNUC__ && 1 < __GNUC__
1628 # define YYCOPY(To, From, Count) \
1629 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1631 # define YYCOPY(To, From, Count) \
1635 for (yyi = 0; yyi < (Count); yyi++) \
1636 (To)[yyi] = (From)[yyi]; \
1642 /* Relocate STACK from its old location to the new one. The
1643 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1644 elements in the stack, and YYPTR gives the new location of the
1645 stack. Advance YYPTR to a properly aligned location for the next
1647 # define YYSTACK_RELOCATE(Stack) \
1650 YYSIZE_T yynewbytes; \
1651 YYCOPY (&yyptr->Stack, Stack, yysize); \
1652 Stack = &yyptr->Stack; \
1653 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1654 yyptr += yynewbytes / sizeof (*yyptr); \
1660 /* YYFINAL -- State number of the termination state. */
1662 /* YYLAST -- Last index in YYTABLE. */
1665 /* YYNTOKENS -- Number of terminals. */
1666 #define YYNTOKENS 173
1667 /* YYNNTS -- Number of nonterminals. */
1669 /* YYNRULES -- Number of rules. */
1670 #define YYNRULES 348
1671 /* YYNRULES -- Number of states. */
1672 #define YYNSTATES 708
1674 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1675 #define YYUNDEFTOK 2
1676 #define YYMAXUTOK 413
1678 #define YYTRANSLATE(YYX) \
1679 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1681 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1682 static const yytype_uint8 yytranslate[] =
1684 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1687 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1688 159, 160, 163, 2, 162, 2, 2, 2, 2, 2,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 168, 161, 169, 2, 2, 2, 2, 2, 2, 2,
1691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1693 2, 165, 164, 167, 2, 2, 2, 2, 2, 172,
1694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1696 166, 2, 2, 170, 2, 171, 2, 2, 2, 2,
1697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1698 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1701 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1703 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1704 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1706 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1707 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1708 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1709 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1710 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1711 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1712 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1713 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1714 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1715 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1716 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1717 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1718 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1719 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1720 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1721 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1722 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1723 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1724 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1729 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1731 static const yytype_uint16 yyprhs[] =
1733 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1734 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1735 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1736 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1737 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1738 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1739 118, 123, 124, 127, 128, 131, 133, 135, 137, 138,
1740 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
1741 160, 162, 164, 166, 167, 169, 171, 172, 174, 176,
1742 178, 180, 181, 183, 185, 186, 188, 190, 192, 194,
1743 196, 199, 201, 203, 205, 207, 209, 211, 213, 215,
1744 217, 220, 221, 224, 226, 228, 230, 231, 234, 236,
1745 238, 240, 242, 244, 246, 248, 250, 252, 254, 255,
1746 258, 259, 262, 263, 266, 267, 271, 274, 275, 277,
1747 278, 282, 284, 287, 289, 291, 293, 295, 297, 299,
1748 301, 303, 305, 309, 311, 314, 320, 326, 332, 338,
1749 342, 345, 351, 356, 359, 361, 363, 365, 369, 371,
1750 375, 377, 378, 380, 384, 389, 393, 397, 402, 407,
1751 411, 418, 424, 427, 430, 433, 436, 439, 442, 445,
1752 448, 451, 454, 457, 460, 467, 473, 482, 489, 496,
1753 504, 512, 520, 528, 535, 544, 553, 559, 567, 571,
1754 573, 575, 577, 579, 580, 583, 590, 592, 593, 595,
1755 598, 599, 603, 604, 608, 612, 616, 620, 621, 630,
1756 631, 641, 642, 652, 658, 661, 665, 667, 671, 675,
1757 679, 683, 685, 686, 692, 696, 698, 702, 704, 705,
1758 717, 719, 721, 726, 728, 730, 733, 737, 738, 740,
1759 742, 744, 746, 748, 750, 752, 754, 756, 758, 760,
1760 764, 768, 771, 774, 778, 781, 787, 792, 794, 800,
1761 802, 804, 806, 808, 810, 812, 815, 817, 821, 824,
1762 827, 831, 835, 838, 839, 841, 844, 847, 851, 861,
1763 871, 880, 896, 898, 900, 907, 913, 916, 919, 926,
1764 934, 939, 944, 951, 958, 959, 960, 964, 967, 971,
1765 974, 976, 982, 988, 995, 1002, 1009, 1016, 1021, 1028,
1766 1033, 1038, 1045, 1052, 1055, 1065, 1067, 1069, 1070, 1074,
1767 1081, 1085, 1092, 1095, 1101, 1109, 1115, 1120, 1125
1770 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1771 static const yytype_int16 yyrhs[] =
1773 220, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1774 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1775 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1776 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1777 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1778 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1779 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1780 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1781 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1782 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1783 -1, 102, -1, 103, -1, 26, -1, 27, -1, 19,
1784 -1, 22, -1, 24, -1, 179, -1, -1, 55, 159,
1785 4, 160, -1, -1, 179, 161, -1, -1, 7, 161,
1786 -1, 20, -1, 23, -1, 186, -1, -1, 184, 161,
1787 -1, 42, -1, 44, -1, 43, -1, 45, -1, 47,
1788 -1, 49, -1, 46, -1, 48, -1, 51, -1, -1,
1789 156, -1, 157, -1, 158, -1, -1, 46, -1, 48,
1790 -1, -1, 42, -1, 43, -1, 44, -1, 47, -1,
1791 -1, 44, -1, 42, -1, -1, 63, -1, 64, -1,
1792 65, -1, 66, -1, 67, -1, 62, 4, -1, 142,
1793 -1, 121, -1, 141, -1, 122, -1, 144, -1, 145,
1794 -1, 147, -1, 148, -1, 149, -1, 54, 4, -1,
1795 -1, 195, 194, -1, 144, -1, 142, -1, 141, -1,
1796 -1, 197, 196, -1, 143, -1, 146, -1, 144, -1,
1797 142, -1, 141, -1, 150, -1, 151, -1, 154, -1,
1798 155, -1, 153, -1, -1, 199, 198, -1, -1, 152,
1799 22, -1, -1, 54, 4, -1, -1, 162, 54, 4,
1800 -1, 34, 22, -1, -1, 203, -1, -1, 162, 206,
1801 205, -1, 203, -1, 54, 4, -1, 11, -1, 12,
1802 -1, 13, -1, 16, -1, 15, -1, 14, -1, 17,
1803 -1, 50, -1, 207, -1, 208, 181, 163, -1, 242,
1804 -1, 164, 4, -1, 208, 159, 212, 160, 199, -1,
1805 10, 159, 212, 160, 199, -1, 165, 4, 166, 208,
1806 167, -1, 168, 4, 166, 208, 169, -1, 170, 213,
1807 171, -1, 170, 171, -1, 168, 170, 213, 171, 169,
1808 -1, 168, 170, 171, 169, -1, 208, 195, -1, 208,
1809 -1, 10, -1, 209, -1, 211, 162, 209, -1, 211,
1810 -1, 211, 162, 39, -1, 39, -1, -1, 208, -1,
1811 213, 162, 208, -1, 208, 165, 216, 167, -1, 208,
1812 165, 167, -1, 208, 172, 22, -1, 208, 168, 216,
1813 169, -1, 208, 170, 216, 171, -1, 208, 170, 171,
1814 -1, 208, 168, 170, 216, 171, 169, -1, 208, 168,
1815 170, 171, 169, -1, 208, 40, -1, 208, 41, -1,
1816 208, 242, -1, 208, 215, -1, 208, 25, -1, 208,
1817 3, -1, 208, 5, -1, 208, 4, -1, 208, 6,
1818 -1, 208, 26, -1, 208, 27, -1, 208, 9, -1,
1819 176, 159, 214, 38, 208, 160, -1, 119, 159, 214,
1820 254, 160, -1, 133, 159, 214, 162, 214, 162, 214,
1821 160, -1, 174, 159, 214, 162, 214, 160, -1, 175,
1822 159, 214, 162, 214, 160, -1, 90, 177, 159, 214,
1823 162, 214, 160, -1, 91, 178, 159, 214, 162, 214,
1824 160, -1, 92, 177, 159, 214, 162, 214, 160, -1,
1825 93, 178, 159, 214, 162, 214, 160, -1, 135, 159,
1826 214, 162, 214, 160, -1, 136, 159, 214, 162, 214,
1827 162, 214, 160, -1, 137, 159, 214, 162, 214, 162,
1828 214, 160, -1, 139, 159, 214, 255, 160, -1, 140,
1829 159, 214, 162, 214, 255, 160, -1, 216, 162, 214,
1830 -1, 214, -1, 32, -1, 33, -1, 37, -1, -1,
1831 210, 242, -1, 125, 159, 219, 38, 208, 160, -1,
1832 221, -1, -1, 222, -1, 221, 222, -1, -1, 31,
1833 223, 238, -1, -1, 30, 224, 239, -1, 60, 59,
1834 228, -1, 182, 18, 208, -1, 182, 18, 10, -1,
1835 -1, 185, 189, 218, 217, 214, 181, 225, 205, -1,
1836 -1, 185, 187, 189, 218, 217, 214, 181, 226, 205,
1837 -1, -1, 185, 188, 189, 218, 217, 208, 181, 227,
1838 205, -1, 185, 189, 35, 192, 219, -1, 52, 229,
1839 -1, 56, 161, 230, -1, 22, -1, 53, 161, 22,
1840 -1, 68, 161, 22, -1, 165, 231, 167, -1, 231,
1841 162, 22, -1, 22, -1, -1, 232, 162, 208, 195,
1842 180, -1, 208, 195, 180, -1, 232, -1, 232, 162,
1843 39, -1, 39, -1, -1, 193, 197, 210, 184, 159,
1844 233, 160, 199, 204, 201, 200, -1, 28, -1, 170,
1845 -1, 191, 189, 234, 235, -1, 29, -1, 171, -1,
1846 246, 237, -1, 190, 189, 234, -1, -1, 61, -1,
1847 3, -1, 4, -1, 5, -1, 6, -1, 9, -1,
1848 26, -1, 27, -1, 40, -1, 41, -1, 25, -1,
1849 168, 216, 169, -1, 165, 216, 167, -1, 165, 167,
1850 -1, 172, 22, -1, 170, 216, 171, -1, 170, 171,
1851 -1, 168, 170, 216, 171, 169, -1, 168, 170, 171,
1852 169, -1, 215, -1, 59, 240, 22, 162, 22, -1,
1853 7, -1, 8, -1, 179, -1, 184, -1, 242, -1,
1854 241, -1, 208, 243, -1, 244, -1, 245, 162, 244,
1855 -1, 246, 247, -1, 236, 247, -1, 248, 182, 249,
1856 -1, 248, 183, 249, -1, 248, 251, -1, -1, 21,
1857 -1, 69, 245, -1, 69, 10, -1, 70, 17, 243,
1858 -1, 70, 11, 243, 162, 17, 243, 162, 17, 243,
1859 -1, 71, 11, 243, 162, 17, 243, 165, 250, 167,
1860 -1, 71, 11, 243, 162, 17, 243, 165, 167, -1,
1861 72, 193, 197, 210, 243, 159, 253, 160, 199, 38,
1862 17, 243, 73, 17, 243, -1, 73, -1, 74, -1,
1863 250, 11, 241, 162, 17, 243, -1, 11, 241, 162,
1864 17, 243, -1, 182, 257, -1, 183, 257, -1, 208,
1865 165, 243, 162, 243, 167, -1, 252, 162, 165, 243,
1866 162, 243, 167, -1, 208, 195, 243, 195, -1, 17,
1867 195, 243, 195, -1, 253, 162, 208, 195, 243, 195,
1868 -1, 253, 162, 17, 195, 243, 195, -1, -1, -1,
1869 254, 162, 244, -1, 162, 4, -1, 255, 162, 4,
1870 -1, 58, 57, -1, 57, -1, 174, 208, 243, 162,
1871 243, -1, 175, 208, 243, 162, 243, -1, 90, 177,
1872 208, 243, 162, 243, -1, 91, 178, 208, 243, 162,
1873 243, -1, 92, 177, 208, 243, 162, 243, -1, 93,
1874 178, 208, 243, 162, 243, -1, 176, 244, 38, 208,
1875 -1, 133, 244, 162, 244, 162, 244, -1, 134, 244,
1876 162, 208, -1, 135, 244, 162, 244, -1, 136, 244,
1877 162, 244, 162, 244, -1, 137, 244, 162, 244, 162,
1878 244, -1, 132, 252, -1, 256, 193, 197, 210, 243,
1879 159, 253, 160, 199, -1, 259, -1, 36, -1, -1,
1880 114, 208, 202, -1, 114, 208, 162, 11, 243, 202,
1881 -1, 115, 208, 202, -1, 115, 208, 162, 11, 243,
1882 202, -1, 116, 244, -1, 258, 117, 208, 243, 202,
1883 -1, 258, 118, 244, 162, 208, 243, 202, -1, 138,
1884 208, 243, 162, 4, -1, 119, 208, 243, 254, -1,
1885 139, 208, 243, 255, -1, 140, 208, 243, 162, 208,
1889 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1890 static const yytype_uint16 yyrline[] =
1892 0, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148,
1893 1148, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150, 1150,
1894 1150, 1150, 1150, 1151, 1151, 1151, 1151, 1151, 1151, 1154,
1895 1154, 1155, 1155, 1156, 1156, 1157, 1157, 1158, 1158, 1162,
1896 1162, 1163, 1163, 1164, 1164, 1165, 1165, 1166, 1166, 1167,
1897 1167, 1168, 1168, 1169, 1170, 1173, 1173, 1173, 1174, 1174,
1898 1176, 1177, 1181, 1185, 1190, 1196, 1196, 1198, 1199, 1204,
1899 1210, 1211, 1212, 1213, 1214, 1215, 1219, 1220, 1221, 1225,
1900 1226, 1227, 1228, 1232, 1233, 1234, 1238, 1239, 1240, 1241,
1901 1242, 1246, 1247, 1248, 1251, 1252, 1253, 1254, 1255, 1256,
1902 1257, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1271, 1272,
1903 1273, 1277, 1278, 1283, 1284, 1285, 1288, 1289, 1295, 1296,
1904 1297, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1307, 1308,
1905 1314, 1315, 1322, 1323, 1329, 1330, 1339, 1347, 1348, 1353,
1906 1354, 1355, 1360, 1373, 1373, 1373, 1373, 1373, 1373, 1373,
1907 1376, 1380, 1384, 1391, 1396, 1404, 1439, 1470, 1475, 1485,
1908 1495, 1499, 1509, 1516, 1525, 1532, 1537, 1542, 1549, 1550,
1909 1557, 1564, 1572, 1578, 1590, 1618, 1634, 1661, 1689, 1715,
1910 1735, 1761, 1781, 1793, 1800, 1866, 1876, 1886, 1897, 1910,
1911 1921, 1935, 1942, 1949, 1967, 1979, 2000, 2008, 2014, 2025,
1912 2030, 2035, 2040, 2045, 2051, 2057, 2063, 2071, 2082, 2086,
1913 2094, 2094, 2097, 2097, 2100, 2112, 2133, 2138, 2146, 2147,
1914 2151, 2151, 2155, 2155, 2158, 2161, 2185, 2197, 2196, 2208,
1915 2207, 2217, 2216, 2227, 2267, 2270, 2276, 2286, 2290, 2295,
1916 2297, 2302, 2307, 2316, 2326, 2337, 2341, 2350, 2359, 2364,
1917 2513, 2513, 2515, 2524, 2524, 2526, 2531, 2543, 2547, 2552,
1918 2556, 2560, 2565, 2570, 2574, 2578, 2582, 2586, 2590, 2594,
1919 2616, 2638, 2644, 2657, 2669, 2674, 2686, 2692, 2696, 2706,
1920 2710, 2714, 2719, 2726, 2726, 2732, 2741, 2746, 2751, 2755,
1921 2764, 2773, 2786, 2795, 2799, 2807, 2827, 2831, 2836, 2847,
1922 2866, 2875, 2979, 2983, 2990, 3001, 3014, 3023, 3036, 3047,
1923 3057, 3068, 3076, 3086, 3093, 3096, 3097, 3105, 3111, 3120,
1924 3124, 3129, 3145, 3162, 3174, 3186, 3200, 3214, 3226, 3247,
1925 3254, 3260, 3266, 3272, 3287, 3397, 3402, 3406, 3413, 3420,
1926 3430, 3437, 3447, 3455, 3469, 3486, 3500, 3515, 3530
1930 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1931 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1932 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1933 static const char *const yytname[] =
1935 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1936 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1937 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1938 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1939 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1940 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1941 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1942 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1943 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1944 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1945 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1946 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1947 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1948 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1949 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1950 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1951 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1952 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1953 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1954 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1955 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1956 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1957 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1958 "READNONE", "READONLY", "GC", "OPTSIZE", "NOINLINE", "ALWAYSINLINE",
1959 "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='", "','", "'*'",
1960 "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'", "'c'",
1961 "$accept", "ArithmeticOps", "LogicalOps", "CastOps", "IPredicates",
1962 "FPredicates", "LocalName", "OptLocalName", "OptAddrSpace",
1963 "OptLocalAssign", "LocalNumber", "GlobalName", "OptGlobalAssign",
1964 "GlobalAssign", "GVInternalLinkage", "GVExternalLinkage",
1965 "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage",
1966 "AliasLinkage", "OptCallingConv", "Attribute", "OptAttributes",
1967 "RetAttr", "OptRetAttrs", "FuncAttr", "OptFuncAttrs", "OptGC",
1968 "OptAlign", "OptCAlign", "SectionString", "OptSection",
1969 "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types",
1970 "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI",
1971 "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal",
1972 "AliaseeRef", "Module", "DefinitionList", "Definition", "@1", "@2", "@3",
1973 "@4", "@5", "AsmBlock", "TargetDefinition", "LibrariesDefinition",
1974 "LibList", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1975 "FunctionHeader", "END", "Function", "FunctionProto", "OptSideEffect",
1976 "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal",
1977 "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1978 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ParamList",
1979 "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1980 "OptVolatile", "MemoryInst", 0
1985 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1987 static const yytype_uint16 yytoknum[] =
1989 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1990 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1991 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1992 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1993 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1994 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1995 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1996 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1997 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1998 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1999 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
2000 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
2001 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2002 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2003 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2004 405, 406, 407, 408, 409, 410, 411, 412, 413, 40,
2005 41, 61, 44, 42, 92, 91, 120, 93, 60, 62,
2010 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2011 static const yytype_uint16 yyr1[] =
2013 0, 173, 174, 174, 174, 174, 174, 174, 174, 174,
2014 174, 175, 175, 175, 175, 175, 175, 176, 176, 176,
2015 176, 176, 176, 176, 176, 176, 176, 176, 176, 177,
2016 177, 177, 177, 177, 177, 177, 177, 177, 177, 178,
2017 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
2018 178, 178, 178, 178, 178, 179, 179, 179, 180, 180,
2019 181, 181, 182, 182, 183, 184, 184, 185, 185, 186,
2020 187, 187, 187, 187, 187, 187, 188, 188, 188, 189,
2021 189, 189, 189, 190, 190, 190, 191, 191, 191, 191,
2022 191, 192, 192, 192, 193, 193, 193, 193, 193, 193,
2023 193, 194, 194, 194, 194, 194, 194, 194, 194, 194,
2024 194, 195, 195, 196, 196, 196, 197, 197, 198, 198,
2025 198, 198, 198, 198, 198, 198, 198, 198, 199, 199,
2026 200, 200, 201, 201, 202, 202, 203, 204, 204, 205,
2027 205, 206, 206, 207, 207, 207, 207, 207, 207, 207,
2028 208, 208, 208, 208, 208, 208, 208, 208, 208, 208,
2029 208, 208, 208, 209, 210, 210, 211, 211, 212, 212,
2030 212, 212, 213, 213, 214, 214, 214, 214, 214, 214,
2031 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
2032 214, 214, 214, 214, 215, 215, 215, 215, 215, 215,
2033 215, 215, 215, 215, 215, 215, 215, 215, 216, 216,
2034 217, 217, 218, 218, 219, 219, 220, 220, 221, 221,
2035 223, 222, 224, 222, 222, 222, 222, 225, 222, 226,
2036 222, 227, 222, 222, 222, 222, 228, 229, 229, 230,
2037 231, 231, 231, 232, 232, 233, 233, 233, 233, 234,
2038 235, 235, 236, 237, 237, 238, 239, 240, 240, 241,
2039 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
2040 241, 241, 241, 241, 241, 241, 241, 241, 241, 242,
2041 242, 242, 242, 243, 243, 244, 245, 245, 246, 246,
2042 247, 247, 248, 248, 248, 249, 249, 249, 249, 249,
2043 249, 249, 249, 249, 250, 250, 251, 251, 252, 252,
2044 253, 253, 253, 253, 253, 254, 254, 255, 255, 256,
2045 256, 257, 257, 257, 257, 257, 257, 257, 257, 257,
2046 257, 257, 257, 257, 257, 257, 258, 258, 259, 259,
2047 259, 259, 259, 259, 259, 259, 259, 259, 259
2050 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2051 static const yytype_uint8 yyr2[] =
2053 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2054 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2055 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2056 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2057 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2058 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2059 4, 0, 2, 0, 2, 1, 1, 1, 0, 2,
2060 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2061 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
2062 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
2063 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2064 2, 0, 2, 1, 1, 1, 0, 2, 1, 1,
2065 1, 1, 1, 1, 1, 1, 1, 1, 0, 2,
2066 0, 2, 0, 2, 0, 3, 2, 0, 1, 0,
2067 3, 1, 2, 1, 1, 1, 1, 1, 1, 1,
2068 1, 1, 3, 1, 2, 5, 5, 5, 5, 3,
2069 2, 5, 4, 2, 1, 1, 1, 3, 1, 3,
2070 1, 0, 1, 3, 4, 3, 3, 4, 4, 3,
2071 6, 5, 2, 2, 2, 2, 2, 2, 2, 2,
2072 2, 2, 2, 2, 6, 5, 8, 6, 6, 7,
2073 7, 7, 7, 6, 8, 8, 5, 7, 3, 1,
2074 1, 1, 1, 0, 2, 6, 1, 0, 1, 2,
2075 0, 3, 0, 3, 3, 3, 3, 0, 8, 0,
2076 9, 0, 9, 5, 2, 3, 1, 3, 3, 3,
2077 3, 1, 0, 5, 3, 1, 3, 1, 0, 11,
2078 1, 1, 4, 1, 1, 2, 3, 0, 1, 1,
2079 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2080 3, 2, 2, 3, 2, 5, 4, 1, 5, 1,
2081 1, 1, 1, 1, 1, 2, 1, 3, 2, 2,
2082 3, 3, 2, 0, 1, 2, 2, 3, 9, 9,
2083 8, 15, 1, 1, 6, 5, 2, 2, 6, 7,
2084 4, 4, 6, 6, 0, 0, 3, 2, 3, 2,
2085 1, 5, 5, 6, 6, 6, 6, 4, 6, 4,
2086 4, 6, 6, 2, 9, 1, 1, 0, 3, 6,
2087 3, 6, 2, 5, 7, 5, 4, 4, 7
2090 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2091 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2092 means the default is an error. */
2093 static const yytype_uint16 yydefact[] =
2095 68, 55, 65, 56, 66, 57, 222, 220, 0, 0,
2096 0, 0, 0, 0, 79, 67, 0, 68, 218, 83,
2097 86, 0, 0, 234, 0, 0, 62, 0, 69, 70,
2098 72, 71, 73, 76, 74, 77, 75, 78, 80, 81,
2099 82, 79, 79, 213, 1, 219, 84, 85, 79, 223,
2100 87, 88, 89, 90, 79, 293, 221, 293, 0, 0,
2101 242, 235, 236, 224, 279, 280, 226, 143, 144, 145,
2102 148, 147, 146, 149, 150, 0, 0, 0, 0, 281,
2103 282, 151, 225, 153, 213, 213, 91, 212, 0, 94,
2104 94, 294, 289, 63, 253, 254, 255, 288, 237, 238,
2105 241, 0, 171, 154, 0, 0, 0, 0, 160, 172,
2106 0, 0, 171, 0, 0, 0, 93, 92, 0, 210,
2107 211, 0, 0, 95, 96, 97, 98, 99, 116, 256,
2108 0, 0, 337, 337, 292, 0, 239, 170, 111, 166,
2109 168, 0, 0, 0, 0, 0, 0, 159, 0, 0,
2110 152, 0, 0, 165, 0, 164, 0, 233, 61, 61,
2111 100, 0, 250, 251, 252, 64, 336, 320, 0, 0,
2112 0, 0, 94, 302, 303, 2, 3, 4, 5, 6,
2113 7, 8, 9, 10, 14, 15, 16, 11, 12, 13,
2114 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
2115 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
2116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2117 0, 0, 290, 94, 306, 0, 335, 291, 307, 240,
2118 163, 0, 128, 61, 61, 162, 0, 173, 0, 128,
2119 61, 61, 0, 214, 187, 189, 188, 190, 193, 186,
2120 191, 192, 182, 183, 0, 0, 0, 0, 0, 0,
2121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2122 0, 0, 185, 184, 227, 115, 114, 113, 117, 0,
2123 319, 296, 61, 286, 295, 0, 0, 0, 116, 29,
2124 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2125 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2126 43, 44, 45, 46, 47, 48, 0, 0, 0, 134,
2127 134, 342, 61, 61, 333, 0, 0, 0, 0, 0,
2128 61, 61, 61, 61, 61, 0, 116, 0, 0, 0,
2129 102, 104, 103, 101, 105, 106, 107, 108, 109, 112,
2130 169, 167, 156, 157, 158, 161, 60, 155, 229, 231,
2131 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2132 0, 0, 175, 209, 0, 0, 0, 179, 0, 176,
2133 0, 0, 0, 139, 0, 259, 260, 261, 262, 263,
2134 268, 264, 265, 266, 267, 257, 0, 0, 0, 0,
2135 277, 284, 283, 285, 0, 0, 297, 0, 0, 61,
2136 61, 61, 61, 0, 338, 0, 340, 315, 0, 0,
2137 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2138 0, 0, 61, 0, 110, 122, 121, 118, 120, 119,
2139 123, 124, 127, 125, 126, 129, 139, 139, 0, 0,
2140 0, 0, 0, 315, 0, 0, 0, 0, 0, 0,
2141 0, 174, 160, 172, 0, 177, 178, 0, 0, 0,
2142 0, 228, 248, 258, 0, 271, 0, 0, 0, 274,
2143 0, 272, 287, 0, 0, 0, 0, 0, 0, 0,
2144 0, 0, 0, 346, 0, 0, 0, 329, 330, 0,
2145 0, 0, 0, 347, 0, 0, 0, 327, 0, 134,
2146 0, 230, 232, 61, 0, 0, 0, 0, 0, 0,
2147 0, 0, 0, 0, 0, 208, 181, 0, 0, 0,
2148 0, 0, 0, 141, 139, 247, 111, 245, 0, 0,
2149 270, 160, 0, 269, 273, 0, 0, 0, 0, 0,
2150 0, 0, 134, 135, 134, 0, 0, 0, 0, 0,
2151 0, 345, 317, 0, 61, 321, 322, 0, 0, 343,
2152 61, 215, 0, 0, 0, 0, 195, 0, 0, 0,
2153 0, 206, 0, 180, 0, 0, 61, 136, 142, 140,
2154 59, 0, 128, 0, 276, 0, 0, 0, 314, 323,
2155 324, 325, 326, 339, 341, 316, 0, 0, 328, 331,
2156 332, 318, 0, 314, 134, 0, 0, 0, 0, 0,
2157 203, 0, 0, 0, 197, 198, 194, 58, 244, 246,
2158 111, 137, 278, 275, 0, 0, 111, 111, 0, 308,
2159 0, 348, 0, 344, 199, 200, 201, 202, 0, 0,
2160 0, 207, 59, 138, 132, 0, 0, 300, 0, 0,
2161 0, 128, 0, 309, 128, 196, 204, 205, 243, 0,
2162 130, 298, 0, 0, 299, 102, 104, 111, 111, 0,
2163 111, 111, 334, 133, 0, 249, 0, 0, 311, 310,
2164 0, 0, 0, 131, 0, 0, 0, 111, 111, 305,
2165 0, 0, 313, 312, 304, 0, 0, 301
2168 /* YYDEFGOTO[NTERM-NUM]. */
2169 static const yytype_int16 yydefgoto[] =
2171 -1, 269, 270, 271, 299, 316, 79, 628, 113, 12,
2172 133, 80, 14, 15, 41, 42, 43, 48, 54, 118,
2173 128, 349, 230, 278, 161, 445, 352, 685, 670, 414,
2174 533, 654, 471, 534, 81, 158, 139, 156, 140, 141,
2175 110, 373, 400, 374, 121, 88, 157, 16, 17, 18,
2176 20, 19, 383, 446, 447, 63, 23, 61, 101, 537,
2177 538, 129, 164, 55, 96, 56, 49, 474, 401, 83,
2178 403, 283, 284, 57, 92, 93, 222, 658, 134, 324,
2179 638, 493, 503, 223, 224, 225, 226
2182 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2184 #define YYPACT_NINF -624
2185 static const yytype_int16 yypact[] =
2187 815, -624, -624, -624, -624, -624, -624, -624, 14, -114,
2188 16, -73, 78, -31, 299, -624, 163, 2187, -624, 164,
2189 80, 19, 22, -624, 2, 179, -624, 1912, -624, -624,
2190 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2191 -624, 68, 68, 201, -624, -624, -624, -624, 68, -624,
2192 -624, -624, -624, -624, 68, 200, -624, 5, 215, 222,
2193 225, -624, -624, -624, -624, -624, 117, -624, -624, -624,
2194 -624, -624, -624, -624, -624, 264, 277, 7, 49, -624,
2195 -624, -624, -12, -624, 252, 252, 198, -624, 79, 231,
2196 231, -624, -624, 83, -624, -624, -624, -624, -624, -624,
2197 -624, -21, 649, -624, 138, 149, 627, 117, -624, -12,
2198 -120, 159, 649, 158, 79, 79, -624, -624, 1557, -624,
2199 -624, 2012, 320, -624, -624, -624, -624, -624, -624, -624,
2200 -13, 173, 2237, 2237, -624, 313, -624, -624, -12, -624,
2201 174, 177, 2012, 2012, 169, -118, 2012, -624, 336, 191,
2202 -624, 2012, 2012, 117, 193, -12, 226, -624, 1296, 308,
2203 -624, 1516, -624, -624, -624, -624, -624, -624, 307, 2031,
2204 108, 357, 231, -624, -624, -624, -624, -624, -624, -624,
2205 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2206 454, 958, 454, 958, 2012, 2012, 2012, 2012, -624, -624,
2207 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2208 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012,
2209 2012, 2012, -624, 231, -624, 55, -624, -624, -624, -624,
2210 161, 1748, -624, -23, -41, -624, 203, -12, 214, -624,
2211 308, -20, 1557, -624, -624, -624, -624, -624, -624, -624,
2212 -624, -624, -624, -624, 454, 958, 454, 958, 216, 217,
2213 218, 220, 221, 224, 227, 1789, 2076, 732, 351, 228,
2214 229, 230, -624, -624, -624, -624, -624, -624, -624, 109,
2215 -624, 117, 956, -624, 219, 1466, 1466, 1466, -624, -624,
2216 -624, -624, -624, -624, -624, -624, -624, -624, -624, 2012,
2217 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2218 -624, -624, -624, -624, -624, -624, 2012, 2012, 2012, -10,
2219 3, -624, 956, -17, 223, 237, 238, 239, 240, 241,
2220 956, 956, 956, 956, 956, 352, -624, 2012, 2012, 387,
2221 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2222 -624, -624, 539, -624, -624, -624, -624, 539, -624, 158,
2223 354, 234, 248, 249, 250, 2012, 2012, 2012, 2012, 2012,
2224 2012, 2012, -624, -624, 42, 1006, -121, -624, -116, -624,
2225 2012, 2012, 2012, 253, 251, -624, -624, -624, -624, -624,
2226 -624, -624, -624, -624, -624, 353, 1807, 2094, 1175, 390,
2227 -624, -624, -624, -624, 2012, 255, -624, 256, 1516, 956,
2228 956, 956, 956, 20, -624, 29, -624, -624, 1466, 254,
2229 2012, 2012, 2012, 2012, 2012, 258, 259, 261, 262, 263,
2230 2012, 1516, 956, 266, -624, -624, -624, -624, -624, -624,
2231 -624, -624, -624, -624, -624, -624, 253, 253, 2012, 2012,
2232 2012, 2012, 2012, -624, 269, 270, 272, 273, 259, 274,
2233 2012, -624, 268, 1126, -84, -624, -624, 280, 281, 406,
2234 -5, -624, 1830, -624, 423, -624, 61, 1345, -56, -624,
2235 -77, -624, -624, 430, 431, 1466, 288, 290, 291, 292,
2236 1466, 455, 1466, 296, 298, 1466, 300, -12, -624, 301,
2237 302, 457, 461, 306, 2012, 1466, 1466, -12, 1466, 311,
2238 2012, -624, -624, -1, 312, 314, 317, 319, 101, 2012,
2239 2012, 2012, 2012, 112, 2012, -624, -624, 318, 2012, 2012,
2240 2012, 453, 478, -624, 253, -624, -12, 321, 326, 327,
2241 -624, 323, -67, -624, -624, 1466, 1466, 329, 1466, 1466,
2242 1466, 1466, 311, -624, 311, 2012, 1466, 328, 2012, 2012,
2243 2012, -624, -624, 489, 956, -624, -624, 335, 441, -624,
2244 956, -624, 2012, 2012, 2012, 2012, -624, 334, 337, 339,
2245 340, -624, 259, -624, 343, 345, 15, -624, -624, -624,
2246 178, 1848, -624, 484, -624, 338, 350, 349, 2117, -624,
2247 -624, -624, -624, -624, -624, -624, 348, 1466, -624, -624,
2248 -624, -624, 259, 2117, 311, 356, 359, 360, 361, 2012,
2249 -624, 2012, 2012, 115, -624, -624, -624, -624, -624, -624,
2250 -12, 116, -624, -624, 505, -7, 59, -12, 118, -624,
2251 358, 306, 124, -624, -624, -624, -624, -624, 363, 364,
2252 366, -624, 178, -624, 473, 1466, 1614, -624, -6, 802,
2253 802, -624, 2135, -624, -624, -624, -624, -624, -624, 526,
2254 379, -624, 374, 1614, -624, 378, 380, -624, -624, 442,
2255 59, -12, 539, -624, 516, -624, 523, 396, 161, 161,
2256 524, 802, 802, -624, 1466, 525, 1466, -624, -624, -624,
2257 1466, 486, 161, 161, -624, 543, 1466, -624
2260 /* YYPGOTO[NTERM-NUM]. */
2261 static const yytype_int16 yypgoto[] =
2263 -624, 132, 155, 181, -165, -154, 0, -86, -143, 474,
2264 -624, 6, -624, -624, -624, -624, 67, -624, -624, -624,
2265 -142, -624, -499, -624, -252, -624, -231, -624, -624, -313,
2266 -63, -624, -434, -624, -624, -26, 342, -152, -624, 458,
2267 463, -11, -156, -242, 202, 244, 332, -624, -624, 554,
2268 -624, -624, -624, -624, -624, -624, -624, -624, -624, -624,
2269 -624, 485, -624, -624, -624, -624, -624, -624, -623, -79,
2270 213, -193, -624, -624, 520, -624, 445, -624, -624, -624,
2271 -34, 129, -448, -624, 456, -624, -624
2274 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2275 positive, shift that token. If negative, reduce the rule which
2276 number is the opposite. If zero, do what YYDEFACT says.
2277 If YYTABLE_NINF, syntax error. */
2278 #define YYTABLE_NINF -218
2279 static const yytype_int16 yytable[] =
2281 11, 82, 272, 321, 656, 673, 13, 416, 357, 279,
2282 523, 105, 511, 512, 111, 162, 274, 11, 325, 326,
2283 327, 328, 329, 13, 376, 378, 91, 317, 335, 531,
2284 288, 490, 111, 672, 94, 111, 408, 590, 111, 318,
2285 492, 460, 146, 111, 146, 111, 460, 24, 465, 532,
2286 687, 147, 109, 236, 111, 466, 64, 65, 111, 107,
2287 67, 68, 69, 70, 71, 72, 73, 21, 1, 2,
2288 111, 3, 4, 5, 491, 25, 138, 243, 460, 273,
2289 109, 336, 22, 491, 431, 460, 138, 527, 26, 361,
2290 131, 363, 155, 11, 544, 460, 27, 358, 359, 74,
2291 589, 362, 1, 364, 595, 3, 460, 5, 84, 85,
2292 159, 119, 120, 543, -149, 89, 233, 234, 112, 285,
2293 237, 90, 50, 51, 52, 286, 241, 53, 354, 2,
2294 28, 652, 4, 464, 623, 155, 112, 659, 660, 112,
2295 240, 135, 112, 282, 353, 433, 136, 112, 418, 112,
2296 531, -61, 413, -61, 476, 478, 480, 163, 112, 571,
2297 657, 674, 112, 44, 641, 415, -61, 60, 319, 320,
2298 282, 322, 337, 338, 112, 626, 95, 106, 688, 689,
2299 58, 691, 692, 59, 323, 282, 282, 282, 282, 282,
2300 330, 331, 332, 333, 334, 282, 569, 1, 702, 703,
2301 3, 62, 5, 402, 460, 138, 402, 402, 402, 461,
2302 46, 482, 47, 75, 76, 339, 155, 77, -149, 78,
2303 108, 91, -149, 460, 38, 39, 40, 496, 540, 498,
2304 499, 500, 339, 64, 65, 542, 86, 98, 87, 603,
2305 116, 604, 117, 402, 99, 1, 2, 100, 3, 4,
2306 5, 402, 402, 402, 402, 402, 485, 435, 436, 437,
2307 438, 576, 439, 555, 219, 219, 440, 441, 103, 442,
2308 443, 444, 581, 409, 563, 651, 102, 563, 661, 508,
2309 662, 104, 340, 341, 664, 384, 662, 220, 220, 87,
2310 410, 411, 412, 122, 123, 124, 125, 126, 127, 340,
2311 341, 643, 342, 343, 142, 344, 345, 272, 346, 347,
2312 348, 432, 282, 221, 221, 143, 151, 152, 148, 342,
2313 343, 150, 344, 345, 160, 346, 347, 348, 114, 115,
2314 402, 402, 402, 402, 165, 229, 231, 232, 235, 402,
2315 238, 29, 30, 31, 32, 33, 34, 35, 36, 463,
2316 37, 239, 242, 402, 453, 454, 455, 456, 457, 458,
2317 459, 631, 605, 111, 280, 608, 609, 610, 287, 467,
2318 468, 469, 355, 379, 356, 365, 366, 367, 282, 368,
2319 369, 404, 155, 370, 273, 419, 371, 380, 381, 382,
2320 430, 434, 448, 449, 282, 497, 282, 282, 282, 420,
2321 421, 422, 423, 424, 507, 155, 402, 450, 451, 452,
2322 472, 402, 481, 402, 473, 470, 402, 483, 484, 495,
2323 501, 502, 513, 504, 505, 506, 402, 402, 510, 402,
2324 679, 519, 520, 682, 521, 522, 524, 526, 514, 515,
2325 516, 517, 528, 529, 530, 539, 536, 545, 546, 525,
2326 548, 463, 549, 550, 551, 38, 39, 40, 555, 553,
2327 556, 561, 558, 559, 560, 562, 402, 402, 563, 402,
2328 402, 402, 402, 568, 572, 587, 573, 402, 564, 574,
2329 690, 575, 588, 591, 570, 402, 592, 583, 598, 593,
2330 607, 402, 594, 611, 613, 491, 619, 620, 405, 406,
2331 407, 621, 622, 624, 586, 625, 632, 633, 577, 578,
2332 579, 580, 634, 582, 635, 639, 644, 584, 585, 645,
2333 646, 647, 655, 665, 666, 663, 667, 669, 402, 282,
2334 683, 684, 282, 282, 282, 417, 686, -18, 693, -19,
2335 694, 696, 700, 425, 426, 427, 428, 429, 289, 290,
2336 291, 292, 293, 294, 295, 296, 297, 298, 695, 705,
2337 706, 615, 616, 617, 618, 630, 668, 132, 653, 145,
2338 149, 45, 637, 351, 360, 130, 402, 97, 227, 642,
2339 402, 402, 518, 435, 436, 437, 438, 637, 439, 228,
2340 627, 0, 440, 441, 0, 442, 443, 444, 0, 0,
2341 0, 0, 0, 0, 0, 0, 0, 0, 648, 0,
2342 649, 650, 402, 402, 0, 402, 0, 402, 0, 0,
2343 0, 402, 486, 487, 488, 489, 0, 402, 0, 0,
2344 0, 494, 0, 0, 64, 65, 681, 107, 67, 68,
2345 69, 70, 71, 72, 73, 509, 1, 2, 0, 3,
2346 4, 5, 627, 0, 0, 0, 64, 65, 0, 107,
2347 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2348 0, 3, 4, 5, 0, 0, 0, 74, 0, 0,
2349 435, 436, 437, 438, 0, 439, 0, 0, 137, 440,
2350 441, 0, 442, 443, 444, 0, 0, 0, 547, 74,
2351 0, 0, 0, 552, 0, 554, 0, 0, 557, 0,
2352 0, 0, 0, 0, 0, 0, 0, 0, 565, 566,
2353 0, 567, 0, 0, 0, 0, 0, 0, 0, 0,
2354 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,
2355 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2356 0, 1, 2, 0, 3, 4, 5, 0, 596, 597,
2357 0, 599, 600, 601, 602, 0, 0, 0, 0, 606,
2358 0, 0, 0, 0, 0, 0, 0, 612, 0, 0,
2359 0, 0, 74, 614, 0, 0, 0, 0, 0, 0,
2360 0, 75, 76, 0, 0, 77, 0, 78, 144, 0,
2361 0, 0, 0, 0, 0, 385, 386, 387, 388, 64,
2362 65, 389, 0, 75, 76, -217, 0, 77, 0, 78,
2363 640, 1, 2, 0, 3, 4, 5, 390, 391, 392,
2364 0, 0, 0, -63, 1, 2, 0, 3, 4, 5,
2365 0, 0, 393, 394, 0, 6, 7, 0, 0, 0,
2366 0, 0, 0, 0, 0, 0, 339, 0, 0, 0,
2367 0, 395, 0, 0, 0, 0, 0, 8, 671, 0,
2368 0, 9, 677, 678, 0, 10, 0, 175, 176, 177,
2369 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
2370 188, 189, 254, 255, 256, 257, 75, 76, 0, 0,
2371 77, 0, 78, 377, 697, 698, 0, 699, 0, 701,
2372 0, 0, 0, 704, 0, 0, 0, 0, 0, 707,
2373 0, 258, 198, 675, 676, 201, 202, 203, 204, 205,
2374 206, 207, 208, 209, 0, 259, 0, 260, 261, 262,
2375 0, 263, 264, 342, 343, 0, 344, 345, 0, 346,
2376 347, 348, 0, 0, 0, 0, 0, 0, 0, 385,
2377 386, 387, 388, 64, 65, 389, 0, 396, 0, 0,
2378 397, 0, 398, 0, 399, 1, 2, 0, 3, 4,
2379 5, 390, 391, 392, 300, 301, 0, 0, 0, 0,
2380 0, 0, 0, 0, 0, 0, 393, 394, 0, 0,
2381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2382 0, 111, 0, 64, 65, 395, 107, 67, 68, 69,
2383 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2384 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2385 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2386 0, 0, 0, 0, 0, 0, 74, 0, 302, 303,
2387 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
2388 314, 315, 0, 0, 0, 258, 198, 199, 200, 201,
2389 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2390 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2391 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2392 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2393 0, 396, 0, 0, 397, 0, 398, 0, 399, 244,
2394 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2395 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2396 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2397 0, 0, 0, 0, 0, 0, 252, 253, 0, 0,
2398 75, 76, 0, 0, 77, 0, 78, 462, 0, 0,
2399 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2400 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2401 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2402 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2403 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2404 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2405 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2406 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2407 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2408 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2409 0, 0, 0, 0, 0, 112, 0, 0, 0, -61,
2410 0, 265, 0, 0, 266, 0, 267, 0, 268, 244,
2411 245, 246, 247, 64, 65, 248, 0, 0, 0, 0,
2412 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2413 5, 249, 250, 251, 0, 0, 0, 0, 0, 0,
2414 0, 0, 0, 0, 0, 0, 252, 253, 0, 75,
2415 76, 0, 0, 77, 0, 78, 479, 0, 0, 0,
2416 0, 111, 64, 65, 0, 107, 67, 68, 69, 70,
2417 71, 72, 73, 0, 1, 2, 0, 3, 4, 5,
2418 0, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2419 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2420 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2421 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2422 0, 0, 0, 0, 0, 258, 198, 199, 200, 201,
2423 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2424 0, 260, 261, 262, 0, 263, 264, 0, 0, 0,
2425 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2426 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2427 0, 265, 0, 0, 266, 0, 267, 0, 268, 385,
2428 386, 387, 388, 64, 65, 389, 0, 0, 0, 0,
2429 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2430 5, 390, 391, 392, 0, 0, 0, 0, 0, 0,
2431 0, 0, 0, 0, 0, 0, 393, 394, 0, 75,
2432 76, 0, 0, 77, 0, 78, 541, 0, 0, 0,
2433 0, 0, 0, 64, 65, 395, 153, 67, 68, 69,
2434 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2435 5, 175, 176, 177, 178, 179, 180, 181, 182, 183,
2436 184, 185, 186, 187, 188, 189, 254, 255, 256, 257,
2437 0, 0, 0, 0, 64, 65, 74, 153, 67, 68,
2438 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2439 4, 5, 0, 0, 0, 258, 198, 199, 200, 201,
2440 202, 203, 204, 205, 206, 207, 208, 209, 0, 259,
2441 0, 260, 261, 262, 0, 263, 264, 74, 0, 0,
2442 0, 0, 0, 0, 0, 0, 0, 385, 386, 387,
2443 388, 0, 0, 389, 0, 0, 0, 0, 0, 0,
2444 0, 396, 0, 0, 397, 0, 398, 0, 399, 390,
2445 391, 392, 0, 0, 0, 0, 0, 0, 0, 0,
2446 0, 0, 0, 0, 393, 394, 0, 275, 276, 0,
2447 277, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2448 0, 0, 0, 395, 0, 0, 0, 0, 0, 0,
2449 75, 76, 154, 0, 77, 0, 78, 0, 0, 175,
2450 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
2451 186, 187, 188, 189, 254, 255, 256, 257, 0, 0,
2452 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2453 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2454 0, 0, 0, 258, 198, 199, 200, 201, 202, 203,
2455 204, 205, 206, 207, 208, 209, 0, 259, 0, 260,
2456 261, 262, 0, 263, 264, 64, 65, 0, 107, 67,
2457 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2458 3, 4, 5, 0, 0, 0, 0, 0, 0, 396,
2459 0, 0, 397, 0, 398, 0, 399, 350, 0, 0,
2460 0, 0, 0, 0, 0, 0, 64, 65, 74, 107,
2461 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2462 0, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2463 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2464 4, 5, 0, 0, 0, 0, 0, 64, 65, 74,
2465 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2466 2, 0, 3, 4, 5, 64, 65, 74, 107, 67,
2467 68, 69, 70, 71, 72, 73, 0, 1, 2, 535,
2468 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2469 74, 0, 0, 0, 0, 0, 0, 629, 0, 0,
2470 0, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2471 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2472 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2473 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
2474 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2475 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2476 0, 0, 0, 75, 76, 0, 372, 77, 0, 78,
2477 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2478 0, 75, 76, 0, 475, 77, 0, 78, 0, 0,
2479 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2480 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2481 78, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2482 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2483 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2484 0, 1, 2, 0, 3, 4, 5, 0, 64, 65,
2485 0, 281, 67, 68, 69, 70, 71, 72, 73, 0,
2486 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2487 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2488 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2489 77, 74, 78, 64, 65, 0, 107, 67, 68, 69,
2490 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2491 5, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2492 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2493 0, 0, 0, 0, 64, 65, 74, 107, 67, 68,
2494 69, 70, 71, 72, 636, 0, 1, 2, 0, 3,
2495 4, 5, 64, 65, 74, 107, 67, 68, 69, 70,
2496 71, 72, 680, 0, 1, 2, 0, 3, 4, 5,
2497 0, 0, 0, 0, 0, 0, 0, 74, 0, 0,
2498 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2499 77, 0, 78, 0, 0, 74, 0, -216, 0, 0,
2500 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2501 0, 78, 0, 0, 0, -63, 1, 2, 0, 3,
2502 4, 5, 0, 0, 0, 0, 0, 6, 7, 0,
2503 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2504 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
2505 75, 76, 0, 9, 77, 0, 375, 10, 0, 0,
2506 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2507 0, 0, 77, 0, 477, 0, 0, 0, 0, 0,
2508 0, 0, 0, 166, 0, 0, 0, 0, 0, 0,
2509 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2510 0, 0, 0, 0, 167, 168, 0, 0, 0, 75,
2511 76, 0, 0, 77, 0, 78, 169, 170, 171, 172,
2512 173, 174, 175, 176, 177, 178, 179, 180, 181, 182,
2513 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2514 193, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2515 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2516 0, 194, 195, 196, 0, 0, 197, 198, 199, 200,
2517 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
2518 211, 212, 213, 214, 215, 216, 217, 218
2521 static const yytype_int16 yycheck[] =
2523 0, 27, 158, 196, 11, 11, 0, 320, 239, 161,
2524 458, 4, 446, 447, 55, 28, 159, 17, 211, 212,
2525 213, 214, 215, 17, 266, 267, 21, 192, 221, 34,
2526 172, 11, 55, 656, 29, 55, 288, 536, 55, 193,
2527 11, 162, 162, 55, 162, 55, 162, 161, 169, 54,
2528 673, 171, 78, 171, 55, 171, 7, 8, 55, 10,
2529 11, 12, 13, 14, 15, 16, 17, 53, 19, 20,
2530 55, 22, 23, 24, 54, 59, 102, 156, 162, 158,
2531 106, 223, 68, 54, 336, 162, 112, 171, 161, 254,
2532 7, 256, 118, 93, 171, 162, 18, 240, 241, 50,
2533 534, 255, 19, 257, 171, 22, 162, 24, 41, 42,
2534 121, 32, 33, 169, 55, 48, 142, 143, 159, 11,
2535 146, 54, 42, 43, 44, 17, 152, 47, 169, 20,
2536 161, 630, 23, 375, 582, 161, 159, 636, 637, 159,
2537 151, 162, 159, 169, 167, 338, 167, 159, 165, 159,
2538 34, 163, 162, 163, 396, 397, 398, 170, 159, 160,
2539 167, 167, 159, 0, 612, 162, 163, 165, 194, 195,
2540 196, 197, 117, 118, 159, 160, 171, 170, 677, 678,
2541 161, 680, 681, 161, 210, 211, 212, 213, 214, 215,
2542 216, 217, 218, 219, 220, 221, 509, 19, 697, 698,
2543 22, 22, 24, 282, 162, 231, 285, 286, 287, 167,
2544 46, 404, 48, 164, 165, 54, 242, 168, 159, 170,
2545 171, 21, 163, 162, 156, 157, 158, 420, 167, 422,
2546 423, 424, 54, 7, 8, 477, 35, 22, 37, 552,
2547 42, 554, 44, 322, 22, 19, 20, 22, 22, 23,
2548 24, 330, 331, 332, 333, 334, 408, 141, 142, 143,
2549 144, 160, 146, 162, 132, 133, 150, 151, 4, 153,
2550 154, 155, 160, 299, 162, 160, 159, 162, 160, 431,
2551 162, 4, 121, 122, 160, 279, 162, 132, 133, 37,
2552 316, 317, 318, 62, 63, 64, 65, 66, 67, 121,
2553 122, 614, 141, 142, 166, 144, 145, 463, 147, 148,
2554 149, 337, 338, 132, 133, 166, 114, 115, 159, 141,
2555 142, 163, 144, 145, 4, 147, 148, 149, 84, 85,
2556 409, 410, 411, 412, 161, 22, 162, 160, 169, 418,
2557 4, 42, 43, 44, 45, 46, 47, 48, 49, 375,
2558 51, 160, 159, 432, 365, 366, 367, 368, 369, 370,
2559 371, 592, 555, 55, 57, 558, 559, 560, 11, 380,
2560 381, 382, 169, 22, 160, 159, 159, 159, 404, 159,
2561 159, 162, 408, 159, 463, 162, 159, 159, 159, 159,
2562 38, 4, 38, 159, 420, 421, 422, 423, 424, 162,
2563 162, 162, 162, 162, 430, 431, 485, 159, 159, 159,
2564 159, 490, 22, 492, 61, 162, 495, 162, 162, 165,
2565 162, 162, 448, 162, 162, 162, 505, 506, 162, 508,
2566 661, 162, 162, 664, 162, 162, 162, 169, 449, 450,
2567 451, 452, 162, 162, 38, 22, 472, 17, 17, 460,
2568 162, 477, 162, 162, 162, 156, 157, 158, 162, 4,
2569 162, 4, 162, 162, 162, 4, 545, 546, 162, 548,
2570 549, 550, 551, 162, 162, 22, 162, 556, 504, 162,
2571 38, 162, 4, 162, 510, 564, 160, 169, 159, 162,
2572 162, 570, 169, 4, 159, 54, 162, 160, 285, 286,
2573 287, 162, 162, 160, 530, 160, 22, 169, 519, 520,
2574 521, 522, 162, 524, 165, 167, 160, 528, 529, 160,
2575 160, 160, 17, 160, 160, 167, 160, 54, 607, 555,
2576 4, 152, 558, 559, 560, 322, 162, 159, 22, 159,
2577 17, 17, 17, 330, 331, 332, 333, 334, 94, 95,
2578 96, 97, 98, 99, 100, 101, 102, 103, 162, 73,
2579 17, 572, 573, 574, 575, 591, 652, 93, 631, 106,
2580 112, 17, 598, 231, 242, 90, 655, 57, 133, 613,
2581 659, 660, 453, 141, 142, 143, 144, 613, 146, 133,
2582 590, -1, 150, 151, -1, 153, 154, 155, -1, -1,
2583 -1, -1, -1, -1, -1, -1, -1, -1, 619, -1,
2584 621, 622, 691, 692, -1, 694, -1, 696, -1, -1,
2585 -1, 700, 409, 410, 411, 412, -1, 706, -1, -1,
2586 -1, 418, -1, -1, 7, 8, 662, 10, 11, 12,
2587 13, 14, 15, 16, 17, 432, 19, 20, -1, 22,
2588 23, 24, 652, -1, -1, -1, 7, 8, -1, 10,
2589 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2590 -1, 22, 23, 24, -1, -1, -1, 50, -1, -1,
2591 141, 142, 143, 144, -1, 146, -1, -1, 39, 150,
2592 151, -1, 153, 154, 155, -1, -1, -1, 485, 50,
2593 -1, -1, -1, 490, -1, 492, -1, -1, 495, -1,
2594 -1, -1, -1, -1, -1, -1, -1, -1, 505, 506,
2595 -1, 508, -1, -1, -1, -1, -1, -1, -1, -1,
2596 -1, -1, -1, -1, -1, -1, -1, -1, -1, 7,
2597 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2598 -1, 19, 20, -1, 22, 23, 24, -1, 545, 546,
2599 -1, 548, 549, 550, 551, -1, -1, -1, -1, 556,
2600 -1, -1, -1, -1, -1, -1, -1, 564, -1, -1,
2601 -1, -1, 50, 570, -1, -1, -1, -1, -1, -1,
2602 -1, 164, 165, -1, -1, 168, -1, 170, 171, -1,
2603 -1, -1, -1, -1, -1, 3, 4, 5, 6, 7,
2604 8, 9, -1, 164, 165, 0, -1, 168, -1, 170,
2605 607, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2606 -1, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2607 -1, -1, 40, 41, -1, 30, 31, -1, -1, -1,
2608 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
2609 -1, 59, -1, -1, -1, -1, -1, 52, 655, -1,
2610 -1, 56, 659, 660, -1, 60, -1, 75, 76, 77,
2611 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2612 88, 89, 90, 91, 92, 93, 164, 165, -1, -1,
2613 168, -1, 170, 171, 691, 692, -1, 694, -1, 696,
2614 -1, -1, -1, 700, -1, -1, -1, -1, -1, 706,
2615 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2616 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2617 -1, 139, 140, 141, 142, -1, 144, 145, -1, 147,
2618 148, 149, -1, -1, -1, -1, -1, -1, -1, 3,
2619 4, 5, 6, 7, 8, 9, -1, 165, -1, -1,
2620 168, -1, 170, -1, 172, 19, 20, -1, 22, 23,
2621 24, 25, 26, 27, 26, 27, -1, -1, -1, -1,
2622 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2623 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2624 -1, 55, -1, 7, 8, 59, 10, 11, 12, 13,
2625 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2626 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2627 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2628 -1, -1, -1, -1, -1, -1, 50, -1, 100, 101,
2629 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
2630 112, 113, -1, -1, -1, 119, 120, 121, 122, 123,
2631 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2632 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2633 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2634 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2635 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2636 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2637 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2638 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2639 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2640 164, 165, -1, -1, 168, -1, 170, 171, -1, -1,
2641 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2642 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2643 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2644 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2645 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2646 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2647 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2648 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2649 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2650 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2651 -1, -1, -1, -1, -1, 159, -1, -1, -1, 163,
2652 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2653 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2654 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2655 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2656 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2657 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2658 -1, 55, 7, 8, -1, 10, 11, 12, 13, 14,
2659 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2660 -1, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2661 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2662 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2663 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2664 -1, -1, -1, -1, -1, 119, 120, 121, 122, 123,
2665 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2666 -1, 135, 136, 137, -1, 139, 140, -1, -1, -1,
2667 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2668 -1, -1, -1, -1, -1, 159, -1, -1, -1, -1,
2669 -1, 165, -1, -1, 168, -1, 170, -1, 172, 3,
2670 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2671 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2672 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2673 -1, -1, -1, -1, -1, -1, 40, 41, -1, 164,
2674 165, -1, -1, 168, -1, 170, 171, -1, -1, -1,
2675 -1, -1, -1, 7, 8, 59, 10, 11, 12, 13,
2676 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2677 24, 75, 76, 77, 78, 79, 80, 81, 82, 83,
2678 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2679 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2680 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2681 23, 24, -1, -1, -1, 119, 120, 121, 122, 123,
2682 124, 125, 126, 127, 128, 129, 130, 131, -1, 133,
2683 -1, 135, 136, 137, -1, 139, 140, 50, -1, -1,
2684 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
2685 6, -1, -1, 9, -1, -1, -1, -1, -1, -1,
2686 -1, 165, -1, -1, 168, -1, 170, -1, 172, 25,
2687 26, 27, -1, -1, -1, -1, -1, -1, -1, -1,
2688 -1, -1, -1, -1, 40, 41, -1, 141, 142, -1,
2689 144, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2690 -1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
2691 164, 165, 125, -1, 168, -1, 170, -1, -1, 75,
2692 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2693 86, 87, 88, 89, 90, 91, 92, 93, -1, -1,
2694 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2695 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2696 -1, -1, -1, 119, 120, 121, 122, 123, 124, 125,
2697 126, 127, 128, 129, 130, 131, -1, 133, -1, 135,
2698 136, 137, -1, 139, 140, 7, 8, -1, 10, 11,
2699 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2700 22, 23, 24, -1, -1, -1, -1, -1, -1, 165,
2701 -1, -1, 168, -1, 170, -1, 172, 39, -1, -1,
2702 -1, -1, -1, -1, -1, -1, 7, 8, 50, 10,
2703 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2704 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2705 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2706 23, 24, -1, -1, -1, -1, -1, 7, 8, 50,
2707 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2708 20, -1, 22, 23, 24, 7, 8, 50, 10, 11,
2709 12, 13, 14, 15, 16, 17, -1, 19, 20, 39,
2710 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2711 50, -1, -1, -1, -1, -1, -1, 39, -1, -1,
2712 -1, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2713 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2714 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2715 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2716 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2717 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2718 -1, -1, -1, 164, 165, -1, 167, 168, -1, 170,
2719 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2720 -1, 164, 165, -1, 167, 168, -1, 170, -1, -1,
2721 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2722 -1, -1, -1, -1, 164, 165, -1, -1, 168, -1,
2723 170, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2724 -1, -1, 164, 165, -1, -1, 168, -1, 170, 7,
2725 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2726 -1, 19, 20, -1, 22, 23, 24, -1, 7, 8,
2727 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2728 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2729 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2730 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2731 168, 50, 170, 7, 8, -1, 10, 11, 12, 13,
2732 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2733 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2734 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2735 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2736 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2737 23, 24, 7, 8, 50, 10, 11, 12, 13, 14,
2738 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2739 -1, -1, -1, -1, -1, -1, -1, 50, -1, -1,
2740 -1, -1, -1, -1, -1, -1, 164, 165, -1, -1,
2741 168, -1, 170, -1, -1, 50, -1, 0, -1, -1,
2742 -1, -1, -1, -1, -1, 164, 165, -1, -1, 168,
2743 -1, 170, -1, -1, -1, 18, 19, 20, -1, 22,
2744 23, 24, -1, -1, -1, -1, -1, 30, 31, -1,
2745 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2746 -1, -1, -1, -1, -1, -1, -1, -1, -1, 52,
2747 164, 165, -1, 56, 168, -1, 170, 60, -1, -1,
2748 -1, -1, -1, -1, -1, -1, -1, -1, 164, 165,
2749 -1, -1, 168, -1, 170, -1, -1, -1, -1, -1,
2750 -1, -1, -1, 36, -1, -1, -1, -1, -1, -1,
2751 -1, 164, 165, -1, -1, 168, -1, 170, -1, -1,
2752 -1, -1, -1, -1, 57, 58, -1, -1, -1, 164,
2753 165, -1, -1, 168, -1, 170, 69, 70, 71, 72,
2754 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
2755 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2756 93, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2757 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2758 -1, 114, 115, 116, -1, -1, 119, 120, 121, 122,
2759 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
2760 133, 134, 135, 136, 137, 138, 139, 140
2763 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2764 symbol of state STATE-NUM. */
2765 static const yytype_uint16 yystos[] =
2767 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2768 60, 179, 182, 184, 185, 186, 220, 221, 222, 224,
2769 223, 53, 68, 229, 161, 59, 161, 18, 161, 42,
2770 43, 44, 45, 46, 47, 48, 49, 51, 156, 157,
2771 158, 187, 188, 189, 0, 222, 46, 48, 190, 239,
2772 42, 43, 44, 47, 191, 236, 238, 246, 161, 161,
2773 165, 230, 22, 228, 7, 8, 10, 11, 12, 13,
2774 14, 15, 16, 17, 50, 164, 165, 168, 170, 179,
2775 184, 207, 208, 242, 189, 189, 35, 37, 218, 189,
2776 189, 21, 247, 248, 29, 171, 237, 247, 22, 22,
2777 22, 231, 159, 4, 4, 4, 170, 10, 171, 208,
2778 213, 55, 159, 181, 218, 218, 42, 44, 192, 32,
2779 33, 217, 62, 63, 64, 65, 66, 67, 193, 234,
2780 234, 7, 182, 183, 251, 162, 167, 39, 208, 209,
2781 211, 212, 166, 166, 171, 213, 162, 171, 159, 212,
2782 163, 217, 217, 10, 125, 208, 210, 219, 208, 214,
2783 4, 197, 28, 170, 235, 161, 36, 57, 58, 69,
2784 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2785 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2786 90, 91, 92, 93, 114, 115, 116, 119, 120, 121,
2787 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2788 132, 133, 134, 135, 136, 137, 138, 139, 140, 174,
2789 175, 176, 249, 256, 257, 258, 259, 249, 257, 22,
2790 195, 162, 160, 208, 208, 169, 171, 208, 4, 160,
2791 214, 208, 159, 242, 3, 4, 5, 6, 9, 25,
2792 26, 27, 40, 41, 90, 91, 92, 93, 119, 133,
2793 135, 136, 137, 139, 140, 165, 168, 170, 172, 174,
2794 175, 176, 215, 242, 181, 141, 142, 144, 196, 210,
2795 57, 10, 208, 244, 245, 11, 17, 11, 193, 94,
2796 95, 96, 97, 98, 99, 100, 101, 102, 103, 177,
2797 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2798 108, 109, 110, 111, 112, 113, 178, 177, 178, 208,
2799 208, 244, 208, 208, 252, 244, 244, 244, 244, 244,
2800 208, 208, 208, 208, 208, 244, 193, 117, 118, 54,
2801 121, 122, 141, 142, 144, 145, 147, 148, 149, 194,
2802 39, 209, 199, 167, 169, 169, 160, 199, 181, 181,
2803 219, 177, 178, 177, 178, 159, 159, 159, 159, 159,
2804 159, 159, 167, 214, 216, 170, 216, 171, 216, 22,
2805 159, 159, 159, 225, 184, 3, 4, 5, 6, 9,
2806 25, 26, 27, 40, 41, 59, 165, 168, 170, 172,
2807 215, 241, 242, 243, 162, 243, 243, 243, 197, 208,
2808 208, 208, 208, 162, 202, 162, 202, 243, 165, 162,
2809 162, 162, 162, 162, 162, 243, 243, 243, 243, 243,
2810 38, 197, 208, 244, 4, 141, 142, 143, 144, 146,
2811 150, 151, 153, 154, 155, 198, 226, 227, 38, 159,
2812 159, 159, 159, 214, 214, 214, 214, 214, 214, 214,
2813 162, 167, 171, 208, 216, 169, 171, 214, 214, 214,
2814 162, 205, 159, 61, 240, 167, 216, 170, 216, 171,
2815 216, 22, 244, 162, 162, 210, 243, 243, 243, 243,
2816 11, 54, 11, 254, 243, 165, 244, 208, 244, 244,
2817 244, 162, 162, 255, 162, 162, 162, 208, 210, 243,
2818 162, 205, 205, 208, 214, 214, 214, 214, 254, 162,
2819 162, 162, 162, 255, 162, 214, 169, 171, 162, 162,
2820 38, 34, 54, 203, 206, 39, 208, 232, 233, 22,
2821 167, 171, 216, 169, 171, 17, 17, 243, 162, 162,
2822 162, 162, 243, 4, 243, 162, 162, 243, 162, 162,
2823 162, 4, 4, 162, 208, 243, 243, 243, 162, 202,
2824 208, 160, 162, 162, 162, 162, 160, 214, 214, 214,
2825 214, 160, 214, 169, 214, 214, 208, 22, 4, 205,
2826 195, 162, 160, 162, 169, 171, 243, 243, 159, 243,
2827 243, 243, 243, 202, 202, 244, 243, 162, 244, 244,
2828 244, 4, 243, 159, 243, 214, 214, 214, 214, 162,
2829 160, 162, 162, 255, 160, 160, 160, 179, 180, 39,
2830 208, 199, 22, 169, 162, 165, 17, 208, 253, 167,
2831 243, 255, 253, 202, 160, 160, 160, 160, 214, 214,
2832 214, 160, 195, 203, 204, 17, 11, 167, 250, 195,
2833 195, 160, 162, 167, 160, 160, 160, 160, 180, 54,
2834 201, 243, 241, 11, 167, 121, 122, 243, 243, 199,
2835 17, 208, 199, 4, 152, 200, 162, 241, 195, 195,
2836 38, 195, 195, 22, 17, 162, 17, 243, 243, 243,
2837 17, 243, 195, 195, 243, 73, 17, 243
2840 #define yyerrok (yyerrstatus = 0)
2841 #define yyclearin (yychar = YYEMPTY)
2842 #define YYEMPTY (-2)
2845 #define YYACCEPT goto yyacceptlab
2846 #define YYABORT goto yyabortlab
2847 #define YYERROR goto yyerrorlab
2850 /* Like YYERROR except do call yyerror. This remains here temporarily
2851 to ease the transition to the new meaning of YYERROR, for GCC.
2852 Once GCC version 2 has supplanted version 1, this can go. */
2854 #define YYFAIL goto yyerrlab
2856 #define YYRECOVERING() (!!yyerrstatus)
2858 #define YYBACKUP(Token, Value) \
2860 if (yychar == YYEMPTY && yylen == 1) \
2864 yytoken = YYTRANSLATE (yychar); \
2870 yyerror (YY_("syntax error: cannot back up")); \
2877 #define YYERRCODE 256
2880 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2881 If N is 0, then set CURRENT to the empty location which ends
2882 the previous symbol: RHS[0] (always defined). */
2884 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2885 #ifndef YYLLOC_DEFAULT
2886 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2890 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2891 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2892 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2893 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2897 (Current).first_line = (Current).last_line = \
2898 YYRHSLOC (Rhs, 0).last_line; \
2899 (Current).first_column = (Current).last_column = \
2900 YYRHSLOC (Rhs, 0).last_column; \
2906 /* YY_LOCATION_PRINT -- Print the location on the stream.
2907 This macro was not mandated originally: define only if we know
2908 we won't break user code: when these are the locations we know. */
2910 #ifndef YY_LOCATION_PRINT
2911 # if YYLTYPE_IS_TRIVIAL
2912 # define YY_LOCATION_PRINT(File, Loc) \
2913 fprintf (File, "%d.%d-%d.%d", \
2914 (Loc).first_line, (Loc).first_column, \
2915 (Loc).last_line, (Loc).last_column)
2917 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2922 /* YYLEX -- calling `yylex' with the right arguments. */
2925 # define YYLEX yylex (YYLEX_PARAM)
2927 # define YYLEX yylex ()
2930 /* Enable debugging if requested. */
2934 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2935 # define YYFPRINTF fprintf
2938 # define YYDPRINTF(Args) \
2944 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2948 YYFPRINTF (stderr, "%s ", Title); \
2949 yy_symbol_print (stderr, \
2951 YYFPRINTF (stderr, "\n"); \
2956 /*--------------------------------.
2957 | Print this symbol on YYOUTPUT. |
2958 `--------------------------------*/
2961 #if (defined __STDC__ || defined __C99__FUNC__ \
2962 || defined __cplusplus || defined _MSC_VER)
2964 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2967 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2970 YYSTYPE const * const yyvaluep;
2976 if (yytype < YYNTOKENS)
2977 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2989 /*--------------------------------.
2990 | Print this symbol on YYOUTPUT. |
2991 `--------------------------------*/
2993 #if (defined __STDC__ || defined __C99__FUNC__ \
2994 || defined __cplusplus || defined _MSC_VER)
2996 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2999 yy_symbol_print (yyoutput, yytype, yyvaluep)
3002 YYSTYPE const * const yyvaluep;
3005 if (yytype < YYNTOKENS)
3006 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3008 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3010 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3011 YYFPRINTF (yyoutput, ")");
3014 /*------------------------------------------------------------------.
3015 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3017 `------------------------------------------------------------------*/
3019 #if (defined __STDC__ || defined __C99__FUNC__ \
3020 || defined __cplusplus || defined _MSC_VER)
3022 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3025 yy_stack_print (bottom, top)
3026 yytype_int16 *bottom;
3030 YYFPRINTF (stderr, "Stack now");
3031 for (; bottom <= top; ++bottom)
3032 YYFPRINTF (stderr, " %d", *bottom);
3033 YYFPRINTF (stderr, "\n");
3036 # define YY_STACK_PRINT(Bottom, Top) \
3039 yy_stack_print ((Bottom), (Top)); \
3043 /*------------------------------------------------.
3044 | Report that the YYRULE is going to be reduced. |
3045 `------------------------------------------------*/
3047 #if (defined __STDC__ || defined __C99__FUNC__ \
3048 || defined __cplusplus || defined _MSC_VER)
3050 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3053 yy_reduce_print (yyvsp, yyrule)
3058 int yynrhs = yyr2[yyrule];
3060 unsigned long int yylno = yyrline[yyrule];
3061 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3063 /* The symbols being reduced. */
3064 for (yyi = 0; yyi < yynrhs; yyi++)
3066 fprintf (stderr, " $%d = ", yyi + 1);
3067 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3068 &(yyvsp[(yyi + 1) - (yynrhs)])
3070 fprintf (stderr, "\n");
3074 # define YY_REDUCE_PRINT(Rule) \
3077 yy_reduce_print (yyvsp, Rule); \
3080 /* Nonzero means print parse trace. It is left uninitialized so that
3081 multiple parsers can coexist. */
3083 #else /* !YYDEBUG */
3084 # define YYDPRINTF(Args)
3085 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3086 # define YY_STACK_PRINT(Bottom, Top)
3087 # define YY_REDUCE_PRINT(Rule)
3088 #endif /* !YYDEBUG */
3091 /* YYINITDEPTH -- initial size of the parser's stacks. */
3093 # define YYINITDEPTH 200
3096 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3097 if the built-in stack extension method is used).
3099 Do not make this value too large; the results are undefined if
3100 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3101 evaluated with infinite-precision integer arithmetic. */
3104 # define YYMAXDEPTH 10000
3112 # if defined __GLIBC__ && defined _STRING_H
3113 # define yystrlen strlen
3115 /* Return the length of YYSTR. */
3116 #if (defined __STDC__ || defined __C99__FUNC__ \
3117 || defined __cplusplus || defined _MSC_VER)
3119 yystrlen (const char *yystr)
3127 for (yylen = 0; yystr[yylen]; yylen++)
3135 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3136 # define yystpcpy stpcpy
3138 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3140 #if (defined __STDC__ || defined __C99__FUNC__ \
3141 || defined __cplusplus || defined _MSC_VER)
3143 yystpcpy (char *yydest, const char *yysrc)
3146 yystpcpy (yydest, yysrc)
3152 const char *yys = yysrc;
3154 while ((*yyd++ = *yys++) != '\0')
3163 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3164 quotes and backslashes, so that it's suitable for yyerror. The
3165 heuristic is that double-quoting is unnecessary unless the string
3166 contains an apostrophe, a comma, or backslash (other than
3167 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3168 null, do not copy; instead, return the length of what the result
3171 yytnamerr (char *yyres, const char *yystr)
3176 char const *yyp = yystr;
3183 goto do_not_strip_quotes;
3187 goto do_not_strip_quotes;
3200 do_not_strip_quotes: ;
3204 return yystrlen (yystr);
3206 return yystpcpy (yyres, yystr) - yyres;
3210 /* Copy into YYRESULT an error message about the unexpected token
3211 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3212 including the terminating null byte. If YYRESULT is null, do not
3213 copy anything; just return the number of bytes that would be
3214 copied. As a special case, return 0 if an ordinary "syntax error"
3215 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3216 size calculation. */
3218 yysyntax_error (char *yyresult, int yystate, int yychar)
3220 int yyn = yypact[yystate];
3222 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3226 int yytype = YYTRANSLATE (yychar);
3227 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3228 YYSIZE_T yysize = yysize0;
3230 int yysize_overflow = 0;
3231 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3232 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3236 /* This is so xgettext sees the translatable formats that are
3237 constructed on the fly. */
3238 YY_("syntax error, unexpected %s");
3239 YY_("syntax error, unexpected %s, expecting %s");
3240 YY_("syntax error, unexpected %s, expecting %s or %s");
3241 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3242 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3246 static char const yyunexpected[] = "syntax error, unexpected %s";
3247 static char const yyexpecting[] = ", expecting %s";
3248 static char const yyor[] = " or %s";
3249 char yyformat[sizeof yyunexpected
3250 + sizeof yyexpecting - 1
3251 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3252 * (sizeof yyor - 1))];
3253 char const *yyprefix = yyexpecting;
3255 /* Start YYX at -YYN if negative to avoid negative indexes in
3257 int yyxbegin = yyn < 0 ? -yyn : 0;
3259 /* Stay within bounds of both yycheck and yytname. */
3260 int yychecklim = YYLAST - yyn + 1;
3261 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3264 yyarg[0] = yytname[yytype];
3265 yyfmt = yystpcpy (yyformat, yyunexpected);
3267 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3268 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3270 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3274 yyformat[sizeof yyunexpected - 1] = '\0';
3277 yyarg[yycount++] = yytname[yyx];
3278 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3279 yysize_overflow |= (yysize1 < yysize);
3281 yyfmt = yystpcpy (yyfmt, yyprefix);
3285 yyf = YY_(yyformat);
3286 yysize1 = yysize + yystrlen (yyf);
3287 yysize_overflow |= (yysize1 < yysize);
3290 if (yysize_overflow)
3291 return YYSIZE_MAXIMUM;
3295 /* Avoid sprintf, as that infringes on the user's name space.
3296 Don't have undefined behavior even if the translation
3297 produced a string with the wrong number of "%s"s. */
3298 char *yyp = yyresult;
3300 while ((*yyp = *yyf) != '\0')
3302 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3304 yyp += yytnamerr (yyp, yyarg[yyi++]);
3317 #endif /* YYERROR_VERBOSE */
3320 /*-----------------------------------------------.
3321 | Release the memory associated to this symbol. |
3322 `-----------------------------------------------*/
3325 #if (defined __STDC__ || defined __C99__FUNC__ \
3326 || defined __cplusplus || defined _MSC_VER)
3328 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3331 yydestruct (yymsg, yytype, yyvaluep)
3341 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3352 /* Prevent warnings from -Wmissing-prototypes. */
3354 #ifdef YYPARSE_PARAM
3355 #if defined __STDC__ || defined __cplusplus
3356 int yyparse (void *YYPARSE_PARAM);
3360 #else /* ! YYPARSE_PARAM */
3361 #if defined __STDC__ || defined __cplusplus
3366 #endif /* ! YYPARSE_PARAM */
3370 /* The look-ahead symbol. */
3373 /* The semantic value of the look-ahead symbol. */
3376 /* Number of syntax errors so far. */
3385 #ifdef YYPARSE_PARAM
3386 #if (defined __STDC__ || defined __C99__FUNC__ \
3387 || defined __cplusplus || defined _MSC_VER)
3389 yyparse (void *YYPARSE_PARAM)
3392 yyparse (YYPARSE_PARAM)
3393 void *YYPARSE_PARAM;
3395 #else /* ! YYPARSE_PARAM */
3396 #if (defined __STDC__ || defined __C99__FUNC__ \
3397 || defined __cplusplus || defined _MSC_VER)
3411 /* Number of tokens to shift before error messages enabled. */
3413 /* Look-ahead token as an internal (translated) token number. */
3416 /* Buffer for error messages, and its allocated size. */
3418 char *yymsg = yymsgbuf;
3419 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3422 /* Three stacks and their tools:
3423 `yyss': related to states,
3424 `yyvs': related to semantic values,
3425 `yyls': related to locations.
3427 Refer to the stacks thru separate pointers, to allow yyoverflow
3428 to reallocate them elsewhere. */
3430 /* The state stack. */
3431 yytype_int16 yyssa[YYINITDEPTH];
3432 yytype_int16 *yyss = yyssa;
3433 yytype_int16 *yyssp;
3435 /* The semantic value stack. */
3436 YYSTYPE yyvsa[YYINITDEPTH];
3437 YYSTYPE *yyvs = yyvsa;
3442 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3444 YYSIZE_T yystacksize = YYINITDEPTH;
3446 /* The variables used to return semantic value and location from the
3451 /* The number of symbols on the RHS of the reduced rule.
3452 Keep to zero when no symbol should be popped. */
3455 YYDPRINTF ((stderr, "Starting parse\n"));
3460 yychar = YYEMPTY; /* Cause a token to be read. */
3462 /* Initialize stack pointers.
3463 Waste one element of value and location stack
3464 so that they stay on the same level as the state stack.
3465 The wasted elements are never initialized. */
3472 /*------------------------------------------------------------.
3473 | yynewstate -- Push a new state, which is found in yystate. |
3474 `------------------------------------------------------------*/
3476 /* In all cases, when you get here, the value and location stacks
3477 have just been pushed. So pushing a state here evens the stacks. */
3483 if (yyss + yystacksize - 1 <= yyssp)
3485 /* Get the current used size of the three stacks, in elements. */
3486 YYSIZE_T yysize = yyssp - yyss + 1;
3490 /* Give user a chance to reallocate the stack. Use copies of
3491 these so that the &'s don't force the real ones into
3493 YYSTYPE *yyvs1 = yyvs;
3494 yytype_int16 *yyss1 = yyss;
3497 /* Each stack pointer address is followed by the size of the
3498 data in use in that stack, in bytes. This used to be a
3499 conditional around just the two extra args, but that might
3500 be undefined if yyoverflow is a macro. */
3501 yyoverflow (YY_("memory exhausted"),
3502 &yyss1, yysize * sizeof (*yyssp),
3503 &yyvs1, yysize * sizeof (*yyvsp),
3510 #else /* no yyoverflow */
3511 # ifndef YYSTACK_RELOCATE
3512 goto yyexhaustedlab;
3514 /* Extend the stack our own way. */
3515 if (YYMAXDEPTH <= yystacksize)
3516 goto yyexhaustedlab;
3518 if (YYMAXDEPTH < yystacksize)
3519 yystacksize = YYMAXDEPTH;
3522 yytype_int16 *yyss1 = yyss;
3523 union yyalloc *yyptr =
3524 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3526 goto yyexhaustedlab;
3527 YYSTACK_RELOCATE (yyss);
3528 YYSTACK_RELOCATE (yyvs);
3530 # undef YYSTACK_RELOCATE
3532 YYSTACK_FREE (yyss1);
3535 #endif /* no yyoverflow */
3537 yyssp = yyss + yysize - 1;
3538 yyvsp = yyvs + yysize - 1;
3541 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3542 (unsigned long int) yystacksize));
3544 if (yyss + yystacksize - 1 <= yyssp)
3548 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3557 /* Do appropriate processing given the current state. Read a
3558 look-ahead token if we need one and don't already have one. */
3560 /* First try to decide what to do without reference to look-ahead token. */
3561 yyn = yypact[yystate];
3562 if (yyn == YYPACT_NINF)
3565 /* Not known => get a look-ahead token if don't already have one. */
3567 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3568 if (yychar == YYEMPTY)
3570 YYDPRINTF ((stderr, "Reading a token: "));
3574 if (yychar <= YYEOF)
3576 yychar = yytoken = YYEOF;
3577 YYDPRINTF ((stderr, "Now at end of input.\n"));
3581 yytoken = YYTRANSLATE (yychar);
3582 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3585 /* If the proper action on seeing token YYTOKEN is to reduce or to
3586 detect an error, take that action. */
3588 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3593 if (yyn == 0 || yyn == YYTABLE_NINF)
3602 /* Count tokens shifted since error; after three, turn off error
3607 /* Shift the look-ahead token. */
3608 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3610 /* Discard the shifted token unless it is eof. */
3611 if (yychar != YYEOF)
3620 /*-----------------------------------------------------------.
3621 | yydefault -- do the default action for the current state. |
3622 `-----------------------------------------------------------*/
3624 yyn = yydefact[yystate];
3630 /*-----------------------------.
3631 | yyreduce -- Do a reduction. |
3632 `-----------------------------*/
3634 /* yyn is the number of a rule to reduce with. */
3637 /* If YYLEN is nonzero, implement the default value of the action:
3640 Otherwise, the following line sets YYVAL to garbage.
3641 This behavior is undocumented and Bison
3642 users should not rely upon it. Assigning to YYVAL
3643 unconditionally makes the parser a bit smaller, and it avoids a
3644 GCC warning that YYVAL may be used uninitialized. */
3645 yyval = yyvsp[1-yylen];
3648 YY_REDUCE_PRINT (yyn);
3652 #line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3653 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3657 #line 1154 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3658 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3662 #line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3663 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3667 #line 1155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3668 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3672 #line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3673 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3677 #line 1156 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3678 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3682 #line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3683 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3687 #line 1157 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3688 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3692 #line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3693 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3697 #line 1158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3698 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3702 #line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3703 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3707 #line 1162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3708 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3712 #line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3713 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3717 #line 1163 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3718 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3722 #line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3723 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3727 #line 1164 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3728 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3732 #line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3733 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3737 #line 1165 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3738 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3742 #line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3743 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3747 #line 1166 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3748 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3752 #line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3753 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3757 #line 1167 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3758 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3762 #line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3763 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3767 #line 1168 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3768 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3772 #line 1169 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3773 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3777 #line 1170 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3778 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3782 #line 1174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3783 { (yyval.StrVal) = 0; ;}
3787 #line 1176 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3788 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3792 #line 1177 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3793 { (yyval.UIntVal)=0; ;}
3797 #line 1181 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3799 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3805 #line 1185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3813 #line 1190 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3815 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3821 #line 1199 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3829 #line 1204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3831 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3837 #line 1210 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3838 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3842 #line 1211 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3843 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3847 #line 1212 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3848 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3852 #line 1213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3853 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3857 #line 1214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3858 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3862 #line 1215 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3863 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3867 #line 1219 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3868 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3872 #line 1220 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3873 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3877 #line 1221 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3878 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3882 #line 1225 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3883 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3887 #line 1226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3888 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3892 #line 1227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3893 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3897 #line 1228 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3898 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3902 #line 1232 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3903 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3907 #line 1233 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3908 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3912 #line 1234 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3913 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3917 #line 1238 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3918 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3922 #line 1239 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3923 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3927 #line 1240 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3928 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3932 #line 1241 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3933 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3937 #line 1242 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3938 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3942 #line 1246 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3943 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3947 #line 1247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3948 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3952 #line 1248 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3953 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3957 #line 1251 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3958 { (yyval.UIntVal) = CallingConv::C; ;}
3962 #line 1252 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3963 { (yyval.UIntVal) = CallingConv::C; ;}
3967 #line 1253 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3968 { (yyval.UIntVal) = CallingConv::Fast; ;}
3972 #line 1254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3973 { (yyval.UIntVal) = CallingConv::Cold; ;}
3977 #line 1255 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3978 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3982 #line 1256 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3983 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3987 #line 1257 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3989 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3990 GEN_ERROR("Calling conv too large");
3991 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3997 #line 1264 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
3998 { (yyval.Attributes) = Attribute::ZExt; ;}
4002 #line 1265 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4003 { (yyval.Attributes) = Attribute::ZExt; ;}
4007 #line 1266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4008 { (yyval.Attributes) = Attribute::SExt; ;}
4012 #line 1267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4013 { (yyval.Attributes) = Attribute::SExt; ;}
4017 #line 1268 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4018 { (yyval.Attributes) = Attribute::InReg; ;}
4022 #line 1269 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4023 { (yyval.Attributes) = Attribute::StructRet; ;}
4027 #line 1270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4028 { (yyval.Attributes) = Attribute::NoAlias; ;}
4032 #line 1271 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4033 { (yyval.Attributes) = Attribute::ByVal; ;}
4037 #line 1272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4038 { (yyval.Attributes) = Attribute::Nest; ;}
4042 #line 1273 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4043 { (yyval.Attributes) =
4044 Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4048 #line 1277 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4049 { (yyval.Attributes) = Attribute::None; ;}
4053 #line 1278 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4055 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4060 #line 1283 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4061 { (yyval.Attributes) = Attribute::InReg; ;}
4065 #line 1284 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4066 { (yyval.Attributes) = Attribute::ZExt; ;}
4070 #line 1285 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4071 { (yyval.Attributes) = Attribute::SExt; ;}
4075 #line 1288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4076 { (yyval.Attributes) = Attribute::None; ;}
4080 #line 1289 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4082 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4087 #line 1295 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4088 { (yyval.Attributes) = Attribute::NoReturn; ;}
4092 #line 1296 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4093 { (yyval.Attributes) = Attribute::NoUnwind; ;}
4097 #line 1297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4098 { (yyval.Attributes) = Attribute::InReg; ;}
4102 #line 1298 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4103 { (yyval.Attributes) = Attribute::ZExt; ;}
4107 #line 1299 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4108 { (yyval.Attributes) = Attribute::SExt; ;}
4112 #line 1300 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4113 { (yyval.Attributes) = Attribute::ReadNone; ;}
4117 #line 1301 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4118 { (yyval.Attributes) = Attribute::ReadOnly; ;}
4122 #line 1302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4123 { (yyval.Attributes) = Attribute::NoInline; ;}
4127 #line 1303 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4128 { (yyval.Attributes) = Attribute::AlwaysInline; ;}
4132 #line 1304 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4133 { (yyval.Attributes) = Attribute::OptimizeForSize; ;}
4137 #line 1307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4138 { (yyval.Attributes) = Attribute::None; ;}
4142 #line 1308 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4144 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4149 #line 1314 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4150 { (yyval.StrVal) = 0; ;}
4154 #line 1315 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4156 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4161 #line 1322 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4162 { (yyval.UIntVal) = 0; ;}
4166 #line 1323 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4168 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4169 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4170 GEN_ERROR("Alignment must be a power of two");
4176 #line 1329 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4177 { (yyval.UIntVal) = 0; ;}
4181 #line 1330 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4183 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4184 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4185 GEN_ERROR("Alignment must be a power of two");
4191 #line 1339 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4193 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4194 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4195 GEN_ERROR("Invalid character in section name");
4196 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4202 #line 1347 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4203 { (yyval.StrVal) = 0; ;}
4207 #line 1348 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4208 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4212 #line 1353 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4217 #line 1354 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4222 #line 1355 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4224 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4225 delete (yyvsp[(1) - (1)].StrVal);
4231 #line 1360 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4233 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4234 GEN_ERROR("Alignment must be a power of two");
4235 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4241 #line 1376 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4243 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4249 #line 1380 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4251 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4257 #line 1384 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4259 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4260 GEN_ERROR("Cannot form a pointer to a basic block");
4261 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4262 delete (yyvsp[(1) - (3)].TypeVal);
4268 #line 1391 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4269 { // Named types are also simple types...
4270 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4272 (yyval.TypeVal) = new PATypeHolder(tmp);
4277 #line 1396 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4278 { // Type UpReference
4279 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4280 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4281 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4282 (yyval.TypeVal) = new PATypeHolder(OT);
4283 UR_OUT("New Upreference!\n");
4289 #line 1404 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4291 // Allow but ignore attributes on function types; this permits auto-upgrade.
4292 // FIXME: remove in LLVM 3.0.
4293 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4294 if (!FunctionType::isValidReturnType(RetTy))
4295 GEN_ERROR("Invalid result type for LLVM function");
4297 std::vector<const Type*> Params;
4298 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4299 for (; I != E; ++I ) {
4300 const Type *Ty = I->Ty->get();
4301 Params.push_back(Ty);
4304 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4305 if (isVarArg) Params.pop_back();
4307 for (unsigned i = 0; i != Params.size(); ++i)
4308 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4309 GEN_ERROR("Function arguments must be value types!");
4313 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4314 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4315 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4317 // Delete the argument list
4318 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4321 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4328 #line 1439 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4330 // Allow but ignore attributes on function types; this permits auto-upgrade.
4331 // FIXME: remove in LLVM 3.0.
4332 std::vector<const Type*> Params;
4333 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4334 for ( ; I != E; ++I ) {
4335 const Type* Ty = I->Ty->get();
4336 Params.push_back(Ty);
4339 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4340 if (isVarArg) Params.pop_back();
4342 for (unsigned i = 0; i != Params.size(); ++i)
4343 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4344 GEN_ERROR("Function arguments must be value types!");
4348 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4349 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4351 // Delete the argument list
4352 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4355 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4362 #line 1470 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4363 { // Sized array type?
4364 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4365 delete (yyvsp[(4) - (5)].TypeVal);
4371 #line 1475 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4373 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4374 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4375 GEN_ERROR("Unsigned result not equal to signed result");
4376 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4377 GEN_ERROR("Element type of a VectorType must be primitive");
4378 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4379 delete (yyvsp[(4) - (5)].TypeVal);
4385 #line 1485 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4386 { // Structure type?
4387 std::vector<const Type*> Elements;
4388 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4389 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4390 Elements.push_back(*I);
4392 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4393 delete (yyvsp[(2) - (3)].TypeList);
4399 #line 1495 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4400 { // Empty structure type?
4401 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4407 #line 1499 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4409 std::vector<const Type*> Elements;
4410 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4411 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4412 Elements.push_back(*I);
4414 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4415 delete (yyvsp[(3) - (5)].TypeList);
4421 #line 1509 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4422 { // Empty structure type?
4423 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4429 #line 1516 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4431 // Allow but ignore attributes on function types; this permits auto-upgrade.
4432 // FIXME: remove in LLVM 3.0.
4433 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4434 (yyval.TypeWithAttrs).Attrs = Attribute::None;
4439 #line 1525 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4441 if (!UpRefs.empty())
4442 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4443 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4444 GEN_ERROR("LLVM functions cannot return aggregate types");
4445 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4450 #line 1532 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4452 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4457 #line 1537 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4459 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4460 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4466 #line 1542 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4468 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4474 #line 1550 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4476 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4477 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4478 TWA.Ty = new PATypeHolder(Type::VoidTy);
4479 (yyval.TypeWithAttrsList)->push_back(TWA);
4485 #line 1557 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4487 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4488 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4489 TWA.Ty = new PATypeHolder(Type::VoidTy);
4490 (yyval.TypeWithAttrsList)->push_back(TWA);
4496 #line 1564 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4498 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4504 #line 1572 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4506 (yyval.TypeList) = new std::list<PATypeHolder>();
4507 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4508 delete (yyvsp[(1) - (1)].TypeVal);
4514 #line 1578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4516 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4517 delete (yyvsp[(3) - (3)].TypeVal);
4523 #line 1590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4524 { // Nonempty unsized arr
4525 if (!UpRefs.empty())
4526 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4527 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4529 GEN_ERROR("Cannot make array constant with type: '" +
4530 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4531 const Type *ETy = ATy->getElementType();
4532 uint64_t NumElements = ATy->getNumElements();
4534 // Verify that we have the correct size...
4535 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4536 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4537 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4538 utostr(NumElements) + "");
4540 // Verify all elements are correct type!
4541 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4542 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4543 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4544 ETy->getDescription() +"' as required!\nIt is of type '"+
4545 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4548 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4549 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4555 #line 1618 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4557 if (!UpRefs.empty())
4558 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4559 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4561 GEN_ERROR("Cannot make array constant with type: '" +
4562 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4564 uint64_t NumElements = ATy->getNumElements();
4565 if (NumElements != uint64_t(-1) && NumElements != 0)
4566 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4567 " arguments, but has size of " + utostr(NumElements) +"");
4568 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4569 delete (yyvsp[(1) - (3)].TypeVal);
4575 #line 1634 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4577 if (!UpRefs.empty())
4578 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4579 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4581 GEN_ERROR("Cannot make array constant with type: '" +
4582 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4584 uint64_t NumElements = ATy->getNumElements();
4585 const Type *ETy = ATy->getElementType();
4586 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4587 GEN_ERROR("Can't build string constant of size " +
4588 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4589 " when array has size " + utostr(NumElements) + "");
4590 std::vector<Constant*> Vals;
4591 if (ETy == Type::Int8Ty) {
4592 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4593 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4595 delete (yyvsp[(3) - (3)].StrVal);
4596 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4598 delete (yyvsp[(3) - (3)].StrVal);
4599 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4600 delete (yyvsp[(1) - (3)].TypeVal);
4606 #line 1661 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4607 { // Nonempty unsized arr
4608 if (!UpRefs.empty())
4609 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4610 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4612 GEN_ERROR("Cannot make packed constant with type: '" +
4613 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4614 const Type *ETy = PTy->getElementType();
4615 unsigned NumElements = PTy->getNumElements();
4617 // Verify that we have the correct size...
4618 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4619 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4620 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4621 utostr(NumElements) + "");
4623 // Verify all elements are correct type!
4624 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4625 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4626 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4627 ETy->getDescription() +"' as required!\nIt is of type '"+
4628 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4631 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4632 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4638 #line 1689 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4640 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4642 GEN_ERROR("Cannot make struct constant with type: '" +
4643 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4645 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4646 GEN_ERROR("Illegal number of initializers for structure type");
4648 // Check to ensure that constants are compatible with the type initializer!
4649 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4650 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4651 GEN_ERROR("Expected type '" +
4652 STy->getElementType(i)->getDescription() +
4653 "' for element #" + utostr(i) +
4654 " of structure initializer");
4656 // Check to ensure that Type is not packed
4657 if (STy->isPacked())
4658 GEN_ERROR("Unpacked Initializer to vector type '" +
4659 STy->getDescription() + "'");
4661 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4662 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4668 #line 1715 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4670 if (!UpRefs.empty())
4671 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4672 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4674 GEN_ERROR("Cannot make struct constant with type: '" +
4675 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4677 if (STy->getNumContainedTypes() != 0)
4678 GEN_ERROR("Illegal number of initializers for structure type");
4680 // Check to ensure that Type is not packed
4681 if (STy->isPacked())
4682 GEN_ERROR("Unpacked Initializer to vector type '" +
4683 STy->getDescription() + "'");
4685 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4686 delete (yyvsp[(1) - (3)].TypeVal);
4692 #line 1735 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4694 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4696 GEN_ERROR("Cannot make struct constant with type: '" +
4697 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4699 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4700 GEN_ERROR("Illegal number of initializers for structure type");
4702 // Check to ensure that constants are compatible with the type initializer!
4703 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4704 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4705 GEN_ERROR("Expected type '" +
4706 STy->getElementType(i)->getDescription() +
4707 "' for element #" + utostr(i) +
4708 " of structure initializer");
4710 // Check to ensure that Type is packed
4711 if (!STy->isPacked())
4712 GEN_ERROR("Vector initializer to non-vector type '" +
4713 STy->getDescription() + "'");
4715 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4716 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4722 #line 1761 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4724 if (!UpRefs.empty())
4725 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4726 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4728 GEN_ERROR("Cannot make struct constant with type: '" +
4729 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4731 if (STy->getNumContainedTypes() != 0)
4732 GEN_ERROR("Illegal number of initializers for structure type");
4734 // Check to ensure that Type is packed
4735 if (!STy->isPacked())
4736 GEN_ERROR("Vector initializer to non-vector type '" +
4737 STy->getDescription() + "'");
4739 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4740 delete (yyvsp[(1) - (5)].TypeVal);
4746 #line 1781 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4748 if (!UpRefs.empty())
4749 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4750 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4752 GEN_ERROR("Cannot make null pointer constant with type: '" +
4753 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4755 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4756 delete (yyvsp[(1) - (2)].TypeVal);
4762 #line 1793 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4764 if (!UpRefs.empty())
4765 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4766 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4767 delete (yyvsp[(1) - (2)].TypeVal);
4773 #line 1800 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4775 if (!UpRefs.empty())
4776 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4777 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4779 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4781 // ConstExprs can exist in the body of a function, thus creating
4782 // GlobalValues whenever they refer to a variable. Because we are in
4783 // the context of a function, getExistingVal will search the functions
4784 // symbol table instead of the module symbol table for the global symbol,
4785 // which throws things all off. To get around this, we just tell
4786 // getExistingVal that we are at global scope here.
4788 Function *SavedCurFn = CurFun.CurrentFunction;
4789 CurFun.CurrentFunction = 0;
4791 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4794 CurFun.CurrentFunction = SavedCurFn;
4796 // If this is an initializer for a constant pointer, which is referencing a
4797 // (currently) undefined variable, create a stub now that shall be replaced
4798 // in the future with the right type of variable.
4801 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4802 const PointerType *PT = cast<PointerType>(Ty);
4804 // First check to see if the forward references value is already created!
4805 PerModuleInfo::GlobalRefsType::iterator I =
4806 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4808 if (I != CurModule.GlobalRefs.end()) {
4809 V = I->second; // Placeholder already exists, use it...
4810 (yyvsp[(2) - (2)].ValIDVal).destroy();
4813 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4814 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4815 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4816 GEN_ERROR("Invalid reference to global");
4818 // Create the forward referenced global.
4820 if (const FunctionType *FTy =
4821 dyn_cast<FunctionType>(PT->getElementType())) {
4822 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4823 CurModule.CurrentModule);
4825 GV = new GlobalVariable(PT->getElementType(), false,
4826 GlobalValue::ExternalWeakLinkage, 0,
4827 Name, CurModule.CurrentModule);
4830 // Keep track of the fact that we have a forward ref to recycle it
4831 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4836 (yyval.ConstVal) = cast<GlobalValue>(V);
4837 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4843 #line 1866 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4845 if (!UpRefs.empty())
4846 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4847 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4848 GEN_ERROR("Mismatched types for constant expression: " +
4849 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4850 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4851 delete (yyvsp[(1) - (2)].TypeVal);
4857 #line 1876 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4859 if (!UpRefs.empty())
4860 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4861 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4862 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4863 GEN_ERROR("Cannot create a null initialized value of this type");
4864 (yyval.ConstVal) = Constant::getNullValue(Ty);
4865 delete (yyvsp[(1) - (2)].TypeVal);
4871 #line 1886 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4872 { // integral constants
4873 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4874 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val)))
4875 GEN_ERROR("Constant value doesn't fit in type");
4876 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].SInt64Val), true);
4878 GEN_ERROR("integer constant must have integer type");
4880 delete (yyvsp[(1) - (2)].TypeVal);
4886 #line 1897 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4887 { // arbitrary precision integer constants
4888 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4889 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4890 GEN_ERROR("Constant value does not fit in type");
4891 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(IT->getBitWidth());
4892 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4894 GEN_ERROR("integer constant must have integer type");
4896 delete (yyvsp[(1) - (2)].TypeVal);
4897 delete (yyvsp[(2) - (2)].APIntVal);
4903 #line 1910 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4904 { // integral constants
4905 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4906 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val)))
4907 GEN_ERROR("Constant value doesn't fit in type");
4908 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].UInt64Val), false);
4910 GEN_ERROR("integer constant must have integer type");
4912 delete (yyvsp[(1) - (2)].TypeVal);
4918 #line 1921 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4919 { // arbitrary precision integer constants
4920 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4921 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4922 GEN_ERROR("Constant value does not fit in type");
4923 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(IT->getBitWidth());
4924 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4926 GEN_ERROR("integer constant must have integer type");
4929 delete (yyvsp[(2) - (2)].APIntVal);
4930 delete (yyvsp[(1) - (2)].TypeVal);
4936 #line 1935 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4937 { // Boolean constants
4938 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4939 GEN_ERROR("Constant true must have type i1");
4940 (yyval.ConstVal) = ConstantInt::getTrue();
4941 delete (yyvsp[(1) - (2)].TypeVal);
4947 #line 1942 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4948 { // Boolean constants
4949 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4950 GEN_ERROR("Constant false must have type i1");
4951 (yyval.ConstVal) = ConstantInt::getFalse();
4952 delete (yyvsp[(1) - (2)].TypeVal);
4958 #line 1949 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4959 { // Floating point constants
4960 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal)))
4961 GEN_ERROR("Floating point constant invalid for type");
4963 // Lexer has no type info, so builds all float and double FP constants
4964 // as double. Fix this here. Long double is done right.
4965 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].TypeVal)->get()==Type::FloatTy) {
4967 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
4970 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4971 delete (yyvsp[(1) - (2)].TypeVal);
4972 delete (yyvsp[(2) - (2)].FPVal);
4978 #line 1967 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4980 if (!UpRefs.empty())
4981 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4982 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4983 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4984 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4985 GEN_ERROR("invalid cast opcode for cast from '" +
4986 Val->getType()->getDescription() + "' to '" +
4987 DestTy->getDescription() + "'");
4988 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4989 delete (yyvsp[(5) - (6)].TypeVal);
4994 #line 1979 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
4996 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4997 GEN_ERROR("GetElementPtr requires a pointer operand");
5000 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
5002 GEN_ERROR("Index list invalid for constant getelementptr");
5004 SmallVector<Constant*, 8> IdxVec;
5005 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
5006 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
5007 IdxVec.push_back(C);
5009 GEN_ERROR("Indices to constant getelementptr must be constants");
5011 delete (yyvsp[(4) - (5)].ValueList);
5013 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5019 #line 2000 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5021 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5022 GEN_ERROR("Select condition must be of boolean type");
5023 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5024 GEN_ERROR("Select operand types must match");
5025 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5031 #line 2008 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5033 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5034 GEN_ERROR("Binary operator types must match");
5036 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5041 #line 2014 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5043 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5044 GEN_ERROR("Logical operator types must match");
5045 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5046 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5047 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5048 GEN_ERROR("Logical operator requires integral operands");
5050 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5056 #line 2025 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5058 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5059 GEN_ERROR("icmp operand types must match");
5060 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5065 #line 2030 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5067 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5068 GEN_ERROR("fcmp operand types must match");
5069 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5074 #line 2035 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5076 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5077 GEN_ERROR("vicmp operand types must match");
5078 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5083 #line 2040 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5085 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5086 GEN_ERROR("vfcmp operand types must match");
5087 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5092 #line 2045 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5094 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5095 GEN_ERROR("Invalid extractelement operands");
5096 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5102 #line 2051 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5104 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5105 GEN_ERROR("Invalid insertelement operands");
5106 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5112 #line 2057 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5114 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5115 GEN_ERROR("Invalid shufflevector operands");
5116 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5122 #line 2063 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5124 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5125 GEN_ERROR("ExtractValue requires an aggregate operand");
5127 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5128 delete (yyvsp[(4) - (5)].ConstantList);
5134 #line 2071 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5136 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5137 GEN_ERROR("InsertValue requires an aggregate operand");
5139 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5140 delete (yyvsp[(6) - (7)].ConstantList);
5146 #line 2082 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5148 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5154 #line 2086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5156 (yyval.ConstVector) = new std::vector<Constant*>();
5157 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5163 #line 2094 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5164 { (yyval.BoolVal) = false; ;}
5168 #line 2094 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5169 { (yyval.BoolVal) = true; ;}
5173 #line 2097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5174 { (yyval.BoolVal) = true; ;}
5178 #line 2097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5179 { (yyval.BoolVal) = false; ;}
5183 #line 2100 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5185 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5186 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5188 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5190 GEN_ERROR("Aliases can be created only to global values");
5192 (yyval.ConstVal) = Aliasee;
5194 delete (yyvsp[(1) - (2)].TypeVal);
5199 #line 2112 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5201 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5202 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5203 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5204 GEN_ERROR("invalid cast opcode for cast from '" +
5205 Val->getType()->getDescription() + "' to '" +
5206 DestTy->getDescription() + "'");
5208 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5210 delete (yyvsp[(5) - (6)].TypeVal);
5215 #line 2133 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5217 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5218 CurModule.ModuleDone();
5224 #line 2138 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5226 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5227 CurModule.ModuleDone();
5233 #line 2151 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5234 { CurFun.isDeclare = false; ;}
5238 #line 2151 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5240 CurFun.FunctionDone();
5246 #line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5247 { CurFun.isDeclare = true; ;}
5251 #line 2155 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5258 #line 2158 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5265 #line 2161 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5267 if (!UpRefs.empty())
5268 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5269 // Eagerly resolve types. This is not an optimization, this is a
5270 // requirement that is due to the fact that we could have this:
5272 // %list = type { %list * }
5273 // %list = type { %list * } ; repeated type decl
5275 // If types are not resolved eagerly, then the two types will not be
5276 // determined to be the same type!
5278 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5280 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5282 // If this is a named type that is not a redefinition, add it to the slot
5284 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5287 delete (yyvsp[(3) - (3)].TypeVal);
5293 #line 2185 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5295 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5297 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5299 // If this is a named type that is not a redefinition, add it to the slot
5301 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5308 #line 2197 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5310 /* "Externally Visible" Linkage */
5311 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5312 GEN_ERROR("Global value initializer is not a constant");
5313 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5314 (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));
5320 #line 2204 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5327 #line 2208 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5329 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5330 GEN_ERROR("Global value initializer is not a constant");
5331 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));
5337 #line 2213 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5344 #line 2217 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5346 if (!UpRefs.empty())
5347 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5348 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));
5350 delete (yyvsp[(6) - (7)].TypeVal);
5355 #line 2223 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5363 #line 2227 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5366 if ((yyvsp[(1) - (5)].StrVal)) {
5367 Name = *(yyvsp[(1) - (5)].StrVal);
5368 delete (yyvsp[(1) - (5)].StrVal);
5371 GEN_ERROR("Alias name cannot be empty");
5373 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5375 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5377 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5378 CurModule.CurrentModule);
5379 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5380 InsertValue(GA, CurModule.Values);
5383 // If there was a forward reference of this alias, resolve it now.
5387 ID = ValID::createGlobalName(Name);
5389 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5391 if (GlobalValue *FWGV =
5392 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5393 // Replace uses of the fwdref with the actual alias.
5394 FWGV->replaceAllUsesWith(GA);
5395 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5396 GV->eraseFromParent();
5398 cast<Function>(FWGV)->eraseFromParent();
5407 #line 2267 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5414 #line 2270 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5421 #line 2276 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5423 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5424 if (AsmSoFar.empty())
5425 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5427 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5428 delete (yyvsp[(1) - (1)].StrVal);
5434 #line 2286 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5436 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5437 delete (yyvsp[(3) - (3)].StrVal);
5442 #line 2290 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5444 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5445 delete (yyvsp[(3) - (3)].StrVal);
5450 #line 2297 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5452 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5453 delete (yyvsp[(3) - (3)].StrVal);
5459 #line 2302 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5461 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5462 delete (yyvsp[(1) - (1)].StrVal);
5468 #line 2307 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5475 #line 2316 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5477 if (!UpRefs.empty())
5478 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5479 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5480 GEN_ERROR("Argument types must be first-class");
5481 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].Attributes); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5482 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5483 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5489 #line 2326 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5491 if (!UpRefs.empty())
5492 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5493 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5494 GEN_ERROR("Argument types must be first-class");
5495 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].Attributes); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5496 (yyval.ArgList) = new ArgListType;
5497 (yyval.ArgList)->push_back(E);
5503 #line 2337 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5505 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5511 #line 2341 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5513 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5514 struct ArgListEntry E;
5515 E.Ty = new PATypeHolder(Type::VoidTy);
5517 E.Attrs = Attribute::None;
5518 (yyval.ArgList)->push_back(E);
5524 #line 2350 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5526 (yyval.ArgList) = new ArgListType;
5527 struct ArgListEntry E;
5528 E.Ty = new PATypeHolder(Type::VoidTy);
5530 E.Attrs = Attribute::None;
5531 (yyval.ArgList)->push_back(E);
5537 #line 2359 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5539 (yyval.ArgList) = 0;
5545 #line 2365 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5547 std::string FunctionName(*(yyvsp[(4) - (11)].StrVal));
5548 delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory!
5550 // Check the function result for abstractness if this is a define. We should
5551 // have no abstract types at this point
5552 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(3) - (11)].TypeVal)))
5553 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(3) - (11)].TypeVal)->get()->getDescription());
5555 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (11)].TypeVal)))
5556 GEN_ERROR("Invalid result type for LLVM function");
5558 std::vector<const Type*> ParamTypeList;
5559 SmallVector<AttributeWithIndex, 8> Attrs;
5560 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
5562 Attributes RetAttrs = (yyvsp[(2) - (11)].Attributes);
5563 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None) {
5564 if ((yyvsp[(8) - (11)].Attributes) & Attribute::ZExt) {
5565 RetAttrs = RetAttrs | Attribute::ZExt;
5566 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::ZExt;
5568 if ((yyvsp[(8) - (11)].Attributes) & Attribute::SExt) {
5569 RetAttrs = RetAttrs | Attribute::SExt;
5570 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::SExt;
5572 if ((yyvsp[(8) - (11)].Attributes) & Attribute::InReg) {
5573 RetAttrs = RetAttrs | Attribute::InReg;
5574 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::InReg;
5577 if (RetAttrs != Attribute::None)
5578 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
5579 if ((yyvsp[(6) - (11)].ArgList)) { // If there are arguments...
5581 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin(); I != (yyvsp[(6) - (11)].ArgList)->end(); ++I, ++index) {
5582 const Type* Ty = I->Ty->get();
5583 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5584 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5585 ParamTypeList.push_back(Ty);
5586 if (Ty != Type::VoidTy && I->Attrs != Attribute::None)
5587 Attrs.push_back(AttributeWithIndex::get(index, I->Attrs));
5590 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None)
5591 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(8) - (11)].Attributes)));
5593 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5594 if (isVarArg) ParamTypeList.pop_back();
5598 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
5600 FunctionType *FT = FunctionType::get(*(yyvsp[(3) - (11)].TypeVal), ParamTypeList, isVarArg);
5601 const PointerType *PFT = PointerType::getUnqual(FT);
5602 delete (yyvsp[(3) - (11)].TypeVal);
5605 if (!FunctionName.empty()) {
5606 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5608 ID = ValID::createGlobalID(CurModule.Values.size());
5612 // See if this function was forward referenced. If so, recycle the object.
5613 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5614 // Move the function to the end of the list, from whereever it was
5615 // previously inserted.
5616 Fn = cast<Function>(FWRef);
5617 assert(Fn->getAttributes().isEmpty() &&
5618 "Forward reference has parameter attributes!");
5619 CurModule.CurrentModule->getFunctionList().remove(Fn);
5620 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5621 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5622 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5623 if (Fn->getFunctionType() != FT ) {
5624 // The existing function doesn't have the same type. This is an overload
5626 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5627 } else if (Fn->getAttributes() != PAL) {
5628 // The existing function doesn't have the same parameter attributes.
5629 // This is an overload error.
5630 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5631 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5632 // Neither the existing or the current function is a declaration and they
5633 // have the same name and same type. Clearly this is a redefinition.
5634 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5635 } else if (Fn->isDeclaration()) {
5636 // Make sure to strip off any argument names so we can't get conflicts.
5637 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5641 } else { // Not already defined?
5642 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5643 CurModule.CurrentModule);
5644 InsertValue(Fn, CurModule.Values);
5648 CurFun.FunctionStart(Fn);
5650 if (CurFun.isDeclare) {
5651 // If we have declaration, always overwrite linkage. This will allow us to
5652 // correctly handle cases, when pointer to function is passed as argument to
5653 // another function.
5654 Fn->setLinkage(CurFun.Linkage);
5655 Fn->setVisibility(CurFun.Visibility);
5657 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5658 Fn->setAttributes(PAL);
5659 Fn->setAlignment((yyvsp[(10) - (11)].UIntVal));
5660 if ((yyvsp[(9) - (11)].StrVal)) {
5661 Fn->setSection(*(yyvsp[(9) - (11)].StrVal));
5662 delete (yyvsp[(9) - (11)].StrVal);
5664 if ((yyvsp[(11) - (11)].StrVal)) {
5665 Fn->setGC((yyvsp[(11) - (11)].StrVal)->c_str());
5666 delete (yyvsp[(11) - (11)].StrVal);
5669 // Add all of the arguments we parsed to the function...
5670 if ((yyvsp[(6) - (11)].ArgList)) { // Is null if empty...
5671 if (isVarArg) { // Nuke the last entry
5672 assert((yyvsp[(6) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(6) - (11)].ArgList)->back().Name == 0 &&
5673 "Not a varargs marker!");
5674 delete (yyvsp[(6) - (11)].ArgList)->back().Ty;
5675 (yyvsp[(6) - (11)].ArgList)->pop_back(); // Delete the last entry
5677 Function::arg_iterator ArgIt = Fn->arg_begin();
5678 Function::arg_iterator ArgEnd = Fn->arg_end();
5680 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin();
5681 I != (yyvsp[(6) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5682 delete I->Ty; // Delete the typeholder...
5683 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5689 delete (yyvsp[(6) - (11)].ArgList); // We're now done with the argument list
5696 #line 2515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5698 (yyval.FunctionVal) = CurFun.CurrentFunction;
5700 // Make sure that we keep track of the linkage type even if there was a
5701 // previous "declare".
5702 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5703 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5708 #line 2526 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5710 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5716 #line 2531 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5718 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5719 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5720 (yyval.FunctionVal) = CurFun.CurrentFunction;
5721 CurFun.FunctionDone();
5727 #line 2543 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5729 (yyval.BoolVal) = false;
5735 #line 2547 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5737 (yyval.BoolVal) = true;
5743 #line 2552 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5744 { // A reference to a direct constant
5745 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5751 #line 2556 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5753 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5759 #line 2560 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5760 { // arbitrary precision integer constants
5761 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5762 delete (yyvsp[(1) - (1)].APIntVal);
5768 #line 2565 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5769 { // arbitrary precision integer constants
5770 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5771 delete (yyvsp[(1) - (1)].APIntVal);
5777 #line 2570 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5778 { // Perhaps it's an FP constant?
5779 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5785 #line 2574 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5787 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5793 #line 2578 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5795 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5801 #line 2582 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5803 (yyval.ValIDVal) = ValID::createNull();
5809 #line 2586 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5811 (yyval.ValIDVal) = ValID::createUndef();
5817 #line 2590 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5818 { // A vector zero constant.
5819 (yyval.ValIDVal) = ValID::createZeroInit();
5825 #line 2594 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5826 { // Nonempty unsized packed vector
5827 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5828 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5830 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5831 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5833 VectorType* pt = VectorType::get(ETy, NumElements);
5834 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5836 // Verify all elements are correct type!
5837 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5838 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5839 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5840 ETy->getDescription() +"' as required!\nIt is of type '" +
5841 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5844 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5845 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5851 #line 2616 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5852 { // Nonempty unsized arr
5853 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5854 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5856 if (!ETy->isFirstClassType())
5857 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5859 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5860 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5862 // Verify all elements are correct type!
5863 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5864 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5865 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5866 ETy->getDescription() +"' as required!\nIt is of type '"+
5867 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5870 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5871 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5877 #line 2638 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5879 // Use undef instead of an array because it's inconvenient to determine
5880 // the element type at this point, there being no elements to examine.
5881 (yyval.ValIDVal) = ValID::createUndef();
5887 #line 2644 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5889 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5890 const Type *ETy = Type::Int8Ty;
5892 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5894 std::vector<Constant*> Vals;
5895 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5896 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5897 delete (yyvsp[(2) - (2)].StrVal);
5898 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5904 #line 2657 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5906 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5907 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5908 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5910 const StructType *STy = StructType::get(Elements);
5911 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5913 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5914 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5920 #line 2669 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5922 const StructType *STy = StructType::get(std::vector<const Type*>());
5923 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5929 #line 2674 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5931 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5932 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5933 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5935 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5936 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5938 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5939 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5945 #line 2686 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5947 const StructType *STy = StructType::get(std::vector<const Type*>(),
5949 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5955 #line 2692 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5957 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5963 #line 2696 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5965 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5966 delete (yyvsp[(3) - (5)].StrVal);
5967 delete (yyvsp[(5) - (5)].StrVal);
5973 #line 2706 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5974 { // Is it an integer reference...?
5975 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5981 #line 2710 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5983 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5989 #line 2714 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5990 { // Is it a named reference...?
5991 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5992 delete (yyvsp[(1) - (1)].StrVal);
5998 #line 2719 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
5999 { // Is it a named reference...?
6000 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
6001 delete (yyvsp[(1) - (1)].StrVal);
6007 #line 2732 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6009 if (!UpRefs.empty())
6010 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
6011 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
6012 delete (yyvsp[(1) - (2)].TypeVal);
6018 #line 2741 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6020 (yyval.ValueList) = new std::vector<Value *>();
6021 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
6027 #line 2746 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6029 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6035 #line 2751 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6037 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6043 #line 2755 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6044 { // Do not allow functions with 0 basic blocks
6045 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6051 #line 2764 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6053 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6055 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6056 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6057 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6063 #line 2773 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6066 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6067 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6068 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6069 " is incorrect, expected %" + utostr((unsigned)ValNum));
6071 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6072 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6078 #line 2786 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6080 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6081 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6082 if (CI2->getParent() == 0)
6083 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6084 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6085 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6091 #line 2795 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6092 { // Empty space between instruction lists
6093 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6099 #line 2799 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6100 { // Labelled (named) basic block
6101 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6102 delete (yyvsp[(1) - (1)].StrVal);
6109 #line 2807 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6110 { // Return with a result...
6111 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6112 assert(!VL.empty() && "Invalid ret operands!");
6113 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6114 if (VL.size() > 1 ||
6115 (isa<StructType>(ReturnType) &&
6116 (VL.empty() || VL[0]->getType() != ReturnType))) {
6117 Value *RV = UndefValue::get(ReturnType);
6118 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6119 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6120 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6123 (yyval.TermInstVal) = ReturnInst::Create(RV);
6125 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6127 delete (yyvsp[(2) - (2)].ValueList);
6133 #line 2827 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6134 { // Return with no result...
6135 (yyval.TermInstVal) = ReturnInst::Create();
6141 #line 2831 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6142 { // Unconditional Branch...
6143 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6145 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6150 #line 2836 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6152 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6153 GEN_ERROR("Branch condition must have type i1");
6154 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6156 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6158 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6160 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6165 #line 2847 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6167 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6169 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6171 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6172 (yyval.TermInstVal) = S;
6174 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6175 E = (yyvsp[(8) - (9)].JumpTable)->end();
6176 for (; I != E; ++I) {
6177 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6178 S->addCase(CI, I->second);
6180 GEN_ERROR("Switch case is constant, but not a simple integer");
6182 delete (yyvsp[(8) - (9)].JumpTable);
6188 #line 2866 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6190 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6192 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6194 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6195 (yyval.TermInstVal) = S;
6201 #line 2876 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6204 // Handle the short syntax
6205 const PointerType *PFTy = 0;
6206 const FunctionType *Ty = 0;
6207 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (15)].TypeVal)->get())) ||
6208 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6209 // Pull out the types of all of the arguments...
6210 std::vector<const Type*> ParamTypes;
6211 ParamList::iterator I = (yyvsp[(7) - (15)].ParamList)->begin(), E = (yyvsp[(7) - (15)].ParamList)->end();
6212 for (; I != E; ++I) {
6213 const Type *Ty = I->Val->getType();
6214 if (Ty == Type::VoidTy)
6215 GEN_ERROR("Short call syntax cannot be used with varargs");
6216 ParamTypes.push_back(Ty);
6219 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (15)].TypeVal)))
6220 GEN_ERROR("Invalid result type for LLVM function");
6222 Ty = FunctionType::get((yyvsp[(4) - (15)].TypeVal)->get(), ParamTypes, false);
6223 PFTy = PointerType::getUnqual(Ty);
6226 delete (yyvsp[(4) - (15)].TypeVal);
6228 Value *V = getVal(PFTy, (yyvsp[(5) - (15)].ValIDVal)); // Get the function we're calling...
6230 BasicBlock *Normal = getBBVal((yyvsp[(12) - (15)].ValIDVal));
6232 BasicBlock *Except = getBBVal((yyvsp[(15) - (15)].ValIDVal));
6235 SmallVector<AttributeWithIndex, 8> Attrs;
6236 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6238 Attributes RetAttrs = (yyvsp[(3) - (15)].Attributes);
6239 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None) {
6240 if ((yyvsp[(9) - (15)].Attributes) & Attribute::ZExt) {
6241 RetAttrs = RetAttrs | Attribute::ZExt;
6242 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::ZExt;
6244 if ((yyvsp[(9) - (15)].Attributes) & Attribute::SExt) {
6245 RetAttrs = RetAttrs | Attribute::SExt;
6246 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::SExt;
6248 if ((yyvsp[(9) - (15)].Attributes) & Attribute::InReg) {
6249 RetAttrs = RetAttrs | Attribute::InReg;
6250 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::InReg;
6253 if (RetAttrs != Attribute::None)
6254 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6256 // Check the arguments
6258 if ((yyvsp[(7) - (15)].ParamList)->empty()) { // Has no arguments?
6259 // Make sure no arguments is a good thing!
6260 if (Ty->getNumParams() != 0)
6261 GEN_ERROR("No arguments passed to a function that "
6262 "expects arguments");
6263 } else { // Has arguments?
6264 // Loop through FunctionType's arguments and ensure they are specified
6266 FunctionType::param_iterator I = Ty->param_begin();
6267 FunctionType::param_iterator E = Ty->param_end();
6268 ParamList::iterator ArgI = (yyvsp[(7) - (15)].ParamList)->begin(), ArgE = (yyvsp[(7) - (15)].ParamList)->end();
6271 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6272 if (ArgI->Val->getType() != *I)
6273 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6274 (*I)->getDescription() + "'");
6275 Args.push_back(ArgI->Val);
6276 if (ArgI->Attrs != Attribute::None)
6277 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6280 if (Ty->isVarArg()) {
6282 for (; ArgI != ArgE; ++ArgI, ++index) {
6283 Args.push_back(ArgI->Val); // push the remaining varargs
6284 if (ArgI->Attrs != Attribute::None)
6285 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6287 } else if (I != E || ArgI != ArgE)
6288 GEN_ERROR("Invalid number of parameters detected");
6290 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None)
6291 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (15)].Attributes)));
6294 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6296 // Create the InvokeInst
6297 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6298 Args.begin(), Args.end());
6299 II->setCallingConv((yyvsp[(2) - (15)].UIntVal));
6300 II->setAttributes(PAL);
6301 (yyval.TermInstVal) = II;
6302 delete (yyvsp[(7) - (15)].ParamList);
6308 #line 2979 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6310 (yyval.TermInstVal) = new UnwindInst();
6316 #line 2983 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6318 (yyval.TermInstVal) = new UnreachableInst();
6324 #line 2990 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6326 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6327 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6330 GEN_ERROR("May only switch on a constant pool value");
6332 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6334 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6339 #line 3001 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6341 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6342 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6346 GEN_ERROR("May only switch on a constant pool value");
6348 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6350 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6355 #line 3014 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6357 // Is this definition named?? if so, assign the name...
6358 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6360 InsertValue((yyvsp[(2) - (2)].InstVal));
6361 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6367 #line 3023 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6370 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6372 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6373 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6374 " is incorrect, expected %" + utostr((unsigned)ValNum));
6376 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6382 #line 3036 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6383 { // Used for PHI nodes
6384 if (!UpRefs.empty())
6385 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6386 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6387 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6389 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6391 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6392 delete (yyvsp[(1) - (6)].TypeVal);
6397 #line 3047 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6399 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6400 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6402 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6404 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6409 #line 3057 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6411 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6412 if (!UpRefs.empty())
6413 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6414 // Used for call and invoke instructions
6415 (yyval.ParamList) = new ParamList();
6416 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6417 (yyval.ParamList)->push_back(E);
6418 delete (yyvsp[(1) - (4)].TypeVal);
6424 #line 3068 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6426 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6427 // Labels are only valid in ASMs
6428 (yyval.ParamList) = new ParamList();
6429 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6430 (yyval.ParamList)->push_back(E);
6436 #line 3076 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6438 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6439 if (!UpRefs.empty())
6440 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6441 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6442 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6443 (yyval.ParamList)->push_back(E);
6444 delete (yyvsp[(3) - (6)].TypeVal);
6450 #line 3086 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6452 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6453 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6454 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6455 (yyval.ParamList)->push_back(E);
6461 #line 3093 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6462 { (yyval.ParamList) = new ParamList(); ;}
6466 #line 3096 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6467 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6471 #line 3097 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6473 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6474 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6480 #line 3105 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6482 (yyval.ConstantList) = new std::vector<unsigned>();
6483 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6484 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6485 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6490 #line 3111 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6492 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6493 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6494 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6495 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6501 #line 3120 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6503 (yyval.BoolVal) = true;
6509 #line 3124 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6511 (yyval.BoolVal) = false;
6517 #line 3129 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6519 if (!UpRefs.empty())
6520 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6521 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6522 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6524 "Arithmetic operator requires integer, FP, or packed operands");
6525 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6527 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6529 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6530 if ((yyval.InstVal) == 0)
6531 GEN_ERROR("binary operator returned null");
6532 delete (yyvsp[(2) - (5)].TypeVal);
6537 #line 3145 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6539 if (!UpRefs.empty())
6540 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6541 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6542 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6543 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6544 GEN_ERROR("Logical operator requires integral operands");
6546 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6548 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6550 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6551 if ((yyval.InstVal) == 0)
6552 GEN_ERROR("binary operator returned null");
6553 delete (yyvsp[(2) - (5)].TypeVal);
6558 #line 3162 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6560 if (!UpRefs.empty())
6561 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6562 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6564 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6566 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6567 if ((yyval.InstVal) == 0)
6568 GEN_ERROR("icmp operator returned null");
6569 delete (yyvsp[(3) - (6)].TypeVal);
6574 #line 3174 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6576 if (!UpRefs.empty())
6577 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6578 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6580 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6582 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6583 if ((yyval.InstVal) == 0)
6584 GEN_ERROR("fcmp operator returned null");
6585 delete (yyvsp[(3) - (6)].TypeVal);
6590 #line 3186 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6592 if (!UpRefs.empty())
6593 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6594 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6595 GEN_ERROR("Scalar types not supported by vicmp instruction");
6596 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6598 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6600 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6601 if ((yyval.InstVal) == 0)
6602 GEN_ERROR("vicmp operator returned null");
6603 delete (yyvsp[(3) - (6)].TypeVal);
6608 #line 3200 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6610 if (!UpRefs.empty())
6611 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6612 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6613 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6614 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6616 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6618 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6619 if ((yyval.InstVal) == 0)
6620 GEN_ERROR("vfcmp operator returned null");
6621 delete (yyvsp[(3) - (6)].TypeVal);
6626 #line 3214 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6628 if (!UpRefs.empty())
6629 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6630 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6631 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6632 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6633 GEN_ERROR("invalid cast opcode for cast from '" +
6634 Val->getType()->getDescription() + "' to '" +
6635 DestTy->getDescription() + "'");
6636 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6637 delete (yyvsp[(4) - (4)].TypeVal);
6642 #line 3226 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6644 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6646 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6647 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6648 GEN_ERROR("vector select value types must be vector types");
6649 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6650 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6651 if (cond_type->getElementType() != Type::Int1Ty)
6652 GEN_ERROR("vector select condition element type must be boolean");
6653 if (cond_type->getNumElements() != select_type->getNumElements())
6654 GEN_ERROR("vector select number of elements must be the same");
6656 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6657 GEN_ERROR("select condition must be boolean");
6659 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6660 GEN_ERROR("select value types must match");
6661 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6667 #line 3247 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6669 if (!UpRefs.empty())
6670 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6671 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6672 delete (yyvsp[(4) - (4)].TypeVal);
6678 #line 3254 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6680 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6681 GEN_ERROR("Invalid extractelement operands");
6682 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6688 #line 3260 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6690 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6691 GEN_ERROR("Invalid insertelement operands");
6692 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6698 #line 3266 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6700 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6701 GEN_ERROR("Invalid shufflevector operands");
6702 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6708 #line 3272 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6710 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6711 if (!Ty->isFirstClassType())
6712 GEN_ERROR("PHI node operands must be of first class type");
6713 (yyval.InstVal) = PHINode::Create(Ty);
6714 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6715 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6716 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6717 GEN_ERROR("All elements of a PHI node must be of the same type");
6718 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6719 (yyvsp[(2) - (2)].PHIList)->pop_front();
6721 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6727 #line 3288 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6730 // Handle the short syntax
6731 const PointerType *PFTy = 0;
6732 const FunctionType *Ty = 0;
6733 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (9)].TypeVal)->get())) ||
6734 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6735 // Pull out the types of all of the arguments...
6736 std::vector<const Type*> ParamTypes;
6737 ParamList::iterator I = (yyvsp[(7) - (9)].ParamList)->begin(), E = (yyvsp[(7) - (9)].ParamList)->end();
6738 for (; I != E; ++I) {
6739 const Type *Ty = I->Val->getType();
6740 if (Ty == Type::VoidTy)
6741 GEN_ERROR("Short call syntax cannot be used with varargs");
6742 ParamTypes.push_back(Ty);
6745 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (9)].TypeVal)))
6746 GEN_ERROR("Invalid result type for LLVM function");
6748 Ty = FunctionType::get((yyvsp[(4) - (9)].TypeVal)->get(), ParamTypes, false);
6749 PFTy = PointerType::getUnqual(Ty);
6752 Value *V = getVal(PFTy, (yyvsp[(5) - (9)].ValIDVal)); // Get the function we're calling...
6755 // Check for call to invalid intrinsic to avoid crashing later.
6756 if (Function *theF = dyn_cast<Function>(V)) {
6757 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6758 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6759 !theF->getIntrinsicID(true))
6760 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6761 theF->getName() + "'");
6764 // Set up the Attributes for the function
6765 SmallVector<AttributeWithIndex, 8> Attrs;
6766 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6768 Attributes RetAttrs = (yyvsp[(3) - (9)].Attributes);
6769 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None) {
6770 if ((yyvsp[(9) - (9)].Attributes) & Attribute::ZExt) {
6771 RetAttrs = RetAttrs | Attribute::ZExt;
6772 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::ZExt;
6774 if ((yyvsp[(9) - (9)].Attributes) & Attribute::SExt) {
6775 RetAttrs = RetAttrs | Attribute::SExt;
6776 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::SExt;
6778 if ((yyvsp[(9) - (9)].Attributes) & Attribute::InReg) {
6779 RetAttrs = RetAttrs | Attribute::InReg;
6780 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::InReg;
6783 if (RetAttrs != Attribute::None)
6784 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6786 // Check the arguments
6788 if ((yyvsp[(7) - (9)].ParamList)->empty()) { // Has no arguments?
6789 // Make sure no arguments is a good thing!
6790 if (Ty->getNumParams() != 0)
6791 GEN_ERROR("No arguments passed to a function that "
6792 "expects arguments");
6793 } else { // Has arguments?
6794 // Loop through FunctionType's arguments and ensure they are specified
6795 // correctly. Also, gather any parameter attributes.
6796 FunctionType::param_iterator I = Ty->param_begin();
6797 FunctionType::param_iterator E = Ty->param_end();
6798 ParamList::iterator ArgI = (yyvsp[(7) - (9)].ParamList)->begin(), ArgE = (yyvsp[(7) - (9)].ParamList)->end();
6801 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6802 if (ArgI->Val->getType() != *I)
6803 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6804 (*I)->getDescription() + "'");
6805 Args.push_back(ArgI->Val);
6806 if (ArgI->Attrs != Attribute::None)
6807 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6809 if (Ty->isVarArg()) {
6811 for (; ArgI != ArgE; ++ArgI, ++index) {
6812 Args.push_back(ArgI->Val); // push the remaining varargs
6813 if (ArgI->Attrs != Attribute::None)
6814 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6816 } else if (I != E || ArgI != ArgE)
6817 GEN_ERROR("Invalid number of parameters detected");
6819 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None)
6820 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (9)].Attributes)));
6822 // Finish off the Attributes and check them
6825 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6827 // Create the call node
6828 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6829 CI->setTailCall((yyvsp[(1) - (9)].BoolVal));
6830 CI->setCallingConv((yyvsp[(2) - (9)].UIntVal));
6831 CI->setAttributes(PAL);
6832 (yyval.InstVal) = CI;
6833 delete (yyvsp[(7) - (9)].ParamList);
6834 delete (yyvsp[(4) - (9)].TypeVal);
6840 #line 3397 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6842 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6848 #line 3402 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6850 (yyval.BoolVal) = true;
6856 #line 3406 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6858 (yyval.BoolVal) = false;
6864 #line 3413 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6866 if (!UpRefs.empty())
6867 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6868 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6869 delete (yyvsp[(2) - (3)].TypeVal);
6875 #line 3420 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6877 if (!UpRefs.empty())
6878 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6879 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6880 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6881 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6883 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6884 delete (yyvsp[(2) - (6)].TypeVal);
6889 #line 3430 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6891 if (!UpRefs.empty())
6892 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6893 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6894 delete (yyvsp[(2) - (3)].TypeVal);
6900 #line 3437 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6902 if (!UpRefs.empty())
6903 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6904 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6905 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6906 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6908 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6909 delete (yyvsp[(2) - (6)].TypeVal);
6914 #line 3447 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6916 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6917 GEN_ERROR("Trying to free nonpointer type " +
6918 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6919 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6925 #line 3455 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6927 if (!UpRefs.empty())
6928 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6929 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6930 GEN_ERROR("Can't load from nonpointer type: " +
6931 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6932 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6933 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6934 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6935 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6937 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6938 delete (yyvsp[(3) - (5)].TypeVal);
6943 #line 3469 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6945 if (!UpRefs.empty())
6946 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6947 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6949 GEN_ERROR("Can't store to a nonpointer type: " +
6950 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6951 const Type *ElTy = PT->getElementType();
6952 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6953 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6954 "' into space of type '" + ElTy->getDescription() + "'");
6956 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6958 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6959 delete (yyvsp[(5) - (7)].TypeVal);
6964 #line 3486 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6966 if (!UpRefs.empty())
6967 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6968 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6969 GEN_ERROR("getresult insn requires an aggregate operand");
6970 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6971 GEN_ERROR("Invalid getresult index for type '" +
6972 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6974 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6976 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6977 delete (yyvsp[(2) - (5)].TypeVal);
6982 #line 3500 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
6984 if (!UpRefs.empty())
6985 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6986 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6987 GEN_ERROR("getelementptr insn requires pointer operand");
6989 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6990 GEN_ERROR("Invalid getelementptr indices for type '" +
6991 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6992 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6994 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6995 delete (yyvsp[(2) - (4)].TypeVal);
6996 delete (yyvsp[(4) - (4)].ValueList);
7001 #line 3515 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7003 if (!UpRefs.empty())
7004 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
7005 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
7006 GEN_ERROR("extractvalue insn requires an aggregate operand");
7008 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
7009 GEN_ERROR("Invalid extractvalue indices for type '" +
7010 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7011 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7013 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
7014 delete (yyvsp[(2) - (4)].TypeVal);
7015 delete (yyvsp[(4) - (4)].ConstantList);
7020 #line 3530 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7022 if (!UpRefs.empty())
7023 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
7024 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
7025 GEN_ERROR("extractvalue insn requires an aggregate operand");
7027 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
7028 GEN_ERROR("Invalid insertvalue indices for type '" +
7029 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
7030 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
7031 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
7033 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
7034 delete (yyvsp[(2) - (7)].TypeVal);
7035 delete (yyvsp[(5) - (7)].TypeVal);
7036 delete (yyvsp[(7) - (7)].ConstantList);
7041 /* Line 1267 of yacc.c. */
7042 #line 7043 "llvmAsmParser.tab.c"
7045 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7049 YY_STACK_PRINT (yyss, yyssp);
7054 /* Now `shift' the result of the reduction. Determine what state
7055 that goes to, based on the state we popped back to and the rule
7056 number reduced by. */
7060 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7061 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7062 yystate = yytable[yystate];
7064 yystate = yydefgoto[yyn - YYNTOKENS];
7069 /*------------------------------------.
7070 | yyerrlab -- here on detecting error |
7071 `------------------------------------*/
7073 /* If not already recovering from an error, report this error. */
7077 #if ! YYERROR_VERBOSE
7078 yyerror (YY_("syntax error"));
7081 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7082 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7084 YYSIZE_T yyalloc = 2 * yysize;
7085 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7086 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7087 if (yymsg != yymsgbuf)
7088 YYSTACK_FREE (yymsg);
7089 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7091 yymsg_alloc = yyalloc;
7095 yymsg_alloc = sizeof yymsgbuf;
7099 if (0 < yysize && yysize <= yymsg_alloc)
7101 (void) yysyntax_error (yymsg, yystate, yychar);
7106 yyerror (YY_("syntax error"));
7108 goto yyexhaustedlab;
7116 if (yyerrstatus == 3)
7118 /* If just tried and failed to reuse look-ahead token after an
7119 error, discard it. */
7121 if (yychar <= YYEOF)
7123 /* Return failure if at end of input. */
7124 if (yychar == YYEOF)
7129 yydestruct ("Error: discarding",
7135 /* Else will try to reuse look-ahead token after shifting the error
7140 /*---------------------------------------------------.
7141 | yyerrorlab -- error raised explicitly by YYERROR. |
7142 `---------------------------------------------------*/
7145 /* Pacify compilers like GCC when the user code never invokes
7146 YYERROR and the label yyerrorlab therefore never appears in user
7148 if (/*CONSTCOND*/ 0)
7151 /* Do not reclaim the symbols of the rule which action triggered
7155 YY_STACK_PRINT (yyss, yyssp);
7160 /*-------------------------------------------------------------.
7161 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7162 `-------------------------------------------------------------*/
7164 yyerrstatus = 3; /* Each real token shifted decrements this. */
7168 yyn = yypact[yystate];
7169 if (yyn != YYPACT_NINF)
7172 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7180 /* Pop the current state because it cannot handle the error token. */
7185 yydestruct ("Error: popping",
7186 yystos[yystate], yyvsp);
7189 YY_STACK_PRINT (yyss, yyssp);
7198 /* Shift the error token. */
7199 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7205 /*-------------------------------------.
7206 | yyacceptlab -- YYACCEPT comes here. |
7207 `-------------------------------------*/
7212 /*-----------------------------------.
7213 | yyabortlab -- YYABORT comes here. |
7214 `-----------------------------------*/
7220 /*-------------------------------------------------.
7221 | yyexhaustedlab -- memory exhaustion comes here. |
7222 `-------------------------------------------------*/
7224 yyerror (YY_("memory exhausted"));
7230 if (yychar != YYEOF && yychar != YYEMPTY)
7231 yydestruct ("Cleanup: discarding lookahead",
7233 /* Do not reclaim the symbols of the rule which action triggered
7234 this YYABORT or YYACCEPT. */
7236 YY_STACK_PRINT (yyss, yyssp);
7237 while (yyssp != yyss)
7239 yydestruct ("Cleanup: popping",
7240 yystos[*yyssp], yyvsp);
7245 YYSTACK_FREE (yyss);
7248 if (yymsg != yymsgbuf)
7249 YYSTACK_FREE (yymsg);
7251 /* Make sure YYID is used. */
7252 return YYID (yyresult);
7256 #line 3549 "/cvs/llvm/lib/AsmParser/llvmAsmParser.y"
7259 // common code from the two 'RunVMAsmParser' functions
7260 static Module* RunParser(Module * M) {
7261 CurModule.CurrentModule = M;
7262 // Check to make sure the parser succeeded
7265 delete ParserResult;
7269 // Emit an error if there are any unresolved types left.
7270 if (!CurModule.LateResolveTypes.empty()) {
7271 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7272 if (DID.Type == ValID::LocalName) {
7273 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7275 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7278 delete ParserResult;
7282 // Emit an error if there are any unresolved values left.
7283 if (!CurModule.LateResolveValues.empty()) {
7284 Value *V = CurModule.LateResolveValues.back();
7285 std::map<Value*, std::pair<ValID, int> >::iterator I =
7286 CurModule.PlaceHolderInfo.find(V);
7288 if (I != CurModule.PlaceHolderInfo.end()) {
7289 ValID &DID = I->second.first;
7290 if (DID.Type == ValID::LocalName) {
7291 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7293 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7296 delete ParserResult;
7301 // Check to make sure that parsing produced a result
7305 // Reset ParserResult variable while saving its value for the result.
7306 Module *Result = ParserResult;
7312 void llvm::GenerateError(const std::string &message, int LineNo) {
7313 if (LineNo == -1) LineNo = LLLgetLineNo();
7314 // TODO: column number in exception
7316 TheParseError->setError(LLLgetFilename(), message, LineNo);
7320 int yyerror(const char *ErrorMsg) {
7321 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7322 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7323 if (yychar != YYEMPTY && yychar != 0) {
7324 errMsg += " while reading token: '";
7325 errMsg += std::string(LLLgetTokenStart(),
7326 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7328 GenerateError(errMsg);