1 /* A Bison parser, made by GNU Bison 2.3. */
3 /* Skeleton implementation for Bison's Yacc-like parsers in C
5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6 Free Software Foundation, Inc.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
23 /* As a special exception, you may create a larger work that contains
24 part or all of the Bison parser skeleton and distribute that work
25 under terms of your choice, so long as that work isn't itself a
26 parser generator using the skeleton or a modified version thereof
27 as a parser skeleton. Alternatively, if you modify or redistribute
28 the parser skeleton itself, you may (at your option) remove this
29 special exception, which will cause the skeleton and the resulting
30 Bison output files to be licensed under the GNU General Public
31 License without this special exception.
33 This special exception was added by the Free Software Foundation in
34 version 2.2 of Bison. */
36 /* C LALR(1) parser skeleton written by Richard Stallman, by
37 simplifying the original so-called "semantic" parser. */
39 /* All symbols defined below should begin with yy or YY, to avoid
40 infringing on user name space. This should be done even for local
41 variables, as they might otherwise be expanded by user macros.
42 There are some unavoidable exceptions within include files to
43 define necessary library symbols; they are noted "INFRINGES ON
44 USER NAME SPACE" below. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "2.3"
53 #define YYSKELETON_NAME "yacc.c"
58 /* Using locations. */
59 #define YYLSP_NEEDED 0
61 /* Substitute the variable and function names. */
62 #define yyparse llvmAsmparse
63 #define yylex llvmAsmlex
64 #define yyerror llvmAsmerror
65 #define yylval llvmAsmlval
66 #define yychar llvmAsmchar
67 #define yydebug llvmAsmdebug
68 #define yynerrs llvmAsmnerrs
74 /* Put the tokens into the symbol table, so that GDB and other debuggers
97 ATSTRINGCONSTANT = 278,
98 PCTSTRINGCONSTANT = 279,
99 ZEROINITIALIZER = 280,
140 X86_STDCALLCC_TOK = 321,
141 X86_FASTCALLCC_TOK = 322,
209 EXTRACTELEMENT = 390,
233 #define ESINT64VAL 258
234 #define EUINT64VAL 259
235 #define ESAPINTVAL 260
236 #define EUAPINTVAL 261
237 #define LOCALVAL_ID 262
238 #define GLOBALVAL_ID 263
246 #define PPC_FP128 271
250 #define GLOBALVAR 275
252 #define STRINGCONSTANT 277
253 #define ATSTRINGCONSTANT 278
254 #define PCTSTRINGCONSTANT 279
255 #define ZEROINITIALIZER 280
267 #define THREAD_LOCAL 292
269 #define DOTDOTDOT 294
275 #define APPENDING 300
276 #define DLLIMPORT 301
277 #define DLLEXPORT 302
278 #define EXTERN_WEAK 303
285 #define ADDRSPACE 310
291 #define SIDEEFFECT 316
294 #define FASTCC_TOK 319
295 #define COLDCC_TOK 320
296 #define X86_STDCALLCC_TOK 321
297 #define X86_FASTCALLCC_TOK 322
298 #define DATALAYOUT 323
304 #define UNREACHABLE 329
349 #define GETELEMENTPTR 374
365 #define EXTRACTELEMENT 390
366 #define INSERTELEMENT 391
367 #define SHUFFLEVECTOR 392
368 #define GETRESULT 393
369 #define EXTRACTVALUE 394
370 #define INSERTVALUE 395
385 #define PROTECTED 410
390 /* Copy the first part of user declarations. */
391 #line 14 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
393 #include "ParserInternals.h"
394 #include "llvm/CallingConv.h"
395 #include "llvm/InlineAsm.h"
396 #include "llvm/Instructions.h"
397 #include "llvm/Module.h"
398 #include "llvm/ValueSymbolTable.h"
399 #include "llvm/AutoUpgrade.h"
400 #include "llvm/Support/GetElementPtrTypeIterator.h"
401 #include "llvm/Support/CommandLine.h"
402 #include "llvm/ADT/SmallVector.h"
403 #include "llvm/ADT/STLExtras.h"
404 #include "llvm/Support/MathExtras.h"
405 #include "llvm/Support/Streams.h"
411 // The following is a gross hack. In order to rid the libAsmParser library of
412 // exceptions, we have to have a way of getting the yyparse function to go into
413 // an error situation. So, whenever we want an error to occur, the GenerateError
414 // function (see bottom of file) sets TriggerError. Then, at the end of each
415 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
416 // (a goto) to put YACC in error state. Furthermore, several calls to
417 // GenerateError are made from inside productions and they must simulate the
418 // previous exception behavior by exiting the production immediately. We have
419 // replaced these with the GEN_ERROR macro which calls GeneratError and then
420 // immediately invokes YYERROR. This would be so much cleaner if it was a
421 // recursive descent parser.
422 static bool TriggerError = false;
423 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
424 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
426 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
427 int yylex(); // declaration" of xxx warnings.
429 using namespace llvm;
431 static Module *ParserResult;
433 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
434 // relating to upreferences in the input stream.
436 //#define DEBUG_UPREFS 1
438 #define UR_OUT(X) cerr << X
443 #define YYERROR_VERBOSE 1
445 static GlobalVariable *CurGV;
448 // This contains info used when building the body of a function. It is
449 // destroyed when the function is completed.
451 typedef std::vector<Value *> ValueList; // Numbered defs
454 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
456 static struct PerModuleInfo {
457 Module *CurrentModule;
458 ValueList Values; // Module level numbered definitions
459 ValueList LateResolveValues;
460 std::vector<PATypeHolder> Types;
461 std::map<ValID, PATypeHolder> LateResolveTypes;
463 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
464 /// how they were referenced and on which line of the input they came from so
465 /// that we can resolve them later and print error messages as appropriate.
466 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
468 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
469 // references to global values. Global values may be referenced before they
470 // are defined, and if so, the temporary object that they represent is held
471 // here. This is used for forward references of GlobalValues.
473 typedef std::map<std::pair<const PointerType *,
474 ValID>, GlobalValue*> GlobalRefsType;
475 GlobalRefsType GlobalRefs;
478 // If we could not resolve some functions at function compilation time
479 // (calls to functions before they are defined), resolve them now... Types
480 // are resolved when the constant pool has been completely parsed.
482 ResolveDefinitions(LateResolveValues);
486 // Check to make sure that all global value forward references have been
489 if (!GlobalRefs.empty()) {
490 std::string UndefinedReferences = "Unresolved global references exist:\n";
492 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
494 UndefinedReferences += " " + I->first.first->getDescription() + " " +
495 I->first.second.getName() + "\n";
497 GenerateError(UndefinedReferences);
501 // Look for intrinsic functions and CallInst that need to be upgraded
502 for (Module::iterator FI = CurrentModule->begin(),
503 FE = CurrentModule->end(); FI != FE; )
504 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
506 Values.clear(); // Clear out function local definitions
511 // GetForwardRefForGlobal - Check to see if there is a forward reference
512 // for this global. If so, remove it from the GlobalRefs map and return it.
513 // If not, just return null.
514 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
515 // Check to see if there is a forward reference to this global variable...
516 // if there is, eliminate it and patch the reference to use the new def'n.
517 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
518 GlobalValue *Ret = 0;
519 if (I != GlobalRefs.end()) {
526 bool TypeIsUnresolved(PATypeHolder* PATy) {
527 // If it isn't abstract, its resolved
528 const Type* Ty = PATy->get();
529 if (!Ty->isAbstract())
531 // Traverse the type looking for abstract types. If it isn't abstract then
532 // we don't need to traverse that leg of the type.
533 std::vector<const Type*> WorkList, SeenList;
534 WorkList.push_back(Ty);
535 while (!WorkList.empty()) {
536 const Type* Ty = WorkList.back();
537 SeenList.push_back(Ty);
539 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
540 // Check to see if this is an unresolved type
541 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
542 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
543 for ( ; I != E; ++I) {
544 if (I->second.get() == OpTy)
547 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
548 const Type* TheTy = SeqTy->getElementType();
549 if (TheTy->isAbstract() && TheTy != Ty) {
550 std::vector<const Type*>::iterator I = SeenList.begin(),
556 WorkList.push_back(TheTy);
558 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
559 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
560 const Type* TheTy = StrTy->getElementType(i);
561 if (TheTy->isAbstract() && TheTy != Ty) {
562 std::vector<const Type*>::iterator I = SeenList.begin(),
568 WorkList.push_back(TheTy);
577 static struct PerFunctionInfo {
578 Function *CurrentFunction; // Pointer to current function being created
580 ValueList Values; // Keep track of #'d definitions
582 ValueList LateResolveValues;
583 bool isDeclare; // Is this function a forward declararation?
584 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
585 GlobalValue::VisibilityTypes Visibility;
587 /// BBForwardRefs - When we see forward references to basic blocks, keep
588 /// track of them here.
589 std::map<ValID, BasicBlock*> BBForwardRefs;
591 inline PerFunctionInfo() {
594 Linkage = GlobalValue::ExternalLinkage;
595 Visibility = GlobalValue::DefaultVisibility;
598 inline void FunctionStart(Function *M) {
603 void FunctionDone() {
604 // Any forward referenced blocks left?
605 if (!BBForwardRefs.empty()) {
606 GenerateError("Undefined reference to label " +
607 BBForwardRefs.begin()->second->getName());
611 // Resolve all forward references now.
612 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
614 Values.clear(); // Clear out function local definitions
615 BBForwardRefs.clear();
618 Linkage = GlobalValue::ExternalLinkage;
619 Visibility = GlobalValue::DefaultVisibility;
621 } CurFun; // Info for the current function...
623 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
626 //===----------------------------------------------------------------------===//
627 // Code to handle definitions of all the types
628 //===----------------------------------------------------------------------===//
630 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
631 // Things that have names or are void typed don't get slot numbers
632 if (V->hasName() || (V->getType() == Type::VoidTy))
635 // In the case of function values, we have to allow for the forward reference
636 // of basic blocks, which are included in the numbering. Consequently, we keep
637 // track of the next insertion location with NextValNum. When a BB gets
638 // inserted, it could change the size of the CurFun.Values vector.
639 if (&ValueTab == &CurFun.Values) {
640 if (ValueTab.size() <= CurFun.NextValNum)
641 ValueTab.resize(CurFun.NextValNum+1);
642 ValueTab[CurFun.NextValNum++] = V;
645 // For all other lists, its okay to just tack it on the back of the vector.
646 ValueTab.push_back(V);
649 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
651 case ValID::LocalID: // Is it a numbered definition?
652 // Module constants occupy the lowest numbered slots...
653 if (D.Num < CurModule.Types.size())
654 return CurModule.Types[D.Num];
656 case ValID::LocalName: // Is it a named definition?
657 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
658 D.destroy(); // Free old strdup'd memory...
663 GenerateError("Internal parser error: Invalid symbol type reference");
667 // If we reached here, we referenced either a symbol that we don't know about
668 // or an id number that hasn't been read yet. We may be referencing something
669 // forward, so just create an entry to be resolved later and get to it...
671 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
674 if (inFunctionScope()) {
675 if (D.Type == ValID::LocalName) {
676 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
679 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
684 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
685 if (I != CurModule.LateResolveTypes.end())
688 Type *Typ = OpaqueType::get();
689 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
693 // getExistingVal - Look up the value specified by the provided type and
694 // the provided ValID. If the value exists and has already been defined, return
695 // it. Otherwise return null.
697 static Value *getExistingVal(const Type *Ty, const ValID &D) {
698 if (isa<FunctionType>(Ty)) {
699 GenerateError("Functions are not values and "
700 "must be referenced as pointers");
705 case ValID::LocalID: { // Is it a numbered definition?
706 // Check that the number is within bounds.
707 if (D.Num >= CurFun.Values.size())
709 Value *Result = CurFun.Values[D.Num];
710 if (Ty != Result->getType()) {
711 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
712 Result->getType()->getDescription() + "' does not match "
713 "expected type, '" + Ty->getDescription() + "'");
718 case ValID::GlobalID: { // Is it a numbered definition?
719 if (D.Num >= CurModule.Values.size())
721 Value *Result = CurModule.Values[D.Num];
722 if (Ty != Result->getType()) {
723 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
724 Result->getType()->getDescription() + "' does not match "
725 "expected type, '" + Ty->getDescription() + "'");
731 case ValID::LocalName: { // Is it a named definition?
732 if (!inFunctionScope())
734 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
735 Value *N = SymTab.lookup(D.getName());
738 if (N->getType() != Ty)
741 D.destroy(); // Free old strdup'd memory...
744 case ValID::GlobalName: { // Is it a named definition?
745 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
746 Value *N = SymTab.lookup(D.getName());
749 if (N->getType() != Ty)
752 D.destroy(); // Free old strdup'd memory...
756 // Check to make sure that "Ty" is an integral type, and that our
757 // value will fit into the specified type...
758 case ValID::ConstSIntVal: // Is it a constant pool reference??
759 if (!isa<IntegerType>(Ty) ||
760 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
761 GenerateError("Signed integral constant '" +
762 itostr(D.ConstPool64) + "' is invalid for type '" +
763 Ty->getDescription() + "'");
766 return ConstantInt::get(Ty, D.ConstPool64, true);
768 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
769 if (isa<IntegerType>(Ty) &&
770 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
771 return ConstantInt::get(Ty, D.UConstPool64);
773 if (!isa<IntegerType>(Ty) ||
774 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
775 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
776 "' is invalid or out of range for type '" +
777 Ty->getDescription() + "'");
780 // This is really a signed reference. Transmogrify.
781 return ConstantInt::get(Ty, D.ConstPool64, true);
783 case ValID::ConstFPVal: // Is it a floating point const pool reference?
784 if (!Ty->isFloatingPoint() ||
785 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
786 GenerateError("FP constant invalid for type");
789 // Lexer has no type info, so builds all float and double FP constants
790 // as double. Fix this here. Long double does not need this.
791 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
793 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
794 return ConstantFP::get(*D.ConstPoolFP);
796 case ValID::ConstNullVal: // Is it a null value?
797 if (!isa<PointerType>(Ty)) {
798 GenerateError("Cannot create a a non pointer null");
801 return ConstantPointerNull::get(cast<PointerType>(Ty));
803 case ValID::ConstUndefVal: // Is it an undef value?
804 return UndefValue::get(Ty);
806 case ValID::ConstZeroVal: // Is it a zero value?
807 return Constant::getNullValue(Ty);
809 case ValID::ConstantVal: // Fully resolved constant?
810 if (D.ConstantValue->getType() != Ty) {
811 GenerateError("Constant expression type different from required type");
814 return D.ConstantValue;
816 case ValID::InlineAsmVal: { // Inline asm expression
817 const PointerType *PTy = dyn_cast<PointerType>(Ty);
818 const FunctionType *FTy =
819 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
820 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
821 GenerateError("Invalid type for asm constraint string");
824 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
825 D.IAD->HasSideEffects);
826 D.destroy(); // Free InlineAsmDescriptor.
830 assert(0 && "Unhandled case!");
834 assert(0 && "Unhandled case!");
838 // getVal - This function is identical to getExistingVal, except that if a
839 // value is not already defined, it "improvises" by creating a placeholder var
840 // that looks and acts just like the requested variable. When the value is
841 // defined later, all uses of the placeholder variable are replaced with the
844 static Value *getVal(const Type *Ty, const ValID &ID) {
845 if (Ty == Type::LabelTy) {
846 GenerateError("Cannot use a basic block here");
850 // See if the value has already been defined.
851 Value *V = getExistingVal(Ty, ID);
853 if (TriggerError) return 0;
855 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
856 GenerateError("Invalid use of a non-first-class type");
860 // If we reached here, we referenced either a symbol that we don't know about
861 // or an id number that hasn't been read yet. We may be referencing something
862 // forward, so just create an entry to be resolved later and get to it...
865 case ValID::GlobalName:
866 case ValID::GlobalID: {
867 const PointerType *PTy = dyn_cast<PointerType>(Ty);
869 GenerateError("Invalid type for reference to global" );
872 const Type* ElTy = PTy->getElementType();
873 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
874 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
876 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
877 (Module*)0, false, PTy->getAddressSpace());
881 V = new Argument(Ty);
884 // Remember where this forward reference came from. FIXME, shouldn't we try
885 // to recycle these things??
886 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
889 if (inFunctionScope())
890 InsertValue(V, CurFun.LateResolveValues);
892 InsertValue(V, CurModule.LateResolveValues);
896 /// defineBBVal - This is a definition of a new basic block with the specified
897 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
898 static BasicBlock *defineBBVal(const ValID &ID) {
899 assert(inFunctionScope() && "Can't get basic block at global scope!");
903 // First, see if this was forward referenced
905 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
906 if (BBI != CurFun.BBForwardRefs.end()) {
908 // The forward declaration could have been inserted anywhere in the
909 // function: insert it into the correct place now.
910 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
911 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
913 // We're about to erase the entry, save the key so we can clean it up.
914 ValID Tmp = BBI->first;
916 // Erase the forward ref from the map as its no longer "forward"
917 CurFun.BBForwardRefs.erase(ID);
919 // The key has been removed from the map but so we don't want to leave
920 // strdup'd memory around so destroy it too.
923 // If its a numbered definition, bump the number and set the BB value.
924 if (ID.Type == ValID::LocalID) {
925 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
929 // We haven't seen this BB before and its first mention is a definition.
930 // Just create it and return it.
931 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
932 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
933 if (ID.Type == ValID::LocalID) {
934 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
943 /// getBBVal - get an existing BB value or create a forward reference for it.
945 static BasicBlock *getBBVal(const ValID &ID) {
946 assert(inFunctionScope() && "Can't get basic block at global scope!");
950 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
951 if (BBI != CurFun.BBForwardRefs.end()) {
953 } if (ID.Type == ValID::LocalName) {
954 std::string Name = ID.getName();
955 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
957 if (N->getType()->getTypeID() == Type::LabelTyID)
958 BB = cast<BasicBlock>(N);
960 GenerateError("Reference to label '" + Name + "' is actually of type '"+
961 N->getType()->getDescription() + "'");
963 } else if (ID.Type == ValID::LocalID) {
964 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
965 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
966 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
968 GenerateError("Reference to label '%" + utostr(ID.Num) +
969 "' is actually of type '"+
970 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
973 GenerateError("Illegal label reference " + ID.getName());
977 // If its already been defined, return it now.
979 ID.destroy(); // Free strdup'd memory.
983 // Otherwise, this block has not been seen before, create it.
985 if (ID.Type == ValID::LocalName)
987 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
989 // Insert it in the forward refs map.
990 CurFun.BBForwardRefs[ID] = BB;
996 //===----------------------------------------------------------------------===//
997 // Code to handle forward references in instructions
998 //===----------------------------------------------------------------------===//
1000 // This code handles the late binding needed with statements that reference
1001 // values not defined yet... for example, a forward branch, or the PHI node for
1004 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1005 // and back patchs after we are done.
1008 // ResolveDefinitions - If we could not resolve some defs at parsing
1009 // time (forward branches, phi functions for loops, etc...) resolve the
1013 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1014 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1015 while (!LateResolvers.empty()) {
1016 Value *V = LateResolvers.back();
1017 LateResolvers.pop_back();
1019 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1020 CurModule.PlaceHolderInfo.find(V);
1021 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1023 ValID &DID = PHI->second.first;
1025 Value *TheRealValue = getExistingVal(V->getType(), DID);
1029 V->replaceAllUsesWith(TheRealValue);
1031 CurModule.PlaceHolderInfo.erase(PHI);
1032 } else if (FutureLateResolvers) {
1033 // Functions have their unresolved items forwarded to the module late
1035 InsertValue(V, *FutureLateResolvers);
1037 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1038 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1039 "' of type '" + V->getType()->getDescription() + "'",
1040 PHI->second.second);
1043 GenerateError("Reference to an invalid definition: #" +
1044 itostr(DID.Num) + " of type '" +
1045 V->getType()->getDescription() + "'",
1046 PHI->second.second);
1051 LateResolvers.clear();
1054 // ResolveTypeTo - A brand new type was just declared. This means that (if
1055 // name is not null) things referencing Name can be resolved. Otherwise, things
1056 // refering to the number can be resolved. Do this now.
1058 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1061 D = ValID::createLocalName(*Name);
1063 D = ValID::createLocalID(CurModule.Types.size());
1065 std::map<ValID, PATypeHolder>::iterator I =
1066 CurModule.LateResolveTypes.find(D);
1067 if (I != CurModule.LateResolveTypes.end()) {
1068 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1069 CurModule.LateResolveTypes.erase(I);
1073 // setValueName - Set the specified value to the name given. The name may be
1074 // null potentially, in which case this is a noop. The string passed in is
1075 // assumed to be a malloc'd string buffer, and is free'd by this function.
1077 static void setValueName(Value *V, std::string *NameStr) {
1078 if (!NameStr) return;
1079 std::string Name(*NameStr); // Copy string
1080 delete NameStr; // Free old string
1082 if (V->getType() == Type::VoidTy) {
1083 GenerateError("Can't assign name '" + Name+"' to value with void type");
1087 assert(inFunctionScope() && "Must be in function scope!");
1088 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1089 if (ST.lookup(Name)) {
1090 GenerateError("Redefinition of value '" + Name + "' of type '" +
1091 V->getType()->getDescription() + "'");
1099 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1100 /// this is a declaration, otherwise it is a definition.
1101 static GlobalVariable *
1102 ParseGlobalVariable(std::string *NameStr,
1103 GlobalValue::LinkageTypes Linkage,
1104 GlobalValue::VisibilityTypes Visibility,
1105 bool isConstantGlobal, const Type *Ty,
1106 Constant *Initializer, bool IsThreadLocal,
1107 unsigned AddressSpace = 0) {
1108 if (isa<FunctionType>(Ty)) {
1109 GenerateError("Cannot declare global vars of function type");
1112 if (Ty == Type::LabelTy) {
1113 GenerateError("Cannot declare global vars of label type");
1117 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1121 Name = *NameStr; // Copy string
1122 delete NameStr; // Free old string
1125 // See if this global value was forward referenced. If so, recycle the
1128 if (!Name.empty()) {
1129 ID = ValID::createGlobalName(Name);
1131 ID = ValID::createGlobalID(CurModule.Values.size());
1134 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1135 // Move the global to the end of the list, from whereever it was
1136 // previously inserted.
1137 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1138 CurModule.CurrentModule->getGlobalList().remove(GV);
1139 CurModule.CurrentModule->getGlobalList().push_back(GV);
1140 GV->setInitializer(Initializer);
1141 GV->setLinkage(Linkage);
1142 GV->setVisibility(Visibility);
1143 GV->setConstant(isConstantGlobal);
1144 GV->setThreadLocal(IsThreadLocal);
1145 InsertValue(GV, CurModule.Values);
1149 // If this global has a name
1150 if (!Name.empty()) {
1151 // if the global we're parsing has an initializer (is a definition) and
1152 // has external linkage.
1153 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1154 // If there is already a global with external linkage with this name
1155 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1156 // If we allow this GVar to get created, it will be renamed in the
1157 // symbol table because it conflicts with an existing GVar. We can't
1158 // allow redefinition of GVars whose linking indicates that their name
1159 // must stay the same. Issue the error.
1160 GenerateError("Redefinition of global variable named '" + Name +
1161 "' of type '" + Ty->getDescription() + "'");
1166 // Otherwise there is no existing GV to use, create one now.
1167 GlobalVariable *GV =
1168 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1169 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1170 GV->setVisibility(Visibility);
1171 InsertValue(GV, CurModule.Values);
1175 // setTypeName - Set the specified type to the name given. The name may be
1176 // null potentially, in which case this is a noop. The string passed in is
1177 // assumed to be a malloc'd string buffer, and is freed by this function.
1179 // This function returns true if the type has already been defined, but is
1180 // allowed to be redefined in the specified context. If the name is a new name
1181 // for the type plane, it is inserted and false is returned.
1182 static bool setTypeName(const Type *T, std::string *NameStr) {
1183 assert(!inFunctionScope() && "Can't give types function-local names!");
1184 if (NameStr == 0) return false;
1186 std::string Name(*NameStr); // Copy string
1187 delete NameStr; // Free old string
1189 // We don't allow assigning names to void type
1190 if (T == Type::VoidTy) {
1191 GenerateError("Can't assign name '" + Name + "' to the void type");
1195 // Set the type name, checking for conflicts as we do so.
1196 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1198 if (AlreadyExists) { // Inserting a name that is already defined???
1199 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1200 assert(Existing && "Conflict but no matching type?!");
1202 // There is only one case where this is allowed: when we are refining an
1203 // opaque type. In this case, Existing will be an opaque type.
1204 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1205 // We ARE replacing an opaque type!
1206 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1210 // Otherwise, this is an attempt to redefine a type. That's okay if
1211 // the redefinition is identical to the original. This will be so if
1212 // Existing and T point to the same Type object. In this one case we
1213 // allow the equivalent redefinition.
1214 if (Existing == T) return true; // Yes, it's equal.
1216 // Any other kind of (non-equivalent) redefinition is an error.
1217 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1218 T->getDescription() + "'");
1224 //===----------------------------------------------------------------------===//
1225 // Code for handling upreferences in type names...
1228 // TypeContains - Returns true if Ty directly contains E in it.
1230 static bool TypeContains(const Type *Ty, const Type *E) {
1231 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1232 E) != Ty->subtype_end();
1236 struct UpRefRecord {
1237 // NestingLevel - The number of nesting levels that need to be popped before
1238 // this type is resolved.
1239 unsigned NestingLevel;
1241 // LastContainedTy - This is the type at the current binding level for the
1242 // type. Every time we reduce the nesting level, this gets updated.
1243 const Type *LastContainedTy;
1245 // UpRefTy - This is the actual opaque type that the upreference is
1246 // represented with.
1247 OpaqueType *UpRefTy;
1249 UpRefRecord(unsigned NL, OpaqueType *URTy)
1250 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1254 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1255 static std::vector<UpRefRecord> UpRefs;
1257 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1258 /// called. It loops through the UpRefs vector, which is a list of the
1259 /// currently active types. For each type, if the up reference is contained in
1260 /// the newly completed type, we decrement the level count. When the level
1261 /// count reaches zero, the upreferenced type is the type that is passed in:
1262 /// thus we can complete the cycle.
1264 static PATypeHolder HandleUpRefs(const Type *ty) {
1265 // If Ty isn't abstract, or if there are no up-references in it, then there is
1266 // nothing to resolve here.
1267 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1269 PATypeHolder Ty(ty);
1270 UR_OUT("Type '" << Ty->getDescription() <<
1271 "' newly formed. Resolving upreferences.\n" <<
1272 UpRefs.size() << " upreferences active!\n");
1274 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1275 // to zero), we resolve them all together before we resolve them to Ty. At
1276 // the end of the loop, if there is anything to resolve to Ty, it will be in
1278 OpaqueType *TypeToResolve = 0;
1280 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1281 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1282 << UpRefs[i].second->getDescription() << ") = "
1283 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1284 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1285 // Decrement level of upreference
1286 unsigned Level = --UpRefs[i].NestingLevel;
1287 UpRefs[i].LastContainedTy = Ty;
1288 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1289 if (Level == 0) { // Upreference should be resolved!
1290 if (!TypeToResolve) {
1291 TypeToResolve = UpRefs[i].UpRefTy;
1293 UR_OUT(" * Resolving upreference for "
1294 << UpRefs[i].second->getDescription() << "\n";
1295 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1296 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1297 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1298 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1300 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1301 --i; // Do not skip the next element...
1306 if (TypeToResolve) {
1307 UR_OUT(" * Resolving upreference for "
1308 << UpRefs[i].second->getDescription() << "\n";
1309 std::string OldName = TypeToResolve->getDescription());
1310 TypeToResolve->refineAbstractTypeTo(Ty);
1316 //===----------------------------------------------------------------------===//
1317 // RunVMAsmParser - Define an interface to this parser
1318 //===----------------------------------------------------------------------===//
1320 static Module* RunParser(Module * M);
1322 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1324 Module *M = RunParser(new Module(LLLgetFilename()));
1331 /* Enabling traces. */
1336 /* Enabling verbose error messages. */
1337 #ifdef YYERROR_VERBOSE
1338 # undef YYERROR_VERBOSE
1339 # define YYERROR_VERBOSE 1
1341 # define YYERROR_VERBOSE 0
1344 /* Enabling the token table. */
1345 #ifndef YYTOKEN_TABLE
1346 # define YYTOKEN_TABLE 0
1349 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1350 typedef union YYSTYPE
1351 #line 953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
1353 llvm::Module *ModuleVal;
1354 llvm::Function *FunctionVal;
1355 llvm::BasicBlock *BasicBlockVal;
1356 llvm::TerminatorInst *TermInstVal;
1357 llvm::Instruction *InstVal;
1358 llvm::Constant *ConstVal;
1360 const llvm::Type *PrimType;
1361 std::list<llvm::PATypeHolder> *TypeList;
1362 llvm::PATypeHolder *TypeVal;
1363 llvm::Value *ValueVal;
1364 std::vector<llvm::Value*> *ValueList;
1365 std::vector<unsigned> *ConstantList;
1366 llvm::ArgListType *ArgList;
1367 llvm::TypeWithAttrs TypeWithAttrs;
1368 llvm::TypeWithAttrsList *TypeWithAttrsList;
1369 llvm::ParamList *ParamList;
1371 // Represent the RHS of PHI node
1372 std::list<std::pair<llvm::Value*,
1373 llvm::BasicBlock*> > *PHIList;
1374 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1375 std::vector<llvm::Constant*> *ConstVector;
1377 llvm::GlobalValue::LinkageTypes Linkage;
1378 llvm::GlobalValue::VisibilityTypes Visibility;
1379 llvm::ParameterAttributes ParamAttrs;
1380 llvm::APInt *APIntVal;
1385 llvm::APFloat *FPVal;
1388 std::string *StrVal; // This memory must be deleted
1389 llvm::ValID ValIDVal;
1391 llvm::Instruction::BinaryOps BinaryOpVal;
1392 llvm::Instruction::TermOps TermOpVal;
1393 llvm::Instruction::MemoryOps MemOpVal;
1394 llvm::Instruction::CastOps CastOpVal;
1395 llvm::Instruction::OtherOps OtherOpVal;
1396 llvm::ICmpInst::Predicate IPredicate;
1397 llvm::FCmpInst::Predicate FPredicate;
1399 /* Line 187 of yacc.c. */
1400 #line 1401 "llvmAsmParser.tab.c"
1402 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1403 # define YYSTYPE_IS_DECLARED 1
1404 # define YYSTYPE_IS_TRIVIAL 1
1409 /* Copy the second part of user declarations. */
1412 /* Line 216 of yacc.c. */
1413 #line 1414 "llvmAsmParser.tab.c"
1420 typedef YYTYPE_UINT8 yytype_uint8;
1422 typedef unsigned char yytype_uint8;
1426 typedef YYTYPE_INT8 yytype_int8;
1427 #elif (defined __STDC__ || defined __C99__FUNC__ \
1428 || defined __cplusplus || defined _MSC_VER)
1429 typedef signed char yytype_int8;
1431 typedef short int yytype_int8;
1434 #ifdef YYTYPE_UINT16
1435 typedef YYTYPE_UINT16 yytype_uint16;
1437 typedef unsigned short int yytype_uint16;
1441 typedef YYTYPE_INT16 yytype_int16;
1443 typedef short int yytype_int16;
1447 # ifdef __SIZE_TYPE__
1448 # define YYSIZE_T __SIZE_TYPE__
1449 # elif defined size_t
1450 # define YYSIZE_T size_t
1451 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1452 || defined __cplusplus || defined _MSC_VER)
1453 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1454 # define YYSIZE_T size_t
1456 # define YYSIZE_T unsigned int
1460 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1465 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1466 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1470 # define YY_(msgid) msgid
1474 /* Suppress unused-variable warnings by "using" E. */
1475 #if ! defined lint || defined __GNUC__
1476 # define YYUSE(e) ((void) (e))
1478 # define YYUSE(e) /* empty */
1481 /* Identity function, used to suppress warnings about constant conditions. */
1483 # define YYID(n) (n)
1485 #if (defined __STDC__ || defined __C99__FUNC__ \
1486 || defined __cplusplus || defined _MSC_VER)
1499 #if ! defined yyoverflow || YYERROR_VERBOSE
1501 /* The parser invokes alloca or malloc; define the necessary symbols. */
1503 # ifdef YYSTACK_USE_ALLOCA
1504 # if YYSTACK_USE_ALLOCA
1506 # define YYSTACK_ALLOC __builtin_alloca
1507 # elif defined __BUILTIN_VA_ARG_INCR
1508 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1510 # define YYSTACK_ALLOC __alloca
1511 # elif defined _MSC_VER
1512 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1513 # define alloca _alloca
1515 # define YYSTACK_ALLOC alloca
1516 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1517 || defined __cplusplus || defined _MSC_VER)
1518 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1520 # define _STDLIB_H 1
1527 # ifdef YYSTACK_ALLOC
1528 /* Pacify GCC's `empty if-body' warning. */
1529 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1530 # ifndef YYSTACK_ALLOC_MAXIMUM
1531 /* The OS might guarantee only one guard page at the bottom of the stack,
1532 and a page size can be as small as 4096 bytes. So we cannot safely
1533 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1534 to allow for a few compiler-allocated temporary stack slots. */
1535 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1538 # define YYSTACK_ALLOC YYMALLOC
1539 # define YYSTACK_FREE YYFREE
1540 # ifndef YYSTACK_ALLOC_MAXIMUM
1541 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1543 # if (defined __cplusplus && ! defined _STDLIB_H \
1544 && ! ((defined YYMALLOC || defined malloc) \
1545 && (defined YYFREE || defined free)))
1546 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1548 # define _STDLIB_H 1
1552 # define YYMALLOC malloc
1553 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1554 || defined __cplusplus || defined _MSC_VER)
1555 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1559 # define YYFREE free
1560 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1561 || defined __cplusplus || defined _MSC_VER)
1562 void free (void *); /* INFRINGES ON USER NAME SPACE */
1566 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1569 #if (! defined yyoverflow \
1570 && (! defined __cplusplus \
1571 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1573 /* A type that is properly aligned for any stack member. */
1580 /* The size of the maximum gap between one aligned stack and the next. */
1581 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1583 /* The size of an array large to enough to hold all stacks, each with
1585 # define YYSTACK_BYTES(N) \
1586 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1587 + YYSTACK_GAP_MAXIMUM)
1589 /* Copy COUNT objects from FROM to TO. The source and destination do
1592 # if defined __GNUC__ && 1 < __GNUC__
1593 # define YYCOPY(To, From, Count) \
1594 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1596 # define YYCOPY(To, From, Count) \
1600 for (yyi = 0; yyi < (Count); yyi++) \
1601 (To)[yyi] = (From)[yyi]; \
1607 /* Relocate STACK from its old location to the new one. The
1608 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1609 elements in the stack, and YYPTR gives the new location of the
1610 stack. Advance YYPTR to a properly aligned location for the next
1612 # define YYSTACK_RELOCATE(Stack) \
1615 YYSIZE_T yynewbytes; \
1616 YYCOPY (&yyptr->Stack, Stack, yysize); \
1617 Stack = &yyptr->Stack; \
1618 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1619 yyptr += yynewbytes / sizeof (*yyptr); \
1625 /* YYFINAL -- State number of the termination state. */
1627 /* YYLAST -- Last index in YYTABLE. */
1630 /* YYNTOKENS -- Number of terminals. */
1631 #define YYNTOKENS 170
1632 /* YYNNTS -- Number of nonterminals. */
1634 /* YYNRULES -- Number of rules. */
1635 #define YYNRULES 340
1636 /* YYNRULES -- Number of states. */
1637 #define YYNSTATES 699
1639 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1640 #define YYUNDEFTOK 2
1641 #define YYMAXUTOK 410
1643 #define YYTRANSLATE(YYX) \
1644 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1646 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1647 static const yytype_uint8 yytranslate[] =
1649 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1653 156, 157, 160, 2, 159, 2, 2, 2, 2, 2,
1654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1655 165, 158, 166, 2, 2, 2, 2, 2, 2, 2,
1656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1658 2, 162, 161, 164, 2, 2, 2, 2, 2, 169,
1659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1660 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1661 163, 2, 2, 167, 2, 168, 2, 2, 2, 2,
1662 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1663 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1664 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1665 2, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1670 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1671 2, 2, 2, 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, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1675 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1676 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1677 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1678 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1679 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1680 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1681 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1682 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1683 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1684 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1685 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1686 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1687 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1688 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1689 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1694 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1696 static const yytype_uint16 yyprhs[] =
1698 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1699 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1700 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1701 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1702 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1703 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1704 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1705 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1706 160, 162, 164, 166, 168, 169, 171, 173, 175, 176,
1707 178, 180, 181, 183, 185, 187, 189, 190, 192, 194,
1708 195, 197, 199, 201, 203, 205, 208, 210, 212, 214,
1709 216, 218, 220, 222, 224, 226, 229, 230, 233, 235,
1710 237, 239, 241, 243, 245, 246, 249, 250, 253, 254,
1711 257, 258, 262, 265, 266, 268, 269, 273, 275, 278,
1712 280, 282, 284, 286, 288, 290, 292, 294, 296, 300,
1713 302, 305, 311, 317, 323, 329, 333, 336, 342, 347,
1714 350, 352, 354, 356, 360, 362, 366, 368, 369, 371,
1715 375, 380, 384, 388, 393, 398, 402, 409, 415, 418,
1716 421, 424, 427, 430, 433, 436, 439, 442, 445, 448,
1717 451, 458, 464, 473, 480, 487, 495, 503, 511, 519,
1718 526, 535, 544, 550, 558, 562, 564, 566, 568, 570,
1719 571, 574, 581, 583, 584, 586, 589, 590, 594, 595,
1720 599, 603, 607, 611, 612, 621, 622, 632, 633, 643,
1721 649, 652, 656, 658, 662, 666, 670, 674, 676, 677,
1722 683, 687, 689, 693, 695, 696, 707, 709, 711, 716,
1723 718, 720, 723, 727, 728, 730, 732, 734, 736, 738,
1724 740, 742, 744, 746, 750, 754, 757, 760, 764, 767,
1725 773, 778, 780, 786, 788, 790, 792, 794, 796, 798,
1726 801, 803, 807, 810, 813, 817, 820, 821, 823, 826,
1727 829, 833, 843, 853, 862, 877, 879, 881, 888, 894,
1728 897, 904, 912, 917, 922, 929, 936, 937, 938, 942,
1729 945, 949, 952, 954, 960, 966, 973, 980, 987, 994,
1730 999, 1006, 1011, 1016, 1023, 1030, 1033, 1042, 1044, 1046,
1731 1047, 1051, 1058, 1062, 1069, 1072, 1078, 1086, 1092, 1097,
1735 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1736 static const yytype_int16 yyrhs[] =
1738 216, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1739 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1740 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1741 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1742 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1743 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1744 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1745 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1746 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1747 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1748 -1, 102, -1, 103, -1, 26, -1, 27, -1, 11,
1749 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1750 -1, 19, -1, 22, -1, 24, -1, 178, -1, -1,
1751 55, 156, 4, 157, -1, -1, 178, 158, -1, -1,
1752 20, -1, 23, -1, 184, -1, -1, 182, 158, -1,
1753 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1754 49, -1, 46, -1, 48, -1, 51, -1, -1, 153,
1755 -1, 154, -1, 155, -1, -1, 46, -1, 48, -1,
1756 -1, 42, -1, 43, -1, 44, -1, 47, -1, -1,
1757 44, -1, 42, -1, -1, 63, -1, 64, -1, 65,
1758 -1, 66, -1, 67, -1, 62, 4, -1, 142, -1,
1759 121, -1, 141, -1, 122, -1, 144, -1, 145, -1,
1760 147, -1, 148, -1, 149, -1, 54, 4, -1, -1,
1761 193, 192, -1, 143, -1, 146, -1, 142, -1, 141,
1762 -1, 150, -1, 151, -1, -1, 195, 194, -1, -1,
1763 152, 22, -1, -1, 54, 4, -1, -1, 159, 54,
1764 4, -1, 34, 22, -1, -1, 199, -1, -1, 159,
1765 202, 201, -1, 199, -1, 54, 4, -1, 11, -1,
1766 12, -1, 13, -1, 16, -1, 15, -1, 14, -1,
1767 17, -1, 50, -1, 203, -1, 204, 180, 160, -1,
1768 238, -1, 161, 4, -1, 204, 156, 208, 157, 195,
1769 -1, 10, 156, 208, 157, 195, -1, 162, 4, 163,
1770 204, 164, -1, 165, 4, 163, 204, 166, -1, 167,
1771 209, 168, -1, 167, 168, -1, 165, 167, 209, 168,
1772 166, -1, 165, 167, 168, 166, -1, 204, 193, -1,
1773 204, -1, 10, -1, 205, -1, 207, 159, 205, -1,
1774 207, -1, 207, 159, 39, -1, 39, -1, -1, 204,
1775 -1, 209, 159, 204, -1, 204, 162, 212, 164, -1,
1776 204, 162, 164, -1, 204, 169, 22, -1, 204, 165,
1777 212, 166, -1, 204, 167, 212, 168, -1, 204, 167,
1778 168, -1, 204, 165, 167, 212, 168, 166, -1, 204,
1779 165, 167, 168, 166, -1, 204, 40, -1, 204, 41,
1780 -1, 204, 238, -1, 204, 211, -1, 204, 25, -1,
1781 176, 3, -1, 176, 5, -1, 176, 4, -1, 176,
1782 6, -1, 11, 26, -1, 11, 27, -1, 177, 9,
1783 -1, 173, 156, 210, 38, 204, 157, -1, 119, 156,
1784 210, 250, 157, -1, 133, 156, 210, 159, 210, 159,
1785 210, 157, -1, 171, 156, 210, 159, 210, 157, -1,
1786 172, 156, 210, 159, 210, 157, -1, 90, 174, 156,
1787 210, 159, 210, 157, -1, 91, 175, 156, 210, 159,
1788 210, 157, -1, 92, 174, 156, 210, 159, 210, 157,
1789 -1, 93, 175, 156, 210, 159, 210, 157, -1, 135,
1790 156, 210, 159, 210, 157, -1, 136, 156, 210, 159,
1791 210, 159, 210, 157, -1, 137, 156, 210, 159, 210,
1792 159, 210, 157, -1, 139, 156, 210, 251, 157, -1,
1793 140, 156, 210, 159, 210, 251, 157, -1, 212, 159,
1794 210, -1, 210, -1, 32, -1, 33, -1, 37, -1,
1795 -1, 206, 238, -1, 125, 156, 215, 38, 204, 157,
1796 -1, 217, -1, -1, 218, -1, 217, 218, -1, -1,
1797 31, 219, 234, -1, -1, 30, 220, 235, -1, 60,
1798 59, 224, -1, 181, 18, 204, -1, 181, 18, 10,
1799 -1, -1, 183, 187, 214, 213, 210, 180, 221, 201,
1800 -1, -1, 183, 185, 187, 214, 213, 210, 180, 222,
1801 201, -1, -1, 183, 186, 187, 214, 213, 204, 180,
1802 223, 201, -1, 183, 187, 35, 190, 215, -1, 52,
1803 225, -1, 56, 158, 226, -1, 22, -1, 53, 158,
1804 22, -1, 68, 158, 22, -1, 162, 227, 164, -1,
1805 227, 159, 22, -1, 22, -1, -1, 228, 159, 204,
1806 193, 179, -1, 204, 193, 179, -1, 228, -1, 228,
1807 159, 39, -1, 39, -1, -1, 191, 206, 182, 156,
1808 229, 157, 195, 200, 197, 196, -1, 28, -1, 167,
1809 -1, 189, 187, 230, 231, -1, 29, -1, 168, -1,
1810 242, 233, -1, 188, 187, 230, -1, -1, 61, -1,
1811 3, -1, 4, -1, 9, -1, 26, -1, 27, -1,
1812 40, -1, 41, -1, 25, -1, 165, 212, 166, -1,
1813 162, 212, 164, -1, 162, 164, -1, 169, 22, -1,
1814 167, 212, 168, -1, 167, 168, -1, 165, 167, 212,
1815 168, 166, -1, 165, 167, 168, 166, -1, 211, -1,
1816 59, 236, 22, 159, 22, -1, 7, -1, 8, -1,
1817 178, -1, 182, -1, 238, -1, 237, -1, 204, 239,
1818 -1, 240, -1, 241, 159, 240, -1, 242, 243, -1,
1819 232, 243, -1, 244, 181, 245, -1, 244, 247, -1,
1820 -1, 21, -1, 69, 241, -1, 69, 10, -1, 70,
1821 17, 239, -1, 70, 11, 239, 159, 17, 239, 159,
1822 17, 239, -1, 71, 176, 239, 159, 17, 239, 162,
1823 246, 164, -1, 71, 176, 239, 159, 17, 239, 162,
1824 164, -1, 72, 191, 206, 239, 156, 249, 157, 195,
1825 38, 17, 239, 73, 17, 239, -1, 73, -1, 74,
1826 -1, 246, 176, 237, 159, 17, 239, -1, 176, 237,
1827 159, 17, 239, -1, 181, 253, -1, 204, 162, 239,
1828 159, 239, 164, -1, 248, 159, 162, 239, 159, 239,
1829 164, -1, 204, 193, 239, 193, -1, 17, 193, 239,
1830 193, -1, 249, 159, 204, 193, 239, 193, -1, 249,
1831 159, 17, 193, 239, 193, -1, -1, -1, 250, 159,
1832 240, -1, 159, 4, -1, 251, 159, 4, -1, 58,
1833 57, -1, 57, -1, 171, 204, 239, 159, 239, -1,
1834 172, 204, 239, 159, 239, -1, 90, 174, 204, 239,
1835 159, 239, -1, 91, 175, 204, 239, 159, 239, -1,
1836 92, 174, 204, 239, 159, 239, -1, 93, 175, 204,
1837 239, 159, 239, -1, 173, 240, 38, 204, -1, 133,
1838 240, 159, 240, 159, 240, -1, 134, 240, 159, 204,
1839 -1, 135, 240, 159, 240, -1, 136, 240, 159, 240,
1840 159, 240, -1, 137, 240, 159, 240, 159, 240, -1,
1841 132, 248, -1, 252, 191, 206, 239, 156, 249, 157,
1842 195, -1, 255, -1, 36, -1, -1, 114, 204, 198,
1843 -1, 114, 204, 159, 11, 239, 198, -1, 115, 204,
1844 198, -1, 115, 204, 159, 11, 239, 198, -1, 116,
1845 240, -1, 254, 117, 204, 239, 198, -1, 254, 118,
1846 240, 159, 204, 239, 198, -1, 138, 204, 239, 159,
1847 4, -1, 119, 204, 239, 250, -1, 139, 204, 239,
1848 251, -1, 140, 204, 239, 159, 204, 239, 251, -1
1851 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1852 static const yytype_uint16 yyrline[] =
1854 0, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118,
1855 1118, 1119, 1119, 1119, 1119, 1119, 1119, 1120, 1120, 1120,
1856 1120, 1120, 1120, 1121, 1121, 1121, 1121, 1121, 1121, 1124,
1857 1124, 1125, 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1132,
1858 1132, 1133, 1133, 1134, 1134, 1135, 1135, 1136, 1136, 1137,
1859 1137, 1138, 1138, 1139, 1140, 1145, 1146, 1146, 1146, 1146,
1860 1146, 1148, 1148, 1148, 1149, 1149, 1151, 1152, 1156, 1160,
1861 1165, 1165, 1167, 1168, 1173, 1179, 1180, 1181, 1182, 1183,
1862 1184, 1188, 1189, 1190, 1194, 1195, 1196, 1197, 1201, 1202,
1863 1203, 1207, 1208, 1209, 1210, 1211, 1215, 1216, 1217, 1220,
1864 1221, 1222, 1223, 1224, 1225, 1226, 1233, 1234, 1235, 1236,
1865 1237, 1238, 1239, 1240, 1241, 1242, 1246, 1247, 1252, 1253,
1866 1254, 1255, 1256, 1257, 1260, 1261, 1266, 1267, 1274, 1275,
1867 1281, 1282, 1291, 1299, 1300, 1305, 1306, 1307, 1312, 1325,
1868 1325, 1325, 1325, 1325, 1325, 1325, 1328, 1332, 1336, 1343,
1869 1348, 1356, 1385, 1410, 1415, 1425, 1435, 1439, 1449, 1456,
1870 1465, 1472, 1477, 1482, 1489, 1490, 1497, 1504, 1512, 1518,
1871 1530, 1558, 1574, 1601, 1629, 1655, 1675, 1701, 1721, 1733,
1872 1740, 1806, 1816, 1826, 1832, 1842, 1848, 1858, 1864, 1870,
1873 1883, 1895, 1916, 1924, 1930, 1941, 1946, 1951, 1956, 1961,
1874 1967, 1973, 1979, 1987, 1998, 2002, 2010, 2010, 2013, 2013,
1875 2016, 2028, 2049, 2054, 2062, 2063, 2067, 2067, 2071, 2071,
1876 2074, 2077, 2101, 2113, 2112, 2124, 2123, 2133, 2132, 2143,
1877 2183, 2186, 2192, 2202, 2206, 2211, 2213, 2218, 2223, 2232,
1878 2242, 2253, 2257, 2266, 2275, 2280, 2409, 2409, 2411, 2420,
1879 2420, 2422, 2427, 2439, 2443, 2448, 2452, 2456, 2460, 2464,
1880 2468, 2472, 2476, 2480, 2502, 2524, 2528, 2541, 2553, 2558,
1881 2570, 2576, 2580, 2590, 2594, 2598, 2603, 2610, 2610, 2616,
1882 2625, 2630, 2635, 2639, 2648, 2657, 2666, 2670, 2678, 2685,
1883 2689, 2694, 2705, 2724, 2733, 2819, 2823, 2830, 2841, 2854,
1884 2864, 2875, 2885, 2896, 2904, 2914, 2921, 2924, 2925, 2933,
1885 2939, 2948, 2952, 2957, 2973, 2990, 3004, 3018, 3032, 3046,
1886 3058, 3066, 3073, 3079, 3085, 3091, 3106, 3196, 3201, 3205,
1887 3212, 3219, 3229, 3236, 3246, 3254, 3268, 3285, 3293, 3308,
1892 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1893 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1894 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1895 static const char *const yytname[] =
1897 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1898 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1899 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1900 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1901 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1902 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1903 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1904 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1905 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1906 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1907 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1908 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1909 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1910 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1911 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1912 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1913 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1914 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1915 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1916 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1917 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1918 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1919 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1920 "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1921 "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1922 "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1923 "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1924 "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName",
1925 "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1926 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1927 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1928 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1929 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1930 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1931 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1932 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1933 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1934 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1935 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1936 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1937 "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1938 "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1939 "JumpTable", "Inst", "PHIList", "ParamList", "IndexList",
1940 "ConstantIndexList", "OptTailCall", "InstVal", "OptVolatile",
1946 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1948 static const yytype_uint16 yytoknum[] =
1950 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1951 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1952 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1953 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1954 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1955 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1956 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1957 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1958 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1959 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1960 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1961 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1962 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1963 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1964 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1965 405, 406, 407, 408, 409, 410, 40, 41, 61, 44,
1966 42, 92, 91, 120, 93, 60, 62, 123, 125, 99
1970 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1971 static const yytype_uint8 yyr1[] =
1973 0, 170, 171, 171, 171, 171, 171, 171, 171, 171,
1974 171, 172, 172, 172, 172, 172, 172, 173, 173, 173,
1975 173, 173, 173, 173, 173, 173, 173, 173, 173, 174,
1976 174, 174, 174, 174, 174, 174, 174, 174, 174, 175,
1977 175, 175, 175, 175, 175, 175, 175, 175, 175, 175,
1978 175, 175, 175, 175, 175, 176, 177, 177, 177, 177,
1979 177, 178, 178, 178, 179, 179, 180, 180, 181, 181,
1980 182, 182, 183, 183, 184, 185, 185, 185, 185, 185,
1981 185, 186, 186, 186, 187, 187, 187, 187, 188, 188,
1982 188, 189, 189, 189, 189, 189, 190, 190, 190, 191,
1983 191, 191, 191, 191, 191, 191, 192, 192, 192, 192,
1984 192, 192, 192, 192, 192, 192, 193, 193, 194, 194,
1985 194, 194, 194, 194, 195, 195, 196, 196, 197, 197,
1986 198, 198, 199, 200, 200, 201, 201, 202, 202, 203,
1987 203, 203, 203, 203, 203, 203, 204, 204, 204, 204,
1988 204, 204, 204, 204, 204, 204, 204, 204, 204, 205,
1989 206, 206, 207, 207, 208, 208, 208, 208, 209, 209,
1990 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1991 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
1992 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
1993 211, 211, 211, 211, 212, 212, 213, 213, 214, 214,
1994 215, 215, 216, 216, 217, 217, 219, 218, 220, 218,
1995 218, 218, 218, 221, 218, 222, 218, 223, 218, 218,
1996 218, 218, 224, 225, 225, 226, 227, 227, 227, 228,
1997 228, 229, 229, 229, 229, 230, 231, 231, 232, 233,
1998 233, 234, 235, 236, 236, 237, 237, 237, 237, 237,
1999 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
2000 237, 237, 237, 238, 238, 238, 238, 239, 239, 240,
2001 241, 241, 242, 242, 243, 244, 244, 244, 245, 245,
2002 245, 245, 245, 245, 245, 245, 245, 246, 246, 247,
2003 248, 248, 249, 249, 249, 249, 249, 250, 250, 251,
2004 251, 252, 252, 253, 253, 253, 253, 253, 253, 253,
2005 253, 253, 253, 253, 253, 253, 253, 253, 254, 254,
2006 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
2010 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2011 static const yytype_uint8 yyr2[] =
2013 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2014 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2015 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2016 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2017 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2018 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2019 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
2020 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
2021 1, 1, 1, 1, 0, 1, 1, 1, 0, 1,
2022 1, 0, 1, 1, 1, 1, 0, 1, 1, 0,
2023 1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
2024 1, 1, 1, 1, 1, 2, 0, 2, 1, 1,
2025 1, 1, 1, 1, 0, 2, 0, 2, 0, 2,
2026 0, 3, 2, 0, 1, 0, 3, 1, 2, 1,
2027 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2028 2, 5, 5, 5, 5, 3, 2, 5, 4, 2,
2029 1, 1, 1, 3, 1, 3, 1, 0, 1, 3,
2030 4, 3, 3, 4, 4, 3, 6, 5, 2, 2,
2031 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2032 6, 5, 8, 6, 6, 7, 7, 7, 7, 6,
2033 8, 8, 5, 7, 3, 1, 1, 1, 1, 0,
2034 2, 6, 1, 0, 1, 2, 0, 3, 0, 3,
2035 3, 3, 3, 0, 8, 0, 9, 0, 9, 5,
2036 2, 3, 1, 3, 3, 3, 3, 1, 0, 5,
2037 3, 1, 3, 1, 0, 10, 1, 1, 4, 1,
2038 1, 2, 3, 0, 1, 1, 1, 1, 1, 1,
2039 1, 1, 1, 3, 3, 2, 2, 3, 2, 5,
2040 4, 1, 5, 1, 1, 1, 1, 1, 1, 2,
2041 1, 3, 2, 2, 3, 2, 0, 1, 2, 2,
2042 3, 9, 9, 8, 14, 1, 1, 6, 5, 2,
2043 6, 7, 4, 4, 6, 6, 0, 0, 3, 2,
2044 3, 2, 1, 5, 5, 6, 6, 6, 6, 4,
2045 6, 4, 4, 6, 6, 2, 8, 1, 1, 0,
2046 3, 6, 3, 6, 2, 5, 7, 5, 4, 4,
2050 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2051 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2052 means the default is an error. */
2053 static const yytype_uint16 yydefact[] =
2055 73, 61, 70, 62, 71, 63, 218, 216, 0, 0,
2056 0, 0, 0, 0, 84, 72, 0, 73, 214, 88,
2057 91, 0, 0, 230, 0, 0, 68, 0, 74, 75,
2058 77, 76, 78, 81, 79, 82, 80, 83, 85, 86,
2059 87, 84, 84, 209, 1, 215, 89, 90, 84, 219,
2060 92, 93, 94, 95, 84, 286, 217, 286, 0, 0,
2061 238, 231, 232, 220, 273, 274, 222, 139, 140, 141,
2062 144, 143, 142, 145, 146, 0, 0, 0, 0, 275,
2063 276, 147, 221, 149, 209, 209, 96, 208, 0, 99,
2064 99, 287, 283, 69, 249, 250, 251, 282, 233, 234,
2065 237, 0, 167, 150, 0, 0, 0, 0, 156, 168,
2066 0, 0, 167, 0, 0, 0, 98, 97, 0, 206,
2067 207, 0, 0, 100, 101, 102, 103, 104, 0, 252,
2068 0, 329, 285, 0, 235, 166, 116, 162, 164, 0,
2069 0, 0, 0, 0, 0, 155, 0, 0, 148, 0,
2070 0, 161, 0, 160, 0, 229, 139, 140, 141, 144,
2071 143, 142, 0, 0, 67, 67, 105, 0, 246, 247,
2072 248, 328, 312, 0, 0, 0, 0, 99, 295, 296,
2073 2, 3, 4, 5, 6, 7, 8, 9, 10, 14,
2074 15, 16, 11, 12, 13, 0, 0, 0, 0, 0,
2075 0, 0, 0, 17, 18, 19, 20, 21, 22, 23,
2076 24, 25, 26, 27, 28, 0, 0, 0, 0, 0,
2077 0, 0, 0, 0, 0, 0, 0, 284, 99, 299,
2078 0, 327, 236, 159, 0, 124, 67, 67, 158, 0,
2079 169, 0, 124, 67, 67, 0, 210, 187, 188, 183,
2080 185, 184, 186, 189, 182, 178, 179, 0, 0, 0,
2081 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2082 0, 0, 0, 0, 0, 181, 180, 223, 0, 311,
2083 289, 67, 280, 288, 0, 0, 55, 0, 0, 29,
2084 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2085 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2086 43, 44, 45, 46, 47, 48, 0, 0, 0, 130,
2087 130, 334, 67, 67, 325, 0, 0, 0, 0, 0,
2088 67, 67, 67, 67, 67, 0, 0, 0, 0, 0,
2089 107, 109, 108, 106, 110, 111, 112, 113, 114, 117,
2090 165, 163, 152, 153, 154, 157, 66, 151, 225, 227,
2091 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2092 0, 0, 171, 205, 0, 0, 0, 175, 0, 172,
2093 0, 0, 0, 135, 244, 255, 256, 257, 262, 258,
2094 259, 260, 261, 253, 0, 0, 0, 0, 271, 278,
2095 277, 279, 0, 0, 290, 0, 0, 67, 67, 67,
2096 67, 0, 330, 0, 332, 307, 0, 0, 0, 0,
2097 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2098 67, 0, 115, 121, 120, 118, 119, 122, 123, 125,
2099 135, 135, 0, 0, 0, 0, 0, 307, 0, 0,
2100 0, 0, 0, 0, 0, 170, 156, 168, 0, 173,
2101 174, 0, 0, 0, 0, 224, 243, 116, 241, 0,
2102 254, 0, 265, 0, 0, 0, 268, 0, 266, 281,
2103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2104 338, 0, 0, 0, 321, 322, 0, 0, 0, 0,
2105 339, 0, 0, 0, 319, 0, 130, 0, 226, 228,
2106 67, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2107 0, 0, 204, 177, 0, 0, 0, 0, 0, 0,
2108 137, 135, 65, 0, 124, 0, 264, 156, 0, 263,
2109 267, 0, 0, 306, 0, 0, 0, 0, 130, 131,
2110 130, 0, 0, 0, 0, 0, 0, 337, 309, 0,
2111 67, 313, 314, 306, 0, 335, 67, 211, 0, 0,
2112 0, 0, 191, 0, 0, 0, 0, 202, 0, 176,
2113 0, 0, 67, 132, 138, 136, 64, 240, 242, 116,
2114 133, 0, 270, 0, 0, 0, 116, 116, 0, 315,
2115 316, 317, 318, 331, 333, 308, 0, 0, 320, 323,
2116 324, 310, 0, 0, 130, 0, 0, 0, 0, 0,
2117 199, 0, 0, 0, 193, 194, 190, 65, 134, 128,
2118 272, 269, 0, 0, 0, 0, 124, 0, 300, 0,
2119 340, 124, 336, 195, 196, 197, 198, 0, 0, 0,
2120 203, 239, 0, 126, 0, 293, 0, 0, 107, 109,
2121 116, 116, 0, 116, 116, 301, 326, 192, 200, 201,
2122 129, 0, 245, 291, 0, 292, 0, 303, 302, 0,
2123 0, 0, 127, 0, 0, 0, 116, 116, 0, 0,
2124 0, 305, 304, 298, 0, 0, 297, 0, 294
2127 /* YYDEFGOTO[NTERM-NUM]. */
2128 static const yytype_int16 yydefgoto[] =
2130 -1, 272, 273, 274, 299, 316, 162, 163, 79, 587,
2131 113, 12, 80, 14, 15, 41, 42, 43, 48, 54,
2132 118, 128, 349, 233, 439, 352, 672, 653, 412, 530,
2133 629, 465, 531, 81, 164, 137, 154, 138, 139, 110,
2134 373, 398, 374, 121, 88, 155, 16, 17, 18, 20,
2135 19, 383, 440, 441, 63, 23, 61, 101, 468, 469,
2136 129, 170, 55, 96, 56, 49, 471, 399, 83, 401,
2137 282, 283, 57, 92, 93, 227, 657, 132, 324, 598,
2138 490, 500, 228, 229, 230, 231
2141 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2143 #define YYPACT_NINF -622
2144 static const yytype_int16 yypact[] =
2146 805, -622, -622, -622, -622, -622, -622, -622, -6, -112,
2147 23, -97, 91, -94, 24, -622, 126, 1385, -622, 135,
2148 257, 48, 77, -622, 3, 216, -622, 1807, -622, -622,
2149 -622, -622, -622, -622, -622, -622, -622, -622, -622, -622,
2150 -622, 49, 49, 187, -622, -622, -622, -622, 49, -622,
2151 -622, -622, -622, -622, 49, 218, -622, 16, 220, 239,
2152 243, -622, -622, -622, -622, -622, 110, -622, -622, -622,
2153 -622, -622, -622, -622, -622, 267, 271, 1, 691, -622,
2154 -622, -622, -28, -622, 246, 246, 206, -622, 46, 215,
2155 215, -622, -622, 343, -622, -622, -622, -622, -622, -622,
2156 -622, -59, 1537, -622, 121, 130, 880, 110, -622, -28,
2157 -110, 138, 1537, 142, 46, 46, -622, -622, 1555, -622,
2158 -622, 1830, 302, -622, -622, -622, -622, -622, 1848, -622,
2159 -14, 2199, -622, 293, -622, -622, -28, -622, 160, 165,
2160 1877, 1877, 168, -103, 1877, -622, 334, 189, -622, 1830,
2161 1877, 110, 191, -28, 221, -622, 85, 341, 342, 345,
2162 354, 355, 323, 360, 1373, 315, -622, 28, -622, -622,
2163 -622, -622, -622, 316, 1921, 42, 361, 215, -622, -622,
2164 -622, -622, -622, -622, -622, -622, -622, -622, -622, -622,
2165 -622, -622, -622, -622, -622, 393, 529, 393, 529, 1877,
2166 1877, 1877, 1877, -622, -622, -622, -622, -622, -622, -622,
2167 -622, -622, -622, -622, -622, 1877, 1877, 1877, 1877, 1877,
2168 1877, 1877, 1877, 1877, 1877, 1877, 1877, -622, 215, -622,
2169 70, -622, -622, 176, 1578, -622, -39, -46, -622, 208,
2170 -28, 223, -622, 315, 5, 1555, -622, -622, -622, -622,
2171 -622, -622, -622, -622, -622, -622, -622, 393, 529, 393,
2172 529, 219, 227, 228, 234, 235, 241, 242, 1596, 2009,
2173 993, 356, 244, 245, 251, -622, -622, -622, 254, -622,
2174 110, 792, -622, 240, 943, 943, -622, 943, 1848, -622,
2175 -622, -622, -622, -622, -622, -622, -622, -622, -622, 1877,
2176 -622, -622, -622, -622, -622, -622, -622, -622, -622, -622,
2177 -622, -622, -622, -622, -622, -622, 1877, 1877, 1877, 26,
2178 58, -622, 792, -35, 252, 256, 258, 259, 260, 263,
2179 792, 792, 792, 792, 792, 389, 1848, 1877, 1877, 375,
2180 -622, -622, -622, -622, -622, -622, -622, -622, -622, -622,
2181 -622, -622, 202, -622, -622, -622, -622, 202, -622, 142,
2182 390, 273, 274, 276, 277, 1830, 1830, 1830, 1830, 1830,
2183 1830, 1830, -622, -622, 57, 1268, -82, -622, -64, -622,
2184 1830, 1830, 1830, 275, 1628, -622, -622, -622, -622, -622,
2185 -622, -622, -622, 374, 1757, 2041, 1313, 414, -622, -622,
2186 -622, -622, 1877, 278, -622, 279, 943, 792, 792, 792,
2187 792, 31, -622, 33, -622, -622, 943, 280, 1877, 1877,
2188 1877, 1877, 1877, 281, 282, 284, 285, 287, 1877, 943,
2189 792, 288, -622, -622, -622, -622, -622, -622, -622, -622,
2190 275, 275, 1877, 1830, 1830, 1830, 1830, -622, 290, 291,
2191 292, 294, 282, 295, 1830, -622, 286, 1222, -62, -622,
2192 -622, 301, 307, 429, 20, -622, -622, -28, 309, 312,
2193 -622, 448, -622, 87, 1508, -10, -622, -61, -622, -622,
2194 455, 456, 318, 317, 319, 320, 321, 943, 473, 943,
2195 338, 339, 943, 340, -28, -622, 344, 346, 478, 496,
2196 351, 1877, 943, 943, -28, 348, 352, 1877, -622, -622,
2197 -5, 353, 357, 359, 362, 115, 1830, 1830, 1830, 1830,
2198 146, 1830, -622, -622, 336, 1830, 1830, 1877, 493, 515,
2199 -622, 275, 530, 1789, -622, 363, -622, 358, -60, -622,
2200 -622, 943, 943, 2082, 943, 943, 943, 943, 352, -622,
2201 352, 1877, 943, 364, 1877, 1877, 1877, -622, -622, 516,
2202 792, -622, -622, 2082, 472, -622, 792, -622, 1830, 1830,
2203 1830, 1830, -622, 368, 377, 372, 376, -622, 282, -622,
2204 379, 381, 2, -622, -622, -622, -622, -622, -622, -28,
2205 4, 517, -622, 380, 382, 378, -16, -28, 157, -622,
2206 -622, -622, -622, -622, -622, -622, 384, 943, -622, -622,
2207 -622, -622, 282, 178, 352, 386, 388, 394, 396, 1830,
2208 -622, 1830, 1830, 198, -622, -622, -622, 530, -622, 507,
2209 -622, -622, 533, -7, 641, 641, -622, 2100, -622, 398,
2210 351, -622, -622, -622, -622, -622, -622, 406, 408, 409,
2211 -622, -622, 564, 417, 943, -622, 1088, 7, 415, 416,
2212 -622, -622, -12, -16, -28, -622, 202, -622, -622, -622,
2213 -622, 548, -622, -622, 418, -622, 1088, 176, 176, 557,
2214 641, 641, -622, 558, 419, 943, -622, -622, 943, 562,
2215 508, 176, 176, -622, 943, 563, -622, 943, -622
2218 /* YYPGOTO[NTERM-NUM]. */
2219 static const yytype_int16 yypgoto[] =
2221 -622, 451, 452, 454, -163, -157, -174, -622, 0, -41,
2222 -102, 494, 13, -622, -622, -622, -622, 222, -622, -622,
2223 -622, -145, -622, -427, -622, -227, -622, -622, -301, -2,
2224 -622, -412, -622, -622, -26, 369, -116, -622, 477, 484,
2225 -113, -161, -259, 8, 147, 347, -622, -622, 574, -622,
2226 -622, -622, -622, -622, -622, -622, -622, -622, -622, -622,
2227 503, -622, -622, -622, -622, -622, -622, -621, -121, 55,
2228 -195, -622, -622, 537, -622, -622, -622, -622, -622, 32,
2229 151, -445, -622, -622, -622, -622
2232 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2233 positive, shift that token. If negative, reduce the rule which
2234 number is the opposite. If zero, do what YYDEFACT says.
2235 If YYTABLE_NINF, syntax error. */
2236 #define YYTABLE_NINF -214
2237 static const yytype_int16 yytable[] =
2239 11, 82, 287, 275, 286, 105, 321, 520, 165, 111,
2240 376, 378, 167, 13, 168, 357, 111, 11, 286, 414,
2241 111, 325, 326, 327, 328, 329, 679, 111, 508, 509,
2242 13, 335, 288, 246, 317, 674, 243, 91, 528, -145,
2243 532, 318, 487, 276, 489, 94, 24, 21, 2, 144,
2244 111, 4, 109, 284, 528, 684, 144, 111, 145, 285,
2245 111, 26, 22, 277, 28, 239, 29, 30, 31, 32,
2246 33, 34, 35, 36, 529, 37, 136, 454, 119, 120,
2247 109, 111, 25, 336, 459, 488, 136, 488, -55, -55,
2248 -55, -55, 153, 11, 361, 454, 363, 454, 454, 454,
2249 133, 362, 153, 364, 460, 134, 524, 540, 593, 27,
2250 112, 247, 248, 111, 236, 237, 458, 112, 240, 585,
2251 354, 112, 149, 150, 244, 353, 44, 416, 112, 433,
2252 434, 435, -67, 623, 436, 473, 475, 477, 437, 438,
2253 -145, 358, 359, 431, -145, 433, 434, 435, 281, 454,
2254 436, 112, 567, 169, 437, 438, 539, 655, 112, 626,
2255 400, 112, 627, 400, 400, 60, 400, 640, 106, 634,
2256 635, 675, 406, 319, 320, 281, 322, 38, 39, 40,
2257 278, 46, 112, 47, 95, 411, -67, 337, 338, 323,
2258 281, 281, 281, 281, 281, 330, 331, 332, 333, 334,
2259 281, 400, 38, 39, 40, 565, 58, 479, 136, 400,
2260 400, 400, 400, 400, 112, 538, 454, 413, -67, 153,
2261 429, 455, 86, 493, 87, 495, 496, 497, 64, 65,
2262 339, 114, 115, 677, 678, 59, 680, 681, 62, 91,
2263 1, 2, 98, 3, 4, 5, 454, 603, 116, 604,
2264 117, 536, 447, 448, 449, 450, 451, 452, 453, 691,
2265 692, 99, 153, 84, 85, 100, 102, 461, 462, 463,
2266 89, 103, 572, 407, 551, 104, 90, 122, 123, 124,
2267 125, 126, 127, 87, 140, 400, 400, 400, 400, 400,
2268 408, 409, 410, 141, 146, 400, 275, 340, 341, 50,
2269 51, 52, 148, 577, 53, 559, 166, 590, 400, 400,
2270 153, 430, 281, 642, 636, 232, 637, 342, 343, 234,
2271 344, 345, 235, 346, 347, 348, 249, 250, 251, 252,
2272 511, 512, 513, 514, 238, 641, 276, 637, 241, 403,
2273 404, 522, 405, 433, 434, 435, 242, 245, 436, 457,
2274 -56, -57, 437, 438, -60, 650, 605, 559, 467, 608,
2275 609, 610, 1, -59, -58, 3, 400, 5, 400, 253,
2276 111, 400, 286, 279, 355, 365, 281, 415, 379, 432,
2277 356, 400, 400, 366, 367, 423, 424, 425, 426, 427,
2278 368, 369, 281, 494, 281, 281, 281, 370, 371, 402,
2279 380, 381, 504, 573, 574, 575, 576, 382, 578, 662,
2280 384, 417, 580, 581, 666, 418, 510, 419, 420, 421,
2281 400, 400, 422, 400, 400, 400, 400, 428, 442, 443,
2282 444, 400, 445, 446, 464, 470, 478, 480, 481, 400,
2283 498, 499, 492, 501, 502, 400, 503, 507, 457, 516,
2284 517, 518, 523, 519, 521, 615, 616, 617, 618, 656,
2285 525, 482, 483, 484, 485, 486, 526, 527, 533, 534,
2286 535, 491, 541, 542, 543, 560, 544, 549, 545, 546,
2287 547, 566, 557, 676, 505, 506, 400, 289, 290, 291,
2288 292, 293, 294, 295, 296, 297, 298, 551, 552, 554,
2289 558, 582, 579, 555, 563, 556, 647, 589, 648, 649,
2290 559, 564, 568, 400, 400, 583, 569, 597, 570, 584,
2291 611, 571, 591, 607, 592, 281, 488, 619, 281, 281,
2292 281, 621, 586, 400, 620, 622, 624, 597, 625, 630,
2293 633, 632, 548, 643, 550, 644, 631, 553, 638, 1,
2294 654, 645, 3, 646, 5, 300, 301, 561, 562, 400,
2295 400, 652, 665, 667, 400, 668, 669, 400, 670, 671,
2296 682, -18, -19, 400, 685, 688, 400, 683, 689, 694,
2297 697, 695, 224, 225, 339, 226, 651, 131, 628, 147,
2298 143, 45, 360, 130, 97, 613, 594, 595, 515, 599,
2299 600, 601, 602, 351, 0, 0, 0, 606, 0, 0,
2300 0, 664, 0, 0, 0, 612, 0, 0, 0, 0,
2301 0, 614, 0, 0, 0, 0, 0, 586, 0, 302,
2302 303, 304, 305, 306, 307, 308, 309, 310, 311, 312,
2303 313, 314, 315, 0, 385, 386, 0, 0, 64, 65,
2304 387, 340, 341, 0, 0, 0, 0, 0, 0, 0,
2305 1, 2, 639, 3, 4, 5, 388, 389, 390, 0,
2306 0, 342, 343, 0, 344, 345, 0, 346, 347, 348,
2307 0, 391, 392, 0, 0, 0, 0, 0, 0, 660,
2308 661, 0, 0, 0, 0, 339, 0, 0, 64, 65,
2309 393, 107, 67, 68, 69, 70, 71, 72, 73, 673,
2310 1, 2, 0, 3, 4, 5, 180, 181, 182, 183,
2311 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2312 194, 257, 258, 259, 260, 686, 687, 0, 0, 0,
2313 690, 74, 0, 693, 0, 0, 0, 0, 0, 696,
2314 0, 0, 698, 0, 0, 0, 0, 0, 0, 0,
2315 261, 203, 658, 659, 206, 207, 208, 209, 210, 211,
2316 212, 213, 214, 0, 262, 0, 263, 264, 265, 0,
2317 266, 267, 342, 343, 0, 344, 345, 0, 346, 347,
2318 348, 0, 0, 0, 0, 385, 386, 0, 0, 64,
2319 65, 387, 0, 394, 0, -213, 395, 0, 396, 0,
2320 397, 1, 2, 0, 3, 4, 5, 388, 389, 390,
2321 0, 0, 0, -69, 1, 2, 0, 3, 4, 5,
2322 0, 0, 391, 392, 0, 6, 7, 0, 0, 0,
2323 0, 0, 0, 0, 0, 0, 0, 111, 0, 0,
2324 0, 393, 75, 76, 0, 0, 77, 8, 78, 108,
2325 0, 9, 0, 0, 0, 10, 0, 180, 181, 182,
2326 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2327 193, 194, 257, 258, 259, 260, 0, 64, 65, 0,
2328 107, 67, 68, 69, 70, 71, 72, 73, 0, 1,
2329 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2330 0, 261, 203, 204, 205, 206, 207, 208, 209, 210,
2331 211, 212, 213, 214, 0, 262, 0, 263, 264, 265,
2332 74, 266, 267, 0, 0, 0, 0, 0, 0, 0,
2333 0, 0, 0, 0, 0, 0, 385, 386, 112, 0,
2334 64, 65, 387, 0, 394, 0, 0, 395, 0, 396,
2335 0, 397, 1, 2, 0, 3, 4, 5, 388, 389,
2336 390, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2337 0, 0, 0, 391, 392, 0, 0, 0, 0, 0,
2338 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2339 64, 65, 393, 107, 156, 157, 158, 159, 160, 161,
2340 73, 0, 1, 2, 0, 3, 4, 5, 180, 181,
2341 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
2342 192, 193, 194, 257, 258, 259, 260, 0, 0, 0,
2343 0, 75, 76, 74, 0, 77, 0, 78, 142, 0,
2344 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2345 0, 0, 261, 203, 204, 205, 206, 207, 208, 209,
2346 210, 211, 212, 213, 214, 0, 262, 0, 263, 264,
2347 265, 0, 266, 267, 0, 0, 0, 0, 0, 0,
2348 0, 385, 386, 0, 0, 0, 0, 387, 0, 0,
2349 0, 0, 0, 0, 0, 394, 0, 0, 395, 0,
2350 396, 0, 397, 388, 389, 390, 0, 0, 0, 0,
2351 0, 0, 0, 0, 0, 0, 0, 0, 391, 392,
2352 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2353 0, 0, 0, 0, 0, 0, 0, 393, 0, 0,
2354 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2355 78, 377, 0, 180, 181, 182, 183, 184, 185, 186,
2356 187, 188, 189, 190, 191, 192, 193, 194, 257, 258,
2357 259, 260, 0, 0, 0, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2359 0, 0, 0, 0, 0, 0, 0, 261, 203, 204,
2360 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
2361 0, 262, 0, 263, 264, 265, 0, 266, 267, 64,
2362 65, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2363 0, 1, 2, 0, 3, 4, 5, 254, 0, 0,
2364 394, 0, 0, 395, 0, 396, 0, 397, 0, 0,
2365 0, 0, 255, 256, 0, 0, 0, 0, 0, 0,
2366 0, 0, 0, 0, 0, 64, 65, 111, 107, 156,
2367 157, 158, 159, 160, 161, 73, 0, 1, 2, 0,
2368 3, 4, 5, 0, 0, 0, 0, 180, 181, 182,
2369 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2370 193, 194, 257, 258, 259, 260, 0, 0, 74, 0,
2371 64, 65, 0, 107, 156, 157, 158, 159, 160, 161,
2372 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2373 0, 261, 203, 204, 205, 206, 207, 208, 209, 210,
2374 211, 212, 213, 214, 0, 262, 0, 263, 264, 265,
2375 0, 266, 267, 74, 0, 0, 0, 0, 0, 0,
2376 0, 0, 0, 0, 0, 0, 0, 0, 112, 0,
2377 64, 65, -67, 0, 268, -212, 0, 269, 0, 270,
2378 0, 271, 1, 2, 0, 3, 4, 5, 254, 0,
2379 0, 0, 0, -69, 1, 2, 0, 3, 4, 5,
2380 0, 0, 0, 255, 256, 6, 7, 0, 0, 0,
2381 0, 0, 0, 0, 0, 0, 0, 0, 111, 75,
2382 76, 0, 0, 77, 0, 78, 456, 8, 0, 0,
2383 0, 9, 0, 0, 0, 10, 0, 0, 180, 181,
2384 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
2385 192, 193, 194, 257, 258, 259, 260, 0, 0, 0,
2386 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2387 78, 476, 0, 0, 0, 0, 0, 0, 0, 0,
2388 0, 0, 261, 203, 204, 205, 206, 207, 208, 209,
2389 210, 211, 212, 213, 214, 0, 262, 0, 263, 264,
2390 265, 0, 266, 267, 0, 64, 65, 0, 107, 156,
2391 157, 158, 159, 160, 161, 73, 0, 1, 2, 112,
2392 3, 4, 5, 0, 0, 268, 0, 0, 269, 0,
2393 270, 0, 271, 0, 64, 65, 0, 107, 67, 68,
2394 69, 70, 71, 72, 73, 0, 1, 2, 74, 3,
2395 4, 5, 64, 65, 0, 151, 67, 68, 69, 70,
2396 71, 72, 73, 0, 1, 2, 135, 3, 4, 5,
2397 0, 0, 0, 0, 0, 64, 65, 74, 107, 67,
2398 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2399 3, 4, 5, 64, 65, 74, 107, 156, 157, 158,
2400 159, 160, 161, 73, 0, 1, 2, 350, 3, 4,
2401 5, 0, 0, 0, 0, 0, 0, 0, 74, 0,
2402 0, 0, 0, 0, 0, 64, 65, 0, 107, 67,
2403 68, 69, 70, 71, 72, 73, 74, 1, 2, 0,
2404 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2405 0, 0, 0, 0, 0, 0, 0, 466, 0, 75,
2406 76, 0, 0, 77, 0, 78, 537, 0, 74, 0,
2407 152, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2408 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2409 0, 0, 77, 0, 78, 0, 0, 0, 0, 0,
2410 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2411 77, 0, 78, 0, 0, 0, 0, 0, 0, 0,
2412 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2413 76, 0, 0, 77, 0, 78, 0, 0, 0, 0,
2414 0, 0, 0, 0, 0, 0, 0, 75, 76, 0,
2415 372, 77, 0, 78, 64, 65, 0, 107, 156, 157,
2416 158, 159, 160, 161, 73, 0, 1, 2, 0, 3,
2417 4, 5, 0, 0, 0, 0, 0, 0, 0, 75,
2418 76, 0, 0, 77, 0, 78, 64, 65, 0, 107,
2419 67, 68, 69, 70, 71, 72, 73, 74, 1, 2,
2420 0, 3, 4, 5, 64, 65, 0, 66, 67, 68,
2421 69, 70, 71, 72, 73, 0, 1, 2, 588, 3,
2422 4, 5, 0, 0, 0, 0, 0, 64, 65, 74,
2423 107, 156, 157, 158, 159, 160, 161, 73, 0, 1,
2424 2, 0, 3, 4, 5, 64, 65, 74, 151, 67,
2425 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2426 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2427 74, 0, 0, 0, 64, 65, 0, 107, 67, 68,
2428 69, 70, 71, 72, 73, 0, 1, 2, 74, 3,
2429 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2430 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2431 0, 472, 77, 0, 78, 0, 0, 74, 64, 65,
2432 0, 280, 67, 68, 69, 70, 71, 72, 73, 0,
2433 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2434 75, 76, 0, 0, 77, 0, 78, 0, 0, 0,
2435 0, 0, 0, 0, 0, 0, 0, 0, 75, 76,
2436 0, 74, 77, 0, 78, 0, 0, 0, 0, 0,
2437 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2438 0, 75, 76, 0, 0, 77, 0, 78, 0, 0,
2439 0, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2440 76, 0, 0, 77, 0, 78, 64, 65, 0, 107,
2441 156, 157, 158, 159, 160, 161, 73, 0, 1, 2,
2442 0, 3, 4, 5, 0, 0, 0, 0, 75, 76,
2443 0, 0, 77, 0, 78, 0, 0, 0, 64, 65,
2444 0, 107, 156, 157, 158, 159, 160, 161, 73, 74,
2445 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2446 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2447 0, 0, 75, 76, 0, 0, 77, 0, 78, 64,
2448 65, 74, 107, 67, 68, 69, 70, 71, 72, 596,
2449 0, 1, 2, 0, 3, 4, 5, 64, 65, 0,
2450 107, 67, 68, 69, 70, 71, 72, 663, 0, 1,
2451 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2452 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
2453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2454 74, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2455 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2456 75, 76, 0, 0, 77, 0, 375, 0, 0, 0,
2457 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2458 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2459 0, 0, 75, 76, 0, 0, 77, 0, 474, 0,
2460 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2461 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2462 0, 0, 0, 0, 0, 171, 0, 0, 0, 0,
2463 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2464 0, 0, 0, 0, 0, 0, 172, 173, 0, 0,
2465 0, 75, 76, 0, 0, 77, 0, 78, 174, 175,
2466 176, 177, 178, 179, 180, 181, 182, 183, 184, 185,
2467 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
2468 196, 197, 198, 0, 0, 0, 0, 0, 0, 0,
2469 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2470 0, 0, 0, 199, 200, 201, 0, 0, 202, 203,
2471 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
2472 214, 215, 216, 217, 218, 219, 220, 221, 222, 223
2475 static const yytype_int16 yycheck[] =
2477 0, 27, 176, 164, 11, 4, 201, 452, 121, 55,
2478 269, 270, 128, 0, 28, 242, 55, 17, 11, 320,
2479 55, 216, 217, 218, 219, 220, 38, 55, 440, 441,
2480 17, 226, 177, 154, 197, 656, 149, 21, 34, 55,
2481 467, 198, 11, 164, 11, 29, 158, 53, 20, 159,
2482 55, 23, 78, 11, 34, 676, 159, 55, 168, 17,
2483 55, 158, 68, 165, 158, 168, 42, 43, 44, 45,
2484 46, 47, 48, 49, 54, 51, 102, 159, 32, 33,
2485 106, 55, 59, 228, 166, 54, 112, 54, 3, 4,
2486 5, 6, 118, 93, 257, 159, 259, 159, 159, 159,
2487 159, 258, 128, 260, 168, 164, 168, 168, 168, 18,
2488 156, 26, 27, 55, 140, 141, 375, 156, 144, 531,
2489 166, 156, 114, 115, 150, 164, 0, 162, 156, 141,
2490 142, 143, 160, 578, 146, 394, 395, 396, 150, 151,
2491 156, 243, 244, 338, 160, 141, 142, 143, 174, 159,
2492 146, 156, 157, 167, 150, 151, 166, 164, 156, 157,
2493 281, 156, 589, 284, 285, 162, 287, 612, 167, 596,
2494 597, 164, 288, 199, 200, 201, 202, 153, 154, 155,
2495 167, 46, 156, 48, 168, 159, 160, 117, 118, 215,
2496 216, 217, 218, 219, 220, 221, 222, 223, 224, 225,
2497 226, 322, 153, 154, 155, 506, 158, 402, 234, 330,
2498 331, 332, 333, 334, 156, 474, 159, 159, 160, 245,
2499 336, 164, 35, 418, 37, 420, 421, 422, 7, 8,
2500 54, 84, 85, 660, 661, 158, 663, 664, 22, 21,
2501 19, 20, 22, 22, 23, 24, 159, 548, 42, 550,
2502 44, 164, 365, 366, 367, 368, 369, 370, 371, 686,
2503 687, 22, 288, 41, 42, 22, 156, 380, 381, 382,
2504 48, 4, 157, 299, 159, 4, 54, 62, 63, 64,
2505 65, 66, 67, 37, 163, 406, 407, 408, 409, 410,
2506 316, 317, 318, 163, 156, 416, 457, 121, 122, 42,
2507 43, 44, 160, 157, 47, 159, 4, 534, 429, 430,
2508 336, 337, 338, 614, 157, 22, 159, 141, 142, 159,
2509 144, 145, 157, 147, 148, 149, 3, 4, 5, 6,
2510 443, 444, 445, 446, 166, 157, 457, 159, 4, 284,
2511 285, 454, 287, 141, 142, 143, 157, 156, 146, 375,
2512 9, 9, 150, 151, 9, 157, 551, 159, 384, 554,
2513 555, 556, 19, 9, 9, 22, 487, 24, 489, 9,
2514 55, 492, 11, 57, 166, 156, 402, 322, 22, 4,
2515 157, 502, 503, 156, 156, 330, 331, 332, 333, 334,
2516 156, 156, 418, 419, 420, 421, 422, 156, 156, 159,
2517 156, 156, 428, 516, 517, 518, 519, 156, 521, 636,
2518 156, 159, 525, 526, 641, 159, 442, 159, 159, 159,
2519 541, 542, 159, 544, 545, 546, 547, 38, 38, 156,
2520 156, 552, 156, 156, 159, 61, 22, 159, 159, 560,
2521 159, 159, 162, 159, 159, 566, 159, 159, 474, 159,
2522 159, 159, 166, 159, 159, 568, 569, 570, 571, 633,
2523 159, 406, 407, 408, 409, 410, 159, 38, 159, 157,
2524 22, 416, 17, 17, 156, 501, 159, 4, 159, 159,
2525 159, 507, 4, 657, 429, 430, 607, 94, 95, 96,
2526 97, 98, 99, 100, 101, 102, 103, 159, 159, 159,
2527 4, 527, 166, 159, 156, 159, 619, 533, 621, 622,
2528 159, 159, 159, 634, 635, 22, 159, 543, 159, 4,
2529 4, 159, 159, 159, 166, 551, 54, 159, 554, 555,
2530 556, 159, 532, 654, 157, 159, 157, 563, 157, 22,
2531 162, 159, 487, 157, 489, 157, 166, 492, 164, 19,
2532 17, 157, 22, 157, 24, 26, 27, 502, 503, 680,
2533 681, 54, 164, 157, 685, 157, 157, 688, 4, 152,
2534 22, 156, 156, 694, 17, 17, 697, 159, 159, 17,
2535 17, 73, 131, 131, 54, 131, 627, 93, 590, 112,
2536 106, 17, 245, 90, 57, 563, 541, 542, 447, 544,
2537 545, 546, 547, 234, -1, -1, -1, 552, -1, -1,
2538 -1, 637, -1, -1, -1, 560, -1, -1, -1, -1,
2539 -1, 566, -1, -1, -1, -1, -1, 627, -1, 100,
2540 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
2541 111, 112, 113, -1, 3, 4, -1, -1, 7, 8,
2542 9, 121, 122, -1, -1, -1, -1, -1, -1, -1,
2543 19, 20, 607, 22, 23, 24, 25, 26, 27, -1,
2544 -1, 141, 142, -1, 144, 145, -1, 147, 148, 149,
2545 -1, 40, 41, -1, -1, -1, -1, -1, -1, 634,
2546 635, -1, -1, -1, -1, 54, -1, -1, 7, 8,
2547 59, 10, 11, 12, 13, 14, 15, 16, 17, 654,
2548 19, 20, -1, 22, 23, 24, 75, 76, 77, 78,
2549 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2550 89, 90, 91, 92, 93, 680, 681, -1, -1, -1,
2551 685, 50, -1, 688, -1, -1, -1, -1, -1, 694,
2552 -1, -1, 697, -1, -1, -1, -1, -1, -1, -1,
2553 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2554 129, 130, 131, -1, 133, -1, 135, 136, 137, -1,
2555 139, 140, 141, 142, -1, 144, 145, -1, 147, 148,
2556 149, -1, -1, -1, -1, 3, 4, -1, -1, 7,
2557 8, 9, -1, 162, -1, 0, 165, -1, 167, -1,
2558 169, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2559 -1, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2560 -1, -1, 40, 41, -1, 30, 31, -1, -1, -1,
2561 -1, -1, -1, -1, -1, -1, -1, 55, -1, -1,
2562 -1, 59, 161, 162, -1, -1, 165, 52, 167, 168,
2563 -1, 56, -1, -1, -1, 60, -1, 75, 76, 77,
2564 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2565 88, 89, 90, 91, 92, 93, -1, 7, 8, -1,
2566 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2567 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2568 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2569 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2570 50, 139, 140, -1, -1, -1, -1, -1, -1, -1,
2571 -1, -1, -1, -1, -1, -1, 3, 4, 156, -1,
2572 7, 8, 9, -1, 162, -1, -1, 165, -1, 167,
2573 -1, 169, 19, 20, -1, 22, 23, 24, 25, 26,
2574 27, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2575 -1, -1, -1, 40, 41, -1, -1, -1, -1, -1,
2576 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2577 7, 8, 59, 10, 11, 12, 13, 14, 15, 16,
2578 17, -1, 19, 20, -1, 22, 23, 24, 75, 76,
2579 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2580 87, 88, 89, 90, 91, 92, 93, -1, -1, -1,
2581 -1, 161, 162, 50, -1, 165, -1, 167, 168, -1,
2582 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2583 -1, -1, 119, 120, 121, 122, 123, 124, 125, 126,
2584 127, 128, 129, 130, 131, -1, 133, -1, 135, 136,
2585 137, -1, 139, 140, -1, -1, -1, -1, -1, -1,
2586 -1, 3, 4, -1, -1, -1, -1, 9, -1, -1,
2587 -1, -1, -1, -1, -1, 162, -1, -1, 165, -1,
2588 167, -1, 169, 25, 26, 27, -1, -1, -1, -1,
2589 -1, -1, -1, -1, -1, -1, -1, -1, 40, 41,
2590 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2591 -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
2592 -1, -1, -1, -1, 161, 162, -1, -1, 165, -1,
2593 167, 168, -1, 75, 76, 77, 78, 79, 80, 81,
2594 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
2595 92, 93, -1, -1, -1, -1, -1, -1, -1, -1,
2596 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2597 -1, -1, -1, -1, -1, -1, -1, 119, 120, 121,
2598 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2599 -1, 133, -1, 135, 136, 137, -1, 139, 140, 7,
2600 8, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2601 -1, 19, 20, -1, 22, 23, 24, 25, -1, -1,
2602 162, -1, -1, 165, -1, 167, -1, 169, -1, -1,
2603 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2604 -1, -1, -1, -1, -1, 7, 8, 55, 10, 11,
2605 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2606 22, 23, 24, -1, -1, -1, -1, 75, 76, 77,
2607 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2608 88, 89, 90, 91, 92, 93, -1, -1, 50, -1,
2609 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2610 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2611 -1, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2612 128, 129, 130, 131, -1, 133, -1, 135, 136, 137,
2613 -1, 139, 140, 50, -1, -1, -1, -1, -1, -1,
2614 -1, -1, -1, -1, -1, -1, -1, -1, 156, -1,
2615 7, 8, 160, -1, 162, 0, -1, 165, -1, 167,
2616 -1, 169, 19, 20, -1, 22, 23, 24, 25, -1,
2617 -1, -1, -1, 18, 19, 20, -1, 22, 23, 24,
2618 -1, -1, -1, 40, 41, 30, 31, -1, -1, -1,
2619 -1, -1, -1, -1, -1, -1, -1, -1, 55, 161,
2620 162, -1, -1, 165, -1, 167, 168, 52, -1, -1,
2621 -1, 56, -1, -1, -1, 60, -1, -1, 75, 76,
2622 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2623 87, 88, 89, 90, 91, 92, 93, -1, -1, -1,
2624 -1, -1, -1, -1, 161, 162, -1, -1, 165, -1,
2625 167, 168, -1, -1, -1, -1, -1, -1, -1, -1,
2626 -1, -1, 119, 120, 121, 122, 123, 124, 125, 126,
2627 127, 128, 129, 130, 131, -1, 133, -1, 135, 136,
2628 137, -1, 139, 140, -1, 7, 8, -1, 10, 11,
2629 12, 13, 14, 15, 16, 17, -1, 19, 20, 156,
2630 22, 23, 24, -1, -1, 162, -1, -1, 165, -1,
2631 167, -1, 169, -1, 7, 8, -1, 10, 11, 12,
2632 13, 14, 15, 16, 17, -1, 19, 20, 50, 22,
2633 23, 24, 7, 8, -1, 10, 11, 12, 13, 14,
2634 15, 16, 17, -1, 19, 20, 39, 22, 23, 24,
2635 -1, -1, -1, -1, -1, 7, 8, 50, 10, 11,
2636 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2637 22, 23, 24, 7, 8, 50, 10, 11, 12, 13,
2638 14, 15, 16, 17, -1, 19, 20, 39, 22, 23,
2639 24, -1, -1, -1, -1, -1, -1, -1, 50, -1,
2640 -1, -1, -1, -1, -1, 7, 8, -1, 10, 11,
2641 12, 13, 14, 15, 16, 17, 50, 19, 20, -1,
2642 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2643 -1, -1, -1, -1, -1, -1, -1, 39, -1, 161,
2644 162, -1, -1, 165, -1, 167, 168, -1, 50, -1,
2645 125, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2646 -1, -1, -1, -1, -1, -1, -1, -1, 161, 162,
2647 -1, -1, 165, -1, 167, -1, -1, -1, -1, -1,
2648 -1, -1, -1, -1, -1, -1, 161, 162, -1, -1,
2649 165, -1, 167, -1, -1, -1, -1, -1, -1, -1,
2650 -1, -1, -1, -1, -1, -1, -1, -1, -1, 161,
2651 162, -1, -1, 165, -1, 167, -1, -1, -1, -1,
2652 -1, -1, -1, -1, -1, -1, -1, 161, 162, -1,
2653 164, 165, -1, 167, 7, 8, -1, 10, 11, 12,
2654 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2655 23, 24, -1, -1, -1, -1, -1, -1, -1, 161,
2656 162, -1, -1, 165, -1, 167, 7, 8, -1, 10,
2657 11, 12, 13, 14, 15, 16, 17, 50, 19, 20,
2658 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2659 13, 14, 15, 16, 17, -1, 19, 20, 39, 22,
2660 23, 24, -1, -1, -1, -1, -1, 7, 8, 50,
2661 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2662 20, -1, 22, 23, 24, 7, 8, 50, 10, 11,
2663 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2664 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2665 50, -1, -1, -1, 7, 8, -1, 10, 11, 12,
2666 13, 14, 15, 16, 17, -1, 19, 20, 50, 22,
2667 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2668 -1, -1, -1, -1, -1, -1, -1, -1, 161, 162,
2669 -1, 164, 165, -1, 167, -1, -1, 50, 7, 8,
2670 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
2671 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2672 161, 162, -1, -1, 165, -1, 167, -1, -1, -1,
2673 -1, -1, -1, -1, -1, -1, -1, -1, 161, 162,
2674 -1, 50, 165, -1, 167, -1, -1, -1, -1, -1,
2675 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2676 -1, 161, 162, -1, -1, 165, -1, 167, -1, -1,
2677 -1, -1, -1, -1, -1, -1, -1, -1, -1, 161,
2678 162, -1, -1, 165, -1, 167, 7, 8, -1, 10,
2679 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2680 -1, 22, 23, 24, -1, -1, -1, -1, 161, 162,
2681 -1, -1, 165, -1, 167, -1, -1, -1, 7, 8,
2682 -1, 10, 11, 12, 13, 14, 15, 16, 17, 50,
2683 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2684 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2685 -1, -1, 161, 162, -1, -1, 165, -1, 167, 7,
2686 8, 50, 10, 11, 12, 13, 14, 15, 16, 17,
2687 -1, 19, 20, -1, 22, 23, 24, 7, 8, -1,
2688 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2689 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2690 -1, -1, 50, -1, -1, -1, -1, -1, -1, -1,
2691 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2692 50, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2693 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2694 161, 162, -1, -1, 165, -1, 167, -1, -1, -1,
2695 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2696 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2697 -1, -1, 161, 162, -1, -1, 165, -1, 167, -1,
2698 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2699 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2700 -1, -1, -1, -1, -1, 36, -1, -1, -1, -1,
2701 -1, -1, -1, 161, 162, -1, -1, 165, -1, 167,
2702 -1, -1, -1, -1, -1, -1, 57, 58, -1, -1,
2703 -1, 161, 162, -1, -1, 165, -1, 167, 69, 70,
2704 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
2705 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2706 91, 92, 93, -1, -1, -1, -1, -1, -1, -1,
2707 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2708 -1, -1, -1, 114, 115, 116, -1, -1, 119, 120,
2709 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2710 131, 132, 133, 134, 135, 136, 137, 138, 139, 140
2713 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2714 symbol of state STATE-NUM. */
2715 static const yytype_uint8 yystos[] =
2717 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2718 60, 178, 181, 182, 183, 184, 216, 217, 218, 220,
2719 219, 53, 68, 225, 158, 59, 158, 18, 158, 42,
2720 43, 44, 45, 46, 47, 48, 49, 51, 153, 154,
2721 155, 185, 186, 187, 0, 218, 46, 48, 188, 235,
2722 42, 43, 44, 47, 189, 232, 234, 242, 158, 158,
2723 162, 226, 22, 224, 7, 8, 10, 11, 12, 13,
2724 14, 15, 16, 17, 50, 161, 162, 165, 167, 178,
2725 182, 203, 204, 238, 187, 187, 35, 37, 214, 187,
2726 187, 21, 243, 244, 29, 168, 233, 243, 22, 22,
2727 22, 227, 156, 4, 4, 4, 167, 10, 168, 204,
2728 209, 55, 156, 180, 214, 214, 42, 44, 190, 32,
2729 33, 213, 62, 63, 64, 65, 66, 67, 191, 230,
2730 230, 181, 247, 159, 164, 39, 204, 205, 207, 208,
2731 163, 163, 168, 209, 159, 168, 156, 208, 160, 213,
2732 213, 10, 125, 204, 206, 215, 11, 12, 13, 14,
2733 15, 16, 176, 177, 204, 210, 4, 206, 28, 167,
2734 231, 36, 57, 58, 69, 70, 71, 72, 73, 74,
2735 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2736 85, 86, 87, 88, 89, 90, 91, 92, 93, 114,
2737 115, 116, 119, 120, 121, 122, 123, 124, 125, 126,
2738 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2739 137, 138, 139, 140, 171, 172, 173, 245, 252, 253,
2740 254, 255, 22, 193, 159, 157, 204, 204, 166, 168,
2741 204, 4, 157, 210, 204, 156, 238, 26, 27, 3,
2742 4, 5, 6, 9, 25, 40, 41, 90, 91, 92,
2743 93, 119, 133, 135, 136, 137, 139, 140, 162, 165,
2744 167, 169, 171, 172, 173, 211, 238, 180, 182, 57,
2745 10, 204, 240, 241, 11, 17, 11, 176, 191, 94,
2746 95, 96, 97, 98, 99, 100, 101, 102, 103, 174,
2747 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2748 108, 109, 110, 111, 112, 113, 175, 174, 175, 204,
2749 204, 240, 204, 204, 248, 240, 240, 240, 240, 240,
2750 204, 204, 204, 204, 204, 240, 191, 117, 118, 54,
2751 121, 122, 141, 142, 144, 145, 147, 148, 149, 192,
2752 39, 205, 195, 164, 166, 166, 157, 195, 180, 180,
2753 215, 174, 175, 174, 175, 156, 156, 156, 156, 156,
2754 156, 156, 164, 210, 212, 167, 212, 168, 212, 22,
2755 156, 156, 156, 221, 156, 3, 4, 9, 25, 26,
2756 27, 40, 41, 59, 162, 165, 167, 169, 211, 237,
2757 238, 239, 159, 239, 239, 239, 206, 204, 204, 204,
2758 204, 159, 198, 159, 198, 239, 162, 159, 159, 159,
2759 159, 159, 159, 239, 239, 239, 239, 239, 38, 206,
2760 204, 240, 4, 141, 142, 143, 146, 150, 151, 194,
2761 222, 223, 38, 156, 156, 156, 156, 210, 210, 210,
2762 210, 210, 210, 210, 159, 164, 168, 204, 212, 166,
2763 168, 210, 210, 210, 159, 201, 39, 204, 228, 229,
2764 61, 236, 164, 212, 167, 212, 168, 212, 22, 240,
2765 159, 159, 239, 239, 239, 239, 239, 11, 54, 11,
2766 250, 239, 162, 240, 204, 240, 240, 240, 159, 159,
2767 251, 159, 159, 159, 204, 239, 239, 159, 201, 201,
2768 204, 210, 210, 210, 210, 250, 159, 159, 159, 159,
2769 251, 159, 210, 166, 168, 159, 159, 38, 34, 54,
2770 199, 202, 193, 159, 157, 22, 164, 168, 212, 166,
2771 168, 17, 17, 156, 159, 159, 159, 159, 239, 4,
2772 239, 159, 159, 239, 159, 159, 159, 4, 4, 159,
2773 204, 239, 239, 156, 159, 198, 204, 157, 159, 159,
2774 159, 159, 157, 210, 210, 210, 210, 157, 210, 166,
2775 210, 210, 204, 22, 4, 201, 178, 179, 39, 204,
2776 195, 159, 166, 168, 239, 239, 17, 204, 249, 239,
2777 239, 239, 239, 198, 198, 240, 239, 159, 240, 240,
2778 240, 4, 239, 249, 239, 210, 210, 210, 210, 159,
2779 157, 159, 159, 251, 157, 157, 157, 193, 199, 200,
2780 22, 166, 159, 162, 193, 193, 157, 159, 164, 239,
2781 251, 157, 198, 157, 157, 157, 157, 210, 210, 210,
2782 157, 179, 54, 197, 17, 164, 176, 246, 121, 122,
2783 239, 239, 195, 17, 204, 164, 195, 157, 157, 157,
2784 4, 152, 196, 239, 237, 164, 176, 193, 193, 38,
2785 193, 193, 22, 159, 237, 17, 239, 239, 17, 159,
2786 239, 193, 193, 239, 17, 73, 239, 17, 239
2789 #define yyerrok (yyerrstatus = 0)
2790 #define yyclearin (yychar = YYEMPTY)
2791 #define YYEMPTY (-2)
2794 #define YYACCEPT goto yyacceptlab
2795 #define YYABORT goto yyabortlab
2796 #define YYERROR goto yyerrorlab
2799 /* Like YYERROR except do call yyerror. This remains here temporarily
2800 to ease the transition to the new meaning of YYERROR, for GCC.
2801 Once GCC version 2 has supplanted version 1, this can go. */
2803 #define YYFAIL goto yyerrlab
2805 #define YYRECOVERING() (!!yyerrstatus)
2807 #define YYBACKUP(Token, Value) \
2809 if (yychar == YYEMPTY && yylen == 1) \
2813 yytoken = YYTRANSLATE (yychar); \
2819 yyerror (YY_("syntax error: cannot back up")); \
2826 #define YYERRCODE 256
2829 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2830 If N is 0, then set CURRENT to the empty location which ends
2831 the previous symbol: RHS[0] (always defined). */
2833 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2834 #ifndef YYLLOC_DEFAULT
2835 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2839 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2840 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2841 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2842 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2846 (Current).first_line = (Current).last_line = \
2847 YYRHSLOC (Rhs, 0).last_line; \
2848 (Current).first_column = (Current).last_column = \
2849 YYRHSLOC (Rhs, 0).last_column; \
2855 /* YY_LOCATION_PRINT -- Print the location on the stream.
2856 This macro was not mandated originally: define only if we know
2857 we won't break user code: when these are the locations we know. */
2859 #ifndef YY_LOCATION_PRINT
2860 # if YYLTYPE_IS_TRIVIAL
2861 # define YY_LOCATION_PRINT(File, Loc) \
2862 fprintf (File, "%d.%d-%d.%d", \
2863 (Loc).first_line, (Loc).first_column, \
2864 (Loc).last_line, (Loc).last_column)
2866 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2871 /* YYLEX -- calling `yylex' with the right arguments. */
2874 # define YYLEX yylex (YYLEX_PARAM)
2876 # define YYLEX yylex ()
2879 /* Enable debugging if requested. */
2883 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2884 # define YYFPRINTF fprintf
2887 # define YYDPRINTF(Args) \
2893 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2897 YYFPRINTF (stderr, "%s ", Title); \
2898 yy_symbol_print (stderr, \
2900 YYFPRINTF (stderr, "\n"); \
2905 /*--------------------------------.
2906 | Print this symbol on YYOUTPUT. |
2907 `--------------------------------*/
2910 #if (defined __STDC__ || defined __C99__FUNC__ \
2911 || defined __cplusplus || defined _MSC_VER)
2913 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2916 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2919 YYSTYPE const * const yyvaluep;
2925 if (yytype < YYNTOKENS)
2926 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2938 /*--------------------------------.
2939 | Print this symbol on YYOUTPUT. |
2940 `--------------------------------*/
2942 #if (defined __STDC__ || defined __C99__FUNC__ \
2943 || defined __cplusplus || defined _MSC_VER)
2945 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2948 yy_symbol_print (yyoutput, yytype, yyvaluep)
2951 YYSTYPE const * const yyvaluep;
2954 if (yytype < YYNTOKENS)
2955 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2957 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2959 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2960 YYFPRINTF (yyoutput, ")");
2963 /*------------------------------------------------------------------.
2964 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2966 `------------------------------------------------------------------*/
2968 #if (defined __STDC__ || defined __C99__FUNC__ \
2969 || defined __cplusplus || defined _MSC_VER)
2971 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2974 yy_stack_print (bottom, top)
2975 yytype_int16 *bottom;
2979 YYFPRINTF (stderr, "Stack now");
2980 for (; bottom <= top; ++bottom)
2981 YYFPRINTF (stderr, " %d", *bottom);
2982 YYFPRINTF (stderr, "\n");
2985 # define YY_STACK_PRINT(Bottom, Top) \
2988 yy_stack_print ((Bottom), (Top)); \
2992 /*------------------------------------------------.
2993 | Report that the YYRULE is going to be reduced. |
2994 `------------------------------------------------*/
2996 #if (defined __STDC__ || defined __C99__FUNC__ \
2997 || defined __cplusplus || defined _MSC_VER)
2999 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3002 yy_reduce_print (yyvsp, yyrule)
3007 int yynrhs = yyr2[yyrule];
3009 unsigned long int yylno = yyrline[yyrule];
3010 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3012 /* The symbols being reduced. */
3013 for (yyi = 0; yyi < yynrhs; yyi++)
3015 fprintf (stderr, " $%d = ", yyi + 1);
3016 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3017 &(yyvsp[(yyi + 1) - (yynrhs)])
3019 fprintf (stderr, "\n");
3023 # define YY_REDUCE_PRINT(Rule) \
3026 yy_reduce_print (yyvsp, Rule); \
3029 /* Nonzero means print parse trace. It is left uninitialized so that
3030 multiple parsers can coexist. */
3032 #else /* !YYDEBUG */
3033 # define YYDPRINTF(Args)
3034 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3035 # define YY_STACK_PRINT(Bottom, Top)
3036 # define YY_REDUCE_PRINT(Rule)
3037 #endif /* !YYDEBUG */
3040 /* YYINITDEPTH -- initial size of the parser's stacks. */
3042 # define YYINITDEPTH 200
3045 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3046 if the built-in stack extension method is used).
3048 Do not make this value too large; the results are undefined if
3049 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3050 evaluated with infinite-precision integer arithmetic. */
3053 # define YYMAXDEPTH 10000
3061 # if defined __GLIBC__ && defined _STRING_H
3062 # define yystrlen strlen
3064 /* Return the length of YYSTR. */
3065 #if (defined __STDC__ || defined __C99__FUNC__ \
3066 || defined __cplusplus || defined _MSC_VER)
3068 yystrlen (const char *yystr)
3076 for (yylen = 0; yystr[yylen]; yylen++)
3084 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3085 # define yystpcpy stpcpy
3087 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3089 #if (defined __STDC__ || defined __C99__FUNC__ \
3090 || defined __cplusplus || defined _MSC_VER)
3092 yystpcpy (char *yydest, const char *yysrc)
3095 yystpcpy (yydest, yysrc)
3101 const char *yys = yysrc;
3103 while ((*yyd++ = *yys++) != '\0')
3112 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3113 quotes and backslashes, so that it's suitable for yyerror. The
3114 heuristic is that double-quoting is unnecessary unless the string
3115 contains an apostrophe, a comma, or backslash (other than
3116 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3117 null, do not copy; instead, return the length of what the result
3120 yytnamerr (char *yyres, const char *yystr)
3125 char const *yyp = yystr;
3132 goto do_not_strip_quotes;
3136 goto do_not_strip_quotes;
3149 do_not_strip_quotes: ;
3153 return yystrlen (yystr);
3155 return yystpcpy (yyres, yystr) - yyres;
3159 /* Copy into YYRESULT an error message about the unexpected token
3160 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3161 including the terminating null byte. If YYRESULT is null, do not
3162 copy anything; just return the number of bytes that would be
3163 copied. As a special case, return 0 if an ordinary "syntax error"
3164 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3165 size calculation. */
3167 yysyntax_error (char *yyresult, int yystate, int yychar)
3169 int yyn = yypact[yystate];
3171 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3175 int yytype = YYTRANSLATE (yychar);
3176 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3177 YYSIZE_T yysize = yysize0;
3179 int yysize_overflow = 0;
3180 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3181 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3185 /* This is so xgettext sees the translatable formats that are
3186 constructed on the fly. */
3187 YY_("syntax error, unexpected %s");
3188 YY_("syntax error, unexpected %s, expecting %s");
3189 YY_("syntax error, unexpected %s, expecting %s or %s");
3190 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3191 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3195 static char const yyunexpected[] = "syntax error, unexpected %s";
3196 static char const yyexpecting[] = ", expecting %s";
3197 static char const yyor[] = " or %s";
3198 char yyformat[sizeof yyunexpected
3199 + sizeof yyexpecting - 1
3200 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3201 * (sizeof yyor - 1))];
3202 char const *yyprefix = yyexpecting;
3204 /* Start YYX at -YYN if negative to avoid negative indexes in
3206 int yyxbegin = yyn < 0 ? -yyn : 0;
3208 /* Stay within bounds of both yycheck and yytname. */
3209 int yychecklim = YYLAST - yyn + 1;
3210 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3213 yyarg[0] = yytname[yytype];
3214 yyfmt = yystpcpy (yyformat, yyunexpected);
3216 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3217 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3219 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3223 yyformat[sizeof yyunexpected - 1] = '\0';
3226 yyarg[yycount++] = yytname[yyx];
3227 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3228 yysize_overflow |= (yysize1 < yysize);
3230 yyfmt = yystpcpy (yyfmt, yyprefix);
3234 yyf = YY_(yyformat);
3235 yysize1 = yysize + yystrlen (yyf);
3236 yysize_overflow |= (yysize1 < yysize);
3239 if (yysize_overflow)
3240 return YYSIZE_MAXIMUM;
3244 /* Avoid sprintf, as that infringes on the user's name space.
3245 Don't have undefined behavior even if the translation
3246 produced a string with the wrong number of "%s"s. */
3247 char *yyp = yyresult;
3249 while ((*yyp = *yyf) != '\0')
3251 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3253 yyp += yytnamerr (yyp, yyarg[yyi++]);
3266 #endif /* YYERROR_VERBOSE */
3269 /*-----------------------------------------------.
3270 | Release the memory associated to this symbol. |
3271 `-----------------------------------------------*/
3274 #if (defined __STDC__ || defined __C99__FUNC__ \
3275 || defined __cplusplus || defined _MSC_VER)
3277 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3280 yydestruct (yymsg, yytype, yyvaluep)
3290 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3301 /* Prevent warnings from -Wmissing-prototypes. */
3303 #ifdef YYPARSE_PARAM
3304 #if defined __STDC__ || defined __cplusplus
3305 int yyparse (void *YYPARSE_PARAM);
3309 #else /* ! YYPARSE_PARAM */
3310 #if defined __STDC__ || defined __cplusplus
3315 #endif /* ! YYPARSE_PARAM */
3319 /* The look-ahead symbol. */
3322 /* The semantic value of the look-ahead symbol. */
3325 /* Number of syntax errors so far. */
3334 #ifdef YYPARSE_PARAM
3335 #if (defined __STDC__ || defined __C99__FUNC__ \
3336 || defined __cplusplus || defined _MSC_VER)
3338 yyparse (void *YYPARSE_PARAM)
3341 yyparse (YYPARSE_PARAM)
3342 void *YYPARSE_PARAM;
3344 #else /* ! YYPARSE_PARAM */
3345 #if (defined __STDC__ || defined __C99__FUNC__ \
3346 || defined __cplusplus || defined _MSC_VER)
3360 /* Number of tokens to shift before error messages enabled. */
3362 /* Look-ahead token as an internal (translated) token number. */
3365 /* Buffer for error messages, and its allocated size. */
3367 char *yymsg = yymsgbuf;
3368 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3371 /* Three stacks and their tools:
3372 `yyss': related to states,
3373 `yyvs': related to semantic values,
3374 `yyls': related to locations.
3376 Refer to the stacks thru separate pointers, to allow yyoverflow
3377 to reallocate them elsewhere. */
3379 /* The state stack. */
3380 yytype_int16 yyssa[YYINITDEPTH];
3381 yytype_int16 *yyss = yyssa;
3382 yytype_int16 *yyssp;
3384 /* The semantic value stack. */
3385 YYSTYPE yyvsa[YYINITDEPTH];
3386 YYSTYPE *yyvs = yyvsa;
3391 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3393 YYSIZE_T yystacksize = YYINITDEPTH;
3395 /* The variables used to return semantic value and location from the
3400 /* The number of symbols on the RHS of the reduced rule.
3401 Keep to zero when no symbol should be popped. */
3404 YYDPRINTF ((stderr, "Starting parse\n"));
3409 yychar = YYEMPTY; /* Cause a token to be read. */
3411 /* Initialize stack pointers.
3412 Waste one element of value and location stack
3413 so that they stay on the same level as the state stack.
3414 The wasted elements are never initialized. */
3421 /*------------------------------------------------------------.
3422 | yynewstate -- Push a new state, which is found in yystate. |
3423 `------------------------------------------------------------*/
3425 /* In all cases, when you get here, the value and location stacks
3426 have just been pushed. So pushing a state here evens the stacks. */
3432 if (yyss + yystacksize - 1 <= yyssp)
3434 /* Get the current used size of the three stacks, in elements. */
3435 YYSIZE_T yysize = yyssp - yyss + 1;
3439 /* Give user a chance to reallocate the stack. Use copies of
3440 these so that the &'s don't force the real ones into
3442 YYSTYPE *yyvs1 = yyvs;
3443 yytype_int16 *yyss1 = yyss;
3446 /* Each stack pointer address is followed by the size of the
3447 data in use in that stack, in bytes. This used to be a
3448 conditional around just the two extra args, but that might
3449 be undefined if yyoverflow is a macro. */
3450 yyoverflow (YY_("memory exhausted"),
3451 &yyss1, yysize * sizeof (*yyssp),
3452 &yyvs1, yysize * sizeof (*yyvsp),
3459 #else /* no yyoverflow */
3460 # ifndef YYSTACK_RELOCATE
3461 goto yyexhaustedlab;
3463 /* Extend the stack our own way. */
3464 if (YYMAXDEPTH <= yystacksize)
3465 goto yyexhaustedlab;
3467 if (YYMAXDEPTH < yystacksize)
3468 yystacksize = YYMAXDEPTH;
3471 yytype_int16 *yyss1 = yyss;
3472 union yyalloc *yyptr =
3473 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3475 goto yyexhaustedlab;
3476 YYSTACK_RELOCATE (yyss);
3477 YYSTACK_RELOCATE (yyvs);
3479 # undef YYSTACK_RELOCATE
3481 YYSTACK_FREE (yyss1);
3484 #endif /* no yyoverflow */
3486 yyssp = yyss + yysize - 1;
3487 yyvsp = yyvs + yysize - 1;
3490 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3491 (unsigned long int) yystacksize));
3493 if (yyss + yystacksize - 1 <= yyssp)
3497 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3506 /* Do appropriate processing given the current state. Read a
3507 look-ahead token if we need one and don't already have one. */
3509 /* First try to decide what to do without reference to look-ahead token. */
3510 yyn = yypact[yystate];
3511 if (yyn == YYPACT_NINF)
3514 /* Not known => get a look-ahead token if don't already have one. */
3516 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3517 if (yychar == YYEMPTY)
3519 YYDPRINTF ((stderr, "Reading a token: "));
3523 if (yychar <= YYEOF)
3525 yychar = yytoken = YYEOF;
3526 YYDPRINTF ((stderr, "Now at end of input.\n"));
3530 yytoken = YYTRANSLATE (yychar);
3531 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3534 /* If the proper action on seeing token YYTOKEN is to reduce or to
3535 detect an error, take that action. */
3537 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3542 if (yyn == 0 || yyn == YYTABLE_NINF)
3551 /* Count tokens shifted since error; after three, turn off error
3556 /* Shift the look-ahead token. */
3557 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3559 /* Discard the shifted token unless it is eof. */
3560 if (yychar != YYEOF)
3569 /*-----------------------------------------------------------.
3570 | yydefault -- do the default action for the current state. |
3571 `-----------------------------------------------------------*/
3573 yyn = yydefact[yystate];
3579 /*-----------------------------.
3580 | yyreduce -- Do a reduction. |
3581 `-----------------------------*/
3583 /* yyn is the number of a rule to reduce with. */
3586 /* If YYLEN is nonzero, implement the default value of the action:
3589 Otherwise, the following line sets YYVAL to garbage.
3590 This behavior is undocumented and Bison
3591 users should not rely upon it. Assigning to YYVAL
3592 unconditionally makes the parser a bit smaller, and it avoids a
3593 GCC warning that YYVAL may be used uninitialized. */
3594 yyval = yyvsp[1-yylen];
3597 YY_REDUCE_PRINT (yyn);
3601 #line 1124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3602 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3606 #line 1124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3607 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3611 #line 1125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3612 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3616 #line 1125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3617 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3621 #line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3622 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3626 #line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3627 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3631 #line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3632 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3636 #line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3637 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3641 #line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3642 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3646 #line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3647 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3651 #line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3652 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3656 #line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3657 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3661 #line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3662 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3666 #line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3667 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3671 #line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3672 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3676 #line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3677 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3681 #line 1135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3682 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3686 #line 1135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3687 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3691 #line 1136 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3692 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3696 #line 1136 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3697 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3701 #line 1137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3702 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3706 #line 1137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3707 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3711 #line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3712 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3716 #line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3717 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3721 #line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3722 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3726 #line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3727 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3731 #line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3732 { (yyval.StrVal) = 0; ;}
3736 #line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3737 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3741 #line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.UIntVal)=0; ;}
3746 #line 1156 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3748 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3754 #line 1160 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3762 #line 1168 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3770 #line 1173 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3772 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3778 #line 1179 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3779 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3783 #line 1180 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3784 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3788 #line 1181 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3789 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3793 #line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3794 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3798 #line 1183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3799 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3803 #line 1184 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3804 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3808 #line 1188 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3809 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3813 #line 1189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3814 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3818 #line 1190 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3819 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3823 #line 1194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3824 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3828 #line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3829 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3833 #line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3834 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3838 #line 1197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3839 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3843 #line 1201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3844 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3848 #line 1202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3849 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3853 #line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3854 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3858 #line 1207 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3859 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3863 #line 1208 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3864 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3868 #line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3869 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3873 #line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3874 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3878 #line 1211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3879 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3883 #line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3884 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3888 #line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3889 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3893 #line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3894 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3898 #line 1220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3899 { (yyval.UIntVal) = CallingConv::C; ;}
3903 #line 1221 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3904 { (yyval.UIntVal) = CallingConv::C; ;}
3908 #line 1222 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3909 { (yyval.UIntVal) = CallingConv::Fast; ;}
3913 #line 1223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3914 { (yyval.UIntVal) = CallingConv::Cold; ;}
3918 #line 1224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3919 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3923 #line 1225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3924 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3928 #line 1226 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3930 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3931 GEN_ERROR("Calling conv too large");
3932 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3938 #line 1233 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3939 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3943 #line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3944 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3948 #line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3949 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3953 #line 1236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3954 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3958 #line 1237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3959 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3963 #line 1238 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3964 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3968 #line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3969 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
3973 #line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3974 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
3978 #line 1241 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3979 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
3983 #line 1242 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3984 { (yyval.ParamAttrs) =
3985 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
3989 #line 1246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3990 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3994 #line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
3996 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4001 #line 1252 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4002 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
4006 #line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4007 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
4011 #line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4012 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
4016 #line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4017 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
4021 #line 1256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4022 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
4026 #line 1257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4027 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
4031 #line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4032 { (yyval.ParamAttrs) = ParamAttr::None; ;}
4036 #line 1261 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4038 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
4043 #line 1266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4044 { (yyval.StrVal) = 0; ;}
4048 #line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4050 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4055 #line 1274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4056 { (yyval.UIntVal) = 0; ;}
4060 #line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4062 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4063 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4064 GEN_ERROR("Alignment must be a power of two");
4070 #line 1281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4071 { (yyval.UIntVal) = 0; ;}
4075 #line 1282 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4077 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4078 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4079 GEN_ERROR("Alignment must be a power of two");
4085 #line 1291 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4087 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4088 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4089 GEN_ERROR("Invalid character in section name");
4090 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4096 #line 1299 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4097 { (yyval.StrVal) = 0; ;}
4101 #line 1300 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4102 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4106 #line 1305 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4111 #line 1306 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4116 #line 1307 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4118 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4119 delete (yyvsp[(1) - (1)].StrVal);
4125 #line 1312 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4127 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4128 GEN_ERROR("Alignment must be a power of two");
4129 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4135 #line 1328 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4137 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4143 #line 1332 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4145 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4151 #line 1336 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4153 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4154 GEN_ERROR("Cannot form a pointer to a basic block");
4155 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4156 delete (yyvsp[(1) - (3)].TypeVal);
4162 #line 1343 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4163 { // Named types are also simple types...
4164 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4166 (yyval.TypeVal) = new PATypeHolder(tmp);
4171 #line 1348 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4172 { // Type UpReference
4173 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4174 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4175 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4176 (yyval.TypeVal) = new PATypeHolder(OT);
4177 UR_OUT("New Upreference!\n");
4183 #line 1356 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4185 // Allow but ignore attributes on function types; this permits auto-upgrade.
4186 // FIXME: remove in LLVM 3.0.
4187 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4188 if (!FunctionType::isValidReturnType(RetTy))
4189 GEN_ERROR("Invalid result type for LLVM function");
4191 std::vector<const Type*> Params;
4192 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4193 for (; I != E; ++I ) {
4194 const Type *Ty = I->Ty->get();
4195 Params.push_back(Ty);
4198 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4199 if (isVarArg) Params.pop_back();
4201 for (unsigned i = 0; i != Params.size(); ++i)
4202 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4203 GEN_ERROR("Function arguments must be value types!");
4207 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4208 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4209 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4210 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4216 #line 1385 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4218 // Allow but ignore attributes on function types; this permits auto-upgrade.
4219 // FIXME: remove in LLVM 3.0.
4220 std::vector<const Type*> Params;
4221 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4222 for ( ; I != E; ++I ) {
4223 const Type* Ty = I->Ty->get();
4224 Params.push_back(Ty);
4227 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4228 if (isVarArg) Params.pop_back();
4230 for (unsigned i = 0; i != Params.size(); ++i)
4231 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4232 GEN_ERROR("Function arguments must be value types!");
4236 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4237 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4238 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4244 #line 1410 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4245 { // Sized array type?
4246 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4247 delete (yyvsp[(4) - (5)].TypeVal);
4253 #line 1415 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4255 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4256 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4257 GEN_ERROR("Unsigned result not equal to signed result");
4258 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4259 GEN_ERROR("Element type of a VectorType must be primitive");
4260 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4261 delete (yyvsp[(4) - (5)].TypeVal);
4267 #line 1425 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4268 { // Structure type?
4269 std::vector<const Type*> Elements;
4270 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4271 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4272 Elements.push_back(*I);
4274 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4275 delete (yyvsp[(2) - (3)].TypeList);
4281 #line 1435 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4282 { // Empty structure type?
4283 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4289 #line 1439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4291 std::vector<const Type*> Elements;
4292 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4293 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4294 Elements.push_back(*I);
4296 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4297 delete (yyvsp[(3) - (5)].TypeList);
4303 #line 1449 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4304 { // Empty structure type?
4305 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4311 #line 1456 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4313 // Allow but ignore attributes on function types; this permits auto-upgrade.
4314 // FIXME: remove in LLVM 3.0.
4315 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4316 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4321 #line 1465 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4323 if (!UpRefs.empty())
4324 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4325 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4326 GEN_ERROR("LLVM functions cannot return aggregate types");
4327 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4332 #line 1472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4334 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4339 #line 1477 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4341 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4342 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4348 #line 1482 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4350 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4356 #line 1490 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4358 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4359 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4360 TWA.Ty = new PATypeHolder(Type::VoidTy);
4361 (yyval.TypeWithAttrsList)->push_back(TWA);
4367 #line 1497 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4369 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4370 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4371 TWA.Ty = new PATypeHolder(Type::VoidTy);
4372 (yyval.TypeWithAttrsList)->push_back(TWA);
4378 #line 1504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4380 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4386 #line 1512 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4388 (yyval.TypeList) = new std::list<PATypeHolder>();
4389 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4390 delete (yyvsp[(1) - (1)].TypeVal);
4396 #line 1518 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4398 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4399 delete (yyvsp[(3) - (3)].TypeVal);
4405 #line 1530 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4406 { // Nonempty unsized arr
4407 if (!UpRefs.empty())
4408 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4409 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4411 GEN_ERROR("Cannot make array constant with type: '" +
4412 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4413 const Type *ETy = ATy->getElementType();
4414 int NumElements = ATy->getNumElements();
4416 // Verify that we have the correct size...
4417 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4418 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4419 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4420 itostr(NumElements) + "");
4422 // Verify all elements are correct type!
4423 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4424 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4425 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4426 ETy->getDescription() +"' as required!\nIt is of type '"+
4427 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4430 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4431 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4437 #line 1558 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4439 if (!UpRefs.empty())
4440 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4441 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4443 GEN_ERROR("Cannot make array constant with type: '" +
4444 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4446 int NumElements = ATy->getNumElements();
4447 if (NumElements != -1 && NumElements != 0)
4448 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4449 " arguments, but has size of " + itostr(NumElements) +"");
4450 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4451 delete (yyvsp[(1) - (3)].TypeVal);
4457 #line 1574 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4459 if (!UpRefs.empty())
4460 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4461 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4463 GEN_ERROR("Cannot make array constant with type: '" +
4464 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4466 int NumElements = ATy->getNumElements();
4467 const Type *ETy = ATy->getElementType();
4468 if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
4469 GEN_ERROR("Can't build string constant of size " +
4470 itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
4471 " when array has size " + itostr(NumElements) + "");
4472 std::vector<Constant*> Vals;
4473 if (ETy == Type::Int8Ty) {
4474 for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4475 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4477 delete (yyvsp[(3) - (3)].StrVal);
4478 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4480 delete (yyvsp[(3) - (3)].StrVal);
4481 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4482 delete (yyvsp[(1) - (3)].TypeVal);
4488 #line 1601 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4489 { // Nonempty unsized arr
4490 if (!UpRefs.empty())
4491 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4492 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4494 GEN_ERROR("Cannot make packed constant with type: '" +
4495 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4496 const Type *ETy = PTy->getElementType();
4497 int NumElements = PTy->getNumElements();
4499 // Verify that we have the correct size...
4500 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4501 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4502 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4503 itostr(NumElements) + "");
4505 // Verify all elements are correct type!
4506 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4507 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4508 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4509 ETy->getDescription() +"' as required!\nIt is of type '"+
4510 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4513 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4514 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4520 #line 1629 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4522 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4524 GEN_ERROR("Cannot make struct constant with type: '" +
4525 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4527 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4528 GEN_ERROR("Illegal number of initializers for structure type");
4530 // Check to ensure that constants are compatible with the type initializer!
4531 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4532 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4533 GEN_ERROR("Expected type '" +
4534 STy->getElementType(i)->getDescription() +
4535 "' for element #" + utostr(i) +
4536 " of structure initializer");
4538 // Check to ensure that Type is not packed
4539 if (STy->isPacked())
4540 GEN_ERROR("Unpacked Initializer to vector type '" +
4541 STy->getDescription() + "'");
4543 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4544 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4550 #line 1655 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4552 if (!UpRefs.empty())
4553 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4554 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4556 GEN_ERROR("Cannot make struct constant with type: '" +
4557 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4559 if (STy->getNumContainedTypes() != 0)
4560 GEN_ERROR("Illegal number of initializers for structure type");
4562 // Check to ensure that Type is not packed
4563 if (STy->isPacked())
4564 GEN_ERROR("Unpacked Initializer to vector type '" +
4565 STy->getDescription() + "'");
4567 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4568 delete (yyvsp[(1) - (3)].TypeVal);
4574 #line 1675 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4576 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4578 GEN_ERROR("Cannot make struct constant with type: '" +
4579 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4581 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4582 GEN_ERROR("Illegal number of initializers for structure type");
4584 // Check to ensure that constants are compatible with the type initializer!
4585 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4586 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4587 GEN_ERROR("Expected type '" +
4588 STy->getElementType(i)->getDescription() +
4589 "' for element #" + utostr(i) +
4590 " of structure initializer");
4592 // Check to ensure that Type is packed
4593 if (!STy->isPacked())
4594 GEN_ERROR("Vector initializer to non-vector type '" +
4595 STy->getDescription() + "'");
4597 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4598 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4604 #line 1701 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4606 if (!UpRefs.empty())
4607 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4608 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4610 GEN_ERROR("Cannot make struct constant with type: '" +
4611 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4613 if (STy->getNumContainedTypes() != 0)
4614 GEN_ERROR("Illegal number of initializers for structure type");
4616 // Check to ensure that Type is packed
4617 if (!STy->isPacked())
4618 GEN_ERROR("Vector initializer to non-vector type '" +
4619 STy->getDescription() + "'");
4621 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4622 delete (yyvsp[(1) - (5)].TypeVal);
4628 #line 1721 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4630 if (!UpRefs.empty())
4631 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4632 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4634 GEN_ERROR("Cannot make null pointer constant with type: '" +
4635 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4637 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4638 delete (yyvsp[(1) - (2)].TypeVal);
4644 #line 1733 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4646 if (!UpRefs.empty())
4647 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4648 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4649 delete (yyvsp[(1) - (2)].TypeVal);
4655 #line 1740 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4657 if (!UpRefs.empty())
4658 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4659 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4661 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4663 // ConstExprs can exist in the body of a function, thus creating
4664 // GlobalValues whenever they refer to a variable. Because we are in
4665 // the context of a function, getExistingVal will search the functions
4666 // symbol table instead of the module symbol table for the global symbol,
4667 // which throws things all off. To get around this, we just tell
4668 // getExistingVal that we are at global scope here.
4670 Function *SavedCurFn = CurFun.CurrentFunction;
4671 CurFun.CurrentFunction = 0;
4673 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4676 CurFun.CurrentFunction = SavedCurFn;
4678 // If this is an initializer for a constant pointer, which is referencing a
4679 // (currently) undefined variable, create a stub now that shall be replaced
4680 // in the future with the right type of variable.
4683 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4684 const PointerType *PT = cast<PointerType>(Ty);
4686 // First check to see if the forward references value is already created!
4687 PerModuleInfo::GlobalRefsType::iterator I =
4688 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4690 if (I != CurModule.GlobalRefs.end()) {
4691 V = I->second; // Placeholder already exists, use it...
4692 (yyvsp[(2) - (2)].ValIDVal).destroy();
4695 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4696 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4697 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4698 GEN_ERROR("Invalid reference to global");
4700 // Create the forward referenced global.
4702 if (const FunctionType *FTy =
4703 dyn_cast<FunctionType>(PT->getElementType())) {
4704 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4705 CurModule.CurrentModule);
4707 GV = new GlobalVariable(PT->getElementType(), false,
4708 GlobalValue::ExternalWeakLinkage, 0,
4709 Name, CurModule.CurrentModule);
4712 // Keep track of the fact that we have a forward ref to recycle it
4713 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4718 (yyval.ConstVal) = cast<GlobalValue>(V);
4719 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4725 #line 1806 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4727 if (!UpRefs.empty())
4728 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4729 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4730 GEN_ERROR("Mismatched types for constant expression: " +
4731 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4732 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4733 delete (yyvsp[(1) - (2)].TypeVal);
4739 #line 1816 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4741 if (!UpRefs.empty())
4742 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4743 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4744 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4745 GEN_ERROR("Cannot create a null initialized value of this type");
4746 (yyval.ConstVal) = Constant::getNullValue(Ty);
4747 delete (yyvsp[(1) - (2)].TypeVal);
4753 #line 1826 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4754 { // integral constants
4755 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4756 GEN_ERROR("Constant value doesn't fit in type");
4757 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4763 #line 1832 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4764 { // arbitrary precision integer constants
4765 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4766 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4767 GEN_ERROR("Constant value does not fit in type");
4769 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4770 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4771 delete (yyvsp[(2) - (2)].APIntVal);
4777 #line 1842 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4778 { // integral constants
4779 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4780 GEN_ERROR("Constant value doesn't fit in type");
4781 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4787 #line 1848 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4788 { // arbitrary precision integer constants
4789 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4790 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4791 GEN_ERROR("Constant value does not fit in type");
4793 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4794 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4795 delete (yyvsp[(2) - (2)].APIntVal);
4801 #line 1858 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4802 { // Boolean constants
4803 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4804 GEN_ERROR("Constant true must have type i1");
4805 (yyval.ConstVal) = ConstantInt::getTrue();
4811 #line 1864 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4812 { // Boolean constants
4813 if (cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1)
4814 GEN_ERROR("Constant false must have type i1");
4815 (yyval.ConstVal) = ConstantInt::getFalse();
4821 #line 1870 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4822 { // Floating point constants
4823 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4824 GEN_ERROR("Floating point constant invalid for type");
4825 // Lexer has no type info, so builds all float and double FP constants
4826 // as double. Fix this here. Long double is done right.
4827 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4828 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4829 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
4830 delete (yyvsp[(2) - (2)].FPVal);
4836 #line 1883 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4838 if (!UpRefs.empty())
4839 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4840 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4841 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4842 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4843 GEN_ERROR("invalid cast opcode for cast from '" +
4844 Val->getType()->getDescription() + "' to '" +
4845 DestTy->getDescription() + "'");
4846 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4847 delete (yyvsp[(5) - (6)].TypeVal);
4852 #line 1895 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4854 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4855 GEN_ERROR("GetElementPtr requires a pointer operand");
4858 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
4860 GEN_ERROR("Index list invalid for constant getelementptr");
4862 SmallVector<Constant*, 8> IdxVec;
4863 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4864 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4865 IdxVec.push_back(C);
4867 GEN_ERROR("Indices to constant getelementptr must be constants");
4869 delete (yyvsp[(4) - (5)].ValueList);
4871 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4877 #line 1916 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4879 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4880 GEN_ERROR("Select condition must be of boolean type");
4881 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4882 GEN_ERROR("Select operand types must match");
4883 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4889 #line 1924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4891 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4892 GEN_ERROR("Binary operator types must match");
4894 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4899 #line 1930 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4901 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4902 GEN_ERROR("Logical operator types must match");
4903 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4904 if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4905 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4906 GEN_ERROR("Logical operator requires integral operands");
4908 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4914 #line 1941 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4916 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4917 GEN_ERROR("icmp operand types must match");
4918 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4923 #line 1946 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4925 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4926 GEN_ERROR("fcmp operand types must match");
4927 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4932 #line 1951 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4934 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4935 GEN_ERROR("vicmp operand types must match");
4936 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4941 #line 1956 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4943 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4944 GEN_ERROR("vfcmp operand types must match");
4945 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4950 #line 1961 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4952 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4953 GEN_ERROR("Invalid extractelement operands");
4954 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4960 #line 1967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4962 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4963 GEN_ERROR("Invalid insertelement operands");
4964 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4970 #line 1973 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4972 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4973 GEN_ERROR("Invalid shufflevector operands");
4974 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4980 #line 1979 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4982 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4983 GEN_ERROR("ExtractValue requires an aggregate operand");
4985 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
4986 delete (yyvsp[(4) - (5)].ConstantList);
4992 #line 1987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
4994 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
4995 GEN_ERROR("InsertValue requires an aggregate operand");
4997 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
4998 delete (yyvsp[(6) - (7)].ConstantList);
5004 #line 1998 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5006 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5012 #line 2002 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5014 (yyval.ConstVector) = new std::vector<Constant*>();
5015 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5021 #line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5022 { (yyval.BoolVal) = false; ;}
5026 #line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5027 { (yyval.BoolVal) = true; ;}
5031 #line 2013 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5032 { (yyval.BoolVal) = true; ;}
5036 #line 2013 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5037 { (yyval.BoolVal) = false; ;}
5041 #line 2016 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5043 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5044 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5046 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5048 GEN_ERROR("Aliases can be created only to global values");
5050 (yyval.ConstVal) = Aliasee;
5052 delete (yyvsp[(1) - (2)].TypeVal);
5057 #line 2028 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5059 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5060 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5061 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5062 GEN_ERROR("invalid cast opcode for cast from '" +
5063 Val->getType()->getDescription() + "' to '" +
5064 DestTy->getDescription() + "'");
5066 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5068 delete (yyvsp[(5) - (6)].TypeVal);
5073 #line 2049 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5075 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5076 CurModule.ModuleDone();
5082 #line 2054 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5084 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5085 CurModule.ModuleDone();
5091 #line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5092 { CurFun.isDeclare = false; ;}
5096 #line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5098 CurFun.FunctionDone();
5104 #line 2071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5105 { CurFun.isDeclare = true; ;}
5109 #line 2071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5116 #line 2074 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5123 #line 2077 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5125 if (!UpRefs.empty())
5126 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5127 // Eagerly resolve types. This is not an optimization, this is a
5128 // requirement that is due to the fact that we could have this:
5130 // %list = type { %list * }
5131 // %list = type { %list * } ; repeated type decl
5133 // If types are not resolved eagerly, then the two types will not be
5134 // determined to be the same type!
5136 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5138 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5140 // If this is a named type that is not a redefinition, add it to the slot
5142 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5145 delete (yyvsp[(3) - (3)].TypeVal);
5151 #line 2101 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5153 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5155 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5157 // If this is a named type that is not a redefinition, add it to the slot
5159 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5166 #line 2113 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5168 /* "Externally Visible" Linkage */
5169 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5170 GEN_ERROR("Global value initializer is not a constant");
5171 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5172 (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));
5178 #line 2120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5185 #line 2124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5187 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5188 GEN_ERROR("Global value initializer is not a constant");
5189 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));
5195 #line 2129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5202 #line 2133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5204 if (!UpRefs.empty())
5205 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5206 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));
5208 delete (yyvsp[(6) - (7)].TypeVal);
5213 #line 2139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5221 #line 2143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5224 if ((yyvsp[(1) - (5)].StrVal)) {
5225 Name = *(yyvsp[(1) - (5)].StrVal);
5226 delete (yyvsp[(1) - (5)].StrVal);
5229 GEN_ERROR("Alias name cannot be empty");
5231 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5233 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5235 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5236 CurModule.CurrentModule);
5237 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5238 InsertValue(GA, CurModule.Values);
5241 // If there was a forward reference of this alias, resolve it now.
5245 ID = ValID::createGlobalName(Name);
5247 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5249 if (GlobalValue *FWGV =
5250 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5251 // Replace uses of the fwdref with the actual alias.
5252 FWGV->replaceAllUsesWith(GA);
5253 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5254 GV->eraseFromParent();
5256 cast<Function>(FWGV)->eraseFromParent();
5265 #line 2183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5272 #line 2186 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5279 #line 2192 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5281 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5282 if (AsmSoFar.empty())
5283 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5285 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5286 delete (yyvsp[(1) - (1)].StrVal);
5292 #line 2202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5294 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5295 delete (yyvsp[(3) - (3)].StrVal);
5300 #line 2206 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5302 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5303 delete (yyvsp[(3) - (3)].StrVal);
5308 #line 2213 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5310 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5311 delete (yyvsp[(3) - (3)].StrVal);
5317 #line 2218 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5319 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5320 delete (yyvsp[(1) - (1)].StrVal);
5326 #line 2223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5333 #line 2232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5335 if (!UpRefs.empty())
5336 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5337 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5338 GEN_ERROR("Argument types must be first-class");
5339 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5340 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5341 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5347 #line 2242 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5349 if (!UpRefs.empty())
5350 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5351 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5352 GEN_ERROR("Argument types must be first-class");
5353 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5354 (yyval.ArgList) = new ArgListType;
5355 (yyval.ArgList)->push_back(E);
5361 #line 2253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5363 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5369 #line 2257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5371 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5372 struct ArgListEntry E;
5373 E.Ty = new PATypeHolder(Type::VoidTy);
5375 E.Attrs = ParamAttr::None;
5376 (yyval.ArgList)->push_back(E);
5382 #line 2266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5384 (yyval.ArgList) = new ArgListType;
5385 struct ArgListEntry E;
5386 E.Ty = new PATypeHolder(Type::VoidTy);
5388 E.Attrs = ParamAttr::None;
5389 (yyval.ArgList)->push_back(E);
5395 #line 2275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5397 (yyval.ArgList) = 0;
5403 #line 2281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5405 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5406 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5408 // Check the function result for abstractness if this is a define. We should
5409 // have no abstract types at this point
5410 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5411 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5413 if (!FunctionType::isValidReturnType(*(yyvsp[(2) - (10)].TypeVal)))
5414 GEN_ERROR("Invalid result type for LLVM function");
5416 std::vector<const Type*> ParamTypeList;
5417 SmallVector<ParamAttrsWithIndex, 8> Attrs;
5418 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5419 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
5420 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5422 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5423 const Type* Ty = I->Ty->get();
5424 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5425 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5426 ParamTypeList.push_back(Ty);
5427 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5428 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
5432 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5433 if (isVarArg) ParamTypeList.pop_back();
5437 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
5439 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5440 const PointerType *PFT = PointerType::getUnqual(FT);
5441 delete (yyvsp[(2) - (10)].TypeVal);
5444 if (!FunctionName.empty()) {
5445 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5447 ID = ValID::createGlobalID(CurModule.Values.size());
5451 // See if this function was forward referenced. If so, recycle the object.
5452 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5453 // Move the function to the end of the list, from whereever it was
5454 // previously inserted.
5455 Fn = cast<Function>(FWRef);
5456 assert(Fn->getParamAttrs().isEmpty() &&
5457 "Forward reference has parameter attributes!");
5458 CurModule.CurrentModule->getFunctionList().remove(Fn);
5459 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5460 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5461 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5462 if (Fn->getFunctionType() != FT ) {
5463 // The existing function doesn't have the same type. This is an overload
5465 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5466 } else if (Fn->getParamAttrs() != PAL) {
5467 // The existing function doesn't have the same parameter attributes.
5468 // This is an overload error.
5469 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5470 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5471 // Neither the existing or the current function is a declaration and they
5472 // have the same name and same type. Clearly this is a redefinition.
5473 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5474 } else if (Fn->isDeclaration()) {
5475 // Make sure to strip off any argument names so we can't get conflicts.
5476 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5480 } else { // Not already defined?
5481 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5482 CurModule.CurrentModule);
5483 InsertValue(Fn, CurModule.Values);
5486 CurFun.FunctionStart(Fn);
5488 if (CurFun.isDeclare) {
5489 // If we have declaration, always overwrite linkage. This will allow us to
5490 // correctly handle cases, when pointer to function is passed as argument to
5491 // another function.
5492 Fn->setLinkage(CurFun.Linkage);
5493 Fn->setVisibility(CurFun.Visibility);
5495 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5496 Fn->setParamAttrs(PAL);
5497 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5498 if ((yyvsp[(8) - (10)].StrVal)) {
5499 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5500 delete (yyvsp[(8) - (10)].StrVal);
5502 if ((yyvsp[(10) - (10)].StrVal)) {
5503 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5504 delete (yyvsp[(10) - (10)].StrVal);
5507 // Add all of the arguments we parsed to the function...
5508 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5509 if (isVarArg) { // Nuke the last entry
5510 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5511 "Not a varargs marker!");
5512 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5513 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5515 Function::arg_iterator ArgIt = Fn->arg_begin();
5516 Function::arg_iterator ArgEnd = Fn->arg_end();
5518 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5519 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5520 delete I->Ty; // Delete the typeholder...
5521 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5527 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5534 #line 2411 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5536 (yyval.FunctionVal) = CurFun.CurrentFunction;
5538 // Make sure that we keep track of the linkage type even if there was a
5539 // previous "declare".
5540 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5541 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5546 #line 2422 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5548 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5554 #line 2427 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5556 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5557 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5558 (yyval.FunctionVal) = CurFun.CurrentFunction;
5559 CurFun.FunctionDone();
5565 #line 2439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5567 (yyval.BoolVal) = false;
5573 #line 2443 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5575 (yyval.BoolVal) = true;
5581 #line 2448 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5582 { // A reference to a direct constant
5583 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5589 #line 2452 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5591 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5597 #line 2456 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5598 { // Perhaps it's an FP constant?
5599 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5605 #line 2460 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5607 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5613 #line 2464 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5615 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5621 #line 2468 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5623 (yyval.ValIDVal) = ValID::createNull();
5629 #line 2472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5631 (yyval.ValIDVal) = ValID::createUndef();
5637 #line 2476 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5638 { // A vector zero constant.
5639 (yyval.ValIDVal) = ValID::createZeroInit();
5645 #line 2480 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5646 { // Nonempty unsized packed vector
5647 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5648 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5650 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5651 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5653 VectorType* pt = VectorType::get(ETy, NumElements);
5654 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5656 // Verify all elements are correct type!
5657 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5658 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5659 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5660 ETy->getDescription() +"' as required!\nIt is of type '" +
5661 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5664 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5665 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5671 #line 2502 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5672 { // Nonempty unsized arr
5673 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5674 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5676 if (!ETy->isFirstClassType())
5677 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5679 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5680 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5682 // Verify all elements are correct type!
5683 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5684 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5685 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5686 ETy->getDescription() +"' as required!\nIt is of type '"+
5687 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5690 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5691 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5697 #line 2524 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5699 (yyval.ValIDVal) = ValID::createUndef();
5705 #line 2528 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5707 int NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5708 const Type *ETy = Type::Int8Ty;
5710 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5712 std::vector<Constant*> Vals;
5713 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5714 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5715 delete (yyvsp[(2) - (2)].StrVal);
5716 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5722 #line 2541 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5724 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5725 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5726 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5728 const StructType *STy = StructType::get(Elements);
5729 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5731 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5732 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5738 #line 2553 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5740 const StructType *STy = StructType::get(std::vector<const Type*>());
5741 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5747 #line 2558 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5749 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5750 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5751 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5753 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5754 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5756 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5757 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5763 #line 2570 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5765 const StructType *STy = StructType::get(std::vector<const Type*>(),
5767 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5773 #line 2576 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5775 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5781 #line 2580 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5783 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5784 delete (yyvsp[(3) - (5)].StrVal);
5785 delete (yyvsp[(5) - (5)].StrVal);
5791 #line 2590 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5792 { // Is it an integer reference...?
5793 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5799 #line 2594 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5801 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5807 #line 2598 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5808 { // Is it a named reference...?
5809 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5810 delete (yyvsp[(1) - (1)].StrVal);
5816 #line 2603 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5817 { // Is it a named reference...?
5818 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5819 delete (yyvsp[(1) - (1)].StrVal);
5825 #line 2616 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5827 if (!UpRefs.empty())
5828 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5829 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5830 delete (yyvsp[(1) - (2)].TypeVal);
5836 #line 2625 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5838 (yyval.ValueList) = new std::vector<Value *>();
5839 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5845 #line 2630 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5847 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
5853 #line 2635 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5855 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5861 #line 2639 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5862 { // Do not allow functions with 0 basic blocks
5863 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5869 #line 2648 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5871 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5873 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5874 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5875 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5881 #line 2657 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5883 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5884 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5885 if (CI2->getParent() == 0)
5886 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5887 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5888 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5894 #line 2666 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5895 { // Empty space between instruction lists
5896 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5902 #line 2670 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5903 { // Labelled (named) basic block
5904 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5905 delete (yyvsp[(1) - (1)].StrVal);
5912 #line 2678 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5913 { // Return with a result...
5914 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
5915 assert(!VL.empty() && "Invalid ret operands!");
5916 (yyval.TermInstVal) = ReturnInst::Create(&VL[0], VL.size());
5917 delete (yyvsp[(2) - (2)].ValueList);
5923 #line 2685 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5924 { // Return with no result...
5925 (yyval.TermInstVal) = ReturnInst::Create();
5931 #line 2689 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5932 { // Unconditional Branch...
5933 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5935 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
5940 #line 2694 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5942 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
5943 GEN_ERROR("Branch condition must have type i1");
5944 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5946 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5948 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5950 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
5955 #line 2705 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5957 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
5959 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5961 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
5962 (yyval.TermInstVal) = S;
5964 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
5965 E = (yyvsp[(8) - (9)].JumpTable)->end();
5966 for (; I != E; ++I) {
5967 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
5968 S->addCase(CI, I->second);
5970 GEN_ERROR("Switch case is constant, but not a simple integer");
5972 delete (yyvsp[(8) - (9)].JumpTable);
5978 #line 2724 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5980 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
5982 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
5984 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
5985 (yyval.TermInstVal) = S;
5991 #line 2734 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
5994 // Handle the short syntax
5995 const PointerType *PFTy = 0;
5996 const FunctionType *Ty = 0;
5997 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
5998 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
5999 // Pull out the types of all of the arguments...
6000 std::vector<const Type*> ParamTypes;
6001 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
6002 for (; I != E; ++I) {
6003 const Type *Ty = I->Val->getType();
6004 if (Ty == Type::VoidTy)
6005 GEN_ERROR("Short call syntax cannot be used with varargs");
6006 ParamTypes.push_back(Ty);
6009 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (14)].TypeVal)))
6010 GEN_ERROR("Invalid result type for LLVM function");
6012 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
6013 PFTy = PointerType::getUnqual(Ty);
6016 delete (yyvsp[(3) - (14)].TypeVal);
6018 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
6020 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
6022 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
6025 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6026 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
6027 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
6029 // Check the arguments
6031 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
6032 // Make sure no arguments is a good thing!
6033 if (Ty->getNumParams() != 0)
6034 GEN_ERROR("No arguments passed to a function that "
6035 "expects arguments");
6036 } else { // Has arguments?
6037 // Loop through FunctionType's arguments and ensure they are specified
6039 FunctionType::param_iterator I = Ty->param_begin();
6040 FunctionType::param_iterator E = Ty->param_end();
6041 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
6044 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6045 if (ArgI->Val->getType() != *I)
6046 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6047 (*I)->getDescription() + "'");
6048 Args.push_back(ArgI->Val);
6049 if (ArgI->Attrs != ParamAttr::None)
6050 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6053 if (Ty->isVarArg()) {
6055 for (; ArgI != ArgE; ++ArgI, ++index) {
6056 Args.push_back(ArgI->Val); // push the remaining varargs
6057 if (ArgI->Attrs != ParamAttr::None)
6058 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6060 } else if (I != E || ArgI != ArgE)
6061 GEN_ERROR("Invalid number of parameters detected");
6066 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6068 // Create the InvokeInst
6069 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6070 Args.begin(), Args.end());
6071 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
6072 II->setParamAttrs(PAL);
6073 (yyval.TermInstVal) = II;
6074 delete (yyvsp[(6) - (14)].ParamList);
6080 #line 2819 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6082 (yyval.TermInstVal) = new UnwindInst();
6088 #line 2823 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6090 (yyval.TermInstVal) = new UnreachableInst();
6096 #line 2830 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6098 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6099 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6102 GEN_ERROR("May only switch on a constant pool value");
6104 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6106 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6111 #line 2841 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6113 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6114 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6118 GEN_ERROR("May only switch on a constant pool value");
6120 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6122 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6127 #line 2854 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6129 // Is this definition named?? if so, assign the name...
6130 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6132 InsertValue((yyvsp[(2) - (2)].InstVal));
6133 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6139 #line 2864 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6140 { // Used for PHI nodes
6141 if (!UpRefs.empty())
6142 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6143 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6144 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6146 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6148 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6149 delete (yyvsp[(1) - (6)].TypeVal);
6154 #line 2875 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6156 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6157 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6159 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6161 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6166 #line 2885 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6168 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6169 if (!UpRefs.empty())
6170 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6171 // Used for call and invoke instructions
6172 (yyval.ParamList) = new ParamList();
6173 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6174 (yyval.ParamList)->push_back(E);
6175 delete (yyvsp[(1) - (4)].TypeVal);
6181 #line 2896 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6183 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6184 // Labels are only valid in ASMs
6185 (yyval.ParamList) = new ParamList();
6186 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6187 (yyval.ParamList)->push_back(E);
6193 #line 2904 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6195 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6196 if (!UpRefs.empty())
6197 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6198 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6199 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6200 (yyval.ParamList)->push_back(E);
6201 delete (yyvsp[(3) - (6)].TypeVal);
6207 #line 2914 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6209 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
6210 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6211 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6212 (yyval.ParamList)->push_back(E);
6218 #line 2921 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6219 { (yyval.ParamList) = new ParamList(); ;}
6223 #line 2924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6224 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6228 #line 2925 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6230 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6231 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6237 #line 2933 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6239 (yyval.ConstantList) = new std::vector<unsigned>();
6240 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6241 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6242 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6247 #line 2939 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6249 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6250 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6251 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6252 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6258 #line 2948 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6260 (yyval.BoolVal) = true;
6266 #line 2952 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6268 (yyval.BoolVal) = false;
6274 #line 2957 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6276 if (!UpRefs.empty())
6277 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6278 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6279 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6281 "Arithmetic operator requires integer, FP, or packed operands");
6282 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6284 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6286 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6287 if ((yyval.InstVal) == 0)
6288 GEN_ERROR("binary operator returned null");
6289 delete (yyvsp[(2) - (5)].TypeVal);
6294 #line 2973 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6296 if (!UpRefs.empty())
6297 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6298 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6299 if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6300 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6301 GEN_ERROR("Logical operator requires integral operands");
6303 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6305 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6307 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6308 if ((yyval.InstVal) == 0)
6309 GEN_ERROR("binary operator returned null");
6310 delete (yyvsp[(2) - (5)].TypeVal);
6315 #line 2990 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6317 if (!UpRefs.empty())
6318 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6319 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6320 GEN_ERROR("Vector types not supported by icmp instruction");
6321 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6323 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6325 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6326 if ((yyval.InstVal) == 0)
6327 GEN_ERROR("icmp operator returned null");
6328 delete (yyvsp[(3) - (6)].TypeVal);
6333 #line 3004 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6335 if (!UpRefs.empty())
6336 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6337 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6338 GEN_ERROR("Vector types not supported by fcmp instruction");
6339 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6341 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6343 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6344 if ((yyval.InstVal) == 0)
6345 GEN_ERROR("fcmp operator returned null");
6346 delete (yyvsp[(3) - (6)].TypeVal);
6351 #line 3018 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6353 if (!UpRefs.empty())
6354 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6355 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6356 GEN_ERROR("Scalar types not supported by vicmp instruction");
6357 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6359 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6361 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6362 if ((yyval.InstVal) == 0)
6363 GEN_ERROR("icmp operator returned null");
6364 delete (yyvsp[(3) - (6)].TypeVal);
6369 #line 3032 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6371 if (!UpRefs.empty())
6372 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6373 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6374 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6375 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6377 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6379 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6380 if ((yyval.InstVal) == 0)
6381 GEN_ERROR("fcmp operator returned null");
6382 delete (yyvsp[(3) - (6)].TypeVal);
6387 #line 3046 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6389 if (!UpRefs.empty())
6390 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6391 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6392 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6393 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6394 GEN_ERROR("invalid cast opcode for cast from '" +
6395 Val->getType()->getDescription() + "' to '" +
6396 DestTy->getDescription() + "'");
6397 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6398 delete (yyvsp[(4) - (4)].TypeVal);
6403 #line 3058 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6405 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6406 GEN_ERROR("select condition must be boolean");
6407 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6408 GEN_ERROR("select value types should match");
6409 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6415 #line 3066 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6417 if (!UpRefs.empty())
6418 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6419 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6420 delete (yyvsp[(4) - (4)].TypeVal);
6426 #line 3073 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6428 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6429 GEN_ERROR("Invalid extractelement operands");
6430 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6436 #line 3079 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6438 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6439 GEN_ERROR("Invalid insertelement operands");
6440 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6446 #line 3085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6448 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6449 GEN_ERROR("Invalid shufflevector operands");
6450 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6456 #line 3091 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6458 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6459 if (!Ty->isFirstClassType())
6460 GEN_ERROR("PHI node operands must be of first class type");
6461 (yyval.InstVal) = PHINode::Create(Ty);
6462 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6463 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6464 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6465 GEN_ERROR("All elements of a PHI node must be of the same type");
6466 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6467 (yyvsp[(2) - (2)].PHIList)->pop_front();
6469 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6475 #line 3107 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6478 // Handle the short syntax
6479 const PointerType *PFTy = 0;
6480 const FunctionType *Ty = 0;
6481 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6482 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6483 // Pull out the types of all of the arguments...
6484 std::vector<const Type*> ParamTypes;
6485 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6486 for (; I != E; ++I) {
6487 const Type *Ty = I->Val->getType();
6488 if (Ty == Type::VoidTy)
6489 GEN_ERROR("Short call syntax cannot be used with varargs");
6490 ParamTypes.push_back(Ty);
6493 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (8)].TypeVal)))
6494 GEN_ERROR("Invalid result type for LLVM function");
6496 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6497 PFTy = PointerType::getUnqual(Ty);
6500 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6503 // Check for call to invalid intrinsic to avoid crashing later.
6504 if (Function *theF = dyn_cast<Function>(V)) {
6505 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6506 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6507 !theF->getIntrinsicID(true))
6508 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6509 theF->getName() + "'");
6512 // Set up the ParamAttrs for the function
6513 SmallVector<ParamAttrsWithIndex, 8> Attrs;
6514 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6515 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
6516 // Check the arguments
6518 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6519 // Make sure no arguments is a good thing!
6520 if (Ty->getNumParams() != 0)
6521 GEN_ERROR("No arguments passed to a function that "
6522 "expects arguments");
6523 } else { // Has arguments?
6524 // Loop through FunctionType's arguments and ensure they are specified
6525 // correctly. Also, gather any parameter attributes.
6526 FunctionType::param_iterator I = Ty->param_begin();
6527 FunctionType::param_iterator E = Ty->param_end();
6528 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6531 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6532 if (ArgI->Val->getType() != *I)
6533 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6534 (*I)->getDescription() + "'");
6535 Args.push_back(ArgI->Val);
6536 if (ArgI->Attrs != ParamAttr::None)
6537 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6539 if (Ty->isVarArg()) {
6541 for (; ArgI != ArgE; ++ArgI, ++index) {
6542 Args.push_back(ArgI->Val); // push the remaining varargs
6543 if (ArgI->Attrs != ParamAttr::None)
6544 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
6546 } else if (I != E || ArgI != ArgE)
6547 GEN_ERROR("Invalid number of parameters detected");
6550 // Finish off the ParamAttrs and check them
6553 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
6555 // Create the call node
6556 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6557 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6558 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6559 CI->setParamAttrs(PAL);
6560 (yyval.InstVal) = CI;
6561 delete (yyvsp[(6) - (8)].ParamList);
6562 delete (yyvsp[(3) - (8)].TypeVal);
6568 #line 3196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6570 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6576 #line 3201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6578 (yyval.BoolVal) = true;
6584 #line 3205 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6586 (yyval.BoolVal) = false;
6592 #line 3212 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6594 if (!UpRefs.empty())
6595 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6596 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6597 delete (yyvsp[(2) - (3)].TypeVal);
6603 #line 3219 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6605 if (!UpRefs.empty())
6606 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6607 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6608 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6609 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6611 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6612 delete (yyvsp[(2) - (6)].TypeVal);
6617 #line 3229 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6619 if (!UpRefs.empty())
6620 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6621 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6622 delete (yyvsp[(2) - (3)].TypeVal);
6628 #line 3236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6630 if (!UpRefs.empty())
6631 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6632 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6633 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6634 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6636 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6637 delete (yyvsp[(2) - (6)].TypeVal);
6642 #line 3246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6644 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6645 GEN_ERROR("Trying to free nonpointer type " +
6646 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6647 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6653 #line 3254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6655 if (!UpRefs.empty())
6656 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6657 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6658 GEN_ERROR("Can't load from nonpointer type: " +
6659 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6660 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6661 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6662 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6663 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6665 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6666 delete (yyvsp[(3) - (5)].TypeVal);
6671 #line 3268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6673 if (!UpRefs.empty())
6674 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6675 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6677 GEN_ERROR("Can't store to a nonpointer type: " +
6678 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6679 const Type *ElTy = PT->getElementType();
6680 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6681 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6682 "' into space of type '" + ElTy->getDescription() + "'");
6684 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6686 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6687 delete (yyvsp[(5) - (7)].TypeVal);
6692 #line 3285 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6694 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
6695 if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
6696 GEN_ERROR("Invalid getresult operands");
6697 (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val));
6698 delete (yyvsp[(2) - (5)].TypeVal);
6704 #line 3293 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6706 if (!UpRefs.empty())
6707 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6708 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6709 GEN_ERROR("getelementptr insn requires pointer operand");
6711 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
6712 GEN_ERROR("Invalid getelementptr indices for type '" +
6713 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6714 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6716 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6717 delete (yyvsp[(2) - (4)].TypeVal);
6718 delete (yyvsp[(4) - (4)].ValueList);
6723 #line 3308 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6725 if (!UpRefs.empty())
6726 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6727 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
6728 GEN_ERROR("extractvalue insn requires an aggregate operand");
6730 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
6731 GEN_ERROR("Invalid extractvalue indices for type '" +
6732 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6733 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6735 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
6736 delete (yyvsp[(2) - (4)].TypeVal);
6737 delete (yyvsp[(4) - (4)].ConstantList);
6742 #line 3323 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6744 if (!UpRefs.empty())
6745 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
6746 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
6747 GEN_ERROR("extractvalue insn requires an aggregate operand");
6749 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
6750 GEN_ERROR("Invalid insertvalue indices for type '" +
6751 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
6752 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
6753 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6755 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
6756 delete (yyvsp[(2) - (7)].TypeVal);
6757 delete (yyvsp[(5) - (7)].TypeVal);
6758 delete (yyvsp[(7) - (7)].ConstantList);
6763 /* Line 1267 of yacc.c. */
6764 #line 6765 "llvmAsmParser.tab.c"
6767 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6771 YY_STACK_PRINT (yyss, yyssp);
6776 /* Now `shift' the result of the reduction. Determine what state
6777 that goes to, based on the state we popped back to and the rule
6778 number reduced by. */
6782 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6783 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6784 yystate = yytable[yystate];
6786 yystate = yydefgoto[yyn - YYNTOKENS];
6791 /*------------------------------------.
6792 | yyerrlab -- here on detecting error |
6793 `------------------------------------*/
6795 /* If not already recovering from an error, report this error. */
6799 #if ! YYERROR_VERBOSE
6800 yyerror (YY_("syntax error"));
6803 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6804 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6806 YYSIZE_T yyalloc = 2 * yysize;
6807 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6808 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6809 if (yymsg != yymsgbuf)
6810 YYSTACK_FREE (yymsg);
6811 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6813 yymsg_alloc = yyalloc;
6817 yymsg_alloc = sizeof yymsgbuf;
6821 if (0 < yysize && yysize <= yymsg_alloc)
6823 (void) yysyntax_error (yymsg, yystate, yychar);
6828 yyerror (YY_("syntax error"));
6830 goto yyexhaustedlab;
6838 if (yyerrstatus == 3)
6840 /* If just tried and failed to reuse look-ahead token after an
6841 error, discard it. */
6843 if (yychar <= YYEOF)
6845 /* Return failure if at end of input. */
6846 if (yychar == YYEOF)
6851 yydestruct ("Error: discarding",
6857 /* Else will try to reuse look-ahead token after shifting the error
6862 /*---------------------------------------------------.
6863 | yyerrorlab -- error raised explicitly by YYERROR. |
6864 `---------------------------------------------------*/
6867 /* Pacify compilers like GCC when the user code never invokes
6868 YYERROR and the label yyerrorlab therefore never appears in user
6870 if (/*CONSTCOND*/ 0)
6873 /* Do not reclaim the symbols of the rule which action triggered
6877 YY_STACK_PRINT (yyss, yyssp);
6882 /*-------------------------------------------------------------.
6883 | yyerrlab1 -- common code for both syntax error and YYERROR. |
6884 `-------------------------------------------------------------*/
6886 yyerrstatus = 3; /* Each real token shifted decrements this. */
6890 yyn = yypact[yystate];
6891 if (yyn != YYPACT_NINF)
6894 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6902 /* Pop the current state because it cannot handle the error token. */
6907 yydestruct ("Error: popping",
6908 yystos[yystate], yyvsp);
6911 YY_STACK_PRINT (yyss, yyssp);
6920 /* Shift the error token. */
6921 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6927 /*-------------------------------------.
6928 | yyacceptlab -- YYACCEPT comes here. |
6929 `-------------------------------------*/
6934 /*-----------------------------------.
6935 | yyabortlab -- YYABORT comes here. |
6936 `-----------------------------------*/
6942 /*-------------------------------------------------.
6943 | yyexhaustedlab -- memory exhaustion comes here. |
6944 `-------------------------------------------------*/
6946 yyerror (YY_("memory exhausted"));
6952 if (yychar != YYEOF && yychar != YYEMPTY)
6953 yydestruct ("Cleanup: discarding lookahead",
6955 /* Do not reclaim the symbols of the rule which action triggered
6956 this YYABORT or YYACCEPT. */
6958 YY_STACK_PRINT (yyss, yyssp);
6959 while (yyssp != yyss)
6961 yydestruct ("Cleanup: popping",
6962 yystos[*yyssp], yyvsp);
6967 YYSTACK_FREE (yyss);
6970 if (yymsg != yymsgbuf)
6971 YYSTACK_FREE (yymsg);
6973 /* Make sure YYID is used. */
6974 return YYID (yyresult);
6978 #line 3342 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y"
6981 // common code from the two 'RunVMAsmParser' functions
6982 static Module* RunParser(Module * M) {
6983 CurModule.CurrentModule = M;
6984 // Check to make sure the parser succeeded
6987 delete ParserResult;
6991 // Emit an error if there are any unresolved types left.
6992 if (!CurModule.LateResolveTypes.empty()) {
6993 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
6994 if (DID.Type == ValID::LocalName) {
6995 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
6997 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7000 delete ParserResult;
7004 // Emit an error if there are any unresolved values left.
7005 if (!CurModule.LateResolveValues.empty()) {
7006 Value *V = CurModule.LateResolveValues.back();
7007 std::map<Value*, std::pair<ValID, int> >::iterator I =
7008 CurModule.PlaceHolderInfo.find(V);
7010 if (I != CurModule.PlaceHolderInfo.end()) {
7011 ValID &DID = I->second.first;
7012 if (DID.Type == ValID::LocalName) {
7013 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7015 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7018 delete ParserResult;
7023 // Check to make sure that parsing produced a result
7027 // Reset ParserResult variable while saving its value for the result.
7028 Module *Result = ParserResult;
7034 void llvm::GenerateError(const std::string &message, int LineNo) {
7035 if (LineNo == -1) LineNo = LLLgetLineNo();
7036 // TODO: column number in exception
7038 TheParseError->setError(LLLgetFilename(), message, LineNo);
7042 int yyerror(const char *ErrorMsg) {
7043 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7044 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7045 if (yychar != YYEMPTY && yychar != 0) {
7046 errMsg += " while reading token: '";
7047 errMsg += std::string(LLLgetTokenStart(),
7048 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7050 GenerateError(errMsg);