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,
142 X86_SSECALLCC_TOK = 323,
210 EXTRACTELEMENT = 391,
234 #define ESINT64VAL 258
235 #define EUINT64VAL 259
236 #define ESAPINTVAL 260
237 #define EUAPINTVAL 261
238 #define LOCALVAL_ID 262
239 #define GLOBALVAL_ID 263
247 #define PPC_FP128 271
251 #define GLOBALVAR 275
253 #define STRINGCONSTANT 277
254 #define ATSTRINGCONSTANT 278
255 #define PCTSTRINGCONSTANT 279
256 #define ZEROINITIALIZER 280
268 #define THREAD_LOCAL 292
270 #define DOTDOTDOT 294
276 #define APPENDING 300
277 #define DLLIMPORT 301
278 #define DLLEXPORT 302
279 #define EXTERN_WEAK 303
286 #define ADDRSPACE 310
292 #define SIDEEFFECT 316
295 #define FASTCC_TOK 319
296 #define COLDCC_TOK 320
297 #define X86_STDCALLCC_TOK 321
298 #define X86_FASTCALLCC_TOK 322
299 #define X86_SSECALLCC_TOK 323
300 #define DATALAYOUT 324
306 #define UNREACHABLE 330
351 #define GETELEMENTPTR 375
367 #define EXTRACTELEMENT 391
368 #define INSERTELEMENT 392
369 #define SHUFFLEVECTOR 393
370 #define GETRESULT 394
371 #define EXTRACTVALUE 395
372 #define INSERTVALUE 396
387 #define PROTECTED 411
392 /* Copy the first part of user declarations. */
393 #line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
395 #include "ParserInternals.h"
396 #include "llvm/CallingConv.h"
397 #include "llvm/InlineAsm.h"
398 #include "llvm/Instructions.h"
399 #include "llvm/Module.h"
400 #include "llvm/ValueSymbolTable.h"
401 #include "llvm/AutoUpgrade.h"
402 #include "llvm/Support/GetElementPtrTypeIterator.h"
403 #include "llvm/Support/CommandLine.h"
404 #include "llvm/ADT/SmallVector.h"
405 #include "llvm/ADT/STLExtras.h"
406 #include "llvm/Support/MathExtras.h"
407 #include "llvm/Support/Streams.h"
413 // The following is a gross hack. In order to rid the libAsmParser library of
414 // exceptions, we have to have a way of getting the yyparse function to go into
415 // an error situation. So, whenever we want an error to occur, the GenerateError
416 // function (see bottom of file) sets TriggerError. Then, at the end of each
417 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
418 // (a goto) to put YACC in error state. Furthermore, several calls to
419 // GenerateError are made from inside productions and they must simulate the
420 // previous exception behavior by exiting the production immediately. We have
421 // replaced these with the GEN_ERROR macro which calls GeneratError and then
422 // immediately invokes YYERROR. This would be so much cleaner if it was a
423 // recursive descent parser.
424 static bool TriggerError = false;
425 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
426 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
428 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
429 int yylex(); // declaration" of xxx warnings.
431 using namespace llvm;
433 static Module *ParserResult;
435 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
436 // relating to upreferences in the input stream.
438 //#define DEBUG_UPREFS 1
440 #define UR_OUT(X) cerr << X
445 #define YYERROR_VERBOSE 1
447 static GlobalVariable *CurGV;
450 // This contains info used when building the body of a function. It is
451 // destroyed when the function is completed.
453 typedef std::vector<Value *> ValueList; // Numbered defs
456 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
458 static struct PerModuleInfo {
459 Module *CurrentModule;
460 ValueList Values; // Module level numbered definitions
461 ValueList LateResolveValues;
462 std::vector<PATypeHolder> Types;
463 std::map<ValID, PATypeHolder> LateResolveTypes;
465 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
466 /// how they were referenced and on which line of the input they came from so
467 /// that we can resolve them later and print error messages as appropriate.
468 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
470 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
471 // references to global values. Global values may be referenced before they
472 // are defined, and if so, the temporary object that they represent is held
473 // here. This is used for forward references of GlobalValues.
475 typedef std::map<std::pair<const PointerType *,
476 ValID>, GlobalValue*> GlobalRefsType;
477 GlobalRefsType GlobalRefs;
480 // If we could not resolve some functions at function compilation time
481 // (calls to functions before they are defined), resolve them now... Types
482 // are resolved when the constant pool has been completely parsed.
484 ResolveDefinitions(LateResolveValues);
488 // Check to make sure that all global value forward references have been
491 if (!GlobalRefs.empty()) {
492 std::string UndefinedReferences = "Unresolved global references exist:\n";
494 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
496 UndefinedReferences += " " + I->first.first->getDescription() + " " +
497 I->first.second.getName() + "\n";
499 GenerateError(UndefinedReferences);
503 // Look for intrinsic functions and CallInst that need to be upgraded
504 for (Module::iterator FI = CurrentModule->begin(),
505 FE = CurrentModule->end(); FI != FE; )
506 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
508 Values.clear(); // Clear out function local definitions
513 // GetForwardRefForGlobal - Check to see if there is a forward reference
514 // for this global. If so, remove it from the GlobalRefs map and return it.
515 // If not, just return null.
516 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
517 // Check to see if there is a forward reference to this global variable...
518 // if there is, eliminate it and patch the reference to use the new def'n.
519 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
520 GlobalValue *Ret = 0;
521 if (I != GlobalRefs.end()) {
528 bool TypeIsUnresolved(PATypeHolder* PATy) {
529 // If it isn't abstract, its resolved
530 const Type* Ty = PATy->get();
531 if (!Ty->isAbstract())
533 // Traverse the type looking for abstract types. If it isn't abstract then
534 // we don't need to traverse that leg of the type.
535 std::vector<const Type*> WorkList, SeenList;
536 WorkList.push_back(Ty);
537 while (!WorkList.empty()) {
538 const Type* Ty = WorkList.back();
539 SeenList.push_back(Ty);
541 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
542 // Check to see if this is an unresolved type
543 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
544 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
545 for ( ; I != E; ++I) {
546 if (I->second.get() == OpTy)
549 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
550 const Type* TheTy = SeqTy->getElementType();
551 if (TheTy->isAbstract() && TheTy != Ty) {
552 std::vector<const Type*>::iterator I = SeenList.begin(),
558 WorkList.push_back(TheTy);
560 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
561 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
562 const Type* TheTy = StrTy->getElementType(i);
563 if (TheTy->isAbstract() && TheTy != Ty) {
564 std::vector<const Type*>::iterator I = SeenList.begin(),
570 WorkList.push_back(TheTy);
579 static struct PerFunctionInfo {
580 Function *CurrentFunction; // Pointer to current function being created
582 ValueList Values; // Keep track of #'d definitions
584 ValueList LateResolveValues;
585 bool isDeclare; // Is this function a forward declararation?
586 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
587 GlobalValue::VisibilityTypes Visibility;
589 /// BBForwardRefs - When we see forward references to basic blocks, keep
590 /// track of them here.
591 std::map<ValID, BasicBlock*> BBForwardRefs;
593 inline PerFunctionInfo() {
596 Linkage = GlobalValue::ExternalLinkage;
597 Visibility = GlobalValue::DefaultVisibility;
600 inline void FunctionStart(Function *M) {
605 void FunctionDone() {
606 // Any forward referenced blocks left?
607 if (!BBForwardRefs.empty()) {
608 GenerateError("Undefined reference to label " +
609 BBForwardRefs.begin()->second->getName());
613 // Resolve all forward references now.
614 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
616 Values.clear(); // Clear out function local definitions
617 BBForwardRefs.clear();
620 Linkage = GlobalValue::ExternalLinkage;
621 Visibility = GlobalValue::DefaultVisibility;
623 } CurFun; // Info for the current function...
625 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
628 //===----------------------------------------------------------------------===//
629 // Code to handle definitions of all the types
630 //===----------------------------------------------------------------------===//
632 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
633 // Things that have names or are void typed don't get slot numbers
634 if (V->hasName() || (V->getType() == Type::VoidTy))
637 // In the case of function values, we have to allow for the forward reference
638 // of basic blocks, which are included in the numbering. Consequently, we keep
639 // track of the next insertion location with NextValNum. When a BB gets
640 // inserted, it could change the size of the CurFun.Values vector.
641 if (&ValueTab == &CurFun.Values) {
642 if (ValueTab.size() <= CurFun.NextValNum)
643 ValueTab.resize(CurFun.NextValNum+1);
644 ValueTab[CurFun.NextValNum++] = V;
647 // For all other lists, its okay to just tack it on the back of the vector.
648 ValueTab.push_back(V);
651 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
653 case ValID::LocalID: // Is it a numbered definition?
654 // Module constants occupy the lowest numbered slots...
655 if (D.Num < CurModule.Types.size())
656 return CurModule.Types[D.Num];
658 case ValID::LocalName: // Is it a named definition?
659 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
660 D.destroy(); // Free old strdup'd memory...
665 GenerateError("Internal parser error: Invalid symbol type reference");
669 // If we reached here, we referenced either a symbol that we don't know about
670 // or an id number that hasn't been read yet. We may be referencing something
671 // forward, so just create an entry to be resolved later and get to it...
673 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
676 if (inFunctionScope()) {
677 if (D.Type == ValID::LocalName) {
678 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
681 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
686 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
687 if (I != CurModule.LateResolveTypes.end())
690 Type *Typ = OpaqueType::get();
691 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
695 // getExistingVal - Look up the value specified by the provided type and
696 // the provided ValID. If the value exists and has already been defined, return
697 // it. Otherwise return null.
699 static Value *getExistingVal(const Type *Ty, const ValID &D) {
700 if (isa<FunctionType>(Ty)) {
701 GenerateError("Functions are not values and "
702 "must be referenced as pointers");
707 case ValID::LocalID: { // Is it a numbered definition?
708 // Check that the number is within bounds.
709 if (D.Num >= CurFun.Values.size())
711 Value *Result = CurFun.Values[D.Num];
712 if (Ty != Result->getType()) {
713 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
714 Result->getType()->getDescription() + "' does not match "
715 "expected type, '" + Ty->getDescription() + "'");
720 case ValID::GlobalID: { // Is it a numbered definition?
721 if (D.Num >= CurModule.Values.size())
723 Value *Result = CurModule.Values[D.Num];
724 if (Ty != Result->getType()) {
725 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
726 Result->getType()->getDescription() + "' does not match "
727 "expected type, '" + Ty->getDescription() + "'");
733 case ValID::LocalName: { // Is it a named definition?
734 if (!inFunctionScope())
736 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
737 Value *N = SymTab.lookup(D.getName());
740 if (N->getType() != Ty)
743 D.destroy(); // Free old strdup'd memory...
746 case ValID::GlobalName: { // Is it a named definition?
747 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
748 Value *N = SymTab.lookup(D.getName());
751 if (N->getType() != Ty)
754 D.destroy(); // Free old strdup'd memory...
758 // Check to make sure that "Ty" is an integral type, and that our
759 // value will fit into the specified type...
760 case ValID::ConstSIntVal: // Is it a constant pool reference??
761 if (!isa<IntegerType>(Ty) ||
762 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
763 GenerateError("Signed integral constant '" +
764 itostr(D.ConstPool64) + "' is invalid for type '" +
765 Ty->getDescription() + "'");
768 return ConstantInt::get(Ty, D.ConstPool64, true);
770 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
771 if (isa<IntegerType>(Ty) &&
772 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
773 return ConstantInt::get(Ty, D.UConstPool64);
775 if (!isa<IntegerType>(Ty) ||
776 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
777 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
778 "' is invalid or out of range for type '" +
779 Ty->getDescription() + "'");
782 // This is really a signed reference. Transmogrify.
783 return ConstantInt::get(Ty, D.ConstPool64, true);
785 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
786 if (!isa<IntegerType>(Ty)) {
787 GenerateError("Integral constant '" + D.getName() +
788 "' is invalid or out of range for type '" +
789 Ty->getDescription() + "'");
794 APSInt Tmp = *D.ConstPoolInt;
795 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
796 return ConstantInt::get(Tmp);
799 case ValID::ConstFPVal: // Is it a floating point const pool reference?
800 if (!Ty->isFloatingPoint() ||
801 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
802 GenerateError("FP constant invalid for type");
805 // Lexer has no type info, so builds all float and double FP constants
806 // as double. Fix this here. Long double does not need this.
807 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
809 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
810 return ConstantFP::get(*D.ConstPoolFP);
812 case ValID::ConstNullVal: // Is it a null value?
813 if (!isa<PointerType>(Ty)) {
814 GenerateError("Cannot create a a non pointer null");
817 return ConstantPointerNull::get(cast<PointerType>(Ty));
819 case ValID::ConstUndefVal: // Is it an undef value?
820 return UndefValue::get(Ty);
822 case ValID::ConstZeroVal: // Is it a zero value?
823 return Constant::getNullValue(Ty);
825 case ValID::ConstantVal: // Fully resolved constant?
826 if (D.ConstantValue->getType() != Ty) {
827 GenerateError("Constant expression type different from required type");
830 return D.ConstantValue;
832 case ValID::InlineAsmVal: { // Inline asm expression
833 const PointerType *PTy = dyn_cast<PointerType>(Ty);
834 const FunctionType *FTy =
835 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
836 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
837 GenerateError("Invalid type for asm constraint string");
840 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
841 D.IAD->HasSideEffects);
842 D.destroy(); // Free InlineAsmDescriptor.
846 assert(0 && "Unhandled case!");
850 assert(0 && "Unhandled case!");
854 // getVal - This function is identical to getExistingVal, except that if a
855 // value is not already defined, it "improvises" by creating a placeholder var
856 // that looks and acts just like the requested variable. When the value is
857 // defined later, all uses of the placeholder variable are replaced with the
860 static Value *getVal(const Type *Ty, const ValID &ID) {
861 if (Ty == Type::LabelTy) {
862 GenerateError("Cannot use a basic block here");
866 // See if the value has already been defined.
867 Value *V = getExistingVal(Ty, ID);
869 if (TriggerError) return 0;
871 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
872 GenerateError("Invalid use of a non-first-class type");
876 // If we reached here, we referenced either a symbol that we don't know about
877 // or an id number that hasn't been read yet. We may be referencing something
878 // forward, so just create an entry to be resolved later and get to it...
881 case ValID::GlobalName:
882 case ValID::GlobalID: {
883 const PointerType *PTy = dyn_cast<PointerType>(Ty);
885 GenerateError("Invalid type for reference to global" );
888 const Type* ElTy = PTy->getElementType();
889 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
890 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
892 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
893 (Module*)0, false, PTy->getAddressSpace());
897 V = new Argument(Ty);
900 // Remember where this forward reference came from. FIXME, shouldn't we try
901 // to recycle these things??
902 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
905 if (inFunctionScope())
906 InsertValue(V, CurFun.LateResolveValues);
908 InsertValue(V, CurModule.LateResolveValues);
912 /// defineBBVal - This is a definition of a new basic block with the specified
913 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
914 static BasicBlock *defineBBVal(const ValID &ID) {
915 assert(inFunctionScope() && "Can't get basic block at global scope!");
919 // First, see if this was forward referenced
921 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
922 if (BBI != CurFun.BBForwardRefs.end()) {
924 // The forward declaration could have been inserted anywhere in the
925 // function: insert it into the correct place now.
926 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
927 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
929 // We're about to erase the entry, save the key so we can clean it up.
930 ValID Tmp = BBI->first;
932 // Erase the forward ref from the map as its no longer "forward"
933 CurFun.BBForwardRefs.erase(ID);
935 // The key has been removed from the map but so we don't want to leave
936 // strdup'd memory around so destroy it too.
939 // If its a numbered definition, bump the number and set the BB value.
940 if (ID.Type == ValID::LocalID) {
941 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
945 // We haven't seen this BB before and its first mention is a definition.
946 // Just create it and return it.
947 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
948 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
949 if (ID.Type == ValID::LocalID) {
950 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
959 /// getBBVal - get an existing BB value or create a forward reference for it.
961 static BasicBlock *getBBVal(const ValID &ID) {
962 assert(inFunctionScope() && "Can't get basic block at global scope!");
966 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
967 if (BBI != CurFun.BBForwardRefs.end()) {
969 } if (ID.Type == ValID::LocalName) {
970 std::string Name = ID.getName();
971 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
973 if (N->getType()->getTypeID() == Type::LabelTyID)
974 BB = cast<BasicBlock>(N);
976 GenerateError("Reference to label '" + Name + "' is actually of type '"+
977 N->getType()->getDescription() + "'");
979 } else if (ID.Type == ValID::LocalID) {
980 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
981 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
982 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
984 GenerateError("Reference to label '%" + utostr(ID.Num) +
985 "' is actually of type '"+
986 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
989 GenerateError("Illegal label reference " + ID.getName());
993 // If its already been defined, return it now.
995 ID.destroy(); // Free strdup'd memory.
999 // Otherwise, this block has not been seen before, create it.
1001 if (ID.Type == ValID::LocalName)
1002 Name = ID.getName();
1003 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1005 // Insert it in the forward refs map.
1006 CurFun.BBForwardRefs[ID] = BB;
1012 //===----------------------------------------------------------------------===//
1013 // Code to handle forward references in instructions
1014 //===----------------------------------------------------------------------===//
1016 // This code handles the late binding needed with statements that reference
1017 // values not defined yet... for example, a forward branch, or the PHI node for
1020 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1021 // and back patchs after we are done.
1024 // ResolveDefinitions - If we could not resolve some defs at parsing
1025 // time (forward branches, phi functions for loops, etc...) resolve the
1029 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1030 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1031 while (!LateResolvers.empty()) {
1032 Value *V = LateResolvers.back();
1033 LateResolvers.pop_back();
1035 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1036 CurModule.PlaceHolderInfo.find(V);
1037 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1039 ValID &DID = PHI->second.first;
1041 Value *TheRealValue = getExistingVal(V->getType(), DID);
1045 V->replaceAllUsesWith(TheRealValue);
1047 CurModule.PlaceHolderInfo.erase(PHI);
1048 } else if (FutureLateResolvers) {
1049 // Functions have their unresolved items forwarded to the module late
1051 InsertValue(V, *FutureLateResolvers);
1053 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1054 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1055 "' of type '" + V->getType()->getDescription() + "'",
1056 PHI->second.second);
1059 GenerateError("Reference to an invalid definition: #" +
1060 itostr(DID.Num) + " of type '" +
1061 V->getType()->getDescription() + "'",
1062 PHI->second.second);
1067 LateResolvers.clear();
1070 // ResolveTypeTo - A brand new type was just declared. This means that (if
1071 // name is not null) things referencing Name can be resolved. Otherwise, things
1072 // refering to the number can be resolved. Do this now.
1074 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1077 D = ValID::createLocalName(*Name);
1079 D = ValID::createLocalID(CurModule.Types.size());
1081 std::map<ValID, PATypeHolder>::iterator I =
1082 CurModule.LateResolveTypes.find(D);
1083 if (I != CurModule.LateResolveTypes.end()) {
1084 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1085 CurModule.LateResolveTypes.erase(I);
1089 // setValueName - Set the specified value to the name given. The name may be
1090 // null potentially, in which case this is a noop. The string passed in is
1091 // assumed to be a malloc'd string buffer, and is free'd by this function.
1093 static void setValueName(Value *V, std::string *NameStr) {
1094 if (!NameStr) return;
1095 std::string Name(*NameStr); // Copy string
1096 delete NameStr; // Free old string
1098 if (V->getType() == Type::VoidTy) {
1099 GenerateError("Can't assign name '" + Name+"' to value with void type");
1103 assert(inFunctionScope() && "Must be in function scope!");
1104 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1105 if (ST.lookup(Name)) {
1106 GenerateError("Redefinition of value '" + Name + "' of type '" +
1107 V->getType()->getDescription() + "'");
1115 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1116 /// this is a declaration, otherwise it is a definition.
1117 static GlobalVariable *
1118 ParseGlobalVariable(std::string *NameStr,
1119 GlobalValue::LinkageTypes Linkage,
1120 GlobalValue::VisibilityTypes Visibility,
1121 bool isConstantGlobal, const Type *Ty,
1122 Constant *Initializer, bool IsThreadLocal,
1123 unsigned AddressSpace = 0) {
1124 if (isa<FunctionType>(Ty)) {
1125 GenerateError("Cannot declare global vars of function type");
1128 if (Ty == Type::LabelTy) {
1129 GenerateError("Cannot declare global vars of label type");
1133 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1137 Name = *NameStr; // Copy string
1138 delete NameStr; // Free old string
1141 // See if this global value was forward referenced. If so, recycle the
1144 if (!Name.empty()) {
1145 ID = ValID::createGlobalName(Name);
1147 ID = ValID::createGlobalID(CurModule.Values.size());
1150 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1151 // Move the global to the end of the list, from whereever it was
1152 // previously inserted.
1153 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1154 CurModule.CurrentModule->getGlobalList().remove(GV);
1155 CurModule.CurrentModule->getGlobalList().push_back(GV);
1156 GV->setInitializer(Initializer);
1157 GV->setLinkage(Linkage);
1158 GV->setVisibility(Visibility);
1159 GV->setConstant(isConstantGlobal);
1160 GV->setThreadLocal(IsThreadLocal);
1161 InsertValue(GV, CurModule.Values);
1165 // If this global has a name
1166 if (!Name.empty()) {
1167 // if the global we're parsing has an initializer (is a definition) and
1168 // has external linkage.
1169 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1170 // If there is already a global with external linkage with this name
1171 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1172 // If we allow this GVar to get created, it will be renamed in the
1173 // symbol table because it conflicts with an existing GVar. We can't
1174 // allow redefinition of GVars whose linking indicates that their name
1175 // must stay the same. Issue the error.
1176 GenerateError("Redefinition of global variable named '" + Name +
1177 "' of type '" + Ty->getDescription() + "'");
1182 // Otherwise there is no existing GV to use, create one now.
1183 GlobalVariable *GV =
1184 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1185 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1186 GV->setVisibility(Visibility);
1187 InsertValue(GV, CurModule.Values);
1191 // setTypeName - Set the specified type to the name given. The name may be
1192 // null potentially, in which case this is a noop. The string passed in is
1193 // assumed to be a malloc'd string buffer, and is freed by this function.
1195 // This function returns true if the type has already been defined, but is
1196 // allowed to be redefined in the specified context. If the name is a new name
1197 // for the type plane, it is inserted and false is returned.
1198 static bool setTypeName(const Type *T, std::string *NameStr) {
1199 assert(!inFunctionScope() && "Can't give types function-local names!");
1200 if (NameStr == 0) return false;
1202 std::string Name(*NameStr); // Copy string
1203 delete NameStr; // Free old string
1205 // We don't allow assigning names to void type
1206 if (T == Type::VoidTy) {
1207 GenerateError("Can't assign name '" + Name + "' to the void type");
1211 // Set the type name, checking for conflicts as we do so.
1212 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1214 if (AlreadyExists) { // Inserting a name that is already defined???
1215 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1216 assert(Existing && "Conflict but no matching type?!");
1218 // There is only one case where this is allowed: when we are refining an
1219 // opaque type. In this case, Existing will be an opaque type.
1220 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1221 // We ARE replacing an opaque type!
1222 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1226 // Otherwise, this is an attempt to redefine a type. That's okay if
1227 // the redefinition is identical to the original. This will be so if
1228 // Existing and T point to the same Type object. In this one case we
1229 // allow the equivalent redefinition.
1230 if (Existing == T) return true; // Yes, it's equal.
1232 // Any other kind of (non-equivalent) redefinition is an error.
1233 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1234 T->getDescription() + "'");
1240 //===----------------------------------------------------------------------===//
1241 // Code for handling upreferences in type names...
1244 // TypeContains - Returns true if Ty directly contains E in it.
1246 static bool TypeContains(const Type *Ty, const Type *E) {
1247 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1248 E) != Ty->subtype_end();
1252 struct UpRefRecord {
1253 // NestingLevel - The number of nesting levels that need to be popped before
1254 // this type is resolved.
1255 unsigned NestingLevel;
1257 // LastContainedTy - This is the type at the current binding level for the
1258 // type. Every time we reduce the nesting level, this gets updated.
1259 const Type *LastContainedTy;
1261 // UpRefTy - This is the actual opaque type that the upreference is
1262 // represented with.
1263 OpaqueType *UpRefTy;
1265 UpRefRecord(unsigned NL, OpaqueType *URTy)
1266 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1270 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1271 static std::vector<UpRefRecord> UpRefs;
1273 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1274 /// called. It loops through the UpRefs vector, which is a list of the
1275 /// currently active types. For each type, if the up reference is contained in
1276 /// the newly completed type, we decrement the level count. When the level
1277 /// count reaches zero, the upreferenced type is the type that is passed in:
1278 /// thus we can complete the cycle.
1280 static PATypeHolder HandleUpRefs(const Type *ty) {
1281 // If Ty isn't abstract, or if there are no up-references in it, then there is
1282 // nothing to resolve here.
1283 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1285 PATypeHolder Ty(ty);
1286 UR_OUT("Type '" << Ty->getDescription() <<
1287 "' newly formed. Resolving upreferences.\n" <<
1288 UpRefs.size() << " upreferences active!\n");
1290 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1291 // to zero), we resolve them all together before we resolve them to Ty. At
1292 // the end of the loop, if there is anything to resolve to Ty, it will be in
1294 OpaqueType *TypeToResolve = 0;
1296 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1297 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1298 << UpRefs[i].second->getDescription() << ") = "
1299 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1300 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1301 // Decrement level of upreference
1302 unsigned Level = --UpRefs[i].NestingLevel;
1303 UpRefs[i].LastContainedTy = Ty;
1304 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1305 if (Level == 0) { // Upreference should be resolved!
1306 if (!TypeToResolve) {
1307 TypeToResolve = UpRefs[i].UpRefTy;
1309 UR_OUT(" * Resolving upreference for "
1310 << UpRefs[i].second->getDescription() << "\n";
1311 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1312 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1313 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1314 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1316 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1317 --i; // Do not skip the next element...
1322 if (TypeToResolve) {
1323 UR_OUT(" * Resolving upreference for "
1324 << UpRefs[i].second->getDescription() << "\n";
1325 std::string OldName = TypeToResolve->getDescription());
1326 TypeToResolve->refineAbstractTypeTo(Ty);
1332 //===----------------------------------------------------------------------===//
1333 // RunVMAsmParser - Define an interface to this parser
1334 //===----------------------------------------------------------------------===//
1336 static Module* RunParser(Module * M);
1338 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1340 Module *M = RunParser(new Module(LLLgetFilename()));
1347 /* Enabling traces. */
1352 /* Enabling verbose error messages. */
1353 #ifdef YYERROR_VERBOSE
1354 # undef YYERROR_VERBOSE
1355 # define YYERROR_VERBOSE 1
1357 # define YYERROR_VERBOSE 0
1360 /* Enabling the token table. */
1361 #ifndef YYTOKEN_TABLE
1362 # define YYTOKEN_TABLE 0
1365 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1366 typedef union YYSTYPE
1367 #line 967 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
1369 llvm::Module *ModuleVal;
1370 llvm::Function *FunctionVal;
1371 llvm::BasicBlock *BasicBlockVal;
1372 llvm::TerminatorInst *TermInstVal;
1373 llvm::Instruction *InstVal;
1374 llvm::Constant *ConstVal;
1376 const llvm::Type *PrimType;
1377 std::list<llvm::PATypeHolder> *TypeList;
1378 llvm::PATypeHolder *TypeVal;
1379 llvm::Value *ValueVal;
1380 std::vector<llvm::Value*> *ValueList;
1381 std::vector<unsigned> *ConstantList;
1382 llvm::ArgListType *ArgList;
1383 llvm::TypeWithAttrs TypeWithAttrs;
1384 llvm::TypeWithAttrsList *TypeWithAttrsList;
1385 llvm::ParamList *ParamList;
1387 // Represent the RHS of PHI node
1388 std::list<std::pair<llvm::Value*,
1389 llvm::BasicBlock*> > *PHIList;
1390 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1391 std::vector<llvm::Constant*> *ConstVector;
1393 llvm::GlobalValue::LinkageTypes Linkage;
1394 llvm::GlobalValue::VisibilityTypes Visibility;
1395 llvm::ParameterAttributes ParamAttrs;
1396 llvm::APInt *APIntVal;
1401 llvm::APFloat *FPVal;
1404 std::string *StrVal; // This memory must be deleted
1405 llvm::ValID ValIDVal;
1407 llvm::Instruction::BinaryOps BinaryOpVal;
1408 llvm::Instruction::TermOps TermOpVal;
1409 llvm::Instruction::MemoryOps MemOpVal;
1410 llvm::Instruction::CastOps CastOpVal;
1411 llvm::Instruction::OtherOps OtherOpVal;
1412 llvm::ICmpInst::Predicate IPredicate;
1413 llvm::FCmpInst::Predicate FPredicate;
1415 /* Line 193 of yacc.c. */
1416 #line 1417 "llvmAsmParser.tab.c"
1418 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1419 # define YYSTYPE_IS_DECLARED 1
1420 # define YYSTYPE_IS_TRIVIAL 1
1425 /* Copy the second part of user declarations. */
1428 /* Line 216 of yacc.c. */
1429 #line 1430 "llvmAsmParser.tab.c"
1436 typedef YYTYPE_UINT8 yytype_uint8;
1438 typedef unsigned char yytype_uint8;
1442 typedef YYTYPE_INT8 yytype_int8;
1443 #elif (defined __STDC__ || defined __C99__FUNC__ \
1444 || defined __cplusplus || defined _MSC_VER)
1445 typedef signed char yytype_int8;
1447 typedef short int yytype_int8;
1450 #ifdef YYTYPE_UINT16
1451 typedef YYTYPE_UINT16 yytype_uint16;
1453 typedef unsigned short int yytype_uint16;
1457 typedef YYTYPE_INT16 yytype_int16;
1459 typedef short int yytype_int16;
1463 # ifdef __SIZE_TYPE__
1464 # define YYSIZE_T __SIZE_TYPE__
1465 # elif defined size_t
1466 # define YYSIZE_T size_t
1467 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1468 || defined __cplusplus || defined _MSC_VER)
1469 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1470 # define YYSIZE_T size_t
1472 # define YYSIZE_T unsigned int
1476 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1479 # if defined YYENABLE_NLS && YYENABLE_NLS
1481 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1482 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1486 # define YY_(msgid) msgid
1490 /* Suppress unused-variable warnings by "using" E. */
1491 #if ! defined lint || defined __GNUC__
1492 # define YYUSE(e) ((void) (e))
1494 # define YYUSE(e) /* empty */
1497 /* Identity function, used to suppress warnings about constant conditions. */
1499 # define YYID(n) (n)
1501 #if (defined __STDC__ || defined __C99__FUNC__ \
1502 || defined __cplusplus || defined _MSC_VER)
1515 #if ! defined yyoverflow || YYERROR_VERBOSE
1517 /* The parser invokes alloca or malloc; define the necessary symbols. */
1519 # ifdef YYSTACK_USE_ALLOCA
1520 # if YYSTACK_USE_ALLOCA
1522 # define YYSTACK_ALLOC __builtin_alloca
1523 # elif defined __BUILTIN_VA_ARG_INCR
1524 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1526 # define YYSTACK_ALLOC __alloca
1527 # elif defined _MSC_VER
1528 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1529 # define alloca _alloca
1531 # define YYSTACK_ALLOC alloca
1532 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1533 || defined __cplusplus || defined _MSC_VER)
1534 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1536 # define _STDLIB_H 1
1543 # ifdef YYSTACK_ALLOC
1544 /* Pacify GCC's `empty if-body' warning. */
1545 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1546 # ifndef YYSTACK_ALLOC_MAXIMUM
1547 /* The OS might guarantee only one guard page at the bottom of the stack,
1548 and a page size can be as small as 4096 bytes. So we cannot safely
1549 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1550 to allow for a few compiler-allocated temporary stack slots. */
1551 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1554 # define YYSTACK_ALLOC YYMALLOC
1555 # define YYSTACK_FREE YYFREE
1556 # ifndef YYSTACK_ALLOC_MAXIMUM
1557 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1559 # if (defined __cplusplus && ! defined _STDLIB_H \
1560 && ! ((defined YYMALLOC || defined malloc) \
1561 && (defined YYFREE || defined free)))
1562 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1564 # define _STDLIB_H 1
1568 # define YYMALLOC malloc
1569 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1570 || defined __cplusplus || defined _MSC_VER)
1571 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1575 # define YYFREE free
1576 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1577 || defined __cplusplus || defined _MSC_VER)
1578 void free (void *); /* INFRINGES ON USER NAME SPACE */
1582 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1585 #if (! defined yyoverflow \
1586 && (! defined __cplusplus \
1587 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1589 /* A type that is properly aligned for any stack member. */
1596 /* The size of the maximum gap between one aligned stack and the next. */
1597 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1599 /* The size of an array large to enough to hold all stacks, each with
1601 # define YYSTACK_BYTES(N) \
1602 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1603 + YYSTACK_GAP_MAXIMUM)
1605 /* Copy COUNT objects from FROM to TO. The source and destination do
1608 # if defined __GNUC__ && 1 < __GNUC__
1609 # define YYCOPY(To, From, Count) \
1610 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1612 # define YYCOPY(To, From, Count) \
1616 for (yyi = 0; yyi < (Count); yyi++) \
1617 (To)[yyi] = (From)[yyi]; \
1623 /* Relocate STACK from its old location to the new one. The
1624 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1625 elements in the stack, and YYPTR gives the new location of the
1626 stack. Advance YYPTR to a properly aligned location for the next
1628 # define YYSTACK_RELOCATE(Stack) \
1631 YYSIZE_T yynewbytes; \
1632 YYCOPY (&yyptr->Stack, Stack, yysize); \
1633 Stack = &yyptr->Stack; \
1634 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1635 yyptr += yynewbytes / sizeof (*yyptr); \
1641 /* YYFINAL -- State number of the termination state. */
1643 /* YYLAST -- Last index in YYTABLE. */
1646 /* YYNTOKENS -- Number of terminals. */
1647 #define YYNTOKENS 171
1648 /* YYNNTS -- Number of nonterminals. */
1650 /* YYNRULES -- Number of rules. */
1651 #define YYNRULES 343
1652 /* YYNRULES -- Number of states. */
1653 #define YYNSTATES 702
1655 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1656 #define YYUNDEFTOK 2
1657 #define YYMAXUTOK 411
1659 #define YYTRANSLATE(YYX) \
1660 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1662 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1663 static const yytype_uint8 yytranslate[] =
1665 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1666 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1667 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1668 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1669 157, 158, 161, 2, 160, 2, 2, 2, 2, 2,
1670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1671 166, 159, 167, 2, 2, 2, 2, 2, 2, 2,
1672 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1673 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1674 2, 163, 162, 165, 2, 2, 2, 2, 2, 170,
1675 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1676 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1677 164, 2, 2, 168, 2, 169, 2, 2, 2, 2,
1678 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1679 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1681 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1687 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1690 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1691 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1692 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1693 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1694 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1695 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1696 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1697 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1698 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1699 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1700 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1701 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1702 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1703 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1704 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1705 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1710 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1712 static const yytype_uint16 yyprhs[] =
1714 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1715 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1716 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1717 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1718 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1719 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1720 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1721 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1722 160, 162, 164, 166, 168, 169, 171, 173, 175, 176,
1723 178, 180, 181, 183, 185, 187, 189, 190, 192, 194,
1724 195, 197, 199, 201, 203, 205, 207, 210, 212, 214,
1725 216, 218, 220, 222, 224, 226, 228, 231, 232, 235,
1726 237, 239, 241, 243, 245, 247, 248, 251, 252, 255,
1727 256, 259, 260, 264, 267, 268, 270, 271, 275, 277,
1728 280, 282, 284, 286, 288, 290, 292, 294, 296, 298,
1729 302, 304, 307, 313, 319, 325, 331, 335, 338, 344,
1730 349, 352, 354, 356, 358, 362, 364, 368, 370, 371,
1731 373, 377, 382, 386, 390, 395, 400, 404, 411, 417,
1732 420, 423, 426, 429, 432, 435, 438, 441, 444, 447,
1733 450, 453, 460, 466, 475, 482, 489, 497, 505, 513,
1734 521, 528, 537, 546, 552, 560, 564, 566, 568, 570,
1735 572, 573, 576, 583, 585, 586, 588, 591, 592, 596,
1736 597, 601, 605, 609, 613, 614, 623, 624, 634, 635,
1737 645, 651, 654, 658, 660, 664, 668, 672, 676, 678,
1738 679, 685, 689, 691, 695, 697, 698, 709, 711, 713,
1739 718, 720, 722, 725, 729, 730, 732, 734, 736, 738,
1740 740, 742, 744, 746, 748, 750, 752, 756, 760, 763,
1741 766, 770, 773, 779, 784, 786, 792, 794, 796, 798,
1742 800, 802, 804, 807, 809, 813, 816, 819, 823, 826,
1743 827, 829, 832, 835, 839, 849, 859, 868, 883, 885,
1744 887, 894, 900, 903, 910, 918, 923, 928, 935, 942,
1745 943, 944, 948, 951, 955, 958, 960, 966, 972, 979,
1746 986, 993, 1000, 1005, 1012, 1017, 1022, 1029, 1036, 1039,
1747 1048, 1050, 1052, 1053, 1057, 1064, 1068, 1075, 1078, 1084,
1748 1092, 1098, 1103, 1108
1751 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1752 static const yytype_int16 yyrhs[] =
1754 217, 0, -1, 76, -1, 77, -1, 78, -1, 79,
1755 -1, 80, -1, 81, -1, 82, -1, 83, -1, 84,
1756 -1, 88, -1, 89, -1, 90, -1, 85, -1, 86,
1757 -1, 87, -1, 121, -1, 122, -1, 123, -1, 124,
1758 -1, 125, -1, 126, -1, 127, -1, 128, -1, 129,
1759 -1, 130, -1, 131, -1, 132, -1, 95, -1, 96,
1760 -1, 97, -1, 98, -1, 99, -1, 100, -1, 101,
1761 -1, 102, -1, 103, -1, 104, -1, 105, -1, 106,
1762 -1, 107, -1, 108, -1, 109, -1, 110, -1, 111,
1763 -1, 112, -1, 113, -1, 114, -1, 101, -1, 102,
1764 -1, 103, -1, 104, -1, 26, -1, 27, -1, 11,
1765 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1766 -1, 19, -1, 22, -1, 24, -1, 179, -1, -1,
1767 55, 157, 4, 158, -1, -1, 179, 159, -1, -1,
1768 20, -1, 23, -1, 185, -1, -1, 183, 159, -1,
1769 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1770 49, -1, 46, -1, 48, -1, 51, -1, -1, 154,
1771 -1, 155, -1, 156, -1, -1, 46, -1, 48, -1,
1772 -1, 42, -1, 43, -1, 44, -1, 47, -1, -1,
1773 44, -1, 42, -1, -1, 63, -1, 64, -1, 65,
1774 -1, 66, -1, 67, -1, 68, -1, 62, 4, -1,
1775 143, -1, 122, -1, 142, -1, 123, -1, 145, -1,
1776 146, -1, 148, -1, 149, -1, 150, -1, 54, 4,
1777 -1, -1, 194, 193, -1, 144, -1, 147, -1, 143,
1778 -1, 142, -1, 151, -1, 152, -1, -1, 196, 195,
1779 -1, -1, 153, 22, -1, -1, 54, 4, -1, -1,
1780 160, 54, 4, -1, 34, 22, -1, -1, 200, -1,
1781 -1, 160, 203, 202, -1, 200, -1, 54, 4, -1,
1782 11, -1, 12, -1, 13, -1, 16, -1, 15, -1,
1783 14, -1, 17, -1, 50, -1, 204, -1, 205, 181,
1784 161, -1, 239, -1, 162, 4, -1, 205, 157, 209,
1785 158, 196, -1, 10, 157, 209, 158, 196, -1, 163,
1786 4, 164, 205, 165, -1, 166, 4, 164, 205, 167,
1787 -1, 168, 210, 169, -1, 168, 169, -1, 166, 168,
1788 210, 169, 167, -1, 166, 168, 169, 167, -1, 205,
1789 194, -1, 205, -1, 10, -1, 206, -1, 208, 160,
1790 206, -1, 208, -1, 208, 160, 39, -1, 39, -1,
1791 -1, 205, -1, 210, 160, 205, -1, 205, 163, 213,
1792 165, -1, 205, 163, 165, -1, 205, 170, 22, -1,
1793 205, 166, 213, 167, -1, 205, 168, 213, 169, -1,
1794 205, 168, 169, -1, 205, 166, 168, 213, 169, 167,
1795 -1, 205, 166, 168, 169, 167, -1, 205, 40, -1,
1796 205, 41, -1, 205, 239, -1, 205, 212, -1, 205,
1797 25, -1, 177, 3, -1, 177, 5, -1, 177, 4,
1798 -1, 177, 6, -1, 11, 26, -1, 11, 27, -1,
1799 178, 9, -1, 174, 157, 211, 38, 205, 158, -1,
1800 120, 157, 211, 251, 158, -1, 134, 157, 211, 160,
1801 211, 160, 211, 158, -1, 172, 157, 211, 160, 211,
1802 158, -1, 173, 157, 211, 160, 211, 158, -1, 91,
1803 175, 157, 211, 160, 211, 158, -1, 92, 176, 157,
1804 211, 160, 211, 158, -1, 93, 175, 157, 211, 160,
1805 211, 158, -1, 94, 176, 157, 211, 160, 211, 158,
1806 -1, 136, 157, 211, 160, 211, 158, -1, 137, 157,
1807 211, 160, 211, 160, 211, 158, -1, 138, 157, 211,
1808 160, 211, 160, 211, 158, -1, 140, 157, 211, 252,
1809 158, -1, 141, 157, 211, 160, 211, 252, 158, -1,
1810 213, 160, 211, -1, 211, -1, 32, -1, 33, -1,
1811 37, -1, -1, 207, 239, -1, 126, 157, 216, 38,
1812 205, 158, -1, 218, -1, -1, 219, -1, 218, 219,
1813 -1, -1, 31, 220, 235, -1, -1, 30, 221, 236,
1814 -1, 60, 59, 225, -1, 182, 18, 205, -1, 182,
1815 18, 10, -1, -1, 184, 188, 215, 214, 211, 181,
1816 222, 202, -1, -1, 184, 186, 188, 215, 214, 211,
1817 181, 223, 202, -1, -1, 184, 187, 188, 215, 214,
1818 205, 181, 224, 202, -1, 184, 188, 35, 191, 216,
1819 -1, 52, 226, -1, 56, 159, 227, -1, 22, -1,
1820 53, 159, 22, -1, 69, 159, 22, -1, 163, 228,
1821 165, -1, 228, 160, 22, -1, 22, -1, -1, 229,
1822 160, 205, 194, 180, -1, 205, 194, 180, -1, 229,
1823 -1, 229, 160, 39, -1, 39, -1, -1, 192, 207,
1824 183, 157, 230, 158, 196, 201, 198, 197, -1, 28,
1825 -1, 168, -1, 190, 188, 231, 232, -1, 29, -1,
1826 169, -1, 243, 234, -1, 189, 188, 231, -1, -1,
1827 61, -1, 3, -1, 4, -1, 5, -1, 6, -1,
1828 9, -1, 26, -1, 27, -1, 40, -1, 41, -1,
1829 25, -1, 166, 213, 167, -1, 163, 213, 165, -1,
1830 163, 165, -1, 170, 22, -1, 168, 213, 169, -1,
1831 168, 169, -1, 166, 168, 213, 169, 167, -1, 166,
1832 168, 169, 167, -1, 212, -1, 59, 237, 22, 160,
1833 22, -1, 7, -1, 8, -1, 179, -1, 183, -1,
1834 239, -1, 238, -1, 205, 240, -1, 241, -1, 242,
1835 160, 241, -1, 243, 244, -1, 233, 244, -1, 245,
1836 182, 246, -1, 245, 248, -1, -1, 21, -1, 70,
1837 242, -1, 70, 10, -1, 71, 17, 240, -1, 71,
1838 11, 240, 160, 17, 240, 160, 17, 240, -1, 72,
1839 177, 240, 160, 17, 240, 163, 247, 165, -1, 72,
1840 177, 240, 160, 17, 240, 163, 165, -1, 73, 192,
1841 207, 240, 157, 250, 158, 196, 38, 17, 240, 74,
1842 17, 240, -1, 74, -1, 75, -1, 247, 177, 238,
1843 160, 17, 240, -1, 177, 238, 160, 17, 240, -1,
1844 182, 254, -1, 205, 163, 240, 160, 240, 165, -1,
1845 249, 160, 163, 240, 160, 240, 165, -1, 205, 194,
1846 240, 194, -1, 17, 194, 240, 194, -1, 250, 160,
1847 205, 194, 240, 194, -1, 250, 160, 17, 194, 240,
1848 194, -1, -1, -1, 251, 160, 241, -1, 160, 4,
1849 -1, 252, 160, 4, -1, 58, 57, -1, 57, -1,
1850 172, 205, 240, 160, 240, -1, 173, 205, 240, 160,
1851 240, -1, 91, 175, 205, 240, 160, 240, -1, 92,
1852 176, 205, 240, 160, 240, -1, 93, 175, 205, 240,
1853 160, 240, -1, 94, 176, 205, 240, 160, 240, -1,
1854 174, 241, 38, 205, -1, 134, 241, 160, 241, 160,
1855 241, -1, 135, 241, 160, 205, -1, 136, 241, 160,
1856 241, -1, 137, 241, 160, 241, 160, 241, -1, 138,
1857 241, 160, 241, 160, 241, -1, 133, 249, -1, 253,
1858 192, 207, 240, 157, 250, 158, 196, -1, 256, -1,
1859 36, -1, -1, 115, 205, 199, -1, 115, 205, 160,
1860 11, 240, 199, -1, 116, 205, 199, -1, 116, 205,
1861 160, 11, 240, 199, -1, 117, 241, -1, 255, 118,
1862 205, 240, 199, -1, 255, 119, 241, 160, 205, 240,
1863 199, -1, 139, 205, 240, 160, 4, -1, 120, 205,
1864 240, 251, -1, 140, 205, 240, 252, -1, 141, 205,
1865 240, 160, 205, 240, 252, -1
1868 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1869 static const yytype_uint16 yyrline[] =
1871 0, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133,
1872 1133, 1134, 1134, 1134, 1134, 1134, 1134, 1135, 1135, 1135,
1873 1135, 1135, 1135, 1136, 1136, 1136, 1136, 1136, 1136, 1139,
1874 1139, 1140, 1140, 1141, 1141, 1142, 1142, 1143, 1143, 1147,
1875 1147, 1148, 1148, 1149, 1149, 1150, 1150, 1151, 1151, 1152,
1876 1152, 1153, 1153, 1154, 1155, 1160, 1161, 1161, 1161, 1161,
1877 1161, 1163, 1163, 1163, 1164, 1164, 1166, 1167, 1171, 1175,
1878 1180, 1180, 1182, 1183, 1188, 1194, 1195, 1196, 1197, 1198,
1879 1199, 1203, 1204, 1205, 1209, 1210, 1211, 1212, 1216, 1217,
1880 1218, 1222, 1223, 1224, 1225, 1226, 1230, 1231, 1232, 1235,
1881 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1249, 1250, 1251,
1882 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1262, 1263, 1268,
1883 1269, 1270, 1271, 1272, 1273, 1276, 1277, 1282, 1283, 1290,
1884 1291, 1297, 1298, 1307, 1315, 1316, 1321, 1322, 1323, 1328,
1885 1341, 1341, 1341, 1341, 1341, 1341, 1341, 1344, 1348, 1352,
1886 1359, 1364, 1372, 1401, 1426, 1431, 1441, 1451, 1455, 1465,
1887 1472, 1481, 1488, 1493, 1498, 1505, 1506, 1513, 1520, 1528,
1888 1534, 1546, 1574, 1590, 1617, 1645, 1671, 1691, 1717, 1737,
1889 1749, 1756, 1822, 1832, 1842, 1848, 1858, 1864, 1874, 1880,
1890 1886, 1899, 1911, 1932, 1940, 1946, 1957, 1962, 1967, 1972,
1891 1977, 1983, 1989, 1995, 2003, 2014, 2018, 2026, 2026, 2029,
1892 2029, 2032, 2044, 2065, 2070, 2078, 2079, 2083, 2083, 2087,
1893 2087, 2090, 2093, 2117, 2129, 2128, 2140, 2139, 2149, 2148,
1894 2159, 2199, 2202, 2208, 2218, 2222, 2227, 2229, 2234, 2239,
1895 2248, 2258, 2269, 2273, 2282, 2291, 2296, 2425, 2425, 2427,
1896 2436, 2436, 2438, 2443, 2455, 2459, 2464, 2468, 2472, 2477,
1897 2482, 2486, 2490, 2494, 2498, 2502, 2506, 2528, 2550, 2556,
1898 2569, 2581, 2586, 2598, 2604, 2608, 2618, 2622, 2626, 2631,
1899 2638, 2638, 2644, 2653, 2658, 2663, 2667, 2676, 2685, 2694,
1900 2698, 2706, 2726, 2730, 2735, 2746, 2765, 2774, 2860, 2864,
1901 2871, 2882, 2895, 2905, 2916, 2926, 2937, 2945, 2955, 2962,
1902 2965, 2966, 2974, 2980, 2989, 2993, 2998, 3014, 3031, 3045,
1903 3059, 3073, 3087, 3099, 3107, 3114, 3120, 3126, 3132, 3147,
1904 3237, 3242, 3246, 3253, 3260, 3270, 3277, 3287, 3295, 3309,
1905 3326, 3340, 3355, 3370
1909 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1910 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1911 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1912 static const char *const yytname[] =
1914 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1915 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1916 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1917 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1918 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1919 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1920 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1921 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1922 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1923 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1924 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1925 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1926 "X86_SSECALLCC_TOK", "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE",
1927 "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV",
1928 "UREM", "SREM", "FREM", "AND", "OR", "XOR", "SHL", "LSHR", "ASHR",
1929 "ICMP", "FCMP", "VICMP", "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE",
1930 "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE",
1931 "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE",
1932 "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST",
1933 "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT",
1934 "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT",
1935 "SHUFFLEVECTOR", "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT",
1936 "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL",
1937 "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED",
1938 "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'",
1939 "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps",
1940 "CastOps", "IPredicates", "FPredicates", "IntType", "FPType",
1941 "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign",
1942 "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1943 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1944 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1945 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1946 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1947 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1948 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1949 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1950 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1951 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1952 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1953 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1954 "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1955 "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1956 "JumpTable", "Inst", "PHIList", "ParamList", "IndexList",
1957 "ConstantIndexList", "OptTailCall", "InstVal", "OptVolatile",
1963 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1965 static const yytype_uint16 yytoknum[] =
1967 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1968 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1969 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1970 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1971 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1972 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1973 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1974 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1975 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1976 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1977 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1978 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1979 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1980 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1981 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1982 405, 406, 407, 408, 409, 410, 411, 40, 41, 61,
1983 44, 42, 92, 91, 120, 93, 60, 62, 123, 125,
1988 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1989 static const yytype_uint16 yyr1[] =
1991 0, 171, 172, 172, 172, 172, 172, 172, 172, 172,
1992 172, 173, 173, 173, 173, 173, 173, 174, 174, 174,
1993 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1994 175, 175, 175, 175, 175, 175, 175, 175, 175, 176,
1995 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
1996 176, 176, 176, 176, 176, 177, 178, 178, 178, 178,
1997 178, 179, 179, 179, 180, 180, 181, 181, 182, 182,
1998 183, 183, 184, 184, 185, 186, 186, 186, 186, 186,
1999 186, 187, 187, 187, 188, 188, 188, 188, 189, 189,
2000 189, 190, 190, 190, 190, 190, 191, 191, 191, 192,
2001 192, 192, 192, 192, 192, 192, 192, 193, 193, 193,
2002 193, 193, 193, 193, 193, 193, 193, 194, 194, 195,
2003 195, 195, 195, 195, 195, 196, 196, 197, 197, 198,
2004 198, 199, 199, 200, 201, 201, 202, 202, 203, 203,
2005 204, 204, 204, 204, 204, 204, 204, 205, 205, 205,
2006 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
2007 206, 207, 207, 208, 208, 209, 209, 209, 209, 210,
2008 210, 211, 211, 211, 211, 211, 211, 211, 211, 211,
2009 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
2010 211, 212, 212, 212, 212, 212, 212, 212, 212, 212,
2011 212, 212, 212, 212, 212, 213, 213, 214, 214, 215,
2012 215, 216, 216, 217, 217, 218, 218, 220, 219, 221,
2013 219, 219, 219, 219, 222, 219, 223, 219, 224, 219,
2014 219, 219, 219, 225, 226, 226, 227, 228, 228, 228,
2015 229, 229, 230, 230, 230, 230, 231, 232, 232, 233,
2016 234, 234, 235, 236, 237, 237, 238, 238, 238, 238,
2017 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
2018 238, 238, 238, 238, 238, 238, 239, 239, 239, 239,
2019 240, 240, 241, 242, 242, 243, 243, 244, 245, 245,
2020 245, 246, 246, 246, 246, 246, 246, 246, 246, 246,
2021 247, 247, 248, 249, 249, 250, 250, 250, 250, 250,
2022 251, 251, 252, 252, 253, 253, 254, 254, 254, 254,
2023 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
2024 254, 255, 255, 256, 256, 256, 256, 256, 256, 256,
2028 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2029 static const yytype_uint8 yyr2[] =
2031 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2032 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2033 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2034 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2035 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2036 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2037 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2038 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
2039 1, 1, 1, 1, 0, 1, 1, 1, 0, 1,
2040 1, 0, 1, 1, 1, 1, 0, 1, 1, 0,
2041 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
2042 1, 1, 1, 1, 1, 1, 2, 0, 2, 1,
2043 1, 1, 1, 1, 1, 0, 2, 0, 2, 0,
2044 2, 0, 3, 2, 0, 1, 0, 3, 1, 2,
2045 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,
2046 1, 2, 5, 5, 5, 5, 3, 2, 5, 4,
2047 2, 1, 1, 1, 3, 1, 3, 1, 0, 1,
2048 3, 4, 3, 3, 4, 4, 3, 6, 5, 2,
2049 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2050 2, 6, 5, 8, 6, 6, 7, 7, 7, 7,
2051 6, 8, 8, 5, 7, 3, 1, 1, 1, 1,
2052 0, 2, 6, 1, 0, 1, 2, 0, 3, 0,
2053 3, 3, 3, 3, 0, 8, 0, 9, 0, 9,
2054 5, 2, 3, 1, 3, 3, 3, 3, 1, 0,
2055 5, 3, 1, 3, 1, 0, 10, 1, 1, 4,
2056 1, 1, 2, 3, 0, 1, 1, 1, 1, 1,
2057 1, 1, 1, 1, 1, 1, 3, 3, 2, 2,
2058 3, 2, 5, 4, 1, 5, 1, 1, 1, 1,
2059 1, 1, 2, 1, 3, 2, 2, 3, 2, 0,
2060 1, 2, 2, 3, 9, 9, 8, 14, 1, 1,
2061 6, 5, 2, 6, 7, 4, 4, 6, 6, 0,
2062 0, 3, 2, 3, 2, 1, 5, 5, 6, 6,
2063 6, 6, 4, 6, 4, 4, 6, 6, 2, 8,
2064 1, 1, 0, 3, 6, 3, 6, 2, 5, 7,
2068 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2069 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2070 means the default is an error. */
2071 static const yytype_uint16 yydefact[] =
2073 73, 61, 70, 62, 71, 63, 219, 217, 0, 0,
2074 0, 0, 0, 0, 84, 72, 0, 73, 215, 88,
2075 91, 0, 0, 231, 0, 0, 68, 0, 74, 75,
2076 77, 76, 78, 81, 79, 82, 80, 83, 85, 86,
2077 87, 84, 84, 210, 1, 216, 89, 90, 84, 220,
2078 92, 93, 94, 95, 84, 289, 218, 289, 0, 0,
2079 239, 232, 233, 221, 276, 277, 223, 140, 141, 142,
2080 145, 144, 143, 146, 147, 0, 0, 0, 0, 278,
2081 279, 148, 222, 150, 210, 210, 96, 209, 0, 99,
2082 99, 290, 286, 69, 250, 251, 252, 285, 234, 235,
2083 238, 0, 168, 151, 0, 0, 0, 0, 157, 169,
2084 0, 0, 168, 0, 0, 0, 98, 97, 0, 207,
2085 208, 0, 0, 100, 101, 102, 103, 104, 105, 0,
2086 253, 0, 332, 288, 0, 236, 167, 117, 163, 165,
2087 0, 0, 0, 0, 0, 0, 156, 0, 0, 149,
2088 0, 0, 162, 0, 161, 0, 230, 140, 141, 142,
2089 145, 144, 143, 0, 0, 67, 67, 106, 0, 247,
2090 248, 249, 331, 315, 0, 0, 0, 0, 99, 298,
2091 299, 2, 3, 4, 5, 6, 7, 8, 9, 10,
2092 14, 15, 16, 11, 12, 13, 0, 0, 0, 0,
2093 0, 0, 0, 0, 17, 18, 19, 20, 21, 22,
2094 23, 24, 25, 26, 27, 28, 0, 0, 0, 0,
2095 0, 0, 0, 0, 0, 0, 0, 0, 287, 99,
2096 302, 0, 330, 237, 160, 0, 125, 67, 67, 159,
2097 0, 170, 0, 125, 67, 67, 0, 211, 188, 189,
2098 184, 186, 185, 187, 190, 183, 179, 180, 0, 0,
2099 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2100 0, 0, 0, 0, 0, 0, 182, 181, 224, 0,
2101 314, 292, 67, 283, 291, 0, 0, 55, 0, 0,
2102 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
2103 0, 53, 54, 49, 50, 51, 52, 39, 40, 41,
2104 42, 43, 44, 45, 46, 47, 48, 0, 0, 0,
2105 131, 131, 337, 67, 67, 328, 0, 0, 0, 0,
2106 0, 67, 67, 67, 67, 67, 0, 0, 0, 0,
2107 0, 108, 110, 109, 107, 111, 112, 113, 114, 115,
2108 118, 166, 164, 153, 154, 155, 158, 66, 152, 226,
2109 228, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2110 0, 0, 0, 172, 206, 0, 0, 0, 176, 0,
2111 173, 0, 0, 0, 136, 245, 256, 257, 258, 259,
2112 260, 265, 261, 262, 263, 264, 254, 0, 0, 0,
2113 0, 274, 281, 280, 282, 0, 0, 293, 0, 0,
2114 67, 67, 67, 67, 0, 333, 0, 335, 310, 0,
2115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2116 0, 0, 0, 67, 0, 116, 122, 121, 119, 120,
2117 123, 124, 126, 136, 136, 0, 0, 0, 0, 0,
2118 310, 0, 0, 0, 0, 0, 0, 0, 171, 157,
2119 169, 0, 174, 175, 0, 0, 0, 0, 225, 244,
2120 117, 242, 0, 255, 0, 268, 0, 0, 0, 271,
2121 0, 269, 284, 0, 0, 0, 0, 0, 0, 0,
2122 0, 0, 0, 341, 0, 0, 0, 324, 325, 0,
2123 0, 0, 0, 342, 0, 0, 0, 322, 0, 131,
2124 0, 227, 229, 67, 0, 0, 0, 0, 0, 0,
2125 0, 0, 0, 0, 0, 205, 178, 0, 0, 0,
2126 0, 0, 0, 138, 136, 65, 0, 125, 0, 267,
2127 157, 0, 266, 270, 0, 0, 309, 0, 0, 0,
2128 0, 131, 132, 131, 0, 0, 0, 0, 0, 0,
2129 340, 312, 0, 67, 316, 317, 309, 0, 338, 67,
2130 212, 0, 0, 0, 0, 192, 0, 0, 0, 0,
2131 203, 0, 177, 0, 0, 67, 133, 139, 137, 64,
2132 241, 243, 117, 134, 0, 273, 0, 0, 0, 117,
2133 117, 0, 318, 319, 320, 321, 334, 336, 311, 0,
2134 0, 323, 326, 327, 313, 0, 0, 131, 0, 0,
2135 0, 0, 0, 200, 0, 0, 0, 194, 195, 191,
2136 65, 135, 129, 275, 272, 0, 0, 0, 0, 125,
2137 0, 303, 0, 343, 125, 339, 196, 197, 198, 199,
2138 0, 0, 0, 204, 240, 0, 127, 0, 296, 0,
2139 0, 108, 110, 117, 117, 0, 117, 117, 304, 329,
2140 193, 201, 202, 130, 0, 246, 294, 0, 295, 0,
2141 306, 305, 0, 0, 0, 128, 0, 0, 0, 117,
2142 117, 0, 0, 0, 308, 307, 301, 0, 0, 300,
2146 /* YYDEFGOTO[NTERM-NUM]. */
2147 static const yytype_int16 yydefgoto[] =
2149 -1, 273, 274, 275, 300, 317, 163, 164, 79, 590,
2150 113, 12, 80, 14, 15, 41, 42, 43, 48, 54,
2151 118, 129, 350, 234, 442, 353, 675, 656, 415, 533,
2152 632, 468, 534, 81, 165, 138, 155, 139, 140, 110,
2153 374, 401, 375, 121, 88, 156, 16, 17, 18, 20,
2154 19, 384, 443, 444, 63, 23, 61, 101, 471, 472,
2155 130, 171, 55, 96, 56, 49, 474, 402, 83, 404,
2156 283, 284, 57, 92, 93, 228, 660, 133, 325, 601,
2157 493, 503, 229, 230, 231, 232
2160 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2162 #define YYPACT_NINF -623
2163 static const yytype_int16 yypact[] =
2165 493, -623, -623, -623, -623, -623, -623, -623, 18, -104,
2166 15, -100, 70, -57, -3, -623, 148, 542, -623, 191,
2167 228, -29, 9, -623, 44, 159, -623, 1927, -623, -623,
2168 -623, -623, -623, -623, -623, -623, -623, -623, -623, -623,
2169 -623, 33, 33, 222, -623, -623, -623, -623, 33, -623,
2170 -623, -623, -623, -623, 33, 196, -623, -10, 201, 208,
2171 218, -623, -623, -623, -623, -623, 93, -623, -623, -623,
2172 -623, -623, -623, -623, -623, 256, 262, 2, 624, -623,
2173 -623, -623, 10, -623, 250, 250, 235, -623, 78, 310,
2174 310, -623, -623, 254, -623, -623, -623, -623, -623, -623,
2175 -623, -32, 1645, -623, 125, 139, 806, 93, -623, 10,
2176 -109, 137, 1645, 153, 78, 78, -623, -623, 1686, -623,
2177 -623, 1945, 314, -623, -623, -623, -623, -623, -623, 1974,
2178 -623, -12, 2208, -623, 301, -623, -623, 10, -623, 167,
2179 177, 1992, 1992, 170, -107, 1992, -623, 334, 193, -623,
2180 1945, 1992, 93, 197, 10, 205, -623, 63, 346, 347,
2181 348, 349, 355, 243, 357, 1509, 312, -623, 122, -623,
2182 -623, -623, -623, -623, 324, 2033, 129, 371, 310, -623,
2183 -623, -623, -623, -623, -623, -623, -623, -623, -623, -623,
2184 -623, -623, -623, -623, -623, -623, 245, 548, 245, 548,
2185 1992, 1992, 1992, 1992, -623, -623, -623, -623, -623, -623,
2186 -623, -623, -623, -623, -623, -623, 1992, 1992, 1992, 1992,
2187 1992, 1992, 1992, 1992, 1992, 1992, 1992, 1992, -623, 310,
2188 -623, 39, -623, -623, 331, 1704, -623, -31, -28, -623,
2189 216, 10, 226, -623, 312, 8, 1686, -623, -623, -623,
2190 -623, -623, -623, -623, -623, -623, -623, -623, 245, 548,
2191 245, 548, 229, 230, 231, 232, 233, 234, 236, 1745,
2192 2051, 1126, 370, 237, 246, 247, -623, -623, -623, 251,
2193 -623, 93, 908, -623, 240, 1076, 1076, -623, 1076, 1974,
2194 -623, -623, -623, -623, -623, -623, -623, -623, -623, -623,
2195 1992, -623, -623, -623, -623, -623, -623, -623, -623, -623,
2196 -623, -623, -623, -623, -623, -623, -623, 1992, 1992, 1992,
2197 -40, 22, -623, 908, 6, 242, 249, 253, 257, 258,
2198 260, 908, 908, 908, 908, 908, 369, 1974, 1992, 1992,
2199 407, -623, -623, -623, -623, -623, -623, -623, -623, -623,
2200 -623, -623, -623, 158, -623, -623, -623, -623, 158, -623,
2201 153, 376, 259, 264, 265, 266, 1945, 1945, 1945, 1945,
2202 1945, 1945, 1945, -623, -623, 66, 1170, -111, -623, -88,
2203 -623, 1945, 1945, 1945, 267, 1764, -623, -623, -623, -623,
2204 -623, -623, -623, -623, -623, -623, 363, 1808, 2107, 1403,
2205 406, -623, -623, -623, -623, 1992, 269, -623, 270, 1076,
2206 908, 908, 908, 908, 25, -623, 43, -623, -623, 1076,
2207 268, 1992, 1992, 1992, 1992, 1992, 272, 277, 279, 280,
2208 281, 1992, 1076, 908, 284, -623, -623, -623, -623, -623,
2209 -623, -623, -623, 267, 267, 1992, 1945, 1945, 1945, 1945,
2210 -623, 285, 286, 287, 288, 277, 289, 1945, -623, 283,
2211 1357, -87, -623, -623, 292, 295, 418, 16, -623, -623,
2212 10, 297, 300, -623, 439, -623, 73, 1449, -59, -623,
2213 -69, -623, -623, 446, 454, 315, 322, 332, 335, 336,
2214 1076, 487, 1076, 338, 339, 1076, 340, 10, -623, 341,
2215 342, 490, 499, 354, 1992, 1076, 1076, 10, 361, 359,
2216 1992, -623, -623, 3, 362, 365, 366, 367, 130, 1945,
2217 1945, 1945, 1945, 146, 1945, -623, -623, 374, 1945, 1945,
2218 1992, 507, 517, -623, 267, 119, 1866, -623, 377, -623,
2219 379, -65, -623, -623, 1076, 1076, 2154, 1076, 1076, 1076,
2220 1076, 359, -623, 359, 1992, 1076, 383, 1992, 1992, 1992,
2221 -623, -623, 530, 908, -623, -623, 2154, 494, -623, 908,
2222 -623, 1945, 1945, 1945, 1945, -623, 384, 389, 390, 391,
2223 -623, 277, -623, 394, 396, 28, -623, -623, -623, -623,
2224 -623, -623, 10, -20, 533, -623, 392, 403, 393, 23,
2225 10, 161, -623, -623, -623, -623, -623, -623, -623, 402,
2226 1076, -623, -623, -623, -623, 277, 168, 359, 410, 411,
2227 412, 413, 1945, -623, 1945, 1945, 176, -623, -623, -623,
2228 119, -623, 522, -623, -623, 561, -1, 756, 756, -623,
2229 2213, -623, 414, 354, -623, -623, -623, -623, -623, -623,
2230 422, 423, 424, -623, -623, 584, 436, 1076, -623, 1222,
2231 1, 433, 434, -623, -623, 173, 23, 10, -623, 158,
2232 -623, -623, -623, -623, 570, -623, -623, 435, -623, 1222,
2233 331, 331, 579, 756, 756, -623, 580, 440, 1076, -623,
2234 -623, 1076, 582, 527, 331, 331, -623, 1076, 588, -623,
2238 /* YYPGOTO[NTERM-NUM]. */
2239 static const yytype_int16 yypgoto[] =
2241 -623, 477, 478, 480, -164, -152, -170, -623, 0, -17,
2242 -146, 523, 4, -623, -623, -623, -623, 64, -623, -623,
2243 -623, -145, -623, -445, -623, -238, -623, -623, -295, 26,
2244 -623, -421, -623, -623, -26, 380, -127, -623, 506, 515,
2245 -86, -162, -262, 89, 223, 378, -623, -623, 605, -623,
2246 -623, -623, -623, -623, -623, -623, -623, -623, -623, -623,
2247 535, -623, -623, -623, -623, -623, -623, -622, -80, 174,
2248 -189, -623, -623, 566, -623, -623, -623, -623, -623, 60,
2249 178, -437, -623, -623, -623, -623
2252 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2253 positive, shift that token. If negative, reduce the rule which
2254 number is the opposite. If zero, do what YYDEFACT says.
2255 If YYTABLE_NINF, syntax error. */
2256 #define YYTABLE_NINF -215
2257 static const yytype_int16 yytable[] =
2259 11, 82, 168, 276, 13, 358, 105, 288, 377, 379,
2260 287, 91, 287, 322, 531, 111, 169, 11, 523, 94,
2261 278, 13, 511, 512, 111, 535, 417, 111, 326, 327,
2262 328, 329, 330, 289, 318, 166, 490, 677, 336, 29,
2263 30, 31, 32, 33, 34, 35, 36, 319, 37, 457,
2264 531, 145, 109, 145, 492, 24, 462, 687, 111, 26,
2265 146, 111, 240, 111, 244, 111, -55, -55, -55, -55,
2266 532, 21, 457, 457, 25, 247, 137, 111, -146, 491,
2267 109, 463, 527, 111, 337, 277, 137, 22, 27, 248,
2268 249, 457, 154, 11, 362, 457, 364, 491, 359, 360,
2269 543, 457, 28, 154, 596, 84, 85, 363, 542, 365,
2270 119, 120, 89, 588, 461, 237, 238, 112, 90, 241,
2271 414, -67, 436, 437, 438, 245, 112, 439, 134, 112,
2272 58, 440, 441, 135, 354, 476, 478, 480, 1, 355,
2273 285, 3, 2, 5, 626, 4, 286, 630, 44, 282,
2274 434, 38, 39, 40, 637, 638, 170, 338, 339, 95,
2275 112, 570, 409, 112, 658, 112, 678, 112, 59, 419,
2276 106, -67, 279, 340, 320, 321, 282, 323, 643, 112,
2277 -146, 62, 416, -67, -146, 112, 629, 38, 39, 40,
2278 324, 282, 282, 282, 282, 282, 331, 332, 333, 334,
2279 335, 282, 403, 150, 151, 403, 403, 60, 403, 137,
2280 432, 682, 64, 65, 568, 541, 482, 91, 680, 681,
2281 154, 683, 684, 98, 1, 2, 457, 3, 4, 5,
2282 99, 458, 496, 457, 498, 499, 500, 46, 539, 47,
2283 100, 341, 342, 403, 694, 695, 250, 251, 252, 253,
2284 102, 403, 403, 403, 403, 403, 606, 86, 607, 87,
2285 103, 343, 344, 154, 345, 346, 104, 347, 348, 349,
2286 50, 51, 52, 1, 410, 53, 3, 116, 5, 117,
2287 450, 451, 452, 453, 454, 455, 456, 87, 575, 141,
2288 554, 411, 412, 413, 147, 464, 465, 466, 276, 593,
2289 436, 437, 438, 142, 580, 439, 562, 114, 115, 440,
2290 441, 154, 433, 282, 149, 436, 437, 438, 167, 639,
2291 439, 640, 645, 233, 440, 441, 644, 235, 640, 403,
2292 403, 403, 403, 403, 653, 236, 562, 239, 242, 403,
2293 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
2294 460, 243, 403, 403, 246, -56, -57, -60, -59, 470,
2295 514, 515, 516, 517, -58, 608, 254, 111, 611, 612,
2296 613, 525, 122, 123, 124, 125, 126, 127, 128, 282,
2297 277, 280, 287, 356, 357, 340, 366, 367, 368, 369,
2298 370, 371, 380, 372, 381, 282, 497, 282, 282, 282,
2299 405, 665, 420, 382, 383, 507, 669, 431, 385, 421,
2300 403, 435, 403, 422, 445, 403, 446, 423, 424, 513,
2301 425, 447, 448, 449, 473, 403, 403, 467, 481, 483,
2302 484, 495, 501, 576, 577, 578, 579, 502, 581, 504,
2303 505, 506, 583, 584, 510, 519, 520, 521, 522, 524,
2304 526, 460, 528, 341, 342, 529, 530, 536, 537, 406,
2305 407, 538, 408, 544, 403, 403, 659, 403, 403, 403,
2306 403, 545, 546, 343, 344, 403, 345, 346, 563, 347,
2307 348, 349, 547, 403, 569, 618, 619, 620, 621, 403,
2308 679, 552, 548, -214, 560, 549, 550, 418, 554, 555,
2309 557, 558, 559, 561, 585, 426, 427, 428, 429, 430,
2310 592, -69, 1, 2, 562, 3, 4, 5, 566, 567,
2311 600, 587, 571, 6, 7, 572, 573, 574, 282, 586,
2312 403, 282, 282, 282, 614, 589, 650, 594, 651, 652,
2313 600, 582, -213, 610, 622, 8, 595, 623, 491, 9,
2314 624, 625, 627, 10, 628, 633, 636, 403, 403, 634,
2315 -69, 1, 2, 635, 3, 4, 5, 641, 646, 647,
2316 648, 649, 6, 7, 301, 302, 655, 403, 657, 668,
2317 670, 671, 672, 485, 486, 487, 488, 489, 673, 674,
2318 -18, -19, 685, 494, 8, 686, 688, 691, 9, 697,
2319 692, 698, 10, 403, 403, 700, 508, 509, 403, 225,
2320 226, 403, 227, 654, 667, 352, 132, 403, 148, 631,
2321 403, 144, 45, 97, 361, 131, 616, 0, 518, 0,
2322 589, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2323 72, 73, 0, 1, 2, 0, 3, 4, 5, 303,
2324 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
2325 314, 315, 316, 0, 551, 0, 553, 0, 0, 556,
2326 0, 0, 0, 0, 74, 0, 0, 0, 0, 564,
2327 565, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2328 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2329 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2330 0, 0, 0, 0, 0, 0, 0, 0, 597, 598,
2331 0, 602, 603, 604, 605, 0, 0, 0, 0, 609,
2332 0, 0, 0, 0, 0, 0, 0, 615, 0, 0,
2333 0, 0, 0, 617, 0, 0, 0, 0, 0, 0,
2334 0, 0, 0, 0, 0, 0, 0, 0, 0, 386,
2335 387, 388, 389, 64, 65, 390, 0, 0, 0, 0,
2336 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2337 5, 391, 392, 393, 642, 0, 75, 76, 0, 0,
2338 77, 0, 78, 108, 0, 0, 394, 395, 0, 0,
2339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2340 340, 663, 664, 64, 65, 396, 107, 67, 68, 69,
2341 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2342 5, 676, 181, 182, 183, 184, 185, 186, 187, 188,
2343 189, 190, 191, 192, 193, 194, 195, 258, 259, 260,
2344 261, 0, 0, 0, 0, 0, 74, 689, 690, 0,
2345 0, 0, 693, 0, 0, 696, 0, 0, 0, 0,
2346 0, 699, 0, 0, 701, 0, 262, 204, 661, 662,
2347 207, 208, 209, 210, 211, 212, 213, 214, 215, 0,
2348 263, 0, 264, 265, 266, 0, 267, 268, 343, 344,
2349 0, 345, 346, 0, 347, 348, 349, 0, 0, 0,
2350 0, 386, 387, 388, 389, 64, 65, 390, 0, 397,
2351 0, 0, 398, 0, 399, 0, 400, 1, 2, 0,
2352 3, 4, 5, 391, 392, 393, 0, 0, 0, 0,
2353 0, 0, 0, 0, 0, 0, 0, 0, 394, 395,
2354 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2355 0, 0, 0, 111, 0, 0, 0, 396, 75, 76,
2356 0, 0, 77, 0, 78, 143, 0, 0, 0, 0,
2357 0, 0, 0, 0, 181, 182, 183, 184, 185, 186,
2358 187, 188, 189, 190, 191, 192, 193, 194, 195, 258,
2359 259, 260, 261, 0, 0, 0, 0, 0, 0, 0,
2360 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2361 0, 0, 0, 0, 0, 0, 0, 0, 262, 204,
2362 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
2363 215, 0, 263, 0, 264, 265, 266, 0, 267, 268,
2364 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2365 0, 0, 0, 0, 0, 112, 0, 0, 0, 0,
2366 0, 397, 0, 0, 398, 0, 399, 0, 400, 386,
2367 387, 388, 389, 64, 65, 390, 0, 0, 0, 0,
2368 0, 0, 0, 0, 0, 1, 2, 0, 3, 4,
2369 5, 391, 392, 393, 0, 0, 0, 0, 0, 0,
2370 0, 0, 0, 0, 0, 0, 394, 395, 0, 0,
2371 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2372 0, 0, 0, 64, 65, 396, 107, 157, 158, 159,
2373 160, 161, 162, 73, 0, 1, 2, 0, 3, 4,
2374 5, 0, 181, 182, 183, 184, 185, 186, 187, 188,
2375 189, 190, 191, 192, 193, 194, 195, 258, 259, 260,
2376 261, 0, 0, 0, 0, 0, 74, 64, 65, 0,
2377 107, 157, 158, 159, 160, 161, 162, 73, 0, 1,
2378 2, 0, 3, 4, 5, 0, 262, 204, 205, 206,
2379 207, 208, 209, 210, 211, 212, 213, 214, 215, 0,
2380 263, 0, 264, 265, 266, 0, 267, 268, 0, 0,
2381 74, 0, 0, 0, 0, 386, 387, 388, 389, 0,
2382 0, 390, 0, 0, 0, 0, 0, 0, 0, 397,
2383 0, 0, 398, 0, 399, 0, 400, 391, 392, 393,
2384 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2385 0, 0, 394, 395, 0, 0, 0, 0, 0, 0,
2386 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2387 0, 396, 0, 0, 0, 0, 0, 0, 75, 76,
2388 0, 0, 77, 0, 78, 378, 0, 0, 181, 182,
2389 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2390 193, 194, 195, 258, 259, 260, 261, 0, 0, 0,
2391 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2392 0, 0, 75, 76, 0, 0, 77, 0, 78, 459,
2393 0, 0, 262, 204, 205, 206, 207, 208, 209, 210,
2394 211, 212, 213, 214, 215, 0, 263, 0, 264, 265,
2395 266, 0, 267, 268, 64, 65, 0, 0, 0, 0,
2396 0, 0, 0, 0, 0, 0, 1, 2, 0, 3,
2397 4, 5, 255, 0, 0, 397, 0, 0, 398, 0,
2398 399, 0, 400, 0, 0, 0, 0, 256, 257, 0,
2399 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2400 64, 65, 111, 107, 157, 158, 159, 160, 161, 162,
2401 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2402 0, 0, 0, 181, 182, 183, 184, 185, 186, 187,
2403 188, 189, 190, 191, 192, 193, 194, 195, 258, 259,
2404 260, 261, 0, 74, 0, 0, 64, 65, 0, 107,
2405 157, 158, 159, 160, 161, 162, 73, 0, 1, 2,
2406 0, 3, 4, 5, 0, 0, 0, 262, 204, 205,
2407 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
2408 0, 263, 0, 264, 265, 266, 0, 267, 268, 74,
2409 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2410 0, 0, 0, 0, 112, 0, 64, 65, -67, 0,
2411 269, 0, 0, 270, 0, 271, 0, 272, 1, 2,
2412 0, 3, 4, 5, 255, 0, 0, 0, 0, 0,
2413 0, 0, 0, 0, 0, 0, 0, 0, 0, 256,
2414 257, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2415 0, 0, 0, 0, 111, 75, 76, 0, 0, 77,
2416 0, 78, 479, 0, 0, 0, 0, 0, 0, 0,
2417 0, 0, 0, 0, 0, 181, 182, 183, 184, 185,
2418 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
2419 258, 259, 260, 261, 0, 0, 0, 0, 0, 0,
2420 0, 75, 76, 0, 0, 77, 0, 78, 540, 0,
2421 0, 0, 0, 0, 0, 0, 0, 0, 0, 262,
2422 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
2423 214, 215, 0, 263, 0, 264, 265, 266, 0, 267,
2424 268, 0, 64, 65, 0, 107, 67, 68, 69, 70,
2425 71, 72, 73, 0, 1, 2, 112, 3, 4, 5,
2426 0, 0, 269, 0, 0, 270, 0, 271, 0, 272,
2427 0, 0, 0, 0, 136, 0, 0, 0, 0, 0,
2428 0, 0, 0, 64, 65, 74, 152, 67, 68, 69,
2429 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2430 5, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2431 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2432 0, 0, 0, 0, 0, 0, 74, 0, 0, 0,
2433 0, 0, 0, 351, 0, 0, 0, 0, 0, 0,
2434 0, 0, 64, 65, 74, 107, 157, 158, 159, 160,
2435 161, 162, 73, 0, 1, 2, 0, 3, 4, 5,
2436 0, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2437 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2438 0, 0, 0, 0, 0, 74, 0, 0, 0, 0,
2439 0, 0, 0, 469, 0, 0, 0, 75, 76, 0,
2440 0, 77, 153, 78, 74, 64, 65, 0, 107, 157,
2441 158, 159, 160, 161, 162, 73, 0, 1, 2, 0,
2442 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2443 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2444 0, 0, 77, 0, 78, 0, 0, 0, 74, 0,
2445 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2446 77, 0, 78, 64, 65, 0, 107, 67, 68, 69,
2447 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2448 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2449 0, 0, 0, 0, 0, 591, 0, 75, 76, 0,
2450 373, 77, 0, 78, 0, 0, 74, 0, 0, 0,
2451 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2452 77, 0, 78, 0, 64, 65, 0, 66, 67, 68,
2453 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2454 4, 5, 64, 65, 0, 107, 157, 158, 159, 160,
2455 161, 162, 73, 0, 1, 2, 0, 3, 4, 5,
2456 75, 76, 0, 475, 77, 0, 78, 74, 0, 0,
2457 0, 64, 65, 0, 152, 67, 68, 69, 70, 71,
2458 72, 73, 0, 1, 2, 74, 3, 4, 5, 64,
2459 65, 0, 107, 67, 68, 69, 70, 71, 72, 73,
2460 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2461 0, 0, 0, 0, 74, 0, 0, 0, 75, 76,
2462 0, 0, 77, 0, 78, 0, 0, 0, 0, 0,
2463 64, 65, 74, 281, 67, 68, 69, 70, 71, 72,
2464 73, 0, 1, 2, 0, 3, 4, 5, 64, 65,
2465 0, 107, 157, 158, 159, 160, 161, 162, 73, 0,
2466 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2467 0, 0, 0, 74, 0, 0, 0, 0, 0, 75,
2468 76, 0, 0, 77, 0, 78, 0, 0, 0, 0,
2469 0, 74, 0, 0, 0, 0, 0, 75, 76, 0,
2470 0, 77, 0, 78, 64, 65, 0, 107, 157, 158,
2471 159, 160, 161, 162, 73, 0, 1, 2, 0, 3,
2472 4, 5, 0, 0, 0, 0, 75, 76, 0, 0,
2473 77, 0, 78, 0, 0, 0, 0, 0, 0, 0,
2474 0, 0, 0, 0, 75, 76, 0, 74, 77, 0,
2475 78, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2476 72, 599, 0, 1, 2, 0, 3, 4, 5, 0,
2477 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2478 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2479 0, 78, 0, 0, 74, 0, 0, 0, 0, 0,
2480 0, 0, 0, 75, 76, 0, 0, 77, 0, 376,
2481 64, 65, 0, 107, 67, 68, 69, 70, 71, 72,
2482 666, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2483 0, 0, 0, 0, 172, 0, 0, 0, 0, 0,
2484 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2485 0, 0, 0, 74, 0, 173, 174, 0, 0, 75,
2486 76, 0, 0, 77, 0, 477, 0, 0, 175, 176,
2487 177, 178, 179, 180, 181, 182, 183, 184, 185, 186,
2488 187, 188, 189, 190, 191, 192, 193, 194, 195, 196,
2489 197, 198, 199, 0, 0, 0, 0, 0, 0, 0,
2490 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2491 77, 0, 78, 200, 201, 202, 0, 0, 203, 204,
2492 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
2493 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
2494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2495 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2496 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2500 static const yytype_int16 yycheck[] =
2502 0, 27, 129, 165, 0, 243, 4, 177, 270, 271,
2503 11, 21, 11, 202, 34, 55, 28, 17, 455, 29,
2504 166, 17, 443, 444, 55, 470, 321, 55, 217, 218,
2505 219, 220, 221, 178, 198, 121, 11, 659, 227, 42,
2506 43, 44, 45, 46, 47, 48, 49, 199, 51, 160,
2507 34, 160, 78, 160, 11, 159, 167, 679, 55, 159,
2508 169, 55, 169, 55, 150, 55, 3, 4, 5, 6,
2509 54, 53, 160, 160, 59, 155, 102, 55, 55, 54,
2510 106, 169, 169, 55, 229, 165, 112, 69, 18, 26,
2511 27, 160, 118, 93, 258, 160, 260, 54, 244, 245,
2512 169, 160, 159, 129, 169, 41, 42, 259, 167, 261,
2513 32, 33, 48, 534, 376, 141, 142, 157, 54, 145,
2514 160, 161, 142, 143, 144, 151, 157, 147, 160, 157,
2515 159, 151, 152, 165, 165, 397, 398, 399, 19, 167,
2516 11, 22, 20, 24, 581, 23, 17, 592, 0, 175,
2517 339, 154, 155, 156, 599, 600, 168, 118, 119, 169,
2518 157, 158, 289, 157, 165, 157, 165, 157, 159, 163,
2519 168, 161, 168, 54, 200, 201, 202, 203, 615, 157,
2520 157, 22, 160, 161, 161, 157, 158, 154, 155, 156,
2521 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
2522 226, 227, 282, 114, 115, 285, 286, 163, 288, 235,
2523 337, 38, 7, 8, 509, 477, 405, 21, 663, 664,
2524 246, 666, 667, 22, 19, 20, 160, 22, 23, 24,
2525 22, 165, 421, 160, 423, 424, 425, 46, 165, 48,
2526 22, 122, 123, 323, 689, 690, 3, 4, 5, 6,
2527 157, 331, 332, 333, 334, 335, 551, 35, 553, 37,
2528 4, 142, 143, 289, 145, 146, 4, 148, 149, 150,
2529 42, 43, 44, 19, 300, 47, 22, 42, 24, 44,
2530 366, 367, 368, 369, 370, 371, 372, 37, 158, 164,
2531 160, 317, 318, 319, 157, 381, 382, 383, 460, 537,
2532 142, 143, 144, 164, 158, 147, 160, 84, 85, 151,
2533 152, 337, 338, 339, 161, 142, 143, 144, 4, 158,
2534 147, 160, 617, 22, 151, 152, 158, 160, 160, 409,
2535 410, 411, 412, 413, 158, 158, 160, 167, 4, 419,
2536 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
2537 376, 158, 432, 433, 157, 9, 9, 9, 9, 385,
2538 446, 447, 448, 449, 9, 554, 9, 55, 557, 558,
2539 559, 457, 62, 63, 64, 65, 66, 67, 68, 405,
2540 460, 57, 11, 167, 158, 54, 157, 157, 157, 157,
2541 157, 157, 22, 157, 157, 421, 422, 423, 424, 425,
2542 160, 639, 160, 157, 157, 431, 644, 38, 157, 160,
2543 490, 4, 492, 160, 38, 495, 157, 160, 160, 445,
2544 160, 157, 157, 157, 61, 505, 506, 160, 22, 160,
2545 160, 163, 160, 519, 520, 521, 522, 160, 524, 160,
2546 160, 160, 528, 529, 160, 160, 160, 160, 160, 160,
2547 167, 477, 160, 122, 123, 160, 38, 160, 158, 285,
2548 286, 22, 288, 17, 544, 545, 636, 547, 548, 549,
2549 550, 17, 157, 142, 143, 555, 145, 146, 504, 148,
2550 149, 150, 160, 563, 510, 571, 572, 573, 574, 569,
2551 660, 4, 160, 0, 4, 160, 160, 323, 160, 160,
2552 160, 160, 160, 4, 530, 331, 332, 333, 334, 335,
2553 536, 18, 19, 20, 160, 22, 23, 24, 157, 160,
2554 546, 4, 160, 30, 31, 160, 160, 160, 554, 22,
2555 610, 557, 558, 559, 4, 535, 622, 160, 624, 625,
2556 566, 167, 0, 160, 160, 52, 167, 158, 54, 56,
2557 160, 160, 158, 60, 158, 22, 163, 637, 638, 167,
2558 18, 19, 20, 160, 22, 23, 24, 165, 158, 158,
2559 158, 158, 30, 31, 26, 27, 54, 657, 17, 165,
2560 158, 158, 158, 409, 410, 411, 412, 413, 4, 153,
2561 157, 157, 22, 419, 52, 160, 17, 17, 56, 17,
2562 160, 74, 60, 683, 684, 17, 432, 433, 688, 132,
2563 132, 691, 132, 630, 640, 235, 93, 697, 112, 593,
2564 700, 106, 17, 57, 246, 90, 566, -1, 450, -1,
2565 630, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2566 16, 17, -1, 19, 20, -1, 22, 23, 24, 101,
2567 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
2568 112, 113, 114, -1, 490, -1, 492, -1, -1, 495,
2569 -1, -1, -1, -1, 50, -1, -1, -1, -1, 505,
2570 506, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2571 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2572 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2573 -1, -1, -1, -1, -1, -1, -1, -1, 544, 545,
2574 -1, 547, 548, 549, 550, -1, -1, -1, -1, 555,
2575 -1, -1, -1, -1, -1, -1, -1, 563, -1, -1,
2576 -1, -1, -1, 569, -1, -1, -1, -1, -1, -1,
2577 -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
2578 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2579 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2580 24, 25, 26, 27, 610, -1, 162, 163, -1, -1,
2581 166, -1, 168, 169, -1, -1, 40, 41, -1, -1,
2582 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2583 54, 637, 638, 7, 8, 59, 10, 11, 12, 13,
2584 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2585 24, 657, 76, 77, 78, 79, 80, 81, 82, 83,
2586 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2587 94, -1, -1, -1, -1, -1, 50, 683, 684, -1,
2588 -1, -1, 688, -1, -1, 691, -1, -1, -1, -1,
2589 -1, 697, -1, -1, 700, -1, 120, 121, 122, 123,
2590 124, 125, 126, 127, 128, 129, 130, 131, 132, -1,
2591 134, -1, 136, 137, 138, -1, 140, 141, 142, 143,
2592 -1, 145, 146, -1, 148, 149, 150, -1, -1, -1,
2593 -1, 3, 4, 5, 6, 7, 8, 9, -1, 163,
2594 -1, -1, 166, -1, 168, -1, 170, 19, 20, -1,
2595 22, 23, 24, 25, 26, 27, -1, -1, -1, -1,
2596 -1, -1, -1, -1, -1, -1, -1, -1, 40, 41,
2597 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2598 -1, -1, -1, 55, -1, -1, -1, 59, 162, 163,
2599 -1, -1, 166, -1, 168, 169, -1, -1, -1, -1,
2600 -1, -1, -1, -1, 76, 77, 78, 79, 80, 81,
2601 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2602 92, 93, 94, -1, -1, -1, -1, -1, -1, -1,
2603 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2604 -1, -1, -1, -1, -1, -1, -1, -1, 120, 121,
2605 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2606 132, -1, 134, -1, 136, 137, 138, -1, 140, 141,
2607 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2608 -1, -1, -1, -1, -1, 157, -1, -1, -1, -1,
2609 -1, 163, -1, -1, 166, -1, 168, -1, 170, 3,
2610 4, 5, 6, 7, 8, 9, -1, -1, -1, -1,
2611 -1, -1, -1, -1, -1, 19, 20, -1, 22, 23,
2612 24, 25, 26, 27, -1, -1, -1, -1, -1, -1,
2613 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
2614 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2615 -1, -1, -1, 7, 8, 59, 10, 11, 12, 13,
2616 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2617 24, -1, 76, 77, 78, 79, 80, 81, 82, 83,
2618 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
2619 94, -1, -1, -1, -1, -1, 50, 7, 8, -1,
2620 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2621 20, -1, 22, 23, 24, -1, 120, 121, 122, 123,
2622 124, 125, 126, 127, 128, 129, 130, 131, 132, -1,
2623 134, -1, 136, 137, 138, -1, 140, 141, -1, -1,
2624 50, -1, -1, -1, -1, 3, 4, 5, 6, -1,
2625 -1, 9, -1, -1, -1, -1, -1, -1, -1, 163,
2626 -1, -1, 166, -1, 168, -1, 170, 25, 26, 27,
2627 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2628 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2629 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2630 -1, 59, -1, -1, -1, -1, -1, -1, 162, 163,
2631 -1, -1, 166, -1, 168, 169, -1, -1, 76, 77,
2632 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2633 88, 89, 90, 91, 92, 93, 94, -1, -1, -1,
2634 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2635 -1, -1, 162, 163, -1, -1, 166, -1, 168, 169,
2636 -1, -1, 120, 121, 122, 123, 124, 125, 126, 127,
2637 128, 129, 130, 131, 132, -1, 134, -1, 136, 137,
2638 138, -1, 140, 141, 7, 8, -1, -1, -1, -1,
2639 -1, -1, -1, -1, -1, -1, 19, 20, -1, 22,
2640 23, 24, 25, -1, -1, 163, -1, -1, 166, -1,
2641 168, -1, 170, -1, -1, -1, -1, 40, 41, -1,
2642 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2643 7, 8, 55, 10, 11, 12, 13, 14, 15, 16,
2644 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2645 -1, -1, -1, 76, 77, 78, 79, 80, 81, 82,
2646 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2647 93, 94, -1, 50, -1, -1, 7, 8, -1, 10,
2648 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2649 -1, 22, 23, 24, -1, -1, -1, 120, 121, 122,
2650 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
2651 -1, 134, -1, 136, 137, 138, -1, 140, 141, 50,
2652 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2653 -1, -1, -1, -1, 157, -1, 7, 8, 161, -1,
2654 163, -1, -1, 166, -1, 168, -1, 170, 19, 20,
2655 -1, 22, 23, 24, 25, -1, -1, -1, -1, -1,
2656 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2657 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2658 -1, -1, -1, -1, 55, 162, 163, -1, -1, 166,
2659 -1, 168, 169, -1, -1, -1, -1, -1, -1, -1,
2660 -1, -1, -1, -1, -1, 76, 77, 78, 79, 80,
2661 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2662 91, 92, 93, 94, -1, -1, -1, -1, -1, -1,
2663 -1, 162, 163, -1, -1, 166, -1, 168, 169, -1,
2664 -1, -1, -1, -1, -1, -1, -1, -1, -1, 120,
2665 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2666 131, 132, -1, 134, -1, 136, 137, 138, -1, 140,
2667 141, -1, 7, 8, -1, 10, 11, 12, 13, 14,
2668 15, 16, 17, -1, 19, 20, 157, 22, 23, 24,
2669 -1, -1, 163, -1, -1, 166, -1, 168, -1, 170,
2670 -1, -1, -1, -1, 39, -1, -1, -1, -1, -1,
2671 -1, -1, -1, 7, 8, 50, 10, 11, 12, 13,
2672 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2673 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2674 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2675 -1, -1, -1, -1, -1, -1, 50, -1, -1, -1,
2676 -1, -1, -1, 39, -1, -1, -1, -1, -1, -1,
2677 -1, -1, 7, 8, 50, 10, 11, 12, 13, 14,
2678 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2679 -1, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2680 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2681 -1, -1, -1, -1, -1, 50, -1, -1, -1, -1,
2682 -1, -1, -1, 39, -1, -1, -1, 162, 163, -1,
2683 -1, 166, 126, 168, 50, 7, 8, -1, 10, 11,
2684 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2685 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2686 -1, -1, -1, -1, -1, -1, -1, -1, 162, 163,
2687 -1, -1, 166, -1, 168, -1, -1, -1, 50, -1,
2688 -1, -1, -1, -1, -1, -1, 162, 163, -1, -1,
2689 166, -1, 168, 7, 8, -1, 10, 11, 12, 13,
2690 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2691 24, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2692 -1, -1, -1, -1, -1, 39, -1, 162, 163, -1,
2693 165, 166, -1, 168, -1, -1, 50, -1, -1, -1,
2694 -1, -1, -1, -1, -1, -1, 162, 163, -1, -1,
2695 166, -1, 168, -1, 7, 8, -1, 10, 11, 12,
2696 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2697 23, 24, 7, 8, -1, 10, 11, 12, 13, 14,
2698 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2699 162, 163, -1, 165, 166, -1, 168, 50, -1, -1,
2700 -1, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2701 16, 17, -1, 19, 20, 50, 22, 23, 24, 7,
2702 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2703 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2704 -1, -1, -1, -1, 50, -1, -1, -1, 162, 163,
2705 -1, -1, 166, -1, 168, -1, -1, -1, -1, -1,
2706 7, 8, 50, 10, 11, 12, 13, 14, 15, 16,
2707 17, -1, 19, 20, -1, 22, 23, 24, 7, 8,
2708 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2709 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2710 -1, -1, -1, 50, -1, -1, -1, -1, -1, 162,
2711 163, -1, -1, 166, -1, 168, -1, -1, -1, -1,
2712 -1, 50, -1, -1, -1, -1, -1, 162, 163, -1,
2713 -1, 166, -1, 168, 7, 8, -1, 10, 11, 12,
2714 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2715 23, 24, -1, -1, -1, -1, 162, 163, -1, -1,
2716 166, -1, 168, -1, -1, -1, -1, -1, -1, -1,
2717 -1, -1, -1, -1, 162, 163, -1, 50, 166, -1,
2718 168, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2719 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2720 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2721 -1, -1, -1, -1, -1, 162, 163, -1, -1, 166,
2722 -1, 168, -1, -1, 50, -1, -1, -1, -1, -1,
2723 -1, -1, -1, 162, 163, -1, -1, 166, -1, 168,
2724 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2725 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2726 -1, -1, -1, -1, 36, -1, -1, -1, -1, -1,
2727 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2728 -1, -1, -1, 50, -1, 57, 58, -1, -1, 162,
2729 163, -1, -1, 166, -1, 168, -1, -1, 70, 71,
2730 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
2731 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2732 92, 93, 94, -1, -1, -1, -1, -1, -1, -1,
2733 -1, -1, -1, -1, -1, -1, 162, 163, -1, -1,
2734 166, -1, 168, 115, 116, 117, -1, -1, 120, 121,
2735 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2736 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
2737 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2738 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2739 -1, -1, -1, -1, -1, 162, 163, -1, -1, 166,
2743 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2744 symbol of state STATE-NUM. */
2745 static const yytype_uint16 yystos[] =
2747 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2748 60, 179, 182, 183, 184, 185, 217, 218, 219, 221,
2749 220, 53, 69, 226, 159, 59, 159, 18, 159, 42,
2750 43, 44, 45, 46, 47, 48, 49, 51, 154, 155,
2751 156, 186, 187, 188, 0, 219, 46, 48, 189, 236,
2752 42, 43, 44, 47, 190, 233, 235, 243, 159, 159,
2753 163, 227, 22, 225, 7, 8, 10, 11, 12, 13,
2754 14, 15, 16, 17, 50, 162, 163, 166, 168, 179,
2755 183, 204, 205, 239, 188, 188, 35, 37, 215, 188,
2756 188, 21, 244, 245, 29, 169, 234, 244, 22, 22,
2757 22, 228, 157, 4, 4, 4, 168, 10, 169, 205,
2758 210, 55, 157, 181, 215, 215, 42, 44, 191, 32,
2759 33, 214, 62, 63, 64, 65, 66, 67, 68, 192,
2760 231, 231, 182, 248, 160, 165, 39, 205, 206, 208,
2761 209, 164, 164, 169, 210, 160, 169, 157, 209, 161,
2762 214, 214, 10, 126, 205, 207, 216, 11, 12, 13,
2763 14, 15, 16, 177, 178, 205, 211, 4, 207, 28,
2764 168, 232, 36, 57, 58, 70, 71, 72, 73, 74,
2765 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2766 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
2767 115, 116, 117, 120, 121, 122, 123, 124, 125, 126,
2768 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2769 137, 138, 139, 140, 141, 172, 173, 174, 246, 253,
2770 254, 255, 256, 22, 194, 160, 158, 205, 205, 167,
2771 169, 205, 4, 158, 211, 205, 157, 239, 26, 27,
2772 3, 4, 5, 6, 9, 25, 40, 41, 91, 92,
2773 93, 94, 120, 134, 136, 137, 138, 140, 141, 163,
2774 166, 168, 170, 172, 173, 174, 212, 239, 181, 183,
2775 57, 10, 205, 241, 242, 11, 17, 11, 177, 192,
2776 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
2777 175, 26, 27, 101, 102, 103, 104, 105, 106, 107,
2778 108, 109, 110, 111, 112, 113, 114, 176, 175, 176,
2779 205, 205, 241, 205, 205, 249, 241, 241, 241, 241,
2780 241, 205, 205, 205, 205, 205, 241, 192, 118, 119,
2781 54, 122, 123, 142, 143, 145, 146, 148, 149, 150,
2782 193, 39, 206, 196, 165, 167, 167, 158, 196, 181,
2783 181, 216, 175, 176, 175, 176, 157, 157, 157, 157,
2784 157, 157, 157, 165, 211, 213, 168, 213, 169, 213,
2785 22, 157, 157, 157, 222, 157, 3, 4, 5, 6,
2786 9, 25, 26, 27, 40, 41, 59, 163, 166, 168,
2787 170, 212, 238, 239, 240, 160, 240, 240, 240, 207,
2788 205, 205, 205, 205, 160, 199, 160, 199, 240, 163,
2789 160, 160, 160, 160, 160, 160, 240, 240, 240, 240,
2790 240, 38, 207, 205, 241, 4, 142, 143, 144, 147,
2791 151, 152, 195, 223, 224, 38, 157, 157, 157, 157,
2792 211, 211, 211, 211, 211, 211, 211, 160, 165, 169,
2793 205, 213, 167, 169, 211, 211, 211, 160, 202, 39,
2794 205, 229, 230, 61, 237, 165, 213, 168, 213, 169,
2795 213, 22, 241, 160, 160, 240, 240, 240, 240, 240,
2796 11, 54, 11, 251, 240, 163, 241, 205, 241, 241,
2797 241, 160, 160, 252, 160, 160, 160, 205, 240, 240,
2798 160, 202, 202, 205, 211, 211, 211, 211, 251, 160,
2799 160, 160, 160, 252, 160, 211, 167, 169, 160, 160,
2800 38, 34, 54, 200, 203, 194, 160, 158, 22, 165,
2801 169, 213, 167, 169, 17, 17, 157, 160, 160, 160,
2802 160, 240, 4, 240, 160, 160, 240, 160, 160, 160,
2803 4, 4, 160, 205, 240, 240, 157, 160, 199, 205,
2804 158, 160, 160, 160, 160, 158, 211, 211, 211, 211,
2805 158, 211, 167, 211, 211, 205, 22, 4, 202, 179,
2806 180, 39, 205, 196, 160, 167, 169, 240, 240, 17,
2807 205, 250, 240, 240, 240, 240, 199, 199, 241, 240,
2808 160, 241, 241, 241, 4, 240, 250, 240, 211, 211,
2809 211, 211, 160, 158, 160, 160, 252, 158, 158, 158,
2810 194, 200, 201, 22, 167, 160, 163, 194, 194, 158,
2811 160, 165, 240, 252, 158, 199, 158, 158, 158, 158,
2812 211, 211, 211, 158, 180, 54, 198, 17, 165, 177,
2813 247, 122, 123, 240, 240, 196, 17, 205, 165, 196,
2814 158, 158, 158, 4, 153, 197, 240, 238, 165, 177,
2815 194, 194, 38, 194, 194, 22, 160, 238, 17, 240,
2816 240, 17, 160, 240, 194, 194, 240, 17, 74, 240,
2820 #define yyerrok (yyerrstatus = 0)
2821 #define yyclearin (yychar = YYEMPTY)
2822 #define YYEMPTY (-2)
2825 #define YYACCEPT goto yyacceptlab
2826 #define YYABORT goto yyabortlab
2827 #define YYERROR goto yyerrorlab
2830 /* Like YYERROR except do call yyerror. This remains here temporarily
2831 to ease the transition to the new meaning of YYERROR, for GCC.
2832 Once GCC version 2 has supplanted version 1, this can go. */
2834 #define YYFAIL goto yyerrlab
2836 #define YYRECOVERING() (!!yyerrstatus)
2838 #define YYBACKUP(Token, Value) \
2840 if (yychar == YYEMPTY && yylen == 1) \
2844 yytoken = YYTRANSLATE (yychar); \
2850 yyerror (YY_("syntax error: cannot back up")); \
2857 #define YYERRCODE 256
2860 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2861 If N is 0, then set CURRENT to the empty location which ends
2862 the previous symbol: RHS[0] (always defined). */
2864 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2865 #ifndef YYLLOC_DEFAULT
2866 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2870 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2871 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2872 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2873 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2877 (Current).first_line = (Current).last_line = \
2878 YYRHSLOC (Rhs, 0).last_line; \
2879 (Current).first_column = (Current).last_column = \
2880 YYRHSLOC (Rhs, 0).last_column; \
2886 /* YY_LOCATION_PRINT -- Print the location on the stream.
2887 This macro was not mandated originally: define only if we know
2888 we won't break user code: when these are the locations we know. */
2890 #ifndef YY_LOCATION_PRINT
2891 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2892 # define YY_LOCATION_PRINT(File, Loc) \
2893 fprintf (File, "%d.%d-%d.%d", \
2894 (Loc).first_line, (Loc).first_column, \
2895 (Loc).last_line, (Loc).last_column)
2897 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2902 /* YYLEX -- calling `yylex' with the right arguments. */
2905 # define YYLEX yylex (YYLEX_PARAM)
2907 # define YYLEX yylex ()
2910 /* Enable debugging if requested. */
2914 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2915 # define YYFPRINTF fprintf
2918 # define YYDPRINTF(Args) \
2924 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2928 YYFPRINTF (stderr, "%s ", Title); \
2929 yy_symbol_print (stderr, \
2931 YYFPRINTF (stderr, "\n"); \
2936 /*--------------------------------.
2937 | Print this symbol on YYOUTPUT. |
2938 `--------------------------------*/
2941 #if (defined __STDC__ || defined __C99__FUNC__ \
2942 || defined __cplusplus || defined _MSC_VER)
2944 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2947 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2950 YYSTYPE const * const yyvaluep;
2956 if (yytype < YYNTOKENS)
2957 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2969 /*--------------------------------.
2970 | Print this symbol on YYOUTPUT. |
2971 `--------------------------------*/
2973 #if (defined __STDC__ || defined __C99__FUNC__ \
2974 || defined __cplusplus || defined _MSC_VER)
2976 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2979 yy_symbol_print (yyoutput, yytype, yyvaluep)
2982 YYSTYPE const * const yyvaluep;
2985 if (yytype < YYNTOKENS)
2986 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2988 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2990 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2991 YYFPRINTF (yyoutput, ")");
2994 /*------------------------------------------------------------------.
2995 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2997 `------------------------------------------------------------------*/
2999 #if (defined __STDC__ || defined __C99__FUNC__ \
3000 || defined __cplusplus || defined _MSC_VER)
3002 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3005 yy_stack_print (bottom, top)
3006 yytype_int16 *bottom;
3010 YYFPRINTF (stderr, "Stack now");
3011 for (; bottom <= top; ++bottom)
3012 YYFPRINTF (stderr, " %d", *bottom);
3013 YYFPRINTF (stderr, "\n");
3016 # define YY_STACK_PRINT(Bottom, Top) \
3019 yy_stack_print ((Bottom), (Top)); \
3023 /*------------------------------------------------.
3024 | Report that the YYRULE is going to be reduced. |
3025 `------------------------------------------------*/
3027 #if (defined __STDC__ || defined __C99__FUNC__ \
3028 || defined __cplusplus || defined _MSC_VER)
3030 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3033 yy_reduce_print (yyvsp, yyrule)
3038 int yynrhs = yyr2[yyrule];
3040 unsigned long int yylno = yyrline[yyrule];
3041 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3043 /* The symbols being reduced. */
3044 for (yyi = 0; yyi < yynrhs; yyi++)
3046 fprintf (stderr, " $%d = ", yyi + 1);
3047 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3048 &(yyvsp[(yyi + 1) - (yynrhs)])
3050 fprintf (stderr, "\n");
3054 # define YY_REDUCE_PRINT(Rule) \
3057 yy_reduce_print (yyvsp, Rule); \
3060 /* Nonzero means print parse trace. It is left uninitialized so that
3061 multiple parsers can coexist. */
3063 #else /* !YYDEBUG */
3064 # define YYDPRINTF(Args)
3065 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3066 # define YY_STACK_PRINT(Bottom, Top)
3067 # define YY_REDUCE_PRINT(Rule)
3068 #endif /* !YYDEBUG */
3071 /* YYINITDEPTH -- initial size of the parser's stacks. */
3073 # define YYINITDEPTH 200
3076 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3077 if the built-in stack extension method is used).
3079 Do not make this value too large; the results are undefined if
3080 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3081 evaluated with infinite-precision integer arithmetic. */
3084 # define YYMAXDEPTH 10000
3092 # if defined __GLIBC__ && defined _STRING_H
3093 # define yystrlen strlen
3095 /* Return the length of YYSTR. */
3096 #if (defined __STDC__ || defined __C99__FUNC__ \
3097 || defined __cplusplus || defined _MSC_VER)
3099 yystrlen (const char *yystr)
3107 for (yylen = 0; yystr[yylen]; yylen++)
3115 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3116 # define yystpcpy stpcpy
3118 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3120 #if (defined __STDC__ || defined __C99__FUNC__ \
3121 || defined __cplusplus || defined _MSC_VER)
3123 yystpcpy (char *yydest, const char *yysrc)
3126 yystpcpy (yydest, yysrc)
3132 const char *yys = yysrc;
3134 while ((*yyd++ = *yys++) != '\0')
3143 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3144 quotes and backslashes, so that it's suitable for yyerror. The
3145 heuristic is that double-quoting is unnecessary unless the string
3146 contains an apostrophe, a comma, or backslash (other than
3147 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3148 null, do not copy; instead, return the length of what the result
3151 yytnamerr (char *yyres, const char *yystr)
3156 char const *yyp = yystr;
3163 goto do_not_strip_quotes;
3167 goto do_not_strip_quotes;
3180 do_not_strip_quotes: ;
3184 return yystrlen (yystr);
3186 return yystpcpy (yyres, yystr) - yyres;
3190 /* Copy into YYRESULT an error message about the unexpected token
3191 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3192 including the terminating null byte. If YYRESULT is null, do not
3193 copy anything; just return the number of bytes that would be
3194 copied. As a special case, return 0 if an ordinary "syntax error"
3195 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3196 size calculation. */
3198 yysyntax_error (char *yyresult, int yystate, int yychar)
3200 int yyn = yypact[yystate];
3202 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3206 int yytype = YYTRANSLATE (yychar);
3207 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3208 YYSIZE_T yysize = yysize0;
3210 int yysize_overflow = 0;
3211 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3212 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3216 /* This is so xgettext sees the translatable formats that are
3217 constructed on the fly. */
3218 YY_("syntax error, unexpected %s");
3219 YY_("syntax error, unexpected %s, expecting %s");
3220 YY_("syntax error, unexpected %s, expecting %s or %s");
3221 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3222 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3226 static char const yyunexpected[] = "syntax error, unexpected %s";
3227 static char const yyexpecting[] = ", expecting %s";
3228 static char const yyor[] = " or %s";
3229 char yyformat[sizeof yyunexpected
3230 + sizeof yyexpecting - 1
3231 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3232 * (sizeof yyor - 1))];
3233 char const *yyprefix = yyexpecting;
3235 /* Start YYX at -YYN if negative to avoid negative indexes in
3237 int yyxbegin = yyn < 0 ? -yyn : 0;
3239 /* Stay within bounds of both yycheck and yytname. */
3240 int yychecklim = YYLAST - yyn + 1;
3241 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3244 yyarg[0] = yytname[yytype];
3245 yyfmt = yystpcpy (yyformat, yyunexpected);
3247 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3248 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3250 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3254 yyformat[sizeof yyunexpected - 1] = '\0';
3257 yyarg[yycount++] = yytname[yyx];
3258 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3259 yysize_overflow |= (yysize1 < yysize);
3261 yyfmt = yystpcpy (yyfmt, yyprefix);
3265 yyf = YY_(yyformat);
3266 yysize1 = yysize + yystrlen (yyf);
3267 yysize_overflow |= (yysize1 < yysize);
3270 if (yysize_overflow)
3271 return YYSIZE_MAXIMUM;
3275 /* Avoid sprintf, as that infringes on the user's name space.
3276 Don't have undefined behavior even if the translation
3277 produced a string with the wrong number of "%s"s. */
3278 char *yyp = yyresult;
3280 while ((*yyp = *yyf) != '\0')
3282 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3284 yyp += yytnamerr (yyp, yyarg[yyi++]);
3297 #endif /* YYERROR_VERBOSE */
3300 /*-----------------------------------------------.
3301 | Release the memory associated to this symbol. |
3302 `-----------------------------------------------*/
3305 #if (defined __STDC__ || defined __C99__FUNC__ \
3306 || defined __cplusplus || defined _MSC_VER)
3308 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3311 yydestruct (yymsg, yytype, yyvaluep)
3321 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3332 /* Prevent warnings from -Wmissing-prototypes. */
3334 #ifdef YYPARSE_PARAM
3335 #if defined __STDC__ || defined __cplusplus
3336 int yyparse (void *YYPARSE_PARAM);
3340 #else /* ! YYPARSE_PARAM */
3341 #if defined __STDC__ || defined __cplusplus
3346 #endif /* ! YYPARSE_PARAM */
3350 /* The look-ahead symbol. */
3353 /* The semantic value of the look-ahead symbol. */
3356 /* Number of syntax errors so far. */
3365 #ifdef YYPARSE_PARAM
3366 #if (defined __STDC__ || defined __C99__FUNC__ \
3367 || defined __cplusplus || defined _MSC_VER)
3369 yyparse (void *YYPARSE_PARAM)
3372 yyparse (YYPARSE_PARAM)
3373 void *YYPARSE_PARAM;
3375 #else /* ! YYPARSE_PARAM */
3376 #if (defined __STDC__ || defined __C99__FUNC__ \
3377 || defined __cplusplus || defined _MSC_VER)
3391 /* Number of tokens to shift before error messages enabled. */
3393 /* Look-ahead token as an internal (translated) token number. */
3396 /* Buffer for error messages, and its allocated size. */
3398 char *yymsg = yymsgbuf;
3399 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3402 /* Three stacks and their tools:
3403 `yyss': related to states,
3404 `yyvs': related to semantic values,
3405 `yyls': related to locations.
3407 Refer to the stacks thru separate pointers, to allow yyoverflow
3408 to reallocate them elsewhere. */
3410 /* The state stack. */
3411 yytype_int16 yyssa[YYINITDEPTH];
3412 yytype_int16 *yyss = yyssa;
3413 yytype_int16 *yyssp;
3415 /* The semantic value stack. */
3416 YYSTYPE yyvsa[YYINITDEPTH];
3417 YYSTYPE *yyvs = yyvsa;
3422 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3424 YYSIZE_T yystacksize = YYINITDEPTH;
3426 /* The variables used to return semantic value and location from the
3431 /* The number of symbols on the RHS of the reduced rule.
3432 Keep to zero when no symbol should be popped. */
3435 YYDPRINTF ((stderr, "Starting parse\n"));
3440 yychar = YYEMPTY; /* Cause a token to be read. */
3442 /* Initialize stack pointers.
3443 Waste one element of value and location stack
3444 so that they stay on the same level as the state stack.
3445 The wasted elements are never initialized. */
3452 /*------------------------------------------------------------.
3453 | yynewstate -- Push a new state, which is found in yystate. |
3454 `------------------------------------------------------------*/
3456 /* In all cases, when you get here, the value and location stacks
3457 have just been pushed. So pushing a state here evens the stacks. */
3463 if (yyss + yystacksize - 1 <= yyssp)
3465 /* Get the current used size of the three stacks, in elements. */
3466 YYSIZE_T yysize = yyssp - yyss + 1;
3470 /* Give user a chance to reallocate the stack. Use copies of
3471 these so that the &'s don't force the real ones into
3473 YYSTYPE *yyvs1 = yyvs;
3474 yytype_int16 *yyss1 = yyss;
3477 /* Each stack pointer address is followed by the size of the
3478 data in use in that stack, in bytes. This used to be a
3479 conditional around just the two extra args, but that might
3480 be undefined if yyoverflow is a macro. */
3481 yyoverflow (YY_("memory exhausted"),
3482 &yyss1, yysize * sizeof (*yyssp),
3483 &yyvs1, yysize * sizeof (*yyvsp),
3490 #else /* no yyoverflow */
3491 # ifndef YYSTACK_RELOCATE
3492 goto yyexhaustedlab;
3494 /* Extend the stack our own way. */
3495 if (YYMAXDEPTH <= yystacksize)
3496 goto yyexhaustedlab;
3498 if (YYMAXDEPTH < yystacksize)
3499 yystacksize = YYMAXDEPTH;
3502 yytype_int16 *yyss1 = yyss;
3503 union yyalloc *yyptr =
3504 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3506 goto yyexhaustedlab;
3507 YYSTACK_RELOCATE (yyss);
3508 YYSTACK_RELOCATE (yyvs);
3510 # undef YYSTACK_RELOCATE
3512 YYSTACK_FREE (yyss1);
3515 #endif /* no yyoverflow */
3517 yyssp = yyss + yysize - 1;
3518 yyvsp = yyvs + yysize - 1;
3521 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3522 (unsigned long int) yystacksize));
3524 if (yyss + yystacksize - 1 <= yyssp)
3528 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3537 /* Do appropriate processing given the current state. Read a
3538 look-ahead token if we need one and don't already have one. */
3540 /* First try to decide what to do without reference to look-ahead token. */
3541 yyn = yypact[yystate];
3542 if (yyn == YYPACT_NINF)
3545 /* Not known => get a look-ahead token if don't already have one. */
3547 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3548 if (yychar == YYEMPTY)
3550 YYDPRINTF ((stderr, "Reading a token: "));
3554 if (yychar <= YYEOF)
3556 yychar = yytoken = YYEOF;
3557 YYDPRINTF ((stderr, "Now at end of input.\n"));
3561 yytoken = YYTRANSLATE (yychar);
3562 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3565 /* If the proper action on seeing token YYTOKEN is to reduce or to
3566 detect an error, take that action. */
3568 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3573 if (yyn == 0 || yyn == YYTABLE_NINF)
3582 /* Count tokens shifted since error; after three, turn off error
3587 /* Shift the look-ahead token. */
3588 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3590 /* Discard the shifted token unless it is eof. */
3591 if (yychar != YYEOF)
3600 /*-----------------------------------------------------------.
3601 | yydefault -- do the default action for the current state. |
3602 `-----------------------------------------------------------*/
3604 yyn = yydefact[yystate];
3610 /*-----------------------------.
3611 | yyreduce -- Do a reduction. |
3612 `-----------------------------*/
3614 /* yyn is the number of a rule to reduce with. */
3617 /* If YYLEN is nonzero, implement the default value of the action:
3620 Otherwise, the following line sets YYVAL to garbage.
3621 This behavior is undocumented and Bison
3622 users should not rely upon it. Assigning to YYVAL
3623 unconditionally makes the parser a bit smaller, and it avoids a
3624 GCC warning that YYVAL may be used uninitialized. */
3625 yyval = yyvsp[1-yylen];
3628 YY_REDUCE_PRINT (yyn);
3632 #line 1139 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3633 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3637 #line 1139 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3638 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3642 #line 1140 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3643 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3647 #line 1140 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3648 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3652 #line 1141 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3653 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3657 #line 1141 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3658 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3662 #line 1142 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3663 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3667 #line 1142 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3668 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3672 #line 1143 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3673 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3677 #line 1143 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3678 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3682 #line 1147 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3683 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3687 #line 1147 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3688 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3692 #line 1148 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3693 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3697 #line 1148 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3698 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3702 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3703 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3707 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3708 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3712 #line 1150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3713 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3717 #line 1150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3718 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3722 #line 1151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3723 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3727 #line 1151 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3728 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3732 #line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3733 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3737 #line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3738 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3742 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3743 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3747 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3748 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3752 #line 1154 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3753 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3757 #line 1155 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3758 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3762 #line 1164 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3763 { (yyval.StrVal) = 0; ;}
3767 #line 1166 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3768 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3772 #line 1167 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3773 { (yyval.UIntVal)=0; ;}
3777 #line 1171 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3779 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3785 #line 1175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3793 #line 1183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3801 #line 1188 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3803 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3809 #line 1194 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3810 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3814 #line 1195 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3815 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3819 #line 1196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3820 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3824 #line 1197 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3825 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3829 #line 1198 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3830 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3834 #line 1199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3835 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3839 #line 1203 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3840 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3844 #line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3845 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3849 #line 1205 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3850 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3854 #line 1209 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3855 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3859 #line 1210 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3860 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3864 #line 1211 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3865 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3869 #line 1212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3870 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3874 #line 1216 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3875 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3879 #line 1217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3880 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3884 #line 1218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3885 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3889 #line 1222 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3890 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3894 #line 1223 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3895 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3899 #line 1224 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3900 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3904 #line 1225 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3905 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3909 #line 1226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3910 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3914 #line 1230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3915 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3919 #line 1231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3920 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3924 #line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3925 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3929 #line 1235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3930 { (yyval.UIntVal) = CallingConv::C; ;}
3934 #line 1236 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3935 { (yyval.UIntVal) = CallingConv::C; ;}
3939 #line 1237 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3940 { (yyval.UIntVal) = CallingConv::Fast; ;}
3944 #line 1238 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3945 { (yyval.UIntVal) = CallingConv::Cold; ;}
3949 #line 1239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3950 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3954 #line 1240 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3955 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3959 #line 1241 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3960 { (yyval.UIntVal) = CallingConv::X86_SSECall; ;}
3964 #line 1242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3966 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3967 GEN_ERROR("Calling conv too large");
3968 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3974 #line 1249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3975 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3979 #line 1250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3980 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3984 #line 1251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3985 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3989 #line 1252 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3990 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3994 #line 1253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3995 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3999 #line 1254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4000 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
4004 #line 1255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4005 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
4009 #line 1256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4010 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
4014 #line 1257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4015 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
4019 #line 1258 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4020 { (yyval.ParamAttrs) =
4021 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4025 #line 1262 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4026 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4030 #line 1263 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4032 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4037 #line 1268 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4038 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4042 #line 1269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4043 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4047 #line 1270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4048 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4052 #line 1271 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4053 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4057 #line 1272 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4058 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4062 #line 1273 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4063 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4067 #line 1276 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4068 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4072 #line 1277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4074 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4079 #line 1282 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4080 { (yyval.StrVal) = 0; ;}
4084 #line 1283 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4086 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4091 #line 1290 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4092 { (yyval.UIntVal) = 0; ;}
4096 #line 1291 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4098 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4099 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4100 GEN_ERROR("Alignment must be a power of two");
4106 #line 1297 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4107 { (yyval.UIntVal) = 0; ;}
4111 #line 1298 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4113 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4114 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4115 GEN_ERROR("Alignment must be a power of two");
4121 #line 1307 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4123 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4124 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4125 GEN_ERROR("Invalid character in section name");
4126 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4132 #line 1315 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4133 { (yyval.StrVal) = 0; ;}
4137 #line 1316 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4138 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4142 #line 1321 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4147 #line 1322 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4152 #line 1323 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4154 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4155 delete (yyvsp[(1) - (1)].StrVal);
4161 #line 1328 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4163 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4164 GEN_ERROR("Alignment must be a power of two");
4165 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4171 #line 1344 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4173 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4179 #line 1348 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4181 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4187 #line 1352 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4189 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4190 GEN_ERROR("Cannot form a pointer to a basic block");
4191 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4192 delete (yyvsp[(1) - (3)].TypeVal);
4198 #line 1359 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4199 { // Named types are also simple types...
4200 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4202 (yyval.TypeVal) = new PATypeHolder(tmp);
4207 #line 1364 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4208 { // Type UpReference
4209 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4210 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4211 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4212 (yyval.TypeVal) = new PATypeHolder(OT);
4213 UR_OUT("New Upreference!\n");
4219 #line 1372 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4221 // Allow but ignore attributes on function types; this permits auto-upgrade.
4222 // FIXME: remove in LLVM 3.0.
4223 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4224 if (!FunctionType::isValidReturnType(RetTy))
4225 GEN_ERROR("Invalid result type for LLVM function");
4227 std::vector<const Type*> Params;
4228 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4229 for (; I != E; ++I ) {
4230 const Type *Ty = I->Ty->get();
4231 Params.push_back(Ty);
4234 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4235 if (isVarArg) Params.pop_back();
4237 for (unsigned i = 0; i != Params.size(); ++i)
4238 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4239 GEN_ERROR("Function arguments must be value types!");
4243 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4244 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4245 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4246 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4252 #line 1401 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4254 // Allow but ignore attributes on function types; this permits auto-upgrade.
4255 // FIXME: remove in LLVM 3.0.
4256 std::vector<const Type*> Params;
4257 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4258 for ( ; I != E; ++I ) {
4259 const Type* Ty = I->Ty->get();
4260 Params.push_back(Ty);
4263 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4264 if (isVarArg) Params.pop_back();
4266 for (unsigned i = 0; i != Params.size(); ++i)
4267 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4268 GEN_ERROR("Function arguments must be value types!");
4272 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4273 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4274 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4280 #line 1426 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4281 { // Sized array type?
4282 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4283 delete (yyvsp[(4) - (5)].TypeVal);
4289 #line 1431 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4291 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4292 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4293 GEN_ERROR("Unsigned result not equal to signed result");
4294 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4295 GEN_ERROR("Element type of a VectorType must be primitive");
4296 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4297 delete (yyvsp[(4) - (5)].TypeVal);
4303 #line 1441 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4304 { // Structure type?
4305 std::vector<const Type*> Elements;
4306 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4307 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4308 Elements.push_back(*I);
4310 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4311 delete (yyvsp[(2) - (3)].TypeList);
4317 #line 1451 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4318 { // Empty structure type?
4319 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4325 #line 1455 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4327 std::vector<const Type*> Elements;
4328 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4329 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4330 Elements.push_back(*I);
4332 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4333 delete (yyvsp[(3) - (5)].TypeList);
4339 #line 1465 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4340 { // Empty structure type?
4341 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4347 #line 1472 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4349 // Allow but ignore attributes on function types; this permits auto-upgrade.
4350 // FIXME: remove in LLVM 3.0.
4351 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4352 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4357 #line 1481 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4359 if (!UpRefs.empty())
4360 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4361 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4362 GEN_ERROR("LLVM functions cannot return aggregate types");
4363 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4368 #line 1488 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4370 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4375 #line 1493 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4377 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4378 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4384 #line 1498 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4386 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4392 #line 1506 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4394 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4395 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4396 TWA.Ty = new PATypeHolder(Type::VoidTy);
4397 (yyval.TypeWithAttrsList)->push_back(TWA);
4403 #line 1513 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4405 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4406 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4407 TWA.Ty = new PATypeHolder(Type::VoidTy);
4408 (yyval.TypeWithAttrsList)->push_back(TWA);
4414 #line 1520 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4416 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4422 #line 1528 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4424 (yyval.TypeList) = new std::list<PATypeHolder>();
4425 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4426 delete (yyvsp[(1) - (1)].TypeVal);
4432 #line 1534 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4434 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4435 delete (yyvsp[(3) - (3)].TypeVal);
4441 #line 1546 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4442 { // Nonempty unsized arr
4443 if (!UpRefs.empty())
4444 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4445 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4447 GEN_ERROR("Cannot make array constant with type: '" +
4448 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4449 const Type *ETy = ATy->getElementType();
4450 uint64_t NumElements = ATy->getNumElements();
4452 // Verify that we have the correct size...
4453 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4454 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4455 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4456 utostr(NumElements) + "");
4458 // Verify all elements are correct type!
4459 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4460 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4461 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4462 ETy->getDescription() +"' as required!\nIt is of type '"+
4463 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4466 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4467 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4473 #line 1574 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4475 if (!UpRefs.empty())
4476 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4477 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4479 GEN_ERROR("Cannot make array constant with type: '" +
4480 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4482 uint64_t NumElements = ATy->getNumElements();
4483 if (NumElements != uint64_t(-1) && NumElements != 0)
4484 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4485 " arguments, but has size of " + utostr(NumElements) +"");
4486 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4487 delete (yyvsp[(1) - (3)].TypeVal);
4493 #line 1590 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4495 if (!UpRefs.empty())
4496 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4497 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4499 GEN_ERROR("Cannot make array constant with type: '" +
4500 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4502 uint64_t NumElements = ATy->getNumElements();
4503 const Type *ETy = ATy->getElementType();
4504 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4505 GEN_ERROR("Can't build string constant of size " +
4506 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4507 " when array has size " + utostr(NumElements) + "");
4508 std::vector<Constant*> Vals;
4509 if (ETy == Type::Int8Ty) {
4510 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4511 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4513 delete (yyvsp[(3) - (3)].StrVal);
4514 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4516 delete (yyvsp[(3) - (3)].StrVal);
4517 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4518 delete (yyvsp[(1) - (3)].TypeVal);
4524 #line 1617 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4525 { // Nonempty unsized arr
4526 if (!UpRefs.empty())
4527 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4528 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4530 GEN_ERROR("Cannot make packed constant with type: '" +
4531 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4532 const Type *ETy = PTy->getElementType();
4533 unsigned NumElements = PTy->getNumElements();
4535 // Verify that we have the correct size...
4536 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4537 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4538 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4539 utostr(NumElements) + "");
4541 // Verify all elements are correct type!
4542 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4543 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4544 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4545 ETy->getDescription() +"' as required!\nIt is of type '"+
4546 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4549 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4550 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4556 #line 1645 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4558 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4560 GEN_ERROR("Cannot make struct constant with type: '" +
4561 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4563 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4564 GEN_ERROR("Illegal number of initializers for structure type");
4566 // Check to ensure that constants are compatible with the type initializer!
4567 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4568 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4569 GEN_ERROR("Expected type '" +
4570 STy->getElementType(i)->getDescription() +
4571 "' for element #" + utostr(i) +
4572 " of structure initializer");
4574 // Check to ensure that Type is not packed
4575 if (STy->isPacked())
4576 GEN_ERROR("Unpacked Initializer to vector type '" +
4577 STy->getDescription() + "'");
4579 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4580 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4586 #line 1671 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4588 if (!UpRefs.empty())
4589 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4590 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4592 GEN_ERROR("Cannot make struct constant with type: '" +
4593 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4595 if (STy->getNumContainedTypes() != 0)
4596 GEN_ERROR("Illegal number of initializers for structure type");
4598 // Check to ensure that Type is not packed
4599 if (STy->isPacked())
4600 GEN_ERROR("Unpacked Initializer to vector type '" +
4601 STy->getDescription() + "'");
4603 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4604 delete (yyvsp[(1) - (3)].TypeVal);
4610 #line 1691 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4612 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4614 GEN_ERROR("Cannot make struct constant with type: '" +
4615 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4617 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4618 GEN_ERROR("Illegal number of initializers for structure type");
4620 // Check to ensure that constants are compatible with the type initializer!
4621 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4622 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4623 GEN_ERROR("Expected type '" +
4624 STy->getElementType(i)->getDescription() +
4625 "' for element #" + utostr(i) +
4626 " of structure initializer");
4628 // Check to ensure that Type is packed
4629 if (!STy->isPacked())
4630 GEN_ERROR("Vector initializer to non-vector type '" +
4631 STy->getDescription() + "'");
4633 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4634 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4640 #line 1717 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4642 if (!UpRefs.empty())
4643 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4644 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4646 GEN_ERROR("Cannot make struct constant with type: '" +
4647 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4649 if (STy->getNumContainedTypes() != 0)
4650 GEN_ERROR("Illegal number of initializers for structure type");
4652 // Check to ensure that Type is packed
4653 if (!STy->isPacked())
4654 GEN_ERROR("Vector initializer to non-vector type '" +
4655 STy->getDescription() + "'");
4657 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4658 delete (yyvsp[(1) - (5)].TypeVal);
4664 #line 1737 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4666 if (!UpRefs.empty())
4667 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4668 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4670 GEN_ERROR("Cannot make null pointer constant with type: '" +
4671 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4673 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4674 delete (yyvsp[(1) - (2)].TypeVal);
4680 #line 1749 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4682 if (!UpRefs.empty())
4683 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4684 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4685 delete (yyvsp[(1) - (2)].TypeVal);
4691 #line 1756 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4693 if (!UpRefs.empty())
4694 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4695 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4697 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4699 // ConstExprs can exist in the body of a function, thus creating
4700 // GlobalValues whenever they refer to a variable. Because we are in
4701 // the context of a function, getExistingVal will search the functions
4702 // symbol table instead of the module symbol table for the global symbol,
4703 // which throws things all off. To get around this, we just tell
4704 // getExistingVal that we are at global scope here.
4706 Function *SavedCurFn = CurFun.CurrentFunction;
4707 CurFun.CurrentFunction = 0;
4709 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4712 CurFun.CurrentFunction = SavedCurFn;
4714 // If this is an initializer for a constant pointer, which is referencing a
4715 // (currently) undefined variable, create a stub now that shall be replaced
4716 // in the future with the right type of variable.
4719 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4720 const PointerType *PT = cast<PointerType>(Ty);
4722 // First check to see if the forward references value is already created!
4723 PerModuleInfo::GlobalRefsType::iterator I =
4724 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4726 if (I != CurModule.GlobalRefs.end()) {
4727 V = I->second; // Placeholder already exists, use it...
4728 (yyvsp[(2) - (2)].ValIDVal).destroy();
4731 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4732 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4733 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4734 GEN_ERROR("Invalid reference to global");
4736 // Create the forward referenced global.
4738 if (const FunctionType *FTy =
4739 dyn_cast<FunctionType>(PT->getElementType())) {
4740 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4741 CurModule.CurrentModule);
4743 GV = new GlobalVariable(PT->getElementType(), false,
4744 GlobalValue::ExternalWeakLinkage, 0,
4745 Name, CurModule.CurrentModule);
4748 // Keep track of the fact that we have a forward ref to recycle it
4749 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4754 (yyval.ConstVal) = cast<GlobalValue>(V);
4755 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4761 #line 1822 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4763 if (!UpRefs.empty())
4764 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4765 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4766 GEN_ERROR("Mismatched types for constant expression: " +
4767 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4768 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4769 delete (yyvsp[(1) - (2)].TypeVal);
4775 #line 1832 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4777 if (!UpRefs.empty())
4778 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4779 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4780 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4781 GEN_ERROR("Cannot create a null initialized value of this type");
4782 (yyval.ConstVal) = Constant::getNullValue(Ty);
4783 delete (yyvsp[(1) - (2)].TypeVal);
4789 #line 1842 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4790 { // integral constants
4791 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4792 GEN_ERROR("Constant value doesn't fit in type");
4793 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4799 #line 1848 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4800 { // arbitrary precision integer constants
4801 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4802 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4803 GEN_ERROR("Constant value does not fit in type");
4805 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4806 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4807 delete (yyvsp[(2) - (2)].APIntVal);
4813 #line 1858 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4814 { // integral constants
4815 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4816 GEN_ERROR("Constant value doesn't fit in type");
4817 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4823 #line 1864 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4824 { // arbitrary precision integer constants
4825 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4826 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4827 GEN_ERROR("Constant value does not fit in type");
4829 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4830 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4831 delete (yyvsp[(2) - (2)].APIntVal);
4837 #line 1874 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4838 { // Boolean constants
4839 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4840 GEN_ERROR("Constant true must have type i1");
4841 (yyval.ConstVal) = ConstantInt::getTrue();
4847 #line 1880 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4848 { // Boolean constants
4849 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4850 GEN_ERROR("Constant false must have type i1");
4851 (yyval.ConstVal) = ConstantInt::getFalse();
4857 #line 1886 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4858 { // Floating point constants
4859 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4860 GEN_ERROR("Floating point constant invalid for type");
4861 // Lexer has no type info, so builds all float and double FP constants
4862 // as double. Fix this here. Long double is done right.
4863 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4864 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4865 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4866 delete (yyvsp[(2) - (2)].FPVal);
4872 #line 1899 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4874 if (!UpRefs.empty())
4875 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4876 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4877 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4878 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4879 GEN_ERROR("invalid cast opcode for cast from '" +
4880 Val->getType()->getDescription() + "' to '" +
4881 DestTy->getDescription() + "'");
4882 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4883 delete (yyvsp[(5) - (6)].TypeVal);
4888 #line 1911 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4890 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4891 GEN_ERROR("GetElementPtr requires a pointer operand");
4894 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4896 GEN_ERROR("Index list invalid for constant getelementptr");
4898 SmallVector<Constant*, 8> IdxVec;
4899 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4900 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4901 IdxVec.push_back(C);
4903 GEN_ERROR("Indices to constant getelementptr must be constants");
4905 delete (yyvsp[(4) - (5)].ValueList);
4907 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4913 #line 1932 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4915 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4916 GEN_ERROR("Select condition must be of boolean type");
4917 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4918 GEN_ERROR("Select operand types must match");
4919 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4925 #line 1940 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4927 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4928 GEN_ERROR("Binary operator types must match");
4930 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4935 #line 1946 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4937 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4938 GEN_ERROR("Logical operator types must match");
4939 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4940 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4941 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4942 GEN_ERROR("Logical operator requires integral operands");
4944 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4950 #line 1957 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4952 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4953 GEN_ERROR("icmp operand types must match");
4954 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4959 #line 1962 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4961 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4962 GEN_ERROR("fcmp operand types must match");
4963 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4968 #line 1967 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4970 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4971 GEN_ERROR("vicmp operand types must match");
4972 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4977 #line 1972 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4979 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4980 GEN_ERROR("vfcmp operand types must match");
4981 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4986 #line 1977 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4988 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4989 GEN_ERROR("Invalid extractelement operands");
4990 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4996 #line 1983 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4998 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4999 GEN_ERROR("Invalid insertelement operands");
5000 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5006 #line 1989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5008 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5009 GEN_ERROR("Invalid shufflevector operands");
5010 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5016 #line 1995 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5018 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5019 GEN_ERROR("ExtractValue requires an aggregate operand");
5021 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5022 delete (yyvsp[(4) - (5)].ConstantList);
5028 #line 2003 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5030 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5031 GEN_ERROR("InsertValue requires an aggregate operand");
5033 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5034 delete (yyvsp[(6) - (7)].ConstantList);
5040 #line 2014 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5042 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5048 #line 2018 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5050 (yyval.ConstVector) = new std::vector<Constant*>();
5051 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5057 #line 2026 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5058 { (yyval.BoolVal) = false; ;}
5062 #line 2026 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5063 { (yyval.BoolVal) = true; ;}
5067 #line 2029 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5068 { (yyval.BoolVal) = true; ;}
5072 #line 2029 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5073 { (yyval.BoolVal) = false; ;}
5077 #line 2032 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5079 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5080 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5082 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5084 GEN_ERROR("Aliases can be created only to global values");
5086 (yyval.ConstVal) = Aliasee;
5088 delete (yyvsp[(1) - (2)].TypeVal);
5093 #line 2044 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5095 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5096 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5097 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5098 GEN_ERROR("invalid cast opcode for cast from '" +
5099 Val->getType()->getDescription() + "' to '" +
5100 DestTy->getDescription() + "'");
5102 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5104 delete (yyvsp[(5) - (6)].TypeVal);
5109 #line 2065 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5111 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5112 CurModule.ModuleDone();
5118 #line 2070 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5120 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5121 CurModule.ModuleDone();
5127 #line 2083 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5128 { CurFun.isDeclare = false; ;}
5132 #line 2083 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5134 CurFun.FunctionDone();
5140 #line 2087 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5141 { CurFun.isDeclare = true; ;}
5145 #line 2087 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5152 #line 2090 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5159 #line 2093 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5161 if (!UpRefs.empty())
5162 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5163 // Eagerly resolve types. This is not an optimization, this is a
5164 // requirement that is due to the fact that we could have this:
5166 // %list = type { %list * }
5167 // %list = type { %list * } ; repeated type decl
5169 // If types are not resolved eagerly, then the two types will not be
5170 // determined to be the same type!
5172 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5174 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5176 // If this is a named type that is not a redefinition, add it to the slot
5178 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5181 delete (yyvsp[(3) - (3)].TypeVal);
5187 #line 2117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5189 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5191 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5193 // If this is a named type that is not a redefinition, add it to the slot
5195 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5202 #line 2129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5204 /* "Externally Visible" Linkage */
5205 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5206 GEN_ERROR("Global value initializer is not a constant");
5207 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5208 (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));
5214 #line 2136 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5221 #line 2140 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5223 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5224 GEN_ERROR("Global value initializer is not a constant");
5225 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));
5231 #line 2145 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5238 #line 2149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5240 if (!UpRefs.empty())
5241 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5242 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));
5244 delete (yyvsp[(6) - (7)].TypeVal);
5249 #line 2155 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5257 #line 2159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5260 if ((yyvsp[(1) - (5)].StrVal)) {
5261 Name = *(yyvsp[(1) - (5)].StrVal);
5262 delete (yyvsp[(1) - (5)].StrVal);
5265 GEN_ERROR("Alias name cannot be empty");
5267 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5269 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5271 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5272 CurModule.CurrentModule);
5273 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5274 InsertValue(GA, CurModule.Values);
5277 // If there was a forward reference of this alias, resolve it now.
5281 ID = ValID::createGlobalName(Name);
5283 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5285 if (GlobalValue *FWGV =
5286 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5287 // Replace uses of the fwdref with the actual alias.
5288 FWGV->replaceAllUsesWith(GA);
5289 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5290 GV->eraseFromParent();
5292 cast<Function>(FWGV)->eraseFromParent();
5301 #line 2199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5308 #line 2202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5315 #line 2208 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5317 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5318 if (AsmSoFar.empty())
5319 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5321 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5322 delete (yyvsp[(1) - (1)].StrVal);
5328 #line 2218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5330 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5331 delete (yyvsp[(3) - (3)].StrVal);
5336 #line 2222 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5338 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5339 delete (yyvsp[(3) - (3)].StrVal);
5344 #line 2229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5346 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5347 delete (yyvsp[(3) - (3)].StrVal);
5353 #line 2234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5355 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5356 delete (yyvsp[(1) - (1)].StrVal);
5362 #line 2239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5369 #line 2248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5371 if (!UpRefs.empty())
5372 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5373 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5374 GEN_ERROR("Argument types must be first-class");
5375 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5376 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5377 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5383 #line 2258 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5385 if (!UpRefs.empty())
5386 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5387 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5388 GEN_ERROR("Argument types must be first-class");
5389 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5390 (yyval.ArgList) = new ArgListType;
5391 (yyval.ArgList)->push_back(E);
5397 #line 2269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5399 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5405 #line 2273 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5407 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5408 struct ArgListEntry E;
5409 E.Ty = new PATypeHolder(Type::VoidTy);
5411 E.Attrs = ParamAttr::None;
5412 (yyval.ArgList)->push_back(E);
5418 #line 2282 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5420 (yyval.ArgList) = new ArgListType;
5421 struct ArgListEntry E;
5422 E.Ty = new PATypeHolder(Type::VoidTy);
5424 E.Attrs = ParamAttr::None;
5425 (yyval.ArgList)->push_back(E);
5431 #line 2291 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5433 (yyval.ArgList) = 0;
5439 #line 2297 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5441 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5442 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5444 // Check the function result for abstractness if this is a define. We should
5445 // have no abstract types at this point
5446 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5447 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5449 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
5450 GEN_ERROR("Invalid result type for LLVM function");
5452 std::vector<const Type*> ParamTypeList;
5453 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5454 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5455 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
5456 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5458 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5459 const Type* Ty = I->Ty->get();
5460 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5461 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5462 ParamTypeList.push_back(Ty);
5463 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5464 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5468 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5469 if (isVarArg) ParamTypeList.pop_back();
5473 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5475 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5476 const PointerType *PFT = PointerType::getUnqual(FT);
5477 delete (yyvsp[(2) - (10)].TypeVal);
5480 if (!FunctionName.empty()) {
5481 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5483 ID = ValID::createGlobalID(CurModule.Values.size());
5487 // See if this function was forward referenced. If so, recycle the object.
5488 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5489 // Move the function to the end of the list, from whereever it was
5490 // previously inserted.
5491 Fn = cast<Function>(FWRef);
5492 assert(Fn->getParamAttrs().isEmpty() &&
5493 "Forward reference has parameter attributes!");
5494 CurModule.CurrentModule->getFunctionList().remove(Fn);
5495 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5496 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5497 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5498 if (Fn->getFunctionType() != FT ) {
5499 // The existing function doesn't have the same type. This is an overload
5501 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5502 } else if (Fn->getParamAttrs() != PAL) {
5503 // The existing function doesn't have the same parameter attributes.
5504 // This is an overload error.
5505 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5506 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5507 // Neither the existing or the current function is a declaration and they
5508 // have the same name and same type. Clearly this is a redefinition.
5509 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5510 } else if (Fn->isDeclaration()) {
5511 // Make sure to strip off any argument names so we can't get conflicts.
5512 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5516 } else { // Not already defined?
5517 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5518 CurModule.CurrentModule);
5519 InsertValue(Fn, CurModule.Values);
5522 CurFun.FunctionStart(Fn);
5524 if (CurFun.isDeclare) {
5525 // If we have declaration, always overwrite linkage. This will allow us to
5526 // correctly handle cases, when pointer to function is passed as argument to
5527 // another function.
5528 Fn->setLinkage(CurFun.Linkage);
5529 Fn->setVisibility(CurFun.Visibility);
5531 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5532 Fn->setParamAttrs(PAL);
5533 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5534 if ((yyvsp[(8) - (10)].StrVal)) {
5535 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5536 delete (yyvsp[(8) - (10)].StrVal);
5538 if ((yyvsp[(10) - (10)].StrVal)) {
5539 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5540 delete (yyvsp[(10) - (10)].StrVal);
5543 // Add all of the arguments we parsed to the function...
5544 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5545 if (isVarArg) { // Nuke the last entry
5546 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5547 "Not a varargs marker!");
5548 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5549 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5551 Function::arg_iterator ArgIt = Fn->arg_begin();
5552 Function::arg_iterator ArgEnd = Fn->arg_end();
5554 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5555 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5556 delete I->Ty; // Delete the typeholder...
5557 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5563 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5570 #line 2427 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5572 (yyval.FunctionVal) = CurFun.CurrentFunction;
5574 // Make sure that we keep track of the linkage type even if there was a
5575 // previous "declare".
5576 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5577 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5582 #line 2438 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5584 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5590 #line 2443 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5592 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5593 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5594 (yyval.FunctionVal) = CurFun.CurrentFunction;
5595 CurFun.FunctionDone();
5601 #line 2455 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5603 (yyval.BoolVal) = false;
5609 #line 2459 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5611 (yyval.BoolVal) = true;
5617 #line 2464 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5618 { // A reference to a direct constant
5619 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5625 #line 2468 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5627 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5633 #line 2472 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5634 { // arbitrary precision integer constants
5635 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5636 delete (yyvsp[(1) - (1)].APIntVal);
5642 #line 2477 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5643 { // arbitrary precision integer constants
5644 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5645 delete (yyvsp[(1) - (1)].APIntVal);
5651 #line 2482 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5652 { // Perhaps it's an FP constant?
5653 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5659 #line 2486 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5661 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5667 #line 2490 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5669 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5675 #line 2494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5677 (yyval.ValIDVal) = ValID::createNull();
5683 #line 2498 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5685 (yyval.ValIDVal) = ValID::createUndef();
5691 #line 2502 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5692 { // A vector zero constant.
5693 (yyval.ValIDVal) = ValID::createZeroInit();
5699 #line 2506 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5700 { // Nonempty unsized packed vector
5701 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5702 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5704 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5705 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5707 VectorType* pt = VectorType::get(ETy, NumElements);
5708 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5710 // Verify all elements are correct type!
5711 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5712 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5713 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5714 ETy->getDescription() +"' as required!\nIt is of type '" +
5715 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5718 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5719 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5725 #line 2528 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5726 { // Nonempty unsized arr
5727 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5728 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5730 if (!ETy->isFirstClassType())
5731 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5733 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5734 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5736 // Verify all elements are correct type!
5737 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5738 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5739 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5740 ETy->getDescription() +"' as required!\nIt is of type '"+
5741 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5744 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5745 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5751 #line 2550 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5753 // Use undef instead of an array because it's inconvenient to determine
5754 // the element type at this point, there being no elements to examine.
5755 (yyval.ValIDVal) = ValID::createUndef();
5761 #line 2556 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5763 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5764 const Type *ETy = Type::Int8Ty;
5766 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5768 std::vector<Constant*> Vals;
5769 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5770 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5771 delete (yyvsp[(2) - (2)].StrVal);
5772 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5778 #line 2569 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5780 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5781 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5782 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5784 const StructType *STy = StructType::get(Elements);
5785 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5787 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5788 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5794 #line 2581 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5796 const StructType *STy = StructType::get(std::vector<const Type*>());
5797 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5803 #line 2586 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5805 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5806 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5807 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5809 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5810 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5812 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5813 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5819 #line 2598 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5821 const StructType *STy = StructType::get(std::vector<const Type*>(),
5823 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5829 #line 2604 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5831 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5837 #line 2608 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5839 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5840 delete (yyvsp[(3) - (5)].StrVal);
5841 delete (yyvsp[(5) - (5)].StrVal);
5847 #line 2618 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5848 { // Is it an integer reference...?
5849 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5855 #line 2622 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5857 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5863 #line 2626 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5864 { // Is it a named reference...?
5865 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5866 delete (yyvsp[(1) - (1)].StrVal);
5872 #line 2631 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5873 { // Is it a named reference...?
5874 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5875 delete (yyvsp[(1) - (1)].StrVal);
5881 #line 2644 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5883 if (!UpRefs.empty())
5884 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5885 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5886 delete (yyvsp[(1) - (2)].TypeVal);
5892 #line 2653 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5894 (yyval.ValueList) = new std::vector<Value *>();
5895 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5901 #line 2658 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5903 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
5909 #line 2663 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5911 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5917 #line 2667 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5918 { // Do not allow functions with 0 basic blocks
5919 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5925 #line 2676 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5927 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5929 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5930 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5931 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5937 #line 2685 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5939 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5940 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5941 if (CI2->getParent() == 0)
5942 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5943 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5944 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5950 #line 2694 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5951 { // Empty space between instruction lists
5952 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5958 #line 2698 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5959 { // Labelled (named) basic block
5960 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5961 delete (yyvsp[(1) - (1)].StrVal);
5968 #line 2706 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5969 { // Return with a result...
5970 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
5971 assert(!VL.empty() && "Invalid ret operands!");
5972 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
5973 if (VL.size() > 1 ||
5974 (isa<StructType>(ReturnType) &&
5975 (VL.empty() || VL[0]->getType() != ReturnType))) {
5976 Value *RV = UndefValue::get(ReturnType);
5977 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
5978 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
5979 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
5982 (yyval.TermInstVal) = ReturnInst::Create(RV);
5984 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
5986 delete (yyvsp[(2) - (2)].ValueList);
5992 #line 2726 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5993 { // Return with no result...
5994 (yyval.TermInstVal) = ReturnInst::Create();
6000 #line 2730 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6001 { // Unconditional Branch...
6002 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6004 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6009 #line 2735 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6011 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6012 GEN_ERROR("Branch condition must have type i1");
6013 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6015 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6017 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6019 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6024 #line 2746 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6026 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6028 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6030 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6031 (yyval.TermInstVal) = S;
6033 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6034 E = (yyvsp[(8) - (9)].JumpTable)->end();
6035 for (; I != E; ++I) {
6036 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6037 S->addCase(CI, I->second);
6039 GEN_ERROR("Switch case is constant, but not a simple integer");
6041 delete (yyvsp[(8) - (9)].JumpTable);
6047 #line 2765 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6049 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6051 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6053 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6054 (yyval.TermInstVal) = S;
6060 #line 2775 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6063 // Handle the short syntax
6064 const PointerType *PFTy = 0;
6065 const FunctionType *Ty = 0;
6066 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
6067 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6068 // Pull out the types of all of the arguments...
6069 std::vector<const Type*> ParamTypes;
6070 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6071 for (; I != E; ++I) {
6072 const Type *Ty = I->Val->getType();
6073 if (Ty == Type::VoidTy)
6074 GEN_ERROR("Short call syntax cannot be used with varargs");
6075 ParamTypes.push_back(Ty);
6078 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6079 GEN_ERROR("Invalid result type for LLVM function");
6081 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6082 PFTy = PointerType::getUnqual(Ty);
6085 delete (yyvsp[(3) - (14)].TypeVal);
6087 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
6089 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6091 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6094 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6095 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6096 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6098 // Check the arguments
6100 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
6101 // Make sure no arguments is a good thing!
6102 if (Ty->getNumParams() != 0)
6103 GEN_ERROR("No arguments passed to a function that "
6104 "expects arguments");
6105 } else { // Has arguments?
6106 // Loop through FunctionType's arguments and ensure they are specified
6108 FunctionType::param_iterator I = Ty->param_begin();
6109 FunctionType::param_iterator E = Ty->param_end();
6110 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6113 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6114 if (ArgI->Val->getType() != *I)
6115 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6116 (*I)->getDescription() + "'");
6117 Args.push_back(ArgI->Val);
6118 if (ArgI->Attrs != ParamAttr::None)
6119 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6122 if (Ty->isVarArg()) {
6124 for (; ArgI != ArgE; ++ArgI, ++index) {
6125 Args.push_back(ArgI->Val); // push the remaining varargs
6126 if (ArgI->Attrs != ParamAttr::None)
6127 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6129 } else if (I != E || ArgI != ArgE)
6130 GEN_ERROR("Invalid number of parameters detected");
6135 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6137 // Create the InvokeInst
6138 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6139 Args.begin(), Args.end());
6140 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6141 II->setParamAttrs(PAL);
6142 (yyval.TermInstVal) = II;
6143 delete (yyvsp[(6) - (14)].ParamList);
6149 #line 2860 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6151 (yyval.TermInstVal) = new UnwindInst();
6157 #line 2864 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6159 (yyval.TermInstVal) = new UnreachableInst();
6165 #line 2871 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6167 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6168 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6171 GEN_ERROR("May only switch on a constant pool value");
6173 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6175 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6180 #line 2882 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6182 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6183 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6187 GEN_ERROR("May only switch on a constant pool value");
6189 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6191 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6196 #line 2895 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6198 // Is this definition named?? if so, assign the name...
6199 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6201 InsertValue((yyvsp[(2) - (2)].InstVal));
6202 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6208 #line 2905 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6209 { // Used for PHI nodes
6210 if (!UpRefs.empty())
6211 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6212 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6213 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6215 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6217 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6218 delete (yyvsp[(1) - (6)].TypeVal);
6223 #line 2916 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6225 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6226 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6228 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6230 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6235 #line 2926 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6237 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6238 if (!UpRefs.empty())
6239 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6240 // Used for call and invoke instructions
6241 (yyval.ParamList) = new ParamList();
6242 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6243 (yyval.ParamList)->push_back(E);
6244 delete (yyvsp[(1) - (4)].TypeVal);
6250 #line 2937 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6252 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6253 // Labels are only valid in ASMs
6254 (yyval.ParamList) = new ParamList();
6255 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6256 (yyval.ParamList)->push_back(E);
6262 #line 2945 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6264 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6265 if (!UpRefs.empty())
6266 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6267 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6268 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6269 (yyval.ParamList)->push_back(E);
6270 delete (yyvsp[(3) - (6)].TypeVal);
6276 #line 2955 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6278 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6279 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6280 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6281 (yyval.ParamList)->push_back(E);
6287 #line 2962 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6288 { (yyval.ParamList) = new ParamList(); ;}
6292 #line 2965 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6293 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6297 #line 2966 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6299 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6300 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6306 #line 2974 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6308 (yyval.ConstantList) = new std::vector<unsigned>();
6309 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6310 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6311 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6316 #line 2980 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6318 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6319 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6320 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6321 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6327 #line 2989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6329 (yyval.BoolVal) = true;
6335 #line 2993 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6337 (yyval.BoolVal) = false;
6343 #line 2998 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6345 if (!UpRefs.empty())
6346 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6347 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6348 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6350 "Arithmetic operator requires integer, FP, or packed operands");
6351 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6353 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6355 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6356 if ((yyval.InstVal) == 0)
6357 GEN_ERROR("binary operator returned null");
6358 delete (yyvsp[(2) - (5)].TypeVal);
6363 #line 3014 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6365 if (!UpRefs.empty())
6366 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6367 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6368 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6369 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6370 GEN_ERROR("Logical operator requires integral operands");
6372 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6374 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6376 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6377 if ((yyval.InstVal) == 0)
6378 GEN_ERROR("binary operator returned null");
6379 delete (yyvsp[(2) - (5)].TypeVal);
6384 #line 3031 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6386 if (!UpRefs.empty())
6387 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6388 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6389 GEN_ERROR("Vector types not supported by icmp instruction");
6390 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6392 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6394 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6395 if ((yyval.InstVal) == 0)
6396 GEN_ERROR("icmp operator returned null");
6397 delete (yyvsp[(3) - (6)].TypeVal);
6402 #line 3045 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6404 if (!UpRefs.empty())
6405 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6406 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6407 GEN_ERROR("Vector types not supported by fcmp instruction");
6408 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6410 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6412 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6413 if ((yyval.InstVal) == 0)
6414 GEN_ERROR("fcmp operator returned null");
6415 delete (yyvsp[(3) - (6)].TypeVal);
6420 #line 3059 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6422 if (!UpRefs.empty())
6423 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6424 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6425 GEN_ERROR("Scalar types not supported by vicmp instruction");
6426 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6428 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6430 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6431 if ((yyval.InstVal) == 0)
6432 GEN_ERROR("icmp operator returned null");
6433 delete (yyvsp[(3) - (6)].TypeVal);
6438 #line 3073 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6440 if (!UpRefs.empty())
6441 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6442 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6443 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6444 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6446 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6448 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6449 if ((yyval.InstVal) == 0)
6450 GEN_ERROR("fcmp operator returned null");
6451 delete (yyvsp[(3) - (6)].TypeVal);
6456 #line 3087 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6458 if (!UpRefs.empty())
6459 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6460 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6461 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6462 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6463 GEN_ERROR("invalid cast opcode for cast from '" +
6464 Val->getType()->getDescription() + "' to '" +
6465 DestTy->getDescription() + "'");
6466 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6467 delete (yyvsp[(4) - (4)].TypeVal);
6472 #line 3099 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6474 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6475 GEN_ERROR("select condition must be boolean");
6476 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6477 GEN_ERROR("select value types should match");
6478 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6484 #line 3107 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6486 if (!UpRefs.empty())
6487 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6488 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6489 delete (yyvsp[(4) - (4)].TypeVal);
6495 #line 3114 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6497 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6498 GEN_ERROR("Invalid extractelement operands");
6499 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6505 #line 3120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6507 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6508 GEN_ERROR("Invalid insertelement operands");
6509 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6515 #line 3126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6517 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6518 GEN_ERROR("Invalid shufflevector operands");
6519 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6525 #line 3132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6527 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6528 if (!Ty->isFirstClassType())
6529 GEN_ERROR("PHI node operands must be of first class type");
6530 (yyval.InstVal) = PHINode::Create(Ty);
6531 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6532 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6533 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6534 GEN_ERROR("All elements of a PHI node must be of the same type");
6535 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6536 (yyvsp[(2) - (2)].PHIList)->pop_front();
6538 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6544 #line 3148 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6547 // Handle the short syntax
6548 const PointerType *PFTy = 0;
6549 const FunctionType *Ty = 0;
6550 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6551 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6552 // Pull out the types of all of the arguments...
6553 std::vector<const Type*> ParamTypes;
6554 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6555 for (; I != E; ++I) {
6556 const Type *Ty = I->Val->getType();
6557 if (Ty == Type::VoidTy)
6558 GEN_ERROR("Short call syntax cannot be used with varargs");
6559 ParamTypes.push_back(Ty);
6562 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6563 GEN_ERROR("Invalid result type for LLVM function");
6565 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6566 PFTy = PointerType::getUnqual(Ty);
6569 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6572 // Check for call to invalid intrinsic to avoid crashing later.
6573 if (Function *theF = dyn_cast<Function>(V)) {
6574 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6575 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6576 !theF->getIntrinsicID(true))
6577 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6578 theF->getName() + "'");
6581 // Set up the ParamAttrs for the function
6582 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6583 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6584 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6585 // Check the arguments
6587 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6588 // Make sure no arguments is a good thing!
6589 if (Ty->getNumParams() != 0)
6590 GEN_ERROR("No arguments passed to a function that "
6591 "expects arguments");
6592 } else { // Has arguments?
6593 // Loop through FunctionType's arguments and ensure they are specified
6594 // correctly. Also, gather any parameter attributes.
6595 FunctionType::param_iterator I = Ty->param_begin();
6596 FunctionType::param_iterator E = Ty->param_end();
6597 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6600 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6601 if (ArgI->Val->getType() != *I)
6602 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6603 (*I)->getDescription() + "'");
6604 Args.push_back(ArgI->Val);
6605 if (ArgI->Attrs != ParamAttr::None)
6606 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6608 if (Ty->isVarArg()) {
6610 for (; ArgI != ArgE; ++ArgI, ++index) {
6611 Args.push_back(ArgI->Val); // push the remaining varargs
6612 if (ArgI->Attrs != ParamAttr::None)
6613 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6615 } else if (I != E || ArgI != ArgE)
6616 GEN_ERROR("Invalid number of parameters detected");
6619 // Finish off the ParamAttrs and check them
6622 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6624 // Create the call node
6625 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6626 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6627 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6628 CI->setParamAttrs(PAL);
6629 (yyval.InstVal) = CI;
6630 delete (yyvsp[(6) - (8)].ParamList);
6631 delete (yyvsp[(3) - (8)].TypeVal);
6637 #line 3237 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6639 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6645 #line 3242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6647 (yyval.BoolVal) = true;
6653 #line 3246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6655 (yyval.BoolVal) = false;
6661 #line 3253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6663 if (!UpRefs.empty())
6664 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6665 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6666 delete (yyvsp[(2) - (3)].TypeVal);
6672 #line 3260 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6674 if (!UpRefs.empty())
6675 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6676 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6677 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6678 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6680 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6681 delete (yyvsp[(2) - (6)].TypeVal);
6686 #line 3270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6688 if (!UpRefs.empty())
6689 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6690 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6691 delete (yyvsp[(2) - (3)].TypeVal);
6697 #line 3277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6699 if (!UpRefs.empty())
6700 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6701 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6702 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6703 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6705 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6706 delete (yyvsp[(2) - (6)].TypeVal);
6711 #line 3287 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6713 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6714 GEN_ERROR("Trying to free nonpointer type " +
6715 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6716 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6722 #line 3295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6724 if (!UpRefs.empty())
6725 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6726 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6727 GEN_ERROR("Can't load from nonpointer type: " +
6728 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6729 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6730 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6731 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6732 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6734 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6735 delete (yyvsp[(3) - (5)].TypeVal);
6740 #line 3309 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6742 if (!UpRefs.empty())
6743 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6744 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6746 GEN_ERROR("Can't store to a nonpointer type: " +
6747 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6748 const Type *ElTy = PT->getElementType();
6749 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6750 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6751 "' into space of type '" + ElTy->getDescription() + "'");
6753 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6755 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6756 delete (yyvsp[(5) - (7)].TypeVal);
6761 #line 3326 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6763 if (!UpRefs.empty())
6764 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6765 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
6766 GEN_ERROR("getresult insn requires an aggregate operand");
6767 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
6768 GEN_ERROR("Invalid getresult index for type '" +
6769 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
6771 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6773 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
6774 delete (yyvsp[(2) - (5)].TypeVal);
6779 #line 3340 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6781 if (!UpRefs.empty())
6782 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6783 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6784 GEN_ERROR("getelementptr insn requires pointer operand");
6786 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6787 GEN_ERROR("Invalid getelementptr indices for type '" +
6788 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6789 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6791 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6792 delete (yyvsp[(2) - (4)].TypeVal);
6793 delete (yyvsp[(4) - (4)].ValueList);
6798 #line 3355 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6800 if (!UpRefs.empty())
6801 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6802 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6803 GEN_ERROR("extractvalue insn requires an aggregate operand");
6805 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6806 GEN_ERROR("Invalid extractvalue indices for type '" +
6807 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6808 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6810 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6811 delete (yyvsp[(2) - (4)].TypeVal);
6812 delete (yyvsp[(4) - (4)].ConstantList);
6817 #line 3370 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6819 if (!UpRefs.empty())
6820 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6821 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6822 GEN_ERROR("extractvalue insn requires an aggregate operand");
6824 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6825 GEN_ERROR("Invalid insertvalue indices for type '" +
6826 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6827 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6828 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6830 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6831 delete (yyvsp[(2) - (7)].TypeVal);
6832 delete (yyvsp[(5) - (7)].TypeVal);
6833 delete (yyvsp[(7) - (7)].ConstantList);
6838 /* Line 1267 of yacc.c. */
6839 #line 6840 "llvmAsmParser.tab.c"
6842 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6846 YY_STACK_PRINT (yyss, yyssp);
6851 /* Now `shift' the result of the reduction. Determine what state
6852 that goes to, based on the state we popped back to and the rule
6853 number reduced by. */
6857 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6858 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6859 yystate = yytable[yystate];
6861 yystate = yydefgoto[yyn - YYNTOKENS];
6866 /*------------------------------------.
6867 | yyerrlab -- here on detecting error |
6868 `------------------------------------*/
6870 /* If not already recovering from an error, report this error. */
6874 #if ! YYERROR_VERBOSE
6875 yyerror (YY_("syntax error"));
6878 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6879 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6881 YYSIZE_T yyalloc = 2 * yysize;
6882 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6883 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6884 if (yymsg != yymsgbuf)
6885 YYSTACK_FREE (yymsg);
6886 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6888 yymsg_alloc = yyalloc;
6892 yymsg_alloc = sizeof yymsgbuf;
6896 if (0 < yysize && yysize <= yymsg_alloc)
6898 (void) yysyntax_error (yymsg, yystate, yychar);
6903 yyerror (YY_("syntax error"));
6905 goto yyexhaustedlab;
6913 if (yyerrstatus == 3)
6915 /* If just tried and failed to reuse look-ahead token after an
6916 error, discard it. */
6918 if (yychar <= YYEOF)
6920 /* Return failure if at end of input. */
6921 if (yychar == YYEOF)
6926 yydestruct ("Error: discarding",
6932 /* Else will try to reuse look-ahead token after shifting the error
6937 /*---------------------------------------------------.
6938 | yyerrorlab -- error raised explicitly by YYERROR. |
6939 `---------------------------------------------------*/
6942 /* Pacify compilers like GCC when the user code never invokes
6943 YYERROR and the label yyerrorlab therefore never appears in user
6945 if (/*CONSTCOND*/ 0)
6948 /* Do not reclaim the symbols of the rule which action triggered
6952 YY_STACK_PRINT (yyss, yyssp);
6957 /*-------------------------------------------------------------.
6958 | yyerrlab1 -- common code for both syntax error and YYERROR. |
6959 `-------------------------------------------------------------*/
6961 yyerrstatus = 3; /* Each real token shifted decrements this. */
6965 yyn = yypact[yystate];
6966 if (yyn != YYPACT_NINF)
6969 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6977 /* Pop the current state because it cannot handle the error token. */
6982 yydestruct ("Error: popping",
6983 yystos[yystate], yyvsp);
6986 YY_STACK_PRINT (yyss, yyssp);
6995 /* Shift the error token. */
6996 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7002 /*-------------------------------------.
7003 | yyacceptlab -- YYACCEPT comes here. |
7004 `-------------------------------------*/
7009 /*-----------------------------------.
7010 | yyabortlab -- YYABORT comes here. |
7011 `-----------------------------------*/
7017 /*-------------------------------------------------.
7018 | yyexhaustedlab -- memory exhaustion comes here. |
7019 `-------------------------------------------------*/
7021 yyerror (YY_("memory exhausted"));
7027 if (yychar != YYEOF && yychar != YYEMPTY)
7028 yydestruct ("Cleanup: discarding lookahead",
7030 /* Do not reclaim the symbols of the rule which action triggered
7031 this YYABORT or YYACCEPT. */
7033 YY_STACK_PRINT (yyss, yyssp);
7034 while (yyssp != yyss)
7036 yydestruct ("Cleanup: popping",
7037 yystos[*yyssp], yyvsp);
7042 YYSTACK_FREE (yyss);
7045 if (yymsg != yymsgbuf)
7046 YYSTACK_FREE (yymsg);
7048 /* Make sure YYID is used. */
7049 return YYID (yyresult);
7053 #line 3389 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
7056 // common code from the two 'RunVMAsmParser' functions
7057 static Module* RunParser(Module * M) {
7058 CurModule.CurrentModule = M;
7059 // Check to make sure the parser succeeded
7062 delete ParserResult;
7066 // Emit an error if there are any unresolved types left.
7067 if (!CurModule.LateResolveTypes.empty()) {
7068 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7069 if (DID.Type == ValID::LocalName) {
7070 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7072 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7075 delete ParserResult;
7079 // Emit an error if there are any unresolved values left.
7080 if (!CurModule.LateResolveValues.empty()) {
7081 Value *V = CurModule.LateResolveValues.back();
7082 std::map<Value*, std::pair<ValID, int> >::iterator I =
7083 CurModule.PlaceHolderInfo.find(V);
7085 if (I != CurModule.PlaceHolderInfo.end()) {
7086 ValID &DID = I->second.first;
7087 if (DID.Type == ValID::LocalName) {
7088 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7090 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7093 delete ParserResult;
7098 // Check to make sure that parsing produced a result
7102 // Reset ParserResult variable while saving its value for the result.
7103 Module *Result = ParserResult;
7109 void llvm::GenerateError(const std::string &message, int LineNo) {
7110 if (LineNo == -1) LineNo = LLLgetLineNo();
7111 // TODO: column number in exception
7113 TheParseError->setError(LLLgetFilename(), message, LineNo);
7117 int yyerror(const char *ErrorMsg) {
7118 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7119 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7120 if (yychar != YYEMPTY && yychar != 0) {
7121 errMsg += " while reading token: '";
7122 errMsg += std::string(LLLgetTokenStart(),
7123 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7125 GenerateError(errMsg);