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,
238 #define ESINT64VAL 258
239 #define EUINT64VAL 259
240 #define ESAPINTVAL 260
241 #define EUAPINTVAL 261
242 #define LOCALVAL_ID 262
243 #define GLOBALVAL_ID 263
251 #define PPC_FP128 271
255 #define GLOBALVAR 275
257 #define STRINGCONSTANT 277
258 #define ATSTRINGCONSTANT 278
259 #define PCTSTRINGCONSTANT 279
260 #define ZEROINITIALIZER 280
272 #define THREAD_LOCAL 292
274 #define DOTDOTDOT 294
280 #define APPENDING 300
281 #define DLLIMPORT 301
282 #define DLLEXPORT 302
283 #define EXTERN_WEAK 303
290 #define ADDRSPACE 310
296 #define SIDEEFFECT 316
299 #define FASTCC_TOK 319
300 #define COLDCC_TOK 320
301 #define X86_STDCALLCC_TOK 321
302 #define X86_FASTCALLCC_TOK 322
303 #define DATALAYOUT 323
309 #define UNREACHABLE 329
354 #define GETELEMENTPTR 374
370 #define EXTRACTELEMENT 390
371 #define INSERTELEMENT 391
372 #define SHUFFLEVECTOR 392
373 #define GETRESULT 393
374 #define EXTRACTVALUE 394
375 #define INSERTVALUE 395
390 #define ALWAYSINLINE 410
395 #define PROTECTED 415
400 /* Copy the first part of user declarations. */
401 #line 14 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
403 #include "ParserInternals.h"
404 #include "llvm/CallingConv.h"
405 #include "llvm/InlineAsm.h"
406 #include "llvm/Instructions.h"
407 #include "llvm/Module.h"
408 #include "llvm/ValueSymbolTable.h"
409 #include "llvm/AutoUpgrade.h"
410 #include "llvm/Support/GetElementPtrTypeIterator.h"
411 #include "llvm/Support/CommandLine.h"
412 #include "llvm/ADT/SmallVector.h"
413 #include "llvm/ADT/STLExtras.h"
414 #include "llvm/Support/MathExtras.h"
415 #include "llvm/Support/Streams.h"
421 // The following is a gross hack. In order to rid the libAsmParser library of
422 // exceptions, we have to have a way of getting the yyparse function to go into
423 // an error situation. So, whenever we want an error to occur, the GenerateError
424 // function (see bottom of file) sets TriggerError. Then, at the end of each
425 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
426 // (a goto) to put YACC in error state. Furthermore, several calls to
427 // GenerateError are made from inside productions and they must simulate the
428 // previous exception behavior by exiting the production immediately. We have
429 // replaced these with the GEN_ERROR macro which calls GeneratError and then
430 // immediately invokes YYERROR. This would be so much cleaner if it was a
431 // recursive descent parser.
432 static bool TriggerError = false;
433 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
434 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
436 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
437 int yylex(); // declaration" of xxx warnings.
439 using namespace llvm;
441 static Module *ParserResult;
443 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
444 // relating to upreferences in the input stream.
446 //#define DEBUG_UPREFS 1
448 #define UR_OUT(X) cerr << X
453 #define YYERROR_VERBOSE 1
455 static GlobalVariable *CurGV;
458 // This contains info used when building the body of a function. It is
459 // destroyed when the function is completed.
461 typedef std::vector<Value *> ValueList; // Numbered defs
464 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
466 static struct PerModuleInfo {
467 Module *CurrentModule;
468 ValueList Values; // Module level numbered definitions
469 ValueList LateResolveValues;
470 std::vector<PATypeHolder> Types;
471 std::map<ValID, PATypeHolder> LateResolveTypes;
473 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
474 /// how they were referenced and on which line of the input they came from so
475 /// that we can resolve them later and print error messages as appropriate.
476 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
478 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
479 // references to global values. Global values may be referenced before they
480 // are defined, and if so, the temporary object that they represent is held
481 // here. This is used for forward references of GlobalValues.
483 typedef std::map<std::pair<const PointerType *,
484 ValID>, GlobalValue*> GlobalRefsType;
485 GlobalRefsType GlobalRefs;
488 // If we could not resolve some functions at function compilation time
489 // (calls to functions before they are defined), resolve them now... Types
490 // are resolved when the constant pool has been completely parsed.
492 ResolveDefinitions(LateResolveValues);
496 // Check to make sure that all global value forward references have been
499 if (!GlobalRefs.empty()) {
500 std::string UndefinedReferences = "Unresolved global references exist:\n";
502 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
504 UndefinedReferences += " " + I->first.first->getDescription() + " " +
505 I->first.second.getName() + "\n";
507 GenerateError(UndefinedReferences);
511 // Look for intrinsic functions and CallInst that need to be upgraded
512 for (Module::iterator FI = CurrentModule->begin(),
513 FE = CurrentModule->end(); FI != FE; )
514 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
516 Values.clear(); // Clear out function local definitions
521 // GetForwardRefForGlobal - Check to see if there is a forward reference
522 // for this global. If so, remove it from the GlobalRefs map and return it.
523 // If not, just return null.
524 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
525 // Check to see if there is a forward reference to this global variable...
526 // if there is, eliminate it and patch the reference to use the new def'n.
527 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
528 GlobalValue *Ret = 0;
529 if (I != GlobalRefs.end()) {
531 I->first.second.destroy();
537 bool TypeIsUnresolved(PATypeHolder* PATy) {
538 // If it isn't abstract, its resolved
539 const Type* Ty = PATy->get();
540 if (!Ty->isAbstract())
542 // Traverse the type looking for abstract types. If it isn't abstract then
543 // we don't need to traverse that leg of the type.
544 std::vector<const Type*> WorkList, SeenList;
545 WorkList.push_back(Ty);
546 while (!WorkList.empty()) {
547 const Type* Ty = WorkList.back();
548 SeenList.push_back(Ty);
550 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
551 // Check to see if this is an unresolved type
552 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
553 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
554 for ( ; I != E; ++I) {
555 if (I->second.get() == OpTy)
558 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
559 const Type* TheTy = SeqTy->getElementType();
560 if (TheTy->isAbstract() && TheTy != Ty) {
561 std::vector<const Type*>::iterator I = SeenList.begin(),
567 WorkList.push_back(TheTy);
569 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
570 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
571 const Type* TheTy = StrTy->getElementType(i);
572 if (TheTy->isAbstract() && TheTy != Ty) {
573 std::vector<const Type*>::iterator I = SeenList.begin(),
579 WorkList.push_back(TheTy);
588 static struct PerFunctionInfo {
589 Function *CurrentFunction; // Pointer to current function being created
591 ValueList Values; // Keep track of #'d definitions
593 ValueList LateResolveValues;
594 bool isDeclare; // Is this function a forward declararation?
595 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
596 GlobalValue::VisibilityTypes Visibility;
598 /// BBForwardRefs - When we see forward references to basic blocks, keep
599 /// track of them here.
600 std::map<ValID, BasicBlock*> BBForwardRefs;
602 inline PerFunctionInfo() {
605 Linkage = GlobalValue::ExternalLinkage;
606 Visibility = GlobalValue::DefaultVisibility;
609 inline void FunctionStart(Function *M) {
614 void FunctionDone() {
615 // Any forward referenced blocks left?
616 if (!BBForwardRefs.empty()) {
617 GenerateError("Undefined reference to label " +
618 BBForwardRefs.begin()->second->getName());
622 // Resolve all forward references now.
623 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
625 Values.clear(); // Clear out function local definitions
626 BBForwardRefs.clear();
629 Linkage = GlobalValue::ExternalLinkage;
630 Visibility = GlobalValue::DefaultVisibility;
632 } CurFun; // Info for the current function...
634 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
637 //===----------------------------------------------------------------------===//
638 // Code to handle definitions of all the types
639 //===----------------------------------------------------------------------===//
641 /// InsertValue - Insert a value into the value table. If it is named, this
642 /// returns -1, otherwise it returns the slot number for the value.
643 static int InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
644 // Things that have names or are void typed don't get slot numbers
645 if (V->hasName() || (V->getType() == Type::VoidTy))
648 // In the case of function values, we have to allow for the forward reference
649 // of basic blocks, which are included in the numbering. Consequently, we keep
650 // track of the next insertion location with NextValNum. When a BB gets
651 // inserted, it could change the size of the CurFun.Values vector.
652 if (&ValueTab == &CurFun.Values) {
653 if (ValueTab.size() <= CurFun.NextValNum)
654 ValueTab.resize(CurFun.NextValNum+1);
655 ValueTab[CurFun.NextValNum++] = V;
656 return CurFun.NextValNum-1;
658 // For all other lists, its okay to just tack it on the back of the vector.
659 ValueTab.push_back(V);
660 return ValueTab.size()-1;
663 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
665 case ValID::LocalID: // Is it a numbered definition?
666 // Module constants occupy the lowest numbered slots...
667 if (D.Num < CurModule.Types.size())
668 return CurModule.Types[D.Num];
670 case ValID::LocalName: // Is it a named definition?
671 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
672 D.destroy(); // Free old strdup'd memory...
677 GenerateError("Internal parser error: Invalid symbol type reference");
681 // If we reached here, we referenced either a symbol that we don't know about
682 // or an id number that hasn't been read yet. We may be referencing something
683 // forward, so just create an entry to be resolved later and get to it...
685 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
688 if (inFunctionScope()) {
689 if (D.Type == ValID::LocalName) {
690 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
693 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
698 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
699 if (I != CurModule.LateResolveTypes.end()) {
704 Type *Typ = OpaqueType::get();
705 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
709 // getExistingVal - Look up the value specified by the provided type and
710 // the provided ValID. If the value exists and has already been defined, return
711 // it. Otherwise return null.
713 static Value *getExistingVal(const Type *Ty, const ValID &D) {
714 if (isa<FunctionType>(Ty)) {
715 GenerateError("Functions are not values and "
716 "must be referenced as pointers");
721 case ValID::LocalID: { // Is it a numbered definition?
722 // Check that the number is within bounds.
723 if (D.Num >= CurFun.Values.size())
725 Value *Result = CurFun.Values[D.Num];
726 if (Ty != Result->getType()) {
727 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
728 Result->getType()->getDescription() + "' does not match "
729 "expected type, '" + Ty->getDescription() + "'");
734 case ValID::GlobalID: { // Is it a numbered definition?
735 if (D.Num >= CurModule.Values.size())
737 Value *Result = CurModule.Values[D.Num];
738 if (Ty != Result->getType()) {
739 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
740 Result->getType()->getDescription() + "' does not match "
741 "expected type, '" + Ty->getDescription() + "'");
747 case ValID::LocalName: { // Is it a named definition?
748 if (!inFunctionScope())
750 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
751 Value *N = SymTab.lookup(D.getName());
754 if (N->getType() != Ty)
757 D.destroy(); // Free old strdup'd memory...
760 case ValID::GlobalName: { // Is it a named definition?
761 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
762 Value *N = SymTab.lookup(D.getName());
765 if (N->getType() != Ty)
768 D.destroy(); // Free old strdup'd memory...
772 // Check to make sure that "Ty" is an integral type, and that our
773 // value will fit into the specified type...
774 case ValID::ConstSIntVal: // Is it a constant pool reference??
775 if (!isa<IntegerType>(Ty) ||
776 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
777 GenerateError("Signed integral constant '" +
778 itostr(D.ConstPool64) + "' is invalid for type '" +
779 Ty->getDescription() + "'");
782 return ConstantInt::get(Ty, D.ConstPool64, true);
784 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
785 if (isa<IntegerType>(Ty) &&
786 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
787 return ConstantInt::get(Ty, D.UConstPool64);
789 if (!isa<IntegerType>(Ty) ||
790 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
791 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
792 "' is invalid or out of range for type '" +
793 Ty->getDescription() + "'");
796 // This is really a signed reference. Transmogrify.
797 return ConstantInt::get(Ty, D.ConstPool64, true);
799 case ValID::ConstAPInt: // Is it an unsigned const pool reference?
800 if (!isa<IntegerType>(Ty)) {
801 GenerateError("Integral constant '" + D.getName() +
802 "' is invalid or out of range for type '" +
803 Ty->getDescription() + "'");
808 APSInt Tmp = *D.ConstPoolInt;
810 Tmp.extOrTrunc(Ty->getPrimitiveSizeInBits());
811 return ConstantInt::get(Tmp);
814 case ValID::ConstFPVal: // Is it a floating point const pool reference?
815 if (!Ty->isFloatingPoint() ||
816 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
817 GenerateError("FP constant invalid for type");
820 // Lexer has no type info, so builds all float and double FP constants
821 // as double. Fix this here. Long double does not need this.
822 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
825 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
829 ConstantFP *tmp = ConstantFP::get(*D.ConstPoolFP);
834 case ValID::ConstNullVal: // Is it a null value?
835 if (!isa<PointerType>(Ty)) {
836 GenerateError("Cannot create a a non pointer null");
839 return ConstantPointerNull::get(cast<PointerType>(Ty));
841 case ValID::ConstUndefVal: // Is it an undef value?
842 return UndefValue::get(Ty);
844 case ValID::ConstZeroVal: // Is it a zero value?
845 return Constant::getNullValue(Ty);
847 case ValID::ConstantVal: // Fully resolved constant?
848 if (D.ConstantValue->getType() != Ty) {
849 GenerateError("Constant expression type different from required type");
852 return D.ConstantValue;
854 case ValID::InlineAsmVal: { // Inline asm expression
855 const PointerType *PTy = dyn_cast<PointerType>(Ty);
856 const FunctionType *FTy =
857 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
858 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
859 GenerateError("Invalid type for asm constraint string");
862 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
863 D.IAD->HasSideEffects);
864 D.destroy(); // Free InlineAsmDescriptor.
868 assert(0 && "Unhandled case!");
872 assert(0 && "Unhandled case!");
876 // getVal - This function is identical to getExistingVal, except that if a
877 // value is not already defined, it "improvises" by creating a placeholder var
878 // that looks and acts just like the requested variable. When the value is
879 // defined later, all uses of the placeholder variable are replaced with the
882 static Value *getVal(const Type *Ty, const ValID &ID) {
883 if (Ty == Type::LabelTy) {
884 GenerateError("Cannot use a basic block here");
888 // See if the value has already been defined.
889 Value *V = getExistingVal(Ty, ID);
891 if (TriggerError) return 0;
893 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
894 GenerateError("Invalid use of a non-first-class type");
898 // If we reached here, we referenced either a symbol that we don't know about
899 // or an id number that hasn't been read yet. We may be referencing something
900 // forward, so just create an entry to be resolved later and get to it...
903 case ValID::GlobalName:
904 case ValID::GlobalID: {
905 const PointerType *PTy = dyn_cast<PointerType>(Ty);
907 GenerateError("Invalid type for reference to global" );
910 const Type* ElTy = PTy->getElementType();
911 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
912 V = Function::Create(FTy, GlobalValue::ExternalLinkage);
914 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
915 (Module*)0, false, PTy->getAddressSpace());
919 V = new Argument(Ty);
922 // Remember where this forward reference came from. FIXME, shouldn't we try
923 // to recycle these things??
924 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
927 if (inFunctionScope())
928 InsertValue(V, CurFun.LateResolveValues);
930 InsertValue(V, CurModule.LateResolveValues);
934 /// defineBBVal - This is a definition of a new basic block with the specified
935 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
936 static BasicBlock *defineBBVal(const ValID &ID) {
937 assert(inFunctionScope() && "Can't get basic block at global scope!");
941 // First, see if this was forward referenced
943 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
944 if (BBI != CurFun.BBForwardRefs.end()) {
946 // The forward declaration could have been inserted anywhere in the
947 // function: insert it into the correct place now.
948 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
949 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
951 // We're about to erase the entry, save the key so we can clean it up.
952 ValID Tmp = BBI->first;
954 // Erase the forward ref from the map as its no longer "forward"
955 CurFun.BBForwardRefs.erase(ID);
957 // The key has been removed from the map but so we don't want to leave
958 // strdup'd memory around so destroy it too.
961 // If its a numbered definition, bump the number and set the BB value.
962 if (ID.Type == ValID::LocalID) {
963 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
967 // We haven't seen this BB before and its first mention is a definition.
968 // Just create it and return it.
969 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
970 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
971 if (ID.Type == ValID::LocalID) {
972 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
981 /// getBBVal - get an existing BB value or create a forward reference for it.
983 static BasicBlock *getBBVal(const ValID &ID) {
984 assert(inFunctionScope() && "Can't get basic block at global scope!");
988 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
989 if (BBI != CurFun.BBForwardRefs.end()) {
991 } if (ID.Type == ValID::LocalName) {
992 std::string Name = ID.getName();
993 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
995 if (N->getType()->getTypeID() == Type::LabelTyID)
996 BB = cast<BasicBlock>(N);
998 GenerateError("Reference to label '" + Name + "' is actually of type '"+
999 N->getType()->getDescription() + "'");
1001 } else if (ID.Type == ValID::LocalID) {
1002 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
1003 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
1004 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
1006 GenerateError("Reference to label '%" + utostr(ID.Num) +
1007 "' is actually of type '"+
1008 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
1011 GenerateError("Illegal label reference " + ID.getName());
1015 // If its already been defined, return it now.
1017 ID.destroy(); // Free strdup'd memory.
1021 // Otherwise, this block has not been seen before, create it.
1023 if (ID.Type == ValID::LocalName)
1024 Name = ID.getName();
1025 BB = BasicBlock::Create(Name, CurFun.CurrentFunction);
1027 // Insert it in the forward refs map.
1028 CurFun.BBForwardRefs[ID] = BB;
1034 //===----------------------------------------------------------------------===//
1035 // Code to handle forward references in instructions
1036 //===----------------------------------------------------------------------===//
1038 // This code handles the late binding needed with statements that reference
1039 // values not defined yet... for example, a forward branch, or the PHI node for
1042 // This keeps a table (CurFun.LateResolveValues) of all such forward references
1043 // and back patchs after we are done.
1046 // ResolveDefinitions - If we could not resolve some defs at parsing
1047 // time (forward branches, phi functions for loops, etc...) resolve the
1051 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1052 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1053 while (!LateResolvers.empty()) {
1054 Value *V = LateResolvers.back();
1055 LateResolvers.pop_back();
1057 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1058 CurModule.PlaceHolderInfo.find(V);
1059 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1061 ValID &DID = PHI->second.first;
1063 Value *TheRealValue = getExistingVal(V->getType(), DID);
1067 V->replaceAllUsesWith(TheRealValue);
1069 CurModule.PlaceHolderInfo.erase(PHI);
1070 } else if (FutureLateResolvers) {
1071 // Functions have their unresolved items forwarded to the module late
1073 InsertValue(V, *FutureLateResolvers);
1075 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1076 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1077 "' of type '" + V->getType()->getDescription() + "'",
1078 PHI->second.second);
1081 GenerateError("Reference to an invalid definition: #" +
1082 itostr(DID.Num) + " of type '" +
1083 V->getType()->getDescription() + "'",
1084 PHI->second.second);
1089 LateResolvers.clear();
1092 // ResolveTypeTo - A brand new type was just declared. This means that (if
1093 // name is not null) things referencing Name can be resolved. Otherwise, things
1094 // refering to the number can be resolved. Do this now.
1096 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1099 D = ValID::createLocalName(*Name);
1101 D = ValID::createLocalID(CurModule.Types.size());
1103 std::map<ValID, PATypeHolder>::iterator I =
1104 CurModule.LateResolveTypes.find(D);
1105 if (I != CurModule.LateResolveTypes.end()) {
1106 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1108 CurModule.LateResolveTypes.erase(I);
1113 // setValueName - Set the specified value to the name given. The name may be
1114 // null potentially, in which case this is a noop. The string passed in is
1115 // assumed to be a malloc'd string buffer, and is free'd by this function.
1117 static void setValueName(Value *V, std::string *NameStr) {
1118 if (!NameStr) return;
1119 std::string Name(*NameStr); // Copy string
1120 delete NameStr; // Free old string
1122 if (V->getType() == Type::VoidTy) {
1123 GenerateError("Can't assign name '" + Name+"' to value with void type");
1127 assert(inFunctionScope() && "Must be in function scope!");
1128 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1129 if (ST.lookup(Name)) {
1130 GenerateError("Redefinition of value '" + Name + "' of type '" +
1131 V->getType()->getDescription() + "'");
1139 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1140 /// this is a declaration, otherwise it is a definition.
1141 static GlobalVariable *
1142 ParseGlobalVariable(std::string *NameStr,
1143 GlobalValue::LinkageTypes Linkage,
1144 GlobalValue::VisibilityTypes Visibility,
1145 bool isConstantGlobal, const Type *Ty,
1146 Constant *Initializer, bool IsThreadLocal,
1147 unsigned AddressSpace = 0) {
1148 if (isa<FunctionType>(Ty)) {
1149 GenerateError("Cannot declare global vars of function type");
1152 if (Ty == Type::LabelTy) {
1153 GenerateError("Cannot declare global vars of label type");
1157 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1161 Name = *NameStr; // Copy string
1162 delete NameStr; // Free old string
1165 // See if this global value was forward referenced. If so, recycle the
1168 if (!Name.empty()) {
1169 ID = ValID::createGlobalName(Name);
1171 ID = ValID::createGlobalID(CurModule.Values.size());
1174 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1175 // Move the global to the end of the list, from whereever it was
1176 // previously inserted.
1177 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1178 CurModule.CurrentModule->getGlobalList().remove(GV);
1179 CurModule.CurrentModule->getGlobalList().push_back(GV);
1180 GV->setInitializer(Initializer);
1181 GV->setLinkage(Linkage);
1182 GV->setVisibility(Visibility);
1183 GV->setConstant(isConstantGlobal);
1184 GV->setThreadLocal(IsThreadLocal);
1185 InsertValue(GV, CurModule.Values);
1192 // If this global has a name
1193 if (!Name.empty()) {
1194 // if the global we're parsing has an initializer (is a definition) and
1195 // has external linkage.
1196 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1197 // If there is already a global with external linkage with this name
1198 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1199 // If we allow this GVar to get created, it will be renamed in the
1200 // symbol table because it conflicts with an existing GVar. We can't
1201 // allow redefinition of GVars whose linking indicates that their name
1202 // must stay the same. Issue the error.
1203 GenerateError("Redefinition of global variable named '" + Name +
1204 "' of type '" + Ty->getDescription() + "'");
1209 // Otherwise there is no existing GV to use, create one now.
1210 GlobalVariable *GV =
1211 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1212 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1213 GV->setVisibility(Visibility);
1214 InsertValue(GV, CurModule.Values);
1218 // setTypeName - Set the specified type to the name given. The name may be
1219 // null potentially, in which case this is a noop. The string passed in is
1220 // assumed to be a malloc'd string buffer, and is freed by this function.
1222 // This function returns true if the type has already been defined, but is
1223 // allowed to be redefined in the specified context. If the name is a new name
1224 // for the type plane, it is inserted and false is returned.
1225 static bool setTypeName(const Type *T, std::string *NameStr) {
1226 assert(!inFunctionScope() && "Can't give types function-local names!");
1227 if (NameStr == 0) return false;
1229 std::string Name(*NameStr); // Copy string
1230 delete NameStr; // Free old string
1232 // We don't allow assigning names to void type
1233 if (T == Type::VoidTy) {
1234 GenerateError("Can't assign name '" + Name + "' to the void type");
1238 // Set the type name, checking for conflicts as we do so.
1239 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1241 if (AlreadyExists) { // Inserting a name that is already defined???
1242 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1243 assert(Existing && "Conflict but no matching type?!");
1245 // There is only one case where this is allowed: when we are refining an
1246 // opaque type. In this case, Existing will be an opaque type.
1247 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1248 // We ARE replacing an opaque type!
1249 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1253 // Otherwise, this is an attempt to redefine a type. That's okay if
1254 // the redefinition is identical to the original. This will be so if
1255 // Existing and T point to the same Type object. In this one case we
1256 // allow the equivalent redefinition.
1257 if (Existing == T) return true; // Yes, it's equal.
1259 // Any other kind of (non-equivalent) redefinition is an error.
1260 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1261 T->getDescription() + "'");
1267 //===----------------------------------------------------------------------===//
1268 // Code for handling upreferences in type names...
1271 // TypeContains - Returns true if Ty directly contains E in it.
1273 static bool TypeContains(const Type *Ty, const Type *E) {
1274 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1275 E) != Ty->subtype_end();
1279 struct UpRefRecord {
1280 // NestingLevel - The number of nesting levels that need to be popped before
1281 // this type is resolved.
1282 unsigned NestingLevel;
1284 // LastContainedTy - This is the type at the current binding level for the
1285 // type. Every time we reduce the nesting level, this gets updated.
1286 const Type *LastContainedTy;
1288 // UpRefTy - This is the actual opaque type that the upreference is
1289 // represented with.
1290 OpaqueType *UpRefTy;
1292 UpRefRecord(unsigned NL, OpaqueType *URTy)
1293 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1297 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1298 static std::vector<UpRefRecord> UpRefs;
1300 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1301 /// called. It loops through the UpRefs vector, which is a list of the
1302 /// currently active types. For each type, if the up reference is contained in
1303 /// the newly completed type, we decrement the level count. When the level
1304 /// count reaches zero, the upreferenced type is the type that is passed in:
1305 /// thus we can complete the cycle.
1307 static PATypeHolder HandleUpRefs(const Type *ty) {
1308 // If Ty isn't abstract, or if there are no up-references in it, then there is
1309 // nothing to resolve here.
1310 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1312 PATypeHolder Ty(ty);
1313 UR_OUT("Type '" << Ty->getDescription() <<
1314 "' newly formed. Resolving upreferences.\n" <<
1315 UpRefs.size() << " upreferences active!\n");
1317 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1318 // to zero), we resolve them all together before we resolve them to Ty. At
1319 // the end of the loop, if there is anything to resolve to Ty, it will be in
1321 OpaqueType *TypeToResolve = 0;
1323 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1324 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1325 << UpRefs[i].second->getDescription() << ") = "
1326 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1327 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1328 // Decrement level of upreference
1329 unsigned Level = --UpRefs[i].NestingLevel;
1330 UpRefs[i].LastContainedTy = Ty;
1331 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1332 if (Level == 0) { // Upreference should be resolved!
1333 if (!TypeToResolve) {
1334 TypeToResolve = UpRefs[i].UpRefTy;
1336 UR_OUT(" * Resolving upreference for "
1337 << UpRefs[i].second->getDescription() << "\n";
1338 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1339 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1340 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1341 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1343 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1344 --i; // Do not skip the next element...
1349 if (TypeToResolve) {
1350 UR_OUT(" * Resolving upreference for "
1351 << UpRefs[i].second->getDescription() << "\n";
1352 std::string OldName = TypeToResolve->getDescription());
1353 TypeToResolve->refineAbstractTypeTo(Ty);
1359 //===----------------------------------------------------------------------===//
1360 // RunVMAsmParser - Define an interface to this parser
1361 //===----------------------------------------------------------------------===//
1363 static Module* RunParser(Module * M);
1365 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1367 Module *M = RunParser(new Module(LLLgetFilename()));
1374 /* Enabling traces. */
1379 /* Enabling verbose error messages. */
1380 #ifdef YYERROR_VERBOSE
1381 # undef YYERROR_VERBOSE
1382 # define YYERROR_VERBOSE 1
1384 # define YYERROR_VERBOSE 0
1387 /* Enabling the token table. */
1388 #ifndef YYTOKEN_TABLE
1389 # define YYTOKEN_TABLE 0
1392 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1393 typedef union YYSTYPE
1394 #line 986 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
1396 llvm::Module *ModuleVal;
1397 llvm::Function *FunctionVal;
1398 llvm::BasicBlock *BasicBlockVal;
1399 llvm::TerminatorInst *TermInstVal;
1400 llvm::Instruction *InstVal;
1401 llvm::Constant *ConstVal;
1403 const llvm::Type *PrimType;
1404 std::list<llvm::PATypeHolder> *TypeList;
1405 llvm::PATypeHolder *TypeVal;
1406 llvm::Value *ValueVal;
1407 std::vector<llvm::Value*> *ValueList;
1408 std::vector<unsigned> *ConstantList;
1409 llvm::ArgListType *ArgList;
1410 llvm::TypeWithAttrs TypeWithAttrs;
1411 llvm::TypeWithAttrsList *TypeWithAttrsList;
1412 llvm::ParamList *ParamList;
1414 // Represent the RHS of PHI node
1415 std::list<std::pair<llvm::Value*,
1416 llvm::BasicBlock*> > *PHIList;
1417 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1418 std::vector<llvm::Constant*> *ConstVector;
1420 llvm::GlobalValue::LinkageTypes Linkage;
1421 llvm::GlobalValue::VisibilityTypes Visibility;
1422 llvm::Attributes Attributes;
1423 llvm::APInt *APIntVal;
1428 llvm::APFloat *FPVal;
1431 std::string *StrVal; // This memory must be deleted
1432 llvm::ValID ValIDVal;
1434 llvm::Instruction::BinaryOps BinaryOpVal;
1435 llvm::Instruction::TermOps TermOpVal;
1436 llvm::Instruction::MemoryOps MemOpVal;
1437 llvm::Instruction::CastOps CastOpVal;
1438 llvm::Instruction::OtherOps OtherOpVal;
1439 llvm::ICmpInst::Predicate IPredicate;
1440 llvm::FCmpInst::Predicate FPredicate;
1442 /* Line 193 of yacc.c. */
1443 #line 1444 "llvmAsmParser.tab.c"
1445 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1446 # define YYSTYPE_IS_DECLARED 1
1447 # define YYSTYPE_IS_TRIVIAL 1
1452 /* Copy the second part of user declarations. */
1455 /* Line 216 of yacc.c. */
1456 #line 1457 "llvmAsmParser.tab.c"
1463 typedef YYTYPE_UINT8 yytype_uint8;
1465 typedef unsigned char yytype_uint8;
1469 typedef YYTYPE_INT8 yytype_int8;
1470 #elif (defined __STDC__ || defined __C99__FUNC__ \
1471 || defined __cplusplus || defined _MSC_VER)
1472 typedef signed char yytype_int8;
1474 typedef short int yytype_int8;
1477 #ifdef YYTYPE_UINT16
1478 typedef YYTYPE_UINT16 yytype_uint16;
1480 typedef unsigned short int yytype_uint16;
1484 typedef YYTYPE_INT16 yytype_int16;
1486 typedef short int yytype_int16;
1490 # ifdef __SIZE_TYPE__
1491 # define YYSIZE_T __SIZE_TYPE__
1492 # elif defined size_t
1493 # define YYSIZE_T size_t
1494 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1495 || defined __cplusplus || defined _MSC_VER)
1496 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1497 # define YYSIZE_T size_t
1499 # define YYSIZE_T unsigned int
1503 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1506 # if defined YYENABLE_NLS && YYENABLE_NLS
1508 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1509 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1513 # define YY_(msgid) msgid
1517 /* Suppress unused-variable warnings by "using" E. */
1518 #if ! defined lint || defined __GNUC__
1519 # define YYUSE(e) ((void) (e))
1521 # define YYUSE(e) /* empty */
1524 /* Identity function, used to suppress warnings about constant conditions. */
1526 # define YYID(n) (n)
1528 #if (defined __STDC__ || defined __C99__FUNC__ \
1529 || defined __cplusplus || defined _MSC_VER)
1542 #if ! defined yyoverflow || YYERROR_VERBOSE
1544 /* The parser invokes alloca or malloc; define the necessary symbols. */
1546 # ifdef YYSTACK_USE_ALLOCA
1547 # if YYSTACK_USE_ALLOCA
1549 # define YYSTACK_ALLOC __builtin_alloca
1550 # elif defined __BUILTIN_VA_ARG_INCR
1551 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1553 # define YYSTACK_ALLOC __alloca
1554 # elif defined _MSC_VER
1555 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1556 # define alloca _alloca
1558 # define YYSTACK_ALLOC alloca
1559 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1560 || defined __cplusplus || defined _MSC_VER)
1561 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1563 # define _STDLIB_H 1
1570 # ifdef YYSTACK_ALLOC
1571 /* Pacify GCC's `empty if-body' warning. */
1572 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1573 # ifndef YYSTACK_ALLOC_MAXIMUM
1574 /* The OS might guarantee only one guard page at the bottom of the stack,
1575 and a page size can be as small as 4096 bytes. So we cannot safely
1576 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1577 to allow for a few compiler-allocated temporary stack slots. */
1578 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1581 # define YYSTACK_ALLOC YYMALLOC
1582 # define YYSTACK_FREE YYFREE
1583 # ifndef YYSTACK_ALLOC_MAXIMUM
1584 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1586 # if (defined __cplusplus && ! defined _STDLIB_H \
1587 && ! ((defined YYMALLOC || defined malloc) \
1588 && (defined YYFREE || defined free)))
1589 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1591 # define _STDLIB_H 1
1595 # define YYMALLOC malloc
1596 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1597 || defined __cplusplus || defined _MSC_VER)
1598 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1602 # define YYFREE free
1603 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1604 || defined __cplusplus || defined _MSC_VER)
1605 void free (void *); /* INFRINGES ON USER NAME SPACE */
1609 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1612 #if (! defined yyoverflow \
1613 && (! defined __cplusplus \
1614 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1616 /* A type that is properly aligned for any stack member. */
1623 /* The size of the maximum gap between one aligned stack and the next. */
1624 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1626 /* The size of an array large to enough to hold all stacks, each with
1628 # define YYSTACK_BYTES(N) \
1629 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1630 + YYSTACK_GAP_MAXIMUM)
1632 /* Copy COUNT objects from FROM to TO. The source and destination do
1635 # if defined __GNUC__ && 1 < __GNUC__
1636 # define YYCOPY(To, From, Count) \
1637 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1639 # define YYCOPY(To, From, Count) \
1643 for (yyi = 0; yyi < (Count); yyi++) \
1644 (To)[yyi] = (From)[yyi]; \
1650 /* Relocate STACK from its old location to the new one. The
1651 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1652 elements in the stack, and YYPTR gives the new location of the
1653 stack. Advance YYPTR to a properly aligned location for the next
1655 # define YYSTACK_RELOCATE(Stack) \
1658 YYSIZE_T yynewbytes; \
1659 YYCOPY (&yyptr->Stack, Stack, yysize); \
1660 Stack = &yyptr->Stack; \
1661 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1662 yyptr += yynewbytes / sizeof (*yyptr); \
1668 /* YYFINAL -- State number of the termination state. */
1670 /* YYLAST -- Last index in YYTABLE. */
1673 /* YYNTOKENS -- Number of terminals. */
1674 #define YYNTOKENS 175
1675 /* YYNNTS -- Number of nonterminals. */
1677 /* YYNRULES -- Number of rules. */
1678 #define YYNRULES 350
1679 /* YYNRULES -- Number of states. */
1680 #define YYNSTATES 710
1682 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1683 #define YYUNDEFTOK 2
1684 #define YYMAXUTOK 415
1686 #define YYTRANSLATE(YYX) \
1687 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1689 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1690 static const yytype_uint8 yytranslate[] =
1692 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1696 161, 162, 165, 2, 164, 2, 2, 2, 2, 2,
1697 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1698 170, 163, 171, 2, 2, 2, 2, 2, 2, 2,
1699 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1700 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1701 2, 167, 166, 169, 2, 2, 2, 2, 2, 174,
1702 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1703 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1704 168, 2, 2, 172, 2, 173, 2, 2, 2, 2,
1705 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1706 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1707 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1708 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1709 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1710 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1711 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1712 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1713 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1714 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1715 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1716 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1717 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1718 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1719 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1720 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1721 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1722 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1723 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1724 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1725 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1726 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1727 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1728 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1729 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1730 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1731 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1732 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
1733 155, 156, 157, 158, 159, 160
1737 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1739 static const yytype_uint16 yyprhs[] =
1741 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1742 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1743 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1744 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1745 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1746 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1747 118, 123, 124, 127, 128, 131, 133, 135, 137, 138,
1748 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
1749 160, 162, 164, 166, 167, 169, 171, 172, 174, 176,
1750 178, 180, 181, 183, 185, 186, 188, 190, 192, 194,
1751 196, 199, 201, 203, 205, 207, 209, 211, 213, 215,
1752 217, 220, 221, 224, 226, 228, 230, 231, 234, 236,
1753 238, 240, 242, 244, 246, 248, 250, 252, 254, 256,
1754 258, 259, 262, 263, 266, 267, 270, 271, 275, 278,
1755 279, 281, 282, 286, 288, 291, 293, 295, 297, 299,
1756 301, 303, 305, 307, 309, 313, 315, 318, 324, 330,
1757 336, 342, 346, 349, 355, 360, 363, 365, 367, 369,
1758 373, 375, 379, 381, 382, 384, 388, 393, 397, 401,
1759 406, 411, 415, 422, 428, 431, 434, 437, 440, 443,
1760 446, 449, 452, 455, 458, 461, 464, 471, 477, 486,
1761 493, 500, 508, 516, 524, 532, 539, 548, 557, 563,
1762 571, 575, 577, 579, 581, 583, 584, 587, 594, 596,
1763 597, 599, 602, 603, 607, 608, 612, 616, 620, 624,
1764 625, 634, 635, 645, 646, 656, 662, 665, 669, 671,
1765 675, 679, 683, 687, 689, 690, 696, 700, 702, 706,
1766 708, 709, 721, 723, 725, 730, 732, 734, 737, 741,
1767 742, 744, 746, 748, 750, 752, 754, 756, 758, 760,
1768 762, 764, 768, 772, 775, 778, 782, 785, 791, 796,
1769 798, 804, 806, 808, 810, 812, 814, 816, 819, 821,
1770 825, 828, 831, 835, 839, 842, 843, 845, 848, 851,
1771 855, 865, 875, 884, 900, 902, 904, 911, 917, 920,
1772 923, 930, 938, 943, 948, 955, 962, 963, 964, 968,
1773 971, 975, 978, 980, 986, 992, 999, 1006, 1013, 1020,
1774 1025, 1032, 1037, 1042, 1049, 1056, 1059, 1069, 1071, 1073,
1775 1074, 1078, 1085, 1089, 1096, 1099, 1105, 1113, 1119, 1124,
1779 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1780 static const yytype_int16 yyrhs[] =
1782 222, 0, -1, 75, -1, 76, -1, 77, -1, 78,
1783 -1, 79, -1, 80, -1, 81, -1, 82, -1, 83,
1784 -1, 87, -1, 88, -1, 89, -1, 84, -1, 85,
1785 -1, 86, -1, 120, -1, 121, -1, 122, -1, 123,
1786 -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
1787 -1, 129, -1, 130, -1, 131, -1, 94, -1, 95,
1788 -1, 96, -1, 97, -1, 98, -1, 99, -1, 100,
1789 -1, 101, -1, 102, -1, 103, -1, 104, -1, 105,
1790 -1, 106, -1, 107, -1, 108, -1, 109, -1, 110,
1791 -1, 111, -1, 112, -1, 113, -1, 100, -1, 101,
1792 -1, 102, -1, 103, -1, 26, -1, 27, -1, 19,
1793 -1, 22, -1, 24, -1, 181, -1, -1, 55, 161,
1794 4, 162, -1, -1, 181, 163, -1, -1, 7, 163,
1795 -1, 20, -1, 23, -1, 188, -1, -1, 186, 163,
1796 -1, 42, -1, 44, -1, 43, -1, 45, -1, 47,
1797 -1, 49, -1, 46, -1, 48, -1, 51, -1, -1,
1798 158, -1, 159, -1, 160, -1, -1, 46, -1, 48,
1799 -1, -1, 42, -1, 43, -1, 44, -1, 47, -1,
1800 -1, 44, -1, 42, -1, -1, 63, -1, 64, -1,
1801 65, -1, 66, -1, 67, -1, 62, 4, -1, 142,
1802 -1, 121, -1, 141, -1, 122, -1, 144, -1, 145,
1803 -1, 147, -1, 148, -1, 149, -1, 54, 4, -1,
1804 -1, 197, 196, -1, 144, -1, 142, -1, 141, -1,
1805 -1, 199, 198, -1, 143, -1, 146, -1, 144, -1,
1806 142, -1, 141, -1, 150, -1, 151, -1, 154, -1,
1807 155, -1, 153, -1, 156, -1, 157, -1, -1, 201,
1808 200, -1, -1, 152, 22, -1, -1, 54, 4, -1,
1809 -1, 164, 54, 4, -1, 34, 22, -1, -1, 205,
1810 -1, -1, 164, 208, 207, -1, 205, -1, 54, 4,
1811 -1, 11, -1, 12, -1, 13, -1, 16, -1, 15,
1812 -1, 14, -1, 17, -1, 50, -1, 209, -1, 210,
1813 183, 165, -1, 244, -1, 166, 4, -1, 210, 161,
1814 214, 162, 201, -1, 10, 161, 214, 162, 201, -1,
1815 167, 4, 168, 210, 169, -1, 170, 4, 168, 210,
1816 171, -1, 172, 215, 173, -1, 172, 173, -1, 170,
1817 172, 215, 173, 171, -1, 170, 172, 173, 171, -1,
1818 210, 197, -1, 210, -1, 10, -1, 211, -1, 213,
1819 164, 211, -1, 213, -1, 213, 164, 39, -1, 39,
1820 -1, -1, 210, -1, 215, 164, 210, -1, 210, 167,
1821 218, 169, -1, 210, 167, 169, -1, 210, 174, 22,
1822 -1, 210, 170, 218, 171, -1, 210, 172, 218, 173,
1823 -1, 210, 172, 173, -1, 210, 170, 172, 218, 173,
1824 171, -1, 210, 170, 172, 173, 171, -1, 210, 40,
1825 -1, 210, 41, -1, 210, 244, -1, 210, 217, -1,
1826 210, 25, -1, 210, 3, -1, 210, 5, -1, 210,
1827 4, -1, 210, 6, -1, 210, 26, -1, 210, 27,
1828 -1, 210, 9, -1, 178, 161, 216, 38, 210, 162,
1829 -1, 119, 161, 216, 256, 162, -1, 133, 161, 216,
1830 164, 216, 164, 216, 162, -1, 176, 161, 216, 164,
1831 216, 162, -1, 177, 161, 216, 164, 216, 162, -1,
1832 90, 179, 161, 216, 164, 216, 162, -1, 91, 180,
1833 161, 216, 164, 216, 162, -1, 92, 179, 161, 216,
1834 164, 216, 162, -1, 93, 180, 161, 216, 164, 216,
1835 162, -1, 135, 161, 216, 164, 216, 162, -1, 136,
1836 161, 216, 164, 216, 164, 216, 162, -1, 137, 161,
1837 216, 164, 216, 164, 216, 162, -1, 139, 161, 216,
1838 257, 162, -1, 140, 161, 216, 164, 216, 257, 162,
1839 -1, 218, 164, 216, -1, 216, -1, 32, -1, 33,
1840 -1, 37, -1, -1, 212, 244, -1, 125, 161, 221,
1841 38, 210, 162, -1, 223, -1, -1, 224, -1, 223,
1842 224, -1, -1, 31, 225, 240, -1, -1, 30, 226,
1843 241, -1, 60, 59, 230, -1, 184, 18, 210, -1,
1844 184, 18, 10, -1, -1, 187, 191, 220, 219, 216,
1845 183, 227, 207, -1, -1, 187, 189, 191, 220, 219,
1846 216, 183, 228, 207, -1, -1, 187, 190, 191, 220,
1847 219, 210, 183, 229, 207, -1, 187, 191, 35, 194,
1848 221, -1, 52, 231, -1, 56, 163, 232, -1, 22,
1849 -1, 53, 163, 22, -1, 68, 163, 22, -1, 167,
1850 233, 169, -1, 233, 164, 22, -1, 22, -1, -1,
1851 234, 164, 210, 197, 182, -1, 210, 197, 182, -1,
1852 234, -1, 234, 164, 39, -1, 39, -1, -1, 195,
1853 199, 212, 186, 161, 235, 162, 201, 206, 203, 202,
1854 -1, 28, -1, 172, -1, 193, 191, 236, 237, -1,
1855 29, -1, 173, -1, 248, 239, -1, 192, 191, 236,
1856 -1, -1, 61, -1, 3, -1, 4, -1, 5, -1,
1857 6, -1, 9, -1, 26, -1, 27, -1, 40, -1,
1858 41, -1, 25, -1, 170, 218, 171, -1, 167, 218,
1859 169, -1, 167, 169, -1, 174, 22, -1, 172, 218,
1860 173, -1, 172, 173, -1, 170, 172, 218, 173, 171,
1861 -1, 170, 172, 173, 171, -1, 217, -1, 59, 242,
1862 22, 164, 22, -1, 7, -1, 8, -1, 181, -1,
1863 186, -1, 244, -1, 243, -1, 210, 245, -1, 246,
1864 -1, 247, 164, 246, -1, 248, 249, -1, 238, 249,
1865 -1, 250, 184, 251, -1, 250, 185, 251, -1, 250,
1866 253, -1, -1, 21, -1, 69, 247, -1, 69, 10,
1867 -1, 70, 17, 245, -1, 70, 11, 245, 164, 17,
1868 245, 164, 17, 245, -1, 71, 11, 245, 164, 17,
1869 245, 167, 252, 169, -1, 71, 11, 245, 164, 17,
1870 245, 167, 169, -1, 72, 195, 199, 212, 245, 161,
1871 255, 162, 201, 38, 17, 245, 73, 17, 245, -1,
1872 73, -1, 74, -1, 252, 11, 243, 164, 17, 245,
1873 -1, 11, 243, 164, 17, 245, -1, 184, 259, -1,
1874 185, 259, -1, 210, 167, 245, 164, 245, 169, -1,
1875 254, 164, 167, 245, 164, 245, 169, -1, 210, 197,
1876 245, 197, -1, 17, 197, 245, 197, -1, 255, 164,
1877 210, 197, 245, 197, -1, 255, 164, 17, 197, 245,
1878 197, -1, -1, -1, 256, 164, 246, -1, 164, 4,
1879 -1, 257, 164, 4, -1, 58, 57, -1, 57, -1,
1880 176, 210, 245, 164, 245, -1, 177, 210, 245, 164,
1881 245, -1, 90, 179, 210, 245, 164, 245, -1, 91,
1882 180, 210, 245, 164, 245, -1, 92, 179, 210, 245,
1883 164, 245, -1, 93, 180, 210, 245, 164, 245, -1,
1884 178, 246, 38, 210, -1, 133, 246, 164, 246, 164,
1885 246, -1, 134, 246, 164, 210, -1, 135, 246, 164,
1886 246, -1, 136, 246, 164, 246, 164, 246, -1, 137,
1887 246, 164, 246, 164, 246, -1, 132, 254, -1, 258,
1888 195, 199, 212, 245, 161, 255, 162, 201, -1, 261,
1889 -1, 36, -1, -1, 114, 210, 204, -1, 114, 210,
1890 164, 11, 245, 204, -1, 115, 210, 204, -1, 115,
1891 210, 164, 11, 245, 204, -1, 116, 246, -1, 260,
1892 117, 210, 245, 204, -1, 260, 118, 246, 164, 210,
1893 245, 204, -1, 138, 210, 245, 164, 4, -1, 119,
1894 210, 245, 256, -1, 139, 210, 245, 257, -1, 140,
1895 210, 245, 164, 210, 245, 257, -1
1898 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1899 static const yytype_uint16 yyrline[] =
1901 0, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152,
1902 1152, 1153, 1153, 1153, 1153, 1153, 1153, 1154, 1154, 1154,
1903 1154, 1154, 1154, 1155, 1155, 1155, 1155, 1155, 1155, 1158,
1904 1158, 1159, 1159, 1160, 1160, 1161, 1161, 1162, 1162, 1166,
1905 1166, 1167, 1167, 1168, 1168, 1169, 1169, 1170, 1170, 1171,
1906 1171, 1172, 1172, 1173, 1174, 1177, 1177, 1177, 1178, 1178,
1907 1180, 1181, 1185, 1189, 1194, 1200, 1200, 1202, 1203, 1208,
1908 1214, 1215, 1216, 1217, 1218, 1219, 1223, 1224, 1225, 1229,
1909 1230, 1231, 1232, 1236, 1237, 1238, 1242, 1243, 1244, 1245,
1910 1246, 1250, 1251, 1252, 1255, 1256, 1257, 1258, 1259, 1260,
1911 1261, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276,
1912 1277, 1281, 1282, 1287, 1288, 1289, 1292, 1293, 1299, 1300,
1913 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310,
1914 1313, 1314, 1320, 1321, 1328, 1329, 1335, 1336, 1345, 1353,
1915 1354, 1359, 1360, 1361, 1366, 1379, 1379, 1379, 1379, 1379,
1916 1379, 1379, 1382, 1386, 1390, 1397, 1402, 1410, 1445, 1476,
1917 1481, 1491, 1501, 1505, 1515, 1522, 1531, 1538, 1543, 1548,
1918 1555, 1556, 1563, 1570, 1578, 1584, 1596, 1624, 1640, 1667,
1919 1695, 1721, 1741, 1767, 1787, 1799, 1806, 1872, 1882, 1892,
1920 1903, 1916, 1927, 1941, 1948, 1955, 1973, 1985, 2006, 2014,
1921 2020, 2031, 2036, 2041, 2046, 2051, 2057, 2063, 2069, 2077,
1922 2088, 2092, 2100, 2100, 2103, 2103, 2106, 2118, 2139, 2144,
1923 2152, 2153, 2157, 2157, 2161, 2161, 2164, 2167, 2191, 2203,
1924 2202, 2214, 2213, 2223, 2222, 2233, 2273, 2276, 2282, 2292,
1925 2296, 2301, 2303, 2308, 2313, 2322, 2332, 2343, 2347, 2356,
1926 2365, 2370, 2519, 2519, 2521, 2530, 2530, 2532, 2537, 2549,
1927 2553, 2558, 2562, 2566, 2571, 2576, 2580, 2584, 2588, 2592,
1928 2596, 2600, 2622, 2644, 2650, 2663, 2675, 2680, 2692, 2698,
1929 2702, 2712, 2716, 2720, 2725, 2732, 2732, 2738, 2747, 2752,
1930 2757, 2761, 2770, 2779, 2792, 2801, 2805, 2813, 2833, 2837,
1931 2842, 2853, 2872, 2881, 2985, 2989, 2996, 3007, 3020, 3029,
1932 3042, 3053, 3063, 3074, 3082, 3092, 3099, 3102, 3103, 3111,
1933 3117, 3126, 3130, 3135, 3151, 3168, 3180, 3192, 3206, 3220,
1934 3232, 3253, 3260, 3266, 3272, 3278, 3293, 3403, 3408, 3412,
1935 3419, 3426, 3436, 3443, 3453, 3461, 3475, 3492, 3506, 3521,
1940 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1941 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1942 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1943 static const char *const yytname[] =
1945 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1946 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1947 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1948 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1949 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1950 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1951 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1952 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1953 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "COMMON", "OPAQUE",
1954 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1955 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1956 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1957 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1958 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1959 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "VICMP",
1960 "VFCMP", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE",
1961 "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ",
1962 "UNE", "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR",
1963 "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP",
1964 "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK",
1965 "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR",
1966 "GETRESULT", "EXTRACTVALUE", "INSERTVALUE", "SIGNEXT", "ZEROEXT",
1967 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1968 "READNONE", "READONLY", "GC", "OPTSIZE", "NOINLINE", "ALWAYSINLINE",
1969 "SSP", "SSPREQ", "DEFAULT", "HIDDEN", "PROTECTED", "'('", "')'", "'='",
1970 "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", "'}'",
1971 "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1972 "IPredicates", "FPredicates", "LocalName", "OptLocalName",
1973 "OptAddrSpace", "OptLocalAssign", "LocalNumber", "GlobalName",
1974 "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1975 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1976 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "Attribute",
1977 "OptAttributes", "RetAttr", "OptRetAttrs", "FuncAttr", "OptFuncAttrs",
1978 "OptGC", "OptAlign", "OptCAlign", "SectionString", "OptSection",
1979 "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types",
1980 "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI",
1981 "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "ThreadLocal",
1982 "AliaseeRef", "Module", "DefinitionList", "Definition", "@1", "@2", "@3",
1983 "@4", "@5", "AsmBlock", "TargetDefinition", "LibrariesDefinition",
1984 "LibList", "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN",
1985 "FunctionHeader", "END", "Function", "FunctionProto", "OptSideEffect",
1986 "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal",
1987 "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList",
1988 "BBTerminatorInst", "JumpTable", "Inst", "PHIList", "ParamList",
1989 "IndexList", "ConstantIndexList", "OptTailCall", "InstVal",
1990 "OptVolatile", "MemoryInst", 0
1995 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1997 static const yytype_uint16 yytoknum[] =
1999 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
2000 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
2001 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
2002 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
2003 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
2004 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
2005 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
2006 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
2007 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
2008 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
2009 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
2010 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
2011 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
2012 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
2013 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
2014 405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
2015 415, 40, 41, 61, 44, 42, 92, 91, 120, 93,
2016 60, 62, 123, 125, 99
2020 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
2021 static const yytype_uint16 yyr1[] =
2023 0, 175, 176, 176, 176, 176, 176, 176, 176, 176,
2024 176, 177, 177, 177, 177, 177, 177, 178, 178, 178,
2025 178, 178, 178, 178, 178, 178, 178, 178, 178, 179,
2026 179, 179, 179, 179, 179, 179, 179, 179, 179, 180,
2027 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
2028 180, 180, 180, 180, 180, 181, 181, 181, 182, 182,
2029 183, 183, 184, 184, 185, 186, 186, 187, 187, 188,
2030 189, 189, 189, 189, 189, 189, 190, 190, 190, 191,
2031 191, 191, 191, 192, 192, 192, 193, 193, 193, 193,
2032 193, 194, 194, 194, 195, 195, 195, 195, 195, 195,
2033 195, 196, 196, 196, 196, 196, 196, 196, 196, 196,
2034 196, 197, 197, 198, 198, 198, 199, 199, 200, 200,
2035 200, 200, 200, 200, 200, 200, 200, 200, 200, 200,
2036 201, 201, 202, 202, 203, 203, 204, 204, 205, 206,
2037 206, 207, 207, 208, 208, 209, 209, 209, 209, 209,
2038 209, 209, 210, 210, 210, 210, 210, 210, 210, 210,
2039 210, 210, 210, 210, 210, 211, 212, 212, 213, 213,
2040 214, 214, 214, 214, 215, 215, 216, 216, 216, 216,
2041 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
2042 216, 216, 216, 216, 216, 216, 217, 217, 217, 217,
2043 217, 217, 217, 217, 217, 217, 217, 217, 217, 217,
2044 218, 218, 219, 219, 220, 220, 221, 221, 222, 222,
2045 223, 223, 225, 224, 226, 224, 224, 224, 224, 227,
2046 224, 228, 224, 229, 224, 224, 224, 224, 230, 231,
2047 231, 232, 233, 233, 233, 234, 234, 235, 235, 235,
2048 235, 236, 237, 237, 238, 239, 239, 240, 241, 242,
2049 242, 243, 243, 243, 243, 243, 243, 243, 243, 243,
2050 243, 243, 243, 243, 243, 243, 243, 243, 243, 243,
2051 243, 244, 244, 244, 244, 245, 245, 246, 247, 247,
2052 248, 248, 249, 249, 250, 250, 250, 251, 251, 251,
2053 251, 251, 251, 251, 251, 251, 252, 252, 253, 253,
2054 254, 254, 255, 255, 255, 255, 255, 256, 256, 257,
2055 257, 258, 258, 259, 259, 259, 259, 259, 259, 259,
2056 259, 259, 259, 259, 259, 259, 259, 259, 260, 260,
2057 261, 261, 261, 261, 261, 261, 261, 261, 261, 261,
2061 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
2062 static const yytype_uint8 yyr2[] =
2064 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
2065 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2066 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2067 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2068 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2069 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2070 4, 0, 2, 0, 2, 1, 1, 1, 0, 2,
2071 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
2072 1, 1, 1, 0, 1, 1, 0, 1, 1, 1,
2073 1, 0, 1, 1, 0, 1, 1, 1, 1, 1,
2074 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2075 2, 0, 2, 1, 1, 1, 0, 2, 1, 1,
2076 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2077 0, 2, 0, 2, 0, 2, 0, 3, 2, 0,
2078 1, 0, 3, 1, 2, 1, 1, 1, 1, 1,
2079 1, 1, 1, 1, 3, 1, 2, 5, 5, 5,
2080 5, 3, 2, 5, 4, 2, 1, 1, 1, 3,
2081 1, 3, 1, 0, 1, 3, 4, 3, 3, 4,
2082 4, 3, 6, 5, 2, 2, 2, 2, 2, 2,
2083 2, 2, 2, 2, 2, 2, 6, 5, 8, 6,
2084 6, 7, 7, 7, 7, 6, 8, 8, 5, 7,
2085 3, 1, 1, 1, 1, 0, 2, 6, 1, 0,
2086 1, 2, 0, 3, 0, 3, 3, 3, 3, 0,
2087 8, 0, 9, 0, 9, 5, 2, 3, 1, 3,
2088 3, 3, 3, 1, 0, 5, 3, 1, 3, 1,
2089 0, 11, 1, 1, 4, 1, 1, 2, 3, 0,
2090 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2091 1, 3, 3, 2, 2, 3, 2, 5, 4, 1,
2092 5, 1, 1, 1, 1, 1, 1, 2, 1, 3,
2093 2, 2, 3, 3, 2, 0, 1, 2, 2, 3,
2094 9, 9, 8, 15, 1, 1, 6, 5, 2, 2,
2095 6, 7, 4, 4, 6, 6, 0, 0, 3, 2,
2096 3, 2, 1, 5, 5, 6, 6, 6, 6, 4,
2097 6, 4, 4, 6, 6, 2, 9, 1, 1, 0,
2098 3, 6, 3, 6, 2, 5, 7, 5, 4, 4,
2102 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2103 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2104 means the default is an error. */
2105 static const yytype_uint16 yydefact[] =
2107 68, 55, 65, 56, 66, 57, 224, 222, 0, 0,
2108 0, 0, 0, 0, 79, 67, 0, 68, 220, 83,
2109 86, 0, 0, 236, 0, 0, 62, 0, 69, 70,
2110 72, 71, 73, 76, 74, 77, 75, 78, 80, 81,
2111 82, 79, 79, 215, 1, 221, 84, 85, 79, 225,
2112 87, 88, 89, 90, 79, 295, 223, 295, 0, 0,
2113 244, 237, 238, 226, 281, 282, 228, 145, 146, 147,
2114 150, 149, 148, 151, 152, 0, 0, 0, 0, 283,
2115 284, 153, 227, 155, 215, 215, 91, 214, 0, 94,
2116 94, 296, 291, 63, 255, 256, 257, 290, 239, 240,
2117 243, 0, 173, 156, 0, 0, 0, 0, 162, 174,
2118 0, 0, 173, 0, 0, 0, 93, 92, 0, 212,
2119 213, 0, 0, 95, 96, 97, 98, 99, 116, 258,
2120 0, 0, 339, 339, 294, 0, 241, 172, 111, 168,
2121 170, 0, 0, 0, 0, 0, 0, 161, 0, 0,
2122 154, 0, 0, 167, 0, 166, 0, 235, 61, 61,
2123 100, 0, 252, 253, 254, 64, 338, 322, 0, 0,
2124 0, 0, 94, 304, 305, 2, 3, 4, 5, 6,
2125 7, 8, 9, 10, 14, 15, 16, 11, 12, 13,
2126 0, 0, 0, 0, 0, 0, 0, 0, 17, 18,
2127 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
2128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2129 0, 0, 292, 94, 308, 0, 337, 293, 309, 242,
2130 165, 0, 130, 61, 61, 164, 0, 175, 0, 130,
2131 61, 61, 0, 216, 189, 191, 190, 192, 195, 188,
2132 193, 194, 184, 185, 0, 0, 0, 0, 0, 0,
2133 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2134 0, 0, 187, 186, 229, 115, 114, 113, 117, 0,
2135 321, 298, 61, 288, 297, 0, 0, 0, 116, 29,
2136 30, 31, 32, 33, 34, 35, 36, 37, 38, 0,
2137 53, 54, 49, 50, 51, 52, 39, 40, 41, 42,
2138 43, 44, 45, 46, 47, 48, 0, 0, 0, 136,
2139 136, 344, 61, 61, 335, 0, 0, 0, 0, 0,
2140 61, 61, 61, 61, 61, 0, 116, 0, 0, 0,
2141 102, 104, 103, 101, 105, 106, 107, 108, 109, 112,
2142 171, 169, 158, 159, 160, 163, 60, 157, 231, 233,
2143 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2144 0, 0, 177, 211, 0, 0, 0, 181, 0, 178,
2145 0, 0, 0, 141, 0, 261, 262, 263, 264, 265,
2146 270, 266, 267, 268, 269, 259, 0, 0, 0, 0,
2147 279, 286, 285, 287, 0, 0, 299, 0, 0, 61,
2148 61, 61, 61, 0, 340, 0, 342, 317, 0, 0,
2149 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2150 0, 0, 61, 0, 110, 122, 121, 118, 120, 119,
2151 123, 124, 127, 125, 126, 128, 129, 131, 141, 141,
2152 0, 0, 0, 0, 0, 317, 0, 0, 0, 0,
2153 0, 0, 0, 176, 162, 174, 0, 179, 180, 0,
2154 0, 0, 0, 230, 250, 260, 0, 273, 0, 0,
2155 0, 276, 0, 274, 289, 0, 0, 0, 0, 0,
2156 0, 0, 0, 0, 0, 348, 0, 0, 0, 331,
2157 332, 0, 0, 0, 0, 349, 0, 0, 0, 329,
2158 0, 136, 0, 232, 234, 61, 0, 0, 0, 0,
2159 0, 0, 0, 0, 0, 0, 0, 210, 183, 0,
2160 0, 0, 0, 0, 0, 143, 141, 249, 111, 247,
2161 0, 0, 272, 162, 0, 271, 275, 0, 0, 0,
2162 0, 0, 0, 0, 136, 137, 136, 0, 0, 0,
2163 0, 0, 0, 347, 319, 0, 61, 323, 324, 0,
2164 0, 345, 61, 217, 0, 0, 0, 0, 197, 0,
2165 0, 0, 0, 208, 0, 182, 0, 0, 61, 138,
2166 144, 142, 59, 0, 130, 0, 278, 0, 0, 0,
2167 316, 325, 326, 327, 328, 341, 343, 318, 0, 0,
2168 330, 333, 334, 320, 0, 316, 136, 0, 0, 0,
2169 0, 0, 205, 0, 0, 0, 199, 200, 196, 58,
2170 246, 248, 111, 139, 280, 277, 0, 0, 111, 111,
2171 0, 310, 0, 350, 0, 346, 201, 202, 203, 204,
2172 0, 0, 0, 209, 59, 140, 134, 0, 0, 302,
2173 0, 0, 0, 130, 0, 311, 130, 198, 206, 207,
2174 245, 0, 132, 300, 0, 0, 301, 102, 104, 111,
2175 111, 0, 111, 111, 336, 135, 0, 251, 0, 0,
2176 313, 312, 0, 0, 0, 133, 0, 0, 0, 111,
2177 111, 307, 0, 0, 315, 314, 306, 0, 0, 303
2180 /* YYDEFGOTO[NTERM-NUM]. */
2181 static const yytype_int16 yydefgoto[] =
2183 -1, 269, 270, 271, 299, 316, 79, 630, 113, 12,
2184 133, 80, 14, 15, 41, 42, 43, 48, 54, 118,
2185 128, 349, 230, 278, 161, 447, 352, 687, 672, 414,
2186 535, 656, 473, 536, 81, 158, 139, 156, 140, 141,
2187 110, 373, 400, 374, 121, 88, 157, 16, 17, 18,
2188 20, 19, 383, 448, 449, 63, 23, 61, 101, 539,
2189 540, 129, 164, 55, 96, 56, 49, 476, 401, 83,
2190 403, 283, 284, 57, 92, 93, 222, 660, 134, 324,
2191 640, 495, 505, 223, 224, 225, 226
2194 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2196 #define YYPACT_NINF -615
2197 static const yytype_int16 yypact[] =
2199 789, -615, -615, -615, -615, -615, -615, -615, -10, -110,
2200 29, -106, 31, -56, 22, -615, 45, 1491, -615, 162,
2201 194, 20, 33, -615, -43, 141, -615, 1998, -615, -615,
2202 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2203 -615, 88, 88, 176, -615, -615, -615, -615, 88, -615,
2204 -615, -615, -615, -615, 88, 178, -615, -11, 207, 213,
2205 243, -615, -615, -615, -615, -615, 115, -615, -615, -615,
2206 -615, -615, -615, -615, -615, 275, 289, 1, 480, -615,
2207 -615, -615, 36, -615, 263, 263, 200, -615, 143, 197,
2208 197, -615, -615, 65, -615, -615, -615, -615, -615, -615,
2209 -615, -54, 1723, -615, 140, 155, 549, 115, -615, 36,
2210 -122, 167, 1723, 160, 143, 143, -615, -615, 1767, -615,
2211 -615, 2023, 327, -615, -615, -615, -615, -615, -615, -615,
2212 -16, 180, 2293, 2293, -615, 322, -615, -615, 36, -615,
2213 181, 184, 2023, 2023, 179, -118, 2023, -615, 343, 189,
2214 -615, 2023, 2023, 115, 191, 36, 55, -615, 1277, 298,
2215 -615, 1678, -615, -615, -615, -615, -615, -615, 297, 2064,
2216 112, 344, 197, -615, -615, -615, -615, -615, -615, -615,
2217 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2218 219, 555, 219, 555, 2023, 2023, 2023, 2023, -615, -615,
2219 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2220 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023, 2023,
2221 2023, 2023, -615, 197, -615, 132, -615, -615, -615, -615,
2222 334, 1816, -615, -39, -40, -615, 188, 36, 198, -615,
2223 298, -14, 1767, -615, -615, -615, -615, -615, -615, -615,
2224 -615, -615, -615, -615, 219, 555, 219, 555, 195, 201,
2225 202, 203, 205, 206, 210, 1857, 2123, 983, 339, 211,
2226 212, 214, -615, -615, -615, -615, -615, -615, -615, 105,
2227 -615, 115, 933, -615, 216, 1449, 1449, 1449, -615, -615,
2228 -615, -615, -615, -615, -615, -615, -615, -615, -615, 2023,
2229 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2230 -615, -615, -615, -615, -615, -615, 2023, 2023, 2023, 54,
2231 56, -615, 933, -29, 217, 223, 226, 227, 228, 229,
2232 933, 933, 933, 933, 933, 336, -615, 2023, 2023, 372,
2233 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2234 -615, -615, 556, -615, -615, -615, -615, 556, -615, 160,
2235 345, 224, 240, 242, 245, 2023, 2023, 2023, 2023, 2023,
2236 2023, 2023, -615, -615, -19, 1154, -52, -615, -117, -615,
2237 2023, 2023, 2023, 247, 252, -615, -615, -615, -615, -615,
2238 -615, -615, -615, -615, -615, 316, 1898, 2164, 1326, 392,
2239 -615, -615, -615, -615, 2023, 251, -615, 254, 1678, 933,
2240 933, 933, 933, 27, -615, 28, -615, -615, 1449, 253,
2241 2023, 2023, 2023, 2023, 2023, 255, 258, 259, 261, 262,
2242 2023, 1678, 933, 264, -615, -615, -615, -615, -615, -615,
2243 -615, -615, -615, -615, -615, -615, -615, -615, 247, 247,
2244 2023, 2023, 2023, 2023, 2023, -615, 265, 267, 268, 269,
2245 258, 270, 2023, -615, 250, 1105, -74, -615, -615, 271,
2246 272, 399, 6, -615, 1939, -615, 416, -615, 34, 1637,
2247 -37, -615, -70, -615, -615, 424, 429, 1449, 283, 285,
2248 287, 288, 1449, 450, 1449, 293, 295, 1449, 301, 36,
2249 -615, 302, 303, 464, 465, 306, 2023, 1449, 1449, 36,
2250 1449, 310, 2023, -615, -615, -1, 313, 320, 321, 325,
2251 107, 2023, 2023, 2023, 2023, 108, 2023, -615, -615, 341,
2252 2023, 2023, 2023, 476, 501, -615, 247, -615, 36, 349,
2253 352, 351, -615, 350, -60, -615, -615, 1449, 1449, 361,
2254 1449, 1449, 1449, 1449, 310, -615, 310, 2023, 1449, 359,
2255 2023, 2023, 2023, -615, -615, 520, 933, -615, -615, 364,
2256 472, -615, 933, -615, 2023, 2023, 2023, 2023, -615, 363,
2257 366, 365, 368, -615, 258, -615, 371, 375, 4, -615,
2258 -615, -615, 185, 1957, -615, 516, -615, 369, 377, 376,
2259 2189, -615, -615, -615, -615, -615, -615, -615, 370, 1449,
2260 -615, -615, -615, -615, 258, 2189, 310, 380, 382, 383,
2261 384, 2023, -615, 2023, 2023, 118, -615, -615, -615, -615,
2262 -615, -615, 36, -2, -615, -615, 530, -5, 41, 36,
2263 121, -615, 379, 306, 122, -615, -615, -615, -615, -615,
2264 388, 389, 390, -615, 185, -615, 504, 1449, 1587, -615,
2265 3, 777, 777, -615, 2230, -615, -615, -615, -615, -615,
2266 -615, 551, 418, -615, 411, 1587, -615, 415, 417, -615,
2267 -615, 473, 41, 36, 556, -615, 557, -615, 560, 419,
2268 334, 334, 563, 777, 777, -615, 1449, 567, 1449, -615,
2269 -615, -615, 1449, 514, 334, 334, -615, 574, 1449, -615
2272 /* YYPGOTO[NTERM-NUM]. */
2273 static const yytype_int16 yypgoto[] =
2275 -615, 156, 164, 166, -159, -157, 0, -61, -135, 508,
2276 -615, 8, -615, -615, -615, -615, 60, -615, -615, -615,
2277 -138, -615, -405, -615, -253, -615, -236, -615, -615, -311,
2278 -31, -615, -418, -615, -615, -26, 374, -150, -615, 491,
2279 500, -114, -156, -239, 221, 257, 367, -615, -615, 590,
2280 -615, -615, -615, -615, -615, -615, -615, -615, -615, -615,
2281 -615, 518, -615, -615, -615, -615, -615, -615, -614, -108,
2282 186, -192, -615, -615, 553, -615, 478, -615, -615, -615,
2283 -3, 158, -447, -615, 487, -615, -615
2286 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2287 positive, shift that token. If negative, reduce the rule which
2288 number is the opposite. If zero, do what YYDEFACT says.
2289 If YYTABLE_NINF, syntax error. */
2290 #define YYTABLE_NINF -220
2291 static const yytype_int16 yytable[] =
2293 11, 82, 272, 357, 321, 105, 658, 159, 13, 416,
2294 91, 279, 162, 525, 675, 111, 111, 11, 94, 325,
2295 326, 327, 328, 329, 274, 13, 111, 376, 378, 335,
2296 513, 514, 533, 317, 288, 408, 318, 240, 492, 494,
2297 533, 111, 146, 21, 674, 44, 146, 462, 243, 27,
2298 273, 147, 109, 24, 111, 236, 468, 26, 22, 111,
2299 534, 689, 64, 65, 29, 30, 31, 32, 33, 34,
2300 35, 36, 131, 37, 1, 2, 138, 3, 4, 5,
2301 109, 493, 493, 431, 1, 336, 138, 3, 25, 5,
2302 462, 111, 155, 11, 462, 361, -151, 363, 362, 529,
2303 364, 84, 85, 546, 462, 358, 359, 28, 89, 111,
2304 135, 111, 462, 597, 90, 136, 233, 234, 591, 467,
2305 237, 112, 112, 285, 60, 2, 241, 462, 4, 286,
2306 353, 354, 112, 592, 545, 155, 466, 625, 418, 435,
2307 436, 437, 438, 282, 439, 462, 433, 112, 440, 441,
2308 463, 442, 443, 444, 445, 446, 163, 478, 480, 482,
2309 112, 573, 95, 62, 659, 112, 628, 643, 319, 320,
2310 282, 322, 676, 106, 402, 119, 120, 402, 402, 402,
2311 38, 39, 40, 58, 323, 282, 282, 282, 282, 282,
2312 330, 331, 332, 333, 334, 282, 59, 112, 462, 91,
2313 571, -61, -151, 542, 1, 138, -151, 3, 46, 5,
2314 47, 86, 484, 87, 402, 112, 155, 112, 413, -61,
2315 415, -61, 402, 402, 402, 402, 402, 654, 498, 98,
2316 500, 501, 502, 661, 662, 99, 50, 51, 52, 339,
2317 544, 53, 116, 605, 117, 606, 38, 39, 40, 337,
2318 338, 455, 456, 457, 458, 459, 460, 461, 487, 122,
2319 123, 124, 125, 126, 127, 100, 469, 470, 471, 578,
2320 583, 557, 565, 409, 690, 691, 102, 693, 694, 103,
2321 653, 510, 565, 663, 666, 664, 664, 384, 219, 219,
2322 410, 411, 412, 104, 704, 705, 220, 220, 221, 221,
2323 87, 402, 402, 402, 402, 645, 340, 341, 142, 272,
2324 402, 432, 282, 289, 290, 291, 292, 293, 294, 295,
2325 296, 297, 298, 143, 402, 150, 342, 343, 148, 344,
2326 345, 160, 346, 347, 348, 151, 152, 516, 517, 518,
2327 519, 114, 115, 165, 229, 231, 232, 238, 527, 465,
2328 235, 239, 242, 111, 280, 287, 365, 273, 633, 355,
2329 356, 379, 366, 367, 368, 607, 369, 370, 610, 611,
2330 612, 371, 380, 381, 430, 382, 434, 475, 282, 402,
2331 404, 419, 155, 450, 402, 451, 402, 420, 339, 402,
2332 421, 422, 423, 424, 282, 499, 282, 282, 282, 402,
2333 402, 452, 402, 453, 509, 155, 454, 579, 580, 581,
2334 582, 472, 584, 474, 483, 485, 586, 587, 486, 503,
2335 497, 528, 504, 506, 515, 507, 508, 681, 512, 521,
2336 684, 522, 523, 524, 526, 530, 531, 532, 541, 402,
2337 402, 547, 402, 402, 402, 402, 548, 550, 538, 551,
2338 402, 552, 553, 465, 555, 340, 341, 557, 402, 558,
2339 617, 618, 619, 620, 402, 560, 561, 562, 563, 564,
2340 565, 405, 406, 407, 570, 342, 343, 574, 344, 345,
2341 566, 346, 347, 348, 575, 576, 572, 64, 65, 577,
2342 107, 67, 68, 69, 70, 71, 72, 73, 589, 1,
2343 2, 402, 3, 4, 5, 590, 588, 650, 417, 651,
2344 652, 692, 585, 593, 594, 595, 425, 426, 427, 428,
2345 429, 596, 600, 609, 613, 615, 493, 621, 622, 623,
2346 74, 282, 624, 626, 282, 282, 282, 627, 634, 641,
2347 635, 636, 646, 637, 647, 648, 649, 657, 665, 402,
2348 667, 668, 669, 402, 402, 685, 64, 65, 671, 107,
2349 67, 68, 69, 70, 71, 72, 73, 632, 1, 2,
2350 686, 3, 4, 5, 639, 688, -18, 696, -19, 695,
2351 698, 300, 301, 697, 702, 402, 402, 707, 402, 639,
2352 402, 708, 629, 670, 402, 488, 489, 490, 491, 74,
2353 402, 132, 655, 149, 496, 351, 145, 45, 130, 360,
2354 97, 227, 644, 520, 435, 436, 437, 438, 511, 439,
2355 228, 0, 0, 440, 441, 0, 442, 443, 444, 445,
2356 446, 0, 0, 0, 0, 0, 0, 0, 683, 0,
2357 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2358 77, 0, 78, 108, 629, 302, 303, 304, 305, 306,
2359 307, 308, 309, 310, 311, 312, 313, 314, 315, 0,
2360 0, 0, 0, 549, 0, 0, 0, 0, 554, 0,
2361 556, 0, 0, 559, 0, 0, 0, 0, 0, 0,
2362 0, 0, 0, 567, 568, 0, 569, 435, 436, 437,
2363 438, 0, 439, 0, 0, 0, 440, 441, 0, 442,
2364 443, 444, 445, 446, 0, 75, 76, 0, 0, 77,
2365 0, 78, 144, 0, 0, 0, 0, 0, 0, 0,
2366 0, 0, 0, 598, 599, 0, 601, 602, 603, 604,
2367 0, 0, 0, 0, 608, 0, 0, 0, 0, 0,
2368 0, 0, 614, 0, 0, 0, 0, 0, 616, 0,
2369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2371 385, 386, 387, 388, 64, 65, 389, 0, 0, -219,
2372 0, 0, 0, 0, 0, 642, 1, 2, 0, 3,
2373 4, 5, 390, 391, 392, 0, 0, -63, 1, 2,
2374 0, 3, 4, 5, 0, 0, 0, 393, 394, 6,
2375 7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2376 0, 339, 0, 0, 0, 0, 395, 0, 0, 0,
2377 0, 8, 0, 673, 0, 9, 0, 679, 680, 10,
2378 0, 0, 175, 176, 177, 178, 179, 180, 181, 182,
2379 183, 184, 185, 186, 187, 188, 189, 254, 255, 256,
2380 257, 0, 0, 0, 0, 0, 0, 0, 0, 699,
2381 700, 0, 701, 0, 703, 0, 0, 0, 706, 0,
2382 0, 0, 0, 0, 709, 0, 258, 198, 677, 678,
2383 201, 202, 203, 204, 205, 206, 207, 208, 209, 0,
2384 259, 0, 260, 261, 262, 0, 263, 264, 342, 343,
2385 0, 344, 345, 0, 346, 347, 348, 0, 0, 0,
2386 0, 0, 0, 0, 0, 0, 385, 386, 387, 388,
2387 64, 65, 389, 0, 396, 0, 0, 397, 0, 398,
2388 0, 399, 1, 2, 0, 3, 4, 5, 390, 391,
2389 392, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2390 0, 0, 0, 393, 394, 0, 0, 0, 0, 0,
2391 0, 0, 0, 0, 0, 0, 0, 0, 111, 0,
2392 64, 65, 395, 107, 67, 68, 69, 70, 71, 72,
2393 73, 0, 1, 2, 0, 3, 4, 5, 175, 176,
2394 177, 178, 179, 180, 181, 182, 183, 184, 185, 186,
2395 187, 188, 189, 254, 255, 256, 257, 0, 0, 0,
2396 0, 0, 0, 74, 0, 0, 0, 0, 0, 0,
2397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2398 0, 0, 258, 198, 199, 200, 201, 202, 203, 204,
2399 205, 206, 207, 208, 209, 0, 259, 0, 260, 261,
2400 262, 0, 263, 264, 0, 0, 0, 0, 0, 0,
2401 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2402 0, 0, 0, 0, 112, 0, 0, 0, 0, 0,
2403 396, 0, 0, 397, 0, 398, 0, 399, 244, 245,
2404 246, 247, 64, 65, 248, 0, 0, 0, 0, 0,
2405 0, 0, 0, 0, 1, 2, 0, 3, 4, 5,
2406 249, 250, 251, 0, 0, 0, 0, 0, 0, 0,
2407 0, 0, 0, 0, 0, 252, 253, 0, 0, 75,
2408 76, 0, 0, 77, 0, 78, 377, 0, 0, 0,
2409 111, 64, 65, 0, 107, 67, 68, 69, 70, 71,
2410 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2411 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
2412 185, 186, 187, 188, 189, 254, 255, 256, 257, 0,
2413 0, 0, 0, 0, 74, 0, 0, 0, 0, 0,
2414 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2415 0, 0, 0, 0, 258, 198, 199, 200, 201, 202,
2416 203, 204, 205, 206, 207, 208, 209, 0, 259, 0,
2417 260, 261, 262, 0, 263, 264, 0, 0, 0, 0,
2418 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2419 0, 0, 0, 0, 0, 0, 112, 0, 0, 0,
2420 -61, 0, 265, 0, 0, 266, 0, 267, 0, 268,
2421 244, 245, 246, 247, 64, 65, 248, 0, 0, 0,
2422 0, 0, 0, 0, 0, 0, 1, 2, 0, 3,
2423 4, 5, 249, 250, 251, 0, 0, 0, 0, 0,
2424 0, 0, 0, 0, 0, 0, 0, 252, 253, 0,
2425 75, 76, 0, 0, 77, 0, 78, 464, 0, 0,
2426 0, 0, 111, 64, 65, 0, 107, 67, 68, 69,
2427 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2428 5, 0, 175, 176, 177, 178, 179, 180, 181, 182,
2429 183, 184, 185, 186, 187, 188, 189, 254, 255, 256,
2430 257, 0, 0, 0, 0, 0, 74, 0, 0, 0,
2431 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2432 0, 0, 0, 0, 0, 0, 258, 198, 199, 200,
2433 201, 202, 203, 204, 205, 206, 207, 208, 209, 0,
2434 259, 0, 260, 261, 262, 0, 263, 264, 0, 0,
2435 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2436 0, 0, 0, 0, 0, 0, 0, 0, 112, 0,
2437 0, 0, 0, 0, 265, 0, 0, 266, 0, 267,
2438 0, 268, 385, 386, 387, 388, 64, 65, 389, 0,
2439 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
2440 0, 3, 4, 5, 390, 391, 392, 0, 0, 0,
2441 0, 0, 0, 0, 0, 0, 0, 0, 0, 393,
2442 394, -218, 75, 76, 0, 0, 77, 0, 78, 481,
2443 0, 0, 0, 0, 0, 0, 0, 0, 395, -63,
2444 1, 2, 0, 3, 4, 5, 0, 0, 0, 0,
2445 0, 6, 7, 0, 175, 176, 177, 178, 179, 180,
2446 181, 182, 183, 184, 185, 186, 187, 188, 189, 254,
2447 255, 256, 257, 8, 0, 0, 0, 9, 0, 0,
2448 0, 10, 0, 0, 0, 0, 0, 0, 0, 0,
2449 0, 0, 0, 0, 0, 0, 0, 0, 258, 198,
2450 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
2451 209, 0, 259, 0, 260, 261, 262, 0, 263, 264,
2452 385, 386, 387, 388, 0, 0, 389, 0, 0, 0,
2453 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2454 0, 0, 390, 391, 392, 0, 396, 0, 0, 397,
2455 0, 398, 0, 399, 0, 0, 0, 393, 394, 0,
2456 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2457 0, 0, 0, 0, 64, 65, 395, 107, 67, 68,
2458 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2459 4, 5, 175, 176, 177, 178, 179, 180, 181, 182,
2460 183, 184, 185, 186, 187, 188, 189, 254, 255, 256,
2461 257, 0, 0, 0, 0, 64, 65, 74, 153, 67,
2462 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2463 3, 4, 5, 0, 0, 0, 258, 198, 199, 200,
2464 201, 202, 203, 204, 205, 206, 207, 208, 209, 0,
2465 259, 0, 260, 261, 262, 0, 263, 264, 74, 0,
2466 64, 65, 0, 107, 67, 68, 69, 70, 71, 72,
2467 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2468 0, 0, 0, 0, 396, 0, 0, 397, 0, 398,
2469 0, 399, 137, 0, 0, 0, 0, 0, 0, 0,
2470 0, 0, 0, 74, 64, 65, 0, 153, 67, 68,
2471 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2472 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2473 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2474 543, 0, 0, 0, 0, 0, 0, 74, 0, 275,
2475 276, 0, 277, 64, 65, 0, 107, 67, 68, 69,
2476 70, 71, 72, 73, 0, 1, 2, 0, 3, 4,
2477 5, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2478 78, 0, 0, 0, 0, 350, 0, 0, 0, 0,
2479 0, 0, 0, 0, 64, 65, 74, 107, 67, 68,
2480 69, 70, 71, 72, 73, 0, 1, 2, 0, 3,
2481 4, 5, 0, 0, 0, 0, 0, 0, 0, 75,
2482 76, 0, 154, 77, 0, 78, 0, 0, 0, 0,
2483 0, 0, 0, 0, 0, 64, 65, 74, 107, 67,
2484 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2485 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2486 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2487 0, 0, 0, 0, 0, 0, 64, 65, 74, 107,
2488 67, 68, 69, 70, 71, 72, 73, 0, 1, 2,
2489 0, 3, 4, 5, 64, 65, 0, 107, 67, 68,
2490 69, 70, 71, 72, 73, 0, 1, 2, 537, 3,
2491 4, 5, 75, 76, 0, 0, 77, 0, 78, 74,
2492 0, 0, 0, 0, 0, 0, 631, 0, 0, 0,
2493 0, 0, 0, 0, 0, 64, 65, 74, 66, 67,
2494 68, 69, 70, 71, 72, 73, 0, 1, 2, 0,
2495 3, 4, 5, 75, 76, 0, 372, 77, 0, 78,
2496 64, 65, 0, 107, 67, 68, 69, 70, 71, 72,
2497 73, 0, 1, 2, 0, 3, 4, 5, 74, 0,
2498 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2499 0, 0, 0, 0, 75, 76, 0, 477, 77, 0,
2500 78, 64, 65, 74, 281, 67, 68, 69, 70, 71,
2501 72, 73, 0, 1, 2, 0, 3, 4, 5, 0,
2502 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2503 0, 0, 0, 0, 0, 75, 76, 0, 0, 77,
2504 0, 78, 0, 0, 74, 0, 0, 0, 0, 0,
2505 0, 0, 0, 75, 76, 0, 0, 77, 0, 78,
2506 64, 65, 0, 107, 67, 68, 69, 70, 71, 72,
2507 73, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2508 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2509 0, 0, 0, 0, 75, 76, 0, 0, 77, 0,
2510 78, 64, 65, 74, 107, 67, 68, 69, 70, 71,
2511 72, 73, 0, 1, 2, 0, 3, 4, 5, 75,
2512 76, 0, 0, 77, 0, 78, 64, 65, 0, 107,
2513 67, 68, 69, 70, 71, 72, 638, 0, 1, 2,
2514 0, 3, 4, 5, 74, 0, 0, 0, 0, 0,
2515 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2516 75, 76, 0, 0, 77, 0, 78, 64, 65, 74,
2517 107, 67, 68, 69, 70, 71, 72, 682, 0, 1,
2518 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2519 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2520 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2521 74, 0, 0, 0, 0, 0, 0, 0, 0, 75,
2522 76, 0, 0, 77, 0, 375, 0, 0, 0, 0,
2523 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2524 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2525 0, 0, 0, 0, 0, 0, 0, 0, 0, 166,
2526 75, 76, 0, 0, 77, 0, 479, 0, 0, 0,
2527 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2528 167, 168, 0, 0, 0, 75, 76, 0, 0, 77,
2529 0, 78, 169, 170, 171, 172, 173, 174, 175, 176,
2530 177, 178, 179, 180, 181, 182, 183, 184, 185, 186,
2531 187, 188, 189, 190, 191, 192, 193, 0, 0, 0,
2532 0, 0, 0, 0, 0, 0, 75, 76, 0, 0,
2533 77, 0, 78, 0, 0, 0, 0, 194, 195, 196,
2534 0, 0, 197, 198, 199, 200, 201, 202, 203, 204,
2535 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
2539 static const yytype_int16 yycheck[] =
2541 0, 27, 158, 239, 196, 4, 11, 121, 0, 320,
2542 21, 161, 28, 460, 11, 55, 55, 17, 29, 211,
2543 212, 213, 214, 215, 159, 17, 55, 266, 267, 221,
2544 448, 449, 34, 192, 172, 288, 193, 151, 11, 11,
2545 34, 55, 164, 53, 658, 0, 164, 164, 156, 18,
2546 158, 173, 78, 163, 55, 173, 173, 163, 68, 55,
2547 54, 675, 7, 8, 42, 43, 44, 45, 46, 47,
2548 48, 49, 7, 51, 19, 20, 102, 22, 23, 24,
2549 106, 54, 54, 336, 19, 223, 112, 22, 59, 24,
2550 164, 55, 118, 93, 164, 254, 55, 256, 255, 173,
2551 257, 41, 42, 173, 164, 240, 241, 163, 48, 55,
2552 164, 55, 164, 173, 54, 169, 142, 143, 536, 171,
2553 146, 161, 161, 11, 167, 20, 152, 164, 23, 17,
2554 169, 171, 161, 538, 171, 161, 375, 584, 167, 141,
2555 142, 143, 144, 169, 146, 164, 338, 161, 150, 151,
2556 169, 153, 154, 155, 156, 157, 172, 396, 397, 398,
2557 161, 162, 173, 22, 169, 161, 162, 614, 194, 195,
2558 196, 197, 169, 172, 282, 32, 33, 285, 286, 287,
2559 158, 159, 160, 163, 210, 211, 212, 213, 214, 215,
2560 216, 217, 218, 219, 220, 221, 163, 161, 164, 21,
2561 511, 165, 161, 169, 19, 231, 165, 22, 46, 24,
2562 48, 35, 404, 37, 322, 161, 242, 161, 164, 165,
2563 164, 165, 330, 331, 332, 333, 334, 632, 420, 22,
2564 422, 423, 424, 638, 639, 22, 42, 43, 44, 54,
2565 479, 47, 42, 554, 44, 556, 158, 159, 160, 117,
2566 118, 365, 366, 367, 368, 369, 370, 371, 408, 62,
2567 63, 64, 65, 66, 67, 22, 380, 381, 382, 162,
2568 162, 164, 164, 299, 679, 680, 161, 682, 683, 4,
2569 162, 431, 164, 162, 162, 164, 164, 279, 132, 133,
2570 316, 317, 318, 4, 699, 700, 132, 133, 132, 133,
2571 37, 409, 410, 411, 412, 616, 121, 122, 168, 465,
2572 418, 337, 338, 94, 95, 96, 97, 98, 99, 100,
2573 101, 102, 103, 168, 432, 165, 141, 142, 161, 144,
2574 145, 4, 147, 148, 149, 114, 115, 451, 452, 453,
2575 454, 84, 85, 163, 22, 164, 162, 4, 462, 375,
2576 171, 162, 161, 55, 57, 11, 161, 465, 594, 171,
2577 162, 22, 161, 161, 161, 557, 161, 161, 560, 561,
2578 562, 161, 161, 161, 38, 161, 4, 61, 404, 487,
2579 164, 164, 408, 38, 492, 161, 494, 164, 54, 497,
2580 164, 164, 164, 164, 420, 421, 422, 423, 424, 507,
2581 508, 161, 510, 161, 430, 431, 161, 521, 522, 523,
2582 524, 164, 526, 161, 22, 164, 530, 531, 164, 164,
2583 167, 171, 164, 164, 450, 164, 164, 663, 164, 164,
2584 666, 164, 164, 164, 164, 164, 164, 38, 22, 547,
2585 548, 17, 550, 551, 552, 553, 17, 164, 474, 164,
2586 558, 164, 164, 479, 4, 121, 122, 164, 566, 164,
2587 574, 575, 576, 577, 572, 164, 164, 164, 4, 4,
2588 164, 285, 286, 287, 164, 141, 142, 164, 144, 145,
2589 506, 147, 148, 149, 164, 164, 512, 7, 8, 164,
2590 10, 11, 12, 13, 14, 15, 16, 17, 22, 19,
2591 20, 609, 22, 23, 24, 4, 532, 621, 322, 623,
2592 624, 38, 171, 164, 162, 164, 330, 331, 332, 333,
2593 334, 171, 161, 164, 4, 161, 54, 164, 162, 164,
2594 50, 557, 164, 162, 560, 561, 562, 162, 22, 169,
2595 171, 164, 162, 167, 162, 162, 162, 17, 169, 657,
2596 162, 162, 162, 661, 662, 4, 7, 8, 54, 10,
2597 11, 12, 13, 14, 15, 16, 17, 593, 19, 20,
2598 152, 22, 23, 24, 600, 164, 161, 17, 161, 22,
2599 17, 26, 27, 164, 17, 693, 694, 73, 696, 615,
2600 698, 17, 592, 654, 702, 409, 410, 411, 412, 50,
2601 708, 93, 633, 112, 418, 231, 106, 17, 90, 242,
2602 57, 133, 615, 455, 141, 142, 143, 144, 432, 146,
2603 133, -1, -1, 150, 151, -1, 153, 154, 155, 156,
2604 157, -1, -1, -1, -1, -1, -1, -1, 664, -1,
2605 -1, -1, -1, -1, -1, -1, 166, 167, -1, -1,
2606 170, -1, 172, 173, 654, 100, 101, 102, 103, 104,
2607 105, 106, 107, 108, 109, 110, 111, 112, 113, -1,
2608 -1, -1, -1, 487, -1, -1, -1, -1, 492, -1,
2609 494, -1, -1, 497, -1, -1, -1, -1, -1, -1,
2610 -1, -1, -1, 507, 508, -1, 510, 141, 142, 143,
2611 144, -1, 146, -1, -1, -1, 150, 151, -1, 153,
2612 154, 155, 156, 157, -1, 166, 167, -1, -1, 170,
2613 -1, 172, 173, -1, -1, -1, -1, -1, -1, -1,
2614 -1, -1, -1, 547, 548, -1, 550, 551, 552, 553,
2615 -1, -1, -1, -1, 558, -1, -1, -1, -1, -1,
2616 -1, -1, 566, -1, -1, -1, -1, -1, 572, -1,
2617 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2618 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2619 3, 4, 5, 6, 7, 8, 9, -1, -1, 0,
2620 -1, -1, -1, -1, -1, 609, 19, 20, -1, 22,
2621 23, 24, 25, 26, 27, -1, -1, 18, 19, 20,
2622 -1, 22, 23, 24, -1, -1, -1, 40, 41, 30,
2623 31, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2624 -1, 54, -1, -1, -1, -1, 59, -1, -1, -1,
2625 -1, 52, -1, 657, -1, 56, -1, 661, 662, 60,
2626 -1, -1, 75, 76, 77, 78, 79, 80, 81, 82,
2627 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2628 93, -1, -1, -1, -1, -1, -1, -1, -1, 693,
2629 694, -1, 696, -1, 698, -1, -1, -1, 702, -1,
2630 -1, -1, -1, -1, 708, -1, 119, 120, 121, 122,
2631 123, 124, 125, 126, 127, 128, 129, 130, 131, -1,
2632 133, -1, 135, 136, 137, -1, 139, 140, 141, 142,
2633 -1, 144, 145, -1, 147, 148, 149, -1, -1, -1,
2634 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
2635 7, 8, 9, -1, 167, -1, -1, 170, -1, 172,
2636 -1, 174, 19, 20, -1, 22, 23, 24, 25, 26,
2637 27, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2638 -1, -1, -1, 40, 41, -1, -1, -1, -1, -1,
2639 -1, -1, -1, -1, -1, -1, -1, -1, 55, -1,
2640 7, 8, 59, 10, 11, 12, 13, 14, 15, 16,
2641 17, -1, 19, 20, -1, 22, 23, 24, 75, 76,
2642 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2643 87, 88, 89, 90, 91, 92, 93, -1, -1, -1,
2644 -1, -1, -1, 50, -1, -1, -1, -1, -1, -1,
2645 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2646 -1, -1, 119, 120, 121, 122, 123, 124, 125, 126,
2647 127, 128, 129, 130, 131, -1, 133, -1, 135, 136,
2648 137, -1, 139, 140, -1, -1, -1, -1, -1, -1,
2649 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2650 -1, -1, -1, -1, 161, -1, -1, -1, -1, -1,
2651 167, -1, -1, 170, -1, 172, -1, 174, 3, 4,
2652 5, 6, 7, 8, 9, -1, -1, -1, -1, -1,
2653 -1, -1, -1, -1, 19, 20, -1, 22, 23, 24,
2654 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
2655 -1, -1, -1, -1, -1, 40, 41, -1, -1, 166,
2656 167, -1, -1, 170, -1, 172, 173, -1, -1, -1,
2657 55, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2658 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2659 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2660 85, 86, 87, 88, 89, 90, 91, 92, 93, -1,
2661 -1, -1, -1, -1, 50, -1, -1, -1, -1, -1,
2662 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2663 -1, -1, -1, -1, 119, 120, 121, 122, 123, 124,
2664 125, 126, 127, 128, 129, 130, 131, -1, 133, -1,
2665 135, 136, 137, -1, 139, 140, -1, -1, -1, -1,
2666 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2667 -1, -1, -1, -1, -1, -1, 161, -1, -1, -1,
2668 165, -1, 167, -1, -1, 170, -1, 172, -1, 174,
2669 3, 4, 5, 6, 7, 8, 9, -1, -1, -1,
2670 -1, -1, -1, -1, -1, -1, 19, 20, -1, 22,
2671 23, 24, 25, 26, 27, -1, -1, -1, -1, -1,
2672 -1, -1, -1, -1, -1, -1, -1, 40, 41, -1,
2673 166, 167, -1, -1, 170, -1, 172, 173, -1, -1,
2674 -1, -1, 55, 7, 8, -1, 10, 11, 12, 13,
2675 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2676 24, -1, 75, 76, 77, 78, 79, 80, 81, 82,
2677 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2678 93, -1, -1, -1, -1, -1, 50, -1, -1, -1,
2679 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2680 -1, -1, -1, -1, -1, -1, 119, 120, 121, 122,
2681 123, 124, 125, 126, 127, 128, 129, 130, 131, -1,
2682 133, -1, 135, 136, 137, -1, 139, 140, -1, -1,
2683 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2684 -1, -1, -1, -1, -1, -1, -1, -1, 161, -1,
2685 -1, -1, -1, -1, 167, -1, -1, 170, -1, 172,
2686 -1, 174, 3, 4, 5, 6, 7, 8, 9, -1,
2687 -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
2688 -1, 22, 23, 24, 25, 26, 27, -1, -1, -1,
2689 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2690 41, 0, 166, 167, -1, -1, 170, -1, 172, 173,
2691 -1, -1, -1, -1, -1, -1, -1, -1, 59, 18,
2692 19, 20, -1, 22, 23, 24, -1, -1, -1, -1,
2693 -1, 30, 31, -1, 75, 76, 77, 78, 79, 80,
2694 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2695 91, 92, 93, 52, -1, -1, -1, 56, -1, -1,
2696 -1, 60, -1, -1, -1, -1, -1, -1, -1, -1,
2697 -1, -1, -1, -1, -1, -1, -1, -1, 119, 120,
2698 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
2699 131, -1, 133, -1, 135, 136, 137, -1, 139, 140,
2700 3, 4, 5, 6, -1, -1, 9, -1, -1, -1,
2701 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2702 -1, -1, 25, 26, 27, -1, 167, -1, -1, 170,
2703 -1, 172, -1, 174, -1, -1, -1, 40, 41, -1,
2704 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2705 -1, -1, -1, -1, 7, 8, 59, 10, 11, 12,
2706 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2707 23, 24, 75, 76, 77, 78, 79, 80, 81, 82,
2708 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
2709 93, -1, -1, -1, -1, 7, 8, 50, 10, 11,
2710 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2711 22, 23, 24, -1, -1, -1, 119, 120, 121, 122,
2712 123, 124, 125, 126, 127, 128, 129, 130, 131, -1,
2713 133, -1, 135, 136, 137, -1, 139, 140, 50, -1,
2714 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2715 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2716 -1, -1, -1, -1, 167, -1, -1, 170, -1, 172,
2717 -1, 174, 39, -1, -1, -1, -1, -1, -1, -1,
2718 -1, -1, -1, 50, 7, 8, -1, 10, 11, 12,
2719 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2720 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2721 -1, -1, -1, 166, 167, -1, -1, 170, -1, 172,
2722 173, -1, -1, -1, -1, -1, -1, 50, -1, 141,
2723 142, -1, 144, 7, 8, -1, 10, 11, 12, 13,
2724 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2725 24, -1, -1, -1, 166, 167, -1, -1, 170, -1,
2726 172, -1, -1, -1, -1, 39, -1, -1, -1, -1,
2727 -1, -1, -1, -1, 7, 8, 50, 10, 11, 12,
2728 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2729 23, 24, -1, -1, -1, -1, -1, -1, -1, 166,
2730 167, -1, 125, 170, -1, 172, -1, -1, -1, -1,
2731 -1, -1, -1, -1, -1, 7, 8, 50, 10, 11,
2732 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2733 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2734 -1, -1, -1, 166, 167, -1, -1, 170, -1, 172,
2735 -1, -1, -1, -1, -1, -1, 7, 8, 50, 10,
2736 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2737 -1, 22, 23, 24, 7, 8, -1, 10, 11, 12,
2738 13, 14, 15, 16, 17, -1, 19, 20, 39, 22,
2739 23, 24, 166, 167, -1, -1, 170, -1, 172, 50,
2740 -1, -1, -1, -1, -1, -1, 39, -1, -1, -1,
2741 -1, -1, -1, -1, -1, 7, 8, 50, 10, 11,
2742 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2743 22, 23, 24, 166, 167, -1, 169, 170, -1, 172,
2744 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2745 17, -1, 19, 20, -1, 22, 23, 24, 50, -1,
2746 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2747 -1, -1, -1, -1, 166, 167, -1, 169, 170, -1,
2748 172, 7, 8, 50, 10, 11, 12, 13, 14, 15,
2749 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2750 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2751 -1, -1, -1, -1, -1, 166, 167, -1, -1, 170,
2752 -1, 172, -1, -1, 50, -1, -1, -1, -1, -1,
2753 -1, -1, -1, 166, 167, -1, -1, 170, -1, 172,
2754 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2755 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2756 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2757 -1, -1, -1, -1, 166, 167, -1, -1, 170, -1,
2758 172, 7, 8, 50, 10, 11, 12, 13, 14, 15,
2759 16, 17, -1, 19, 20, -1, 22, 23, 24, 166,
2760 167, -1, -1, 170, -1, 172, 7, 8, -1, 10,
2761 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2762 -1, 22, 23, 24, 50, -1, -1, -1, -1, -1,
2763 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2764 166, 167, -1, -1, 170, -1, 172, 7, 8, 50,
2765 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2766 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2767 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2768 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2769 50, -1, -1, -1, -1, -1, -1, -1, -1, 166,
2770 167, -1, -1, 170, -1, 172, -1, -1, -1, -1,
2771 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2772 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2773 -1, -1, -1, -1, -1, -1, -1, -1, -1, 36,
2774 166, 167, -1, -1, 170, -1, 172, -1, -1, -1,
2775 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2776 57, 58, -1, -1, -1, 166, 167, -1, -1, 170,
2777 -1, 172, 69, 70, 71, 72, 73, 74, 75, 76,
2778 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2779 87, 88, 89, 90, 91, 92, 93, -1, -1, -1,
2780 -1, -1, -1, -1, -1, -1, 166, 167, -1, -1,
2781 170, -1, 172, -1, -1, -1, -1, 114, 115, 116,
2782 -1, -1, 119, 120, 121, 122, 123, 124, 125, 126,
2783 127, 128, 129, 130, 131, 132, 133, 134, 135, 136,
2787 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2788 symbol of state STATE-NUM. */
2789 static const yytype_uint16 yystos[] =
2791 0, 19, 20, 22, 23, 24, 30, 31, 52, 56,
2792 60, 181, 184, 186, 187, 188, 222, 223, 224, 226,
2793 225, 53, 68, 231, 163, 59, 163, 18, 163, 42,
2794 43, 44, 45, 46, 47, 48, 49, 51, 158, 159,
2795 160, 189, 190, 191, 0, 224, 46, 48, 192, 241,
2796 42, 43, 44, 47, 193, 238, 240, 248, 163, 163,
2797 167, 232, 22, 230, 7, 8, 10, 11, 12, 13,
2798 14, 15, 16, 17, 50, 166, 167, 170, 172, 181,
2799 186, 209, 210, 244, 191, 191, 35, 37, 220, 191,
2800 191, 21, 249, 250, 29, 173, 239, 249, 22, 22,
2801 22, 233, 161, 4, 4, 4, 172, 10, 173, 210,
2802 215, 55, 161, 183, 220, 220, 42, 44, 194, 32,
2803 33, 219, 62, 63, 64, 65, 66, 67, 195, 236,
2804 236, 7, 184, 185, 253, 164, 169, 39, 210, 211,
2805 213, 214, 168, 168, 173, 215, 164, 173, 161, 214,
2806 165, 219, 219, 10, 125, 210, 212, 221, 210, 216,
2807 4, 199, 28, 172, 237, 163, 36, 57, 58, 69,
2808 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
2809 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2810 90, 91, 92, 93, 114, 115, 116, 119, 120, 121,
2811 122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
2812 132, 133, 134, 135, 136, 137, 138, 139, 140, 176,
2813 177, 178, 251, 258, 259, 260, 261, 251, 259, 22,
2814 197, 164, 162, 210, 210, 171, 173, 210, 4, 162,
2815 216, 210, 161, 244, 3, 4, 5, 6, 9, 25,
2816 26, 27, 40, 41, 90, 91, 92, 93, 119, 133,
2817 135, 136, 137, 139, 140, 167, 170, 172, 174, 176,
2818 177, 178, 217, 244, 183, 141, 142, 144, 198, 212,
2819 57, 10, 210, 246, 247, 11, 17, 11, 195, 94,
2820 95, 96, 97, 98, 99, 100, 101, 102, 103, 179,
2821 26, 27, 100, 101, 102, 103, 104, 105, 106, 107,
2822 108, 109, 110, 111, 112, 113, 180, 179, 180, 210,
2823 210, 246, 210, 210, 254, 246, 246, 246, 246, 246,
2824 210, 210, 210, 210, 210, 246, 195, 117, 118, 54,
2825 121, 122, 141, 142, 144, 145, 147, 148, 149, 196,
2826 39, 211, 201, 169, 171, 171, 162, 201, 183, 183,
2827 221, 179, 180, 179, 180, 161, 161, 161, 161, 161,
2828 161, 161, 169, 216, 218, 172, 218, 173, 218, 22,
2829 161, 161, 161, 227, 186, 3, 4, 5, 6, 9,
2830 25, 26, 27, 40, 41, 59, 167, 170, 172, 174,
2831 217, 243, 244, 245, 164, 245, 245, 245, 199, 210,
2832 210, 210, 210, 164, 204, 164, 204, 245, 167, 164,
2833 164, 164, 164, 164, 164, 245, 245, 245, 245, 245,
2834 38, 199, 210, 246, 4, 141, 142, 143, 144, 146,
2835 150, 151, 153, 154, 155, 156, 157, 200, 228, 229,
2836 38, 161, 161, 161, 161, 216, 216, 216, 216, 216,
2837 216, 216, 164, 169, 173, 210, 218, 171, 173, 216,
2838 216, 216, 164, 207, 161, 61, 242, 169, 218, 172,
2839 218, 173, 218, 22, 246, 164, 164, 212, 245, 245,
2840 245, 245, 11, 54, 11, 256, 245, 167, 246, 210,
2841 246, 246, 246, 164, 164, 257, 164, 164, 164, 210,
2842 212, 245, 164, 207, 207, 210, 216, 216, 216, 216,
2843 256, 164, 164, 164, 164, 257, 164, 216, 171, 173,
2844 164, 164, 38, 34, 54, 205, 208, 39, 210, 234,
2845 235, 22, 169, 173, 218, 171, 173, 17, 17, 245,
2846 164, 164, 164, 164, 245, 4, 245, 164, 164, 245,
2847 164, 164, 164, 4, 4, 164, 210, 245, 245, 245,
2848 164, 204, 210, 162, 164, 164, 164, 164, 162, 216,
2849 216, 216, 216, 162, 216, 171, 216, 216, 210, 22,
2850 4, 207, 197, 164, 162, 164, 171, 173, 245, 245,
2851 161, 245, 245, 245, 245, 204, 204, 246, 245, 164,
2852 246, 246, 246, 4, 245, 161, 245, 216, 216, 216,
2853 216, 164, 162, 164, 164, 257, 162, 162, 162, 181,
2854 182, 39, 210, 201, 22, 171, 164, 167, 17, 210,
2855 255, 169, 245, 257, 255, 204, 162, 162, 162, 162,
2856 216, 216, 216, 162, 197, 205, 206, 17, 11, 169,
2857 252, 197, 197, 162, 164, 169, 162, 162, 162, 162,
2858 182, 54, 203, 245, 243, 11, 169, 121, 122, 245,
2859 245, 201, 17, 210, 201, 4, 152, 202, 164, 243,
2860 197, 197, 38, 197, 197, 22, 17, 164, 17, 245,
2861 245, 245, 17, 245, 197, 197, 245, 73, 17, 245
2864 #define yyerrok (yyerrstatus = 0)
2865 #define yyclearin (yychar = YYEMPTY)
2866 #define YYEMPTY (-2)
2869 #define YYACCEPT goto yyacceptlab
2870 #define YYABORT goto yyabortlab
2871 #define YYERROR goto yyerrorlab
2874 /* Like YYERROR except do call yyerror. This remains here temporarily
2875 to ease the transition to the new meaning of YYERROR, for GCC.
2876 Once GCC version 2 has supplanted version 1, this can go. */
2878 #define YYFAIL goto yyerrlab
2880 #define YYRECOVERING() (!!yyerrstatus)
2882 #define YYBACKUP(Token, Value) \
2884 if (yychar == YYEMPTY && yylen == 1) \
2888 yytoken = YYTRANSLATE (yychar); \
2894 yyerror (YY_("syntax error: cannot back up")); \
2901 #define YYERRCODE 256
2904 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2905 If N is 0, then set CURRENT to the empty location which ends
2906 the previous symbol: RHS[0] (always defined). */
2908 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2909 #ifndef YYLLOC_DEFAULT
2910 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2914 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2915 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2916 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2917 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2921 (Current).first_line = (Current).last_line = \
2922 YYRHSLOC (Rhs, 0).last_line; \
2923 (Current).first_column = (Current).last_column = \
2924 YYRHSLOC (Rhs, 0).last_column; \
2930 /* YY_LOCATION_PRINT -- Print the location on the stream.
2931 This macro was not mandated originally: define only if we know
2932 we won't break user code: when these are the locations we know. */
2934 #ifndef YY_LOCATION_PRINT
2935 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2936 # define YY_LOCATION_PRINT(File, Loc) \
2937 fprintf (File, "%d.%d-%d.%d", \
2938 (Loc).first_line, (Loc).first_column, \
2939 (Loc).last_line, (Loc).last_column)
2941 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2946 /* YYLEX -- calling `yylex' with the right arguments. */
2949 # define YYLEX yylex (YYLEX_PARAM)
2951 # define YYLEX yylex ()
2954 /* Enable debugging if requested. */
2958 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2959 # define YYFPRINTF fprintf
2962 # define YYDPRINTF(Args) \
2968 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2972 YYFPRINTF (stderr, "%s ", Title); \
2973 yy_symbol_print (stderr, \
2975 YYFPRINTF (stderr, "\n"); \
2980 /*--------------------------------.
2981 | Print this symbol on YYOUTPUT. |
2982 `--------------------------------*/
2985 #if (defined __STDC__ || defined __C99__FUNC__ \
2986 || defined __cplusplus || defined _MSC_VER)
2988 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2991 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2994 YYSTYPE const * const yyvaluep;
3000 if (yytype < YYNTOKENS)
3001 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
3013 /*--------------------------------.
3014 | Print this symbol on YYOUTPUT. |
3015 `--------------------------------*/
3017 #if (defined __STDC__ || defined __C99__FUNC__ \
3018 || defined __cplusplus || defined _MSC_VER)
3020 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
3023 yy_symbol_print (yyoutput, yytype, yyvaluep)
3026 YYSTYPE const * const yyvaluep;
3029 if (yytype < YYNTOKENS)
3030 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
3032 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
3034 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
3035 YYFPRINTF (yyoutput, ")");
3038 /*------------------------------------------------------------------.
3039 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
3041 `------------------------------------------------------------------*/
3043 #if (defined __STDC__ || defined __C99__FUNC__ \
3044 || defined __cplusplus || defined _MSC_VER)
3046 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
3049 yy_stack_print (bottom, top)
3050 yytype_int16 *bottom;
3054 YYFPRINTF (stderr, "Stack now");
3055 for (; bottom <= top; ++bottom)
3056 YYFPRINTF (stderr, " %d", *bottom);
3057 YYFPRINTF (stderr, "\n");
3060 # define YY_STACK_PRINT(Bottom, Top) \
3063 yy_stack_print ((Bottom), (Top)); \
3067 /*------------------------------------------------.
3068 | Report that the YYRULE is going to be reduced. |
3069 `------------------------------------------------*/
3071 #if (defined __STDC__ || defined __C99__FUNC__ \
3072 || defined __cplusplus || defined _MSC_VER)
3074 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
3077 yy_reduce_print (yyvsp, yyrule)
3082 int yynrhs = yyr2[yyrule];
3084 unsigned long int yylno = yyrline[yyrule];
3085 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
3087 /* The symbols being reduced. */
3088 for (yyi = 0; yyi < yynrhs; yyi++)
3090 fprintf (stderr, " $%d = ", yyi + 1);
3091 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
3092 &(yyvsp[(yyi + 1) - (yynrhs)])
3094 fprintf (stderr, "\n");
3098 # define YY_REDUCE_PRINT(Rule) \
3101 yy_reduce_print (yyvsp, Rule); \
3104 /* Nonzero means print parse trace. It is left uninitialized so that
3105 multiple parsers can coexist. */
3107 #else /* !YYDEBUG */
3108 # define YYDPRINTF(Args)
3109 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
3110 # define YY_STACK_PRINT(Bottom, Top)
3111 # define YY_REDUCE_PRINT(Rule)
3112 #endif /* !YYDEBUG */
3115 /* YYINITDEPTH -- initial size of the parser's stacks. */
3117 # define YYINITDEPTH 200
3120 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
3121 if the built-in stack extension method is used).
3123 Do not make this value too large; the results are undefined if
3124 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
3125 evaluated with infinite-precision integer arithmetic. */
3128 # define YYMAXDEPTH 10000
3136 # if defined __GLIBC__ && defined _STRING_H
3137 # define yystrlen strlen
3139 /* Return the length of YYSTR. */
3140 #if (defined __STDC__ || defined __C99__FUNC__ \
3141 || defined __cplusplus || defined _MSC_VER)
3143 yystrlen (const char *yystr)
3151 for (yylen = 0; yystr[yylen]; yylen++)
3159 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
3160 # define yystpcpy stpcpy
3162 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
3164 #if (defined __STDC__ || defined __C99__FUNC__ \
3165 || defined __cplusplus || defined _MSC_VER)
3167 yystpcpy (char *yydest, const char *yysrc)
3170 yystpcpy (yydest, yysrc)
3176 const char *yys = yysrc;
3178 while ((*yyd++ = *yys++) != '\0')
3187 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
3188 quotes and backslashes, so that it's suitable for yyerror. The
3189 heuristic is that double-quoting is unnecessary unless the string
3190 contains an apostrophe, a comma, or backslash (other than
3191 backslash-backslash). YYSTR is taken from yytname. If YYRES is
3192 null, do not copy; instead, return the length of what the result
3195 yytnamerr (char *yyres, const char *yystr)
3200 char const *yyp = yystr;
3207 goto do_not_strip_quotes;
3211 goto do_not_strip_quotes;
3224 do_not_strip_quotes: ;
3228 return yystrlen (yystr);
3230 return yystpcpy (yyres, yystr) - yyres;
3234 /* Copy into YYRESULT an error message about the unexpected token
3235 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3236 including the terminating null byte. If YYRESULT is null, do not
3237 copy anything; just return the number of bytes that would be
3238 copied. As a special case, return 0 if an ordinary "syntax error"
3239 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3240 size calculation. */
3242 yysyntax_error (char *yyresult, int yystate, int yychar)
3244 int yyn = yypact[yystate];
3246 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3250 int yytype = YYTRANSLATE (yychar);
3251 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3252 YYSIZE_T yysize = yysize0;
3254 int yysize_overflow = 0;
3255 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3256 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3260 /* This is so xgettext sees the translatable formats that are
3261 constructed on the fly. */
3262 YY_("syntax error, unexpected %s");
3263 YY_("syntax error, unexpected %s, expecting %s");
3264 YY_("syntax error, unexpected %s, expecting %s or %s");
3265 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3266 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3270 static char const yyunexpected[] = "syntax error, unexpected %s";
3271 static char const yyexpecting[] = ", expecting %s";
3272 static char const yyor[] = " or %s";
3273 char yyformat[sizeof yyunexpected
3274 + sizeof yyexpecting - 1
3275 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3276 * (sizeof yyor - 1))];
3277 char const *yyprefix = yyexpecting;
3279 /* Start YYX at -YYN if negative to avoid negative indexes in
3281 int yyxbegin = yyn < 0 ? -yyn : 0;
3283 /* Stay within bounds of both yycheck and yytname. */
3284 int yychecklim = YYLAST - yyn + 1;
3285 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3288 yyarg[0] = yytname[yytype];
3289 yyfmt = yystpcpy (yyformat, yyunexpected);
3291 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3292 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3294 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3298 yyformat[sizeof yyunexpected - 1] = '\0';
3301 yyarg[yycount++] = yytname[yyx];
3302 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3303 yysize_overflow |= (yysize1 < yysize);
3305 yyfmt = yystpcpy (yyfmt, yyprefix);
3309 yyf = YY_(yyformat);
3310 yysize1 = yysize + yystrlen (yyf);
3311 yysize_overflow |= (yysize1 < yysize);
3314 if (yysize_overflow)
3315 return YYSIZE_MAXIMUM;
3319 /* Avoid sprintf, as that infringes on the user's name space.
3320 Don't have undefined behavior even if the translation
3321 produced a string with the wrong number of "%s"s. */
3322 char *yyp = yyresult;
3324 while ((*yyp = *yyf) != '\0')
3326 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3328 yyp += yytnamerr (yyp, yyarg[yyi++]);
3341 #endif /* YYERROR_VERBOSE */
3344 /*-----------------------------------------------.
3345 | Release the memory associated to this symbol. |
3346 `-----------------------------------------------*/
3349 #if (defined __STDC__ || defined __C99__FUNC__ \
3350 || defined __cplusplus || defined _MSC_VER)
3352 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3355 yydestruct (yymsg, yytype, yyvaluep)
3365 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3376 /* Prevent warnings from -Wmissing-prototypes. */
3378 #ifdef YYPARSE_PARAM
3379 #if defined __STDC__ || defined __cplusplus
3380 int yyparse (void *YYPARSE_PARAM);
3384 #else /* ! YYPARSE_PARAM */
3385 #if defined __STDC__ || defined __cplusplus
3390 #endif /* ! YYPARSE_PARAM */
3394 /* The look-ahead symbol. */
3397 /* The semantic value of the look-ahead symbol. */
3400 /* Number of syntax errors so far. */
3409 #ifdef YYPARSE_PARAM
3410 #if (defined __STDC__ || defined __C99__FUNC__ \
3411 || defined __cplusplus || defined _MSC_VER)
3413 yyparse (void *YYPARSE_PARAM)
3416 yyparse (YYPARSE_PARAM)
3417 void *YYPARSE_PARAM;
3419 #else /* ! YYPARSE_PARAM */
3420 #if (defined __STDC__ || defined __C99__FUNC__ \
3421 || defined __cplusplus || defined _MSC_VER)
3435 /* Number of tokens to shift before error messages enabled. */
3437 /* Look-ahead token as an internal (translated) token number. */
3440 /* Buffer for error messages, and its allocated size. */
3442 char *yymsg = yymsgbuf;
3443 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3446 /* Three stacks and their tools:
3447 `yyss': related to states,
3448 `yyvs': related to semantic values,
3449 `yyls': related to locations.
3451 Refer to the stacks thru separate pointers, to allow yyoverflow
3452 to reallocate them elsewhere. */
3454 /* The state stack. */
3455 yytype_int16 yyssa[YYINITDEPTH];
3456 yytype_int16 *yyss = yyssa;
3457 yytype_int16 *yyssp;
3459 /* The semantic value stack. */
3460 YYSTYPE yyvsa[YYINITDEPTH];
3461 YYSTYPE *yyvs = yyvsa;
3466 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3468 YYSIZE_T yystacksize = YYINITDEPTH;
3470 /* The variables used to return semantic value and location from the
3475 /* The number of symbols on the RHS of the reduced rule.
3476 Keep to zero when no symbol should be popped. */
3479 YYDPRINTF ((stderr, "Starting parse\n"));
3484 yychar = YYEMPTY; /* Cause a token to be read. */
3486 /* Initialize stack pointers.
3487 Waste one element of value and location stack
3488 so that they stay on the same level as the state stack.
3489 The wasted elements are never initialized. */
3496 /*------------------------------------------------------------.
3497 | yynewstate -- Push a new state, which is found in yystate. |
3498 `------------------------------------------------------------*/
3500 /* In all cases, when you get here, the value and location stacks
3501 have just been pushed. So pushing a state here evens the stacks. */
3507 if (yyss + yystacksize - 1 <= yyssp)
3509 /* Get the current used size of the three stacks, in elements. */
3510 YYSIZE_T yysize = yyssp - yyss + 1;
3514 /* Give user a chance to reallocate the stack. Use copies of
3515 these so that the &'s don't force the real ones into
3517 YYSTYPE *yyvs1 = yyvs;
3518 yytype_int16 *yyss1 = yyss;
3521 /* Each stack pointer address is followed by the size of the
3522 data in use in that stack, in bytes. This used to be a
3523 conditional around just the two extra args, but that might
3524 be undefined if yyoverflow is a macro. */
3525 yyoverflow (YY_("memory exhausted"),
3526 &yyss1, yysize * sizeof (*yyssp),
3527 &yyvs1, yysize * sizeof (*yyvsp),
3534 #else /* no yyoverflow */
3535 # ifndef YYSTACK_RELOCATE
3536 goto yyexhaustedlab;
3538 /* Extend the stack our own way. */
3539 if (YYMAXDEPTH <= yystacksize)
3540 goto yyexhaustedlab;
3542 if (YYMAXDEPTH < yystacksize)
3543 yystacksize = YYMAXDEPTH;
3546 yytype_int16 *yyss1 = yyss;
3547 union yyalloc *yyptr =
3548 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3550 goto yyexhaustedlab;
3551 YYSTACK_RELOCATE (yyss);
3552 YYSTACK_RELOCATE (yyvs);
3554 # undef YYSTACK_RELOCATE
3556 YYSTACK_FREE (yyss1);
3559 #endif /* no yyoverflow */
3561 yyssp = yyss + yysize - 1;
3562 yyvsp = yyvs + yysize - 1;
3565 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3566 (unsigned long int) yystacksize));
3568 if (yyss + yystacksize - 1 <= yyssp)
3572 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3581 /* Do appropriate processing given the current state. Read a
3582 look-ahead token if we need one and don't already have one. */
3584 /* First try to decide what to do without reference to look-ahead token. */
3585 yyn = yypact[yystate];
3586 if (yyn == YYPACT_NINF)
3589 /* Not known => get a look-ahead token if don't already have one. */
3591 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3592 if (yychar == YYEMPTY)
3594 YYDPRINTF ((stderr, "Reading a token: "));
3598 if (yychar <= YYEOF)
3600 yychar = yytoken = YYEOF;
3601 YYDPRINTF ((stderr, "Now at end of input.\n"));
3605 yytoken = YYTRANSLATE (yychar);
3606 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3609 /* If the proper action on seeing token YYTOKEN is to reduce or to
3610 detect an error, take that action. */
3612 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3617 if (yyn == 0 || yyn == YYTABLE_NINF)
3626 /* Count tokens shifted since error; after three, turn off error
3631 /* Shift the look-ahead token. */
3632 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3634 /* Discard the shifted token unless it is eof. */
3635 if (yychar != YYEOF)
3644 /*-----------------------------------------------------------.
3645 | yydefault -- do the default action for the current state. |
3646 `-----------------------------------------------------------*/
3648 yyn = yydefact[yystate];
3654 /*-----------------------------.
3655 | yyreduce -- Do a reduction. |
3656 `-----------------------------*/
3658 /* yyn is the number of a rule to reduce with. */
3661 /* If YYLEN is nonzero, implement the default value of the action:
3664 Otherwise, the following line sets YYVAL to garbage.
3665 This behavior is undocumented and Bison
3666 users should not rely upon it. Assigning to YYVAL
3667 unconditionally makes the parser a bit smaller, and it avoids a
3668 GCC warning that YYVAL may be used uninitialized. */
3669 yyval = yyvsp[1-yylen];
3672 YY_REDUCE_PRINT (yyn);
3676 #line 1158 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3677 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3681 #line 1158 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3682 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3686 #line 1159 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3687 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3691 #line 1159 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3692 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3696 #line 1160 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3697 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3701 #line 1160 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3702 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3706 #line 1161 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3707 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3711 #line 1161 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3712 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3716 #line 1162 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3717 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3721 #line 1162 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3722 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3726 #line 1166 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3727 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3731 #line 1166 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3732 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3736 #line 1167 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3737 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3741 #line 1167 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3742 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3746 #line 1168 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3747 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3751 #line 1168 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3752 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3756 #line 1169 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3757 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3761 #line 1169 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3762 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3766 #line 1170 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3767 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3771 #line 1170 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3772 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3776 #line 1171 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3777 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3781 #line 1171 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3782 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3786 #line 1172 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3787 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3791 #line 1172 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3792 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3796 #line 1173 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3797 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3801 #line 1174 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3802 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3806 #line 1178 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3807 { (yyval.StrVal) = 0; ;}
3811 #line 1180 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3812 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3816 #line 1181 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3817 { (yyval.UIntVal)=0; ;}
3821 #line 1185 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3823 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3829 #line 1189 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3837 #line 1194 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3839 (yyval.UIntVal) = (yyvsp[(1) - (2)].UIntVal);
3845 #line 1203 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3853 #line 1208 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3855 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3861 #line 1214 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3866 #line 1215 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3871 #line 1216 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3876 #line 1217 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3881 #line 1218 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3886 #line 1219 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.Linkage) = GlobalValue::CommonLinkage; ;}
3891 #line 1223 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3892 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3896 #line 1224 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3897 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3901 #line 1225 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3906 #line 1229 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3907 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3911 #line 1230 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3912 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3916 #line 1231 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3917 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3921 #line 1232 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3922 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3926 #line 1236 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3931 #line 1237 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3932 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3936 #line 1238 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3937 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3941 #line 1242 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3946 #line 1243 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3947 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3951 #line 1244 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3952 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3956 #line 1245 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3957 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3961 #line 1246 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3962 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3966 #line 1250 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3967 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3971 #line 1251 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3972 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3976 #line 1252 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3977 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3981 #line 1255 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3982 { (yyval.UIntVal) = CallingConv::C; ;}
3986 #line 1256 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3987 { (yyval.UIntVal) = CallingConv::C; ;}
3991 #line 1257 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3992 { (yyval.UIntVal) = CallingConv::Fast; ;}
3996 #line 1258 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3997 { (yyval.UIntVal) = CallingConv::Cold; ;}
4001 #line 1259 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4002 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
4006 #line 1260 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4007 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
4011 #line 1261 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4013 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
4014 GEN_ERROR("Calling conv too large");
4015 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4021 #line 1268 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4022 { (yyval.Attributes) = Attribute::ZExt; ;}
4026 #line 1269 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4027 { (yyval.Attributes) = Attribute::ZExt; ;}
4031 #line 1270 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4032 { (yyval.Attributes) = Attribute::SExt; ;}
4036 #line 1271 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4037 { (yyval.Attributes) = Attribute::SExt; ;}
4041 #line 1272 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4042 { (yyval.Attributes) = Attribute::InReg; ;}
4046 #line 1273 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4047 { (yyval.Attributes) = Attribute::StructRet; ;}
4051 #line 1274 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4052 { (yyval.Attributes) = Attribute::NoAlias; ;}
4056 #line 1275 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4057 { (yyval.Attributes) = Attribute::ByVal; ;}
4061 #line 1276 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4062 { (yyval.Attributes) = Attribute::Nest; ;}
4066 #line 1277 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4067 { (yyval.Attributes) =
4068 Attribute::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
4072 #line 1281 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4073 { (yyval.Attributes) = Attribute::None; ;}
4077 #line 1282 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4079 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4084 #line 1287 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4085 { (yyval.Attributes) = Attribute::InReg; ;}
4089 #line 1288 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4090 { (yyval.Attributes) = Attribute::ZExt; ;}
4094 #line 1289 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4095 { (yyval.Attributes) = Attribute::SExt; ;}
4099 #line 1292 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4100 { (yyval.Attributes) = Attribute::None; ;}
4104 #line 1293 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4106 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4111 #line 1299 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4112 { (yyval.Attributes) = Attribute::NoReturn; ;}
4116 #line 1300 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4117 { (yyval.Attributes) = Attribute::NoUnwind; ;}
4121 #line 1301 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4122 { (yyval.Attributes) = Attribute::InReg; ;}
4126 #line 1302 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4127 { (yyval.Attributes) = Attribute::ZExt; ;}
4131 #line 1303 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4132 { (yyval.Attributes) = Attribute::SExt; ;}
4136 #line 1304 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4137 { (yyval.Attributes) = Attribute::ReadNone; ;}
4141 #line 1305 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4142 { (yyval.Attributes) = Attribute::ReadOnly; ;}
4146 #line 1306 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4147 { (yyval.Attributes) = Attribute::NoInline; ;}
4151 #line 1307 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4152 { (yyval.Attributes) = Attribute::AlwaysInline; ;}
4156 #line 1308 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4157 { (yyval.Attributes) = Attribute::OptimizeForSize; ;}
4161 #line 1309 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4162 { (yyval.Attributes) = Attribute::StackProtect; ;}
4166 #line 1310 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4167 { (yyval.Attributes) = Attribute::StackProtectReq; ;}
4171 #line 1313 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4172 { (yyval.Attributes) = Attribute::None; ;}
4176 #line 1314 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4178 (yyval.Attributes) = (yyvsp[(1) - (2)].Attributes) | (yyvsp[(2) - (2)].Attributes);
4183 #line 1320 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4184 { (yyval.StrVal) = 0; ;}
4188 #line 1321 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4190 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4195 #line 1328 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4196 { (yyval.UIntVal) = 0; ;}
4200 #line 1329 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4202 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
4203 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4204 GEN_ERROR("Alignment must be a power of two");
4210 #line 1335 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4211 { (yyval.UIntVal) = 0; ;}
4215 #line 1336 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4217 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
4218 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
4219 GEN_ERROR("Alignment must be a power of two");
4225 #line 1345 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4227 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
4228 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
4229 GEN_ERROR("Invalid character in section name");
4230 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
4236 #line 1353 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4237 { (yyval.StrVal) = 0; ;}
4241 #line 1354 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4242 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
4246 #line 1359 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4251 #line 1360 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4256 #line 1361 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4258 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
4259 delete (yyvsp[(1) - (1)].StrVal);
4265 #line 1366 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4267 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
4268 GEN_ERROR("Alignment must be a power of two");
4269 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4275 #line 1382 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4277 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4283 #line 1386 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4285 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4291 #line 1390 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4293 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4294 GEN_ERROR("Cannot form a pointer to a basic block");
4295 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4296 delete (yyvsp[(1) - (3)].TypeVal);
4302 #line 1397 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4303 { // Named types are also simple types...
4304 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4306 (yyval.TypeVal) = new PATypeHolder(tmp);
4311 #line 1402 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4312 { // Type UpReference
4313 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4314 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4315 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4316 (yyval.TypeVal) = new PATypeHolder(OT);
4317 UR_OUT("New Upreference!\n");
4323 #line 1410 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4325 // Allow but ignore attributes on function types; this permits auto-upgrade.
4326 // FIXME: remove in LLVM 3.0.
4327 const Type *RetTy = *(yyvsp[(1) - (5)].TypeVal);
4328 if (!FunctionType::isValidReturnType(RetTy))
4329 GEN_ERROR("Invalid result type for LLVM function");
4331 std::vector<const Type*> Params;
4332 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4333 for (; I != E; ++I ) {
4334 const Type *Ty = I->Ty->get();
4335 Params.push_back(Ty);
4338 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4339 if (isVarArg) Params.pop_back();
4341 for (unsigned i = 0; i != Params.size(); ++i)
4342 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4343 GEN_ERROR("Function arguments must be value types!");
4347 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4348 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4349 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4351 // Delete the argument list
4352 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4355 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4362 #line 1445 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4364 // Allow but ignore attributes on function types; this permits auto-upgrade.
4365 // FIXME: remove in LLVM 3.0.
4366 std::vector<const Type*> Params;
4367 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4368 for ( ; I != E; ++I ) {
4369 const Type* Ty = I->Ty->get();
4370 Params.push_back(Ty);
4373 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4374 if (isVarArg) Params.pop_back();
4376 for (unsigned i = 0; i != Params.size(); ++i)
4377 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4378 GEN_ERROR("Function arguments must be value types!");
4382 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4383 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4385 // Delete the argument list
4386 for (I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin() ; I != E; ++I ) {
4389 delete (yyvsp[(3) - (5)].TypeWithAttrsList);
4396 #line 1476 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4397 { // Sized array type?
4398 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val))));
4399 delete (yyvsp[(4) - (5)].TypeVal);
4405 #line 1481 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4407 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4408 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4409 GEN_ERROR("Unsigned result not equal to signed result");
4410 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4411 GEN_ERROR("Element type of a VectorType must be primitive");
4412 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4413 delete (yyvsp[(4) - (5)].TypeVal);
4419 #line 1491 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4420 { // Structure type?
4421 std::vector<const Type*> Elements;
4422 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4423 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4424 Elements.push_back(*I);
4426 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4427 delete (yyvsp[(2) - (3)].TypeList);
4433 #line 1501 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4434 { // Empty structure type?
4435 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4441 #line 1505 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4443 std::vector<const Type*> Elements;
4444 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4445 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4446 Elements.push_back(*I);
4448 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4449 delete (yyvsp[(3) - (5)].TypeList);
4455 #line 1515 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4456 { // Empty structure type?
4457 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4463 #line 1522 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4465 // Allow but ignore attributes on function types; this permits auto-upgrade.
4466 // FIXME: remove in LLVM 3.0.
4467 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4468 (yyval.TypeWithAttrs).Attrs = Attribute::None;
4473 #line 1531 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4475 if (!UpRefs.empty())
4476 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4477 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && !isa<StructType>((yyvsp[(1) - (1)].TypeVal)->get()))
4478 GEN_ERROR("LLVM functions cannot return aggregate types");
4479 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4484 #line 1538 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4486 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4491 #line 1543 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4493 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4494 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4500 #line 1548 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4502 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4508 #line 1556 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4510 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4511 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4512 TWA.Ty = new PATypeHolder(Type::VoidTy);
4513 (yyval.TypeWithAttrsList)->push_back(TWA);
4519 #line 1563 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4521 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4522 TypeWithAttrs TWA; TWA.Attrs = Attribute::None;
4523 TWA.Ty = new PATypeHolder(Type::VoidTy);
4524 (yyval.TypeWithAttrsList)->push_back(TWA);
4530 #line 1570 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4532 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4538 #line 1578 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4540 (yyval.TypeList) = new std::list<PATypeHolder>();
4541 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4542 delete (yyvsp[(1) - (1)].TypeVal);
4548 #line 1584 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4550 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4551 delete (yyvsp[(3) - (3)].TypeVal);
4557 #line 1596 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4558 { // Nonempty unsized arr
4559 if (!UpRefs.empty())
4560 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4561 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4563 GEN_ERROR("Cannot make array constant with type: '" +
4564 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4565 const Type *ETy = ATy->getElementType();
4566 uint64_t NumElements = ATy->getNumElements();
4568 // Verify that we have the correct size...
4569 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (4)].ConstVector)->size())
4570 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4571 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4572 utostr(NumElements) + "");
4574 // Verify all elements are correct type!
4575 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4576 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4577 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4578 ETy->getDescription() +"' as required!\nIt is of type '"+
4579 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4582 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4583 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4589 #line 1624 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4591 if (!UpRefs.empty())
4592 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4593 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4595 GEN_ERROR("Cannot make array constant with type: '" +
4596 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4598 uint64_t NumElements = ATy->getNumElements();
4599 if (NumElements != uint64_t(-1) && NumElements != 0)
4600 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4601 " arguments, but has size of " + utostr(NumElements) +"");
4602 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4603 delete (yyvsp[(1) - (3)].TypeVal);
4609 #line 1640 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4611 if (!UpRefs.empty())
4612 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4613 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4615 GEN_ERROR("Cannot make array constant with type: '" +
4616 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4618 uint64_t NumElements = ATy->getNumElements();
4619 const Type *ETy = ATy->getElementType();
4620 if (NumElements != uint64_t(-1) && NumElements != (yyvsp[(3) - (3)].StrVal)->length())
4621 GEN_ERROR("Can't build string constant of size " +
4622 utostr((yyvsp[(3) - (3)].StrVal)->length()) +
4623 " when array has size " + utostr(NumElements) + "");
4624 std::vector<Constant*> Vals;
4625 if (ETy == Type::Int8Ty) {
4626 for (uint64_t i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4627 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4629 delete (yyvsp[(3) - (3)].StrVal);
4630 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4632 delete (yyvsp[(3) - (3)].StrVal);
4633 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4634 delete (yyvsp[(1) - (3)].TypeVal);
4640 #line 1667 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4641 { // Nonempty unsized arr
4642 if (!UpRefs.empty())
4643 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4644 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4646 GEN_ERROR("Cannot make packed constant with type: '" +
4647 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4648 const Type *ETy = PTy->getElementType();
4649 unsigned NumElements = PTy->getNumElements();
4651 // Verify that we have the correct size...
4652 if (NumElements != unsigned(-1) && NumElements != (unsigned)(yyvsp[(3) - (4)].ConstVector)->size())
4653 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4654 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4655 utostr(NumElements) + "");
4657 // Verify all elements are correct type!
4658 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4659 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4660 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4661 ETy->getDescription() +"' as required!\nIt is of type '"+
4662 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4665 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4666 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4672 #line 1695 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4674 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4676 GEN_ERROR("Cannot make struct constant with type: '" +
4677 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4679 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4680 GEN_ERROR("Illegal number of initializers for structure type");
4682 // Check to ensure that constants are compatible with the type initializer!
4683 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4684 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4685 GEN_ERROR("Expected type '" +
4686 STy->getElementType(i)->getDescription() +
4687 "' for element #" + utostr(i) +
4688 " of structure initializer");
4690 // Check to ensure that Type is not packed
4691 if (STy->isPacked())
4692 GEN_ERROR("Unpacked Initializer to vector type '" +
4693 STy->getDescription() + "'");
4695 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4696 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4702 #line 1721 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4704 if (!UpRefs.empty())
4705 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4706 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4708 GEN_ERROR("Cannot make struct constant with type: '" +
4709 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4711 if (STy->getNumContainedTypes() != 0)
4712 GEN_ERROR("Illegal number of initializers for structure type");
4714 // Check to ensure that Type is not packed
4715 if (STy->isPacked())
4716 GEN_ERROR("Unpacked Initializer to vector type '" +
4717 STy->getDescription() + "'");
4719 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4720 delete (yyvsp[(1) - (3)].TypeVal);
4726 #line 1741 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4728 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4730 GEN_ERROR("Cannot make struct constant with type: '" +
4731 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4733 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4734 GEN_ERROR("Illegal number of initializers for structure type");
4736 // Check to ensure that constants are compatible with the type initializer!
4737 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4738 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4739 GEN_ERROR("Expected type '" +
4740 STy->getElementType(i)->getDescription() +
4741 "' for element #" + utostr(i) +
4742 " of structure initializer");
4744 // Check to ensure that Type is packed
4745 if (!STy->isPacked())
4746 GEN_ERROR("Vector initializer to non-vector type '" +
4747 STy->getDescription() + "'");
4749 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4750 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4756 #line 1767 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4758 if (!UpRefs.empty())
4759 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4760 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4762 GEN_ERROR("Cannot make struct constant with type: '" +
4763 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4765 if (STy->getNumContainedTypes() != 0)
4766 GEN_ERROR("Illegal number of initializers for structure type");
4768 // Check to ensure that Type is packed
4769 if (!STy->isPacked())
4770 GEN_ERROR("Vector initializer to non-vector type '" +
4771 STy->getDescription() + "'");
4773 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4774 delete (yyvsp[(1) - (5)].TypeVal);
4780 #line 1787 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4782 if (!UpRefs.empty())
4783 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4784 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4786 GEN_ERROR("Cannot make null pointer constant with type: '" +
4787 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4789 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4790 delete (yyvsp[(1) - (2)].TypeVal);
4796 #line 1799 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4798 if (!UpRefs.empty())
4799 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4800 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4801 delete (yyvsp[(1) - (2)].TypeVal);
4807 #line 1806 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4809 if (!UpRefs.empty())
4810 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4811 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4813 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4815 // ConstExprs can exist in the body of a function, thus creating
4816 // GlobalValues whenever they refer to a variable. Because we are in
4817 // the context of a function, getExistingVal will search the functions
4818 // symbol table instead of the module symbol table for the global symbol,
4819 // which throws things all off. To get around this, we just tell
4820 // getExistingVal that we are at global scope here.
4822 Function *SavedCurFn = CurFun.CurrentFunction;
4823 CurFun.CurrentFunction = 0;
4825 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4828 CurFun.CurrentFunction = SavedCurFn;
4830 // If this is an initializer for a constant pointer, which is referencing a
4831 // (currently) undefined variable, create a stub now that shall be replaced
4832 // in the future with the right type of variable.
4835 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4836 const PointerType *PT = cast<PointerType>(Ty);
4838 // First check to see if the forward references value is already created!
4839 PerModuleInfo::GlobalRefsType::iterator I =
4840 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4842 if (I != CurModule.GlobalRefs.end()) {
4843 V = I->second; // Placeholder already exists, use it...
4844 (yyvsp[(2) - (2)].ValIDVal).destroy();
4847 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4848 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4849 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4850 GEN_ERROR("Invalid reference to global");
4852 // Create the forward referenced global.
4854 if (const FunctionType *FTy =
4855 dyn_cast<FunctionType>(PT->getElementType())) {
4856 GV = Function::Create(FTy, GlobalValue::ExternalWeakLinkage, Name,
4857 CurModule.CurrentModule);
4859 GV = new GlobalVariable(PT->getElementType(), false,
4860 GlobalValue::ExternalWeakLinkage, 0,
4861 Name, CurModule.CurrentModule);
4864 // Keep track of the fact that we have a forward ref to recycle it
4865 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4870 (yyval.ConstVal) = cast<GlobalValue>(V);
4871 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4877 #line 1872 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4879 if (!UpRefs.empty())
4880 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4881 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4882 GEN_ERROR("Mismatched types for constant expression: " +
4883 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4884 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4885 delete (yyvsp[(1) - (2)].TypeVal);
4891 #line 1882 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4893 if (!UpRefs.empty())
4894 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4895 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4896 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4897 GEN_ERROR("Cannot create a null initialized value of this type");
4898 (yyval.ConstVal) = Constant::getNullValue(Ty);
4899 delete (yyvsp[(1) - (2)].TypeVal);
4905 #line 1892 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4906 { // integral constants
4907 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4908 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].SInt64Val)))
4909 GEN_ERROR("Constant value doesn't fit in type");
4910 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].SInt64Val), true);
4912 GEN_ERROR("integer constant must have integer type");
4914 delete (yyvsp[(1) - (2)].TypeVal);
4920 #line 1903 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4921 { // arbitrary precision integer constants
4922 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4923 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4924 GEN_ERROR("Constant value does not fit in type");
4925 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(IT->getBitWidth());
4926 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4928 GEN_ERROR("integer constant must have integer type");
4930 delete (yyvsp[(1) - (2)].TypeVal);
4931 delete (yyvsp[(2) - (2)].APIntVal);
4937 #line 1916 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4938 { // integral constants
4939 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4940 if (!ConstantInt::isValueValidForType(IT, (yyvsp[(2) - (2)].UInt64Val)))
4941 GEN_ERROR("Constant value doesn't fit in type");
4942 (yyval.ConstVal) = ConstantInt::get(IT, (yyvsp[(2) - (2)].UInt64Val), false);
4944 GEN_ERROR("integer constant must have integer type");
4946 delete (yyvsp[(1) - (2)].TypeVal);
4952 #line 1927 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4953 { // arbitrary precision integer constants
4954 if (IntegerType *IT = dyn_cast<IntegerType>((yyvsp[(1) - (2)].TypeVal)->get())) {
4955 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > IT->getBitWidth())
4956 GEN_ERROR("Constant value does not fit in type");
4957 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(IT->getBitWidth());
4958 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4960 GEN_ERROR("integer constant must have integer type");
4963 delete (yyvsp[(2) - (2)].APIntVal);
4964 delete (yyvsp[(1) - (2)].TypeVal);
4970 #line 1941 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4971 { // Boolean constants
4972 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4973 GEN_ERROR("Constant true must have type i1");
4974 (yyval.ConstVal) = ConstantInt::getTrue();
4975 delete (yyvsp[(1) - (2)].TypeVal);
4981 #line 1948 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4982 { // Boolean constants
4983 if ((yyvsp[(1) - (2)].TypeVal)->get() != Type::Int1Ty)
4984 GEN_ERROR("Constant false must have type i1");
4985 (yyval.ConstVal) = ConstantInt::getFalse();
4986 delete (yyvsp[(1) - (2)].TypeVal);
4992 #line 1955 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
4993 { // Floating point constants
4994 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].TypeVal)->get(), *(yyvsp[(2) - (2)].FPVal)))
4995 GEN_ERROR("Floating point constant invalid for type");
4997 // Lexer has no type info, so builds all float and double FP constants
4998 // as double. Fix this here. Long double is done right.
4999 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].TypeVal)->get()==Type::FloatTy) {
5001 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven,
5004 (yyval.ConstVal) = ConstantFP::get(*(yyvsp[(2) - (2)].FPVal));
5005 delete (yyvsp[(1) - (2)].TypeVal);
5006 delete (yyvsp[(2) - (2)].FPVal);
5012 #line 1973 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5014 if (!UpRefs.empty())
5015 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
5016 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5017 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5018 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5019 GEN_ERROR("invalid cast opcode for cast from '" +
5020 Val->getType()->getDescription() + "' to '" +
5021 DestTy->getDescription() + "'");
5022 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5023 delete (yyvsp[(5) - (6)].TypeVal);
5028 #line 1985 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5030 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5031 GEN_ERROR("GetElementPtr requires a pointer operand");
5034 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end());
5036 GEN_ERROR("Index list invalid for constant getelementptr");
5038 SmallVector<Constant*, 8> IdxVec;
5039 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
5040 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
5041 IdxVec.push_back(C);
5043 GEN_ERROR("Indices to constant getelementptr must be constants");
5045 delete (yyvsp[(4) - (5)].ValueList);
5047 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
5053 #line 2006 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5055 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
5056 GEN_ERROR("Select condition must be of boolean type");
5057 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
5058 GEN_ERROR("Select operand types must match");
5059 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5065 #line 2014 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5067 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5068 GEN_ERROR("Binary operator types must match");
5070 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5075 #line 2020 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5077 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
5078 GEN_ERROR("Logical operator types must match");
5079 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
5080 if (!isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
5081 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
5082 GEN_ERROR("Logical operator requires integral operands");
5084 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5090 #line 2031 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5092 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5093 GEN_ERROR("icmp operand types must match");
5094 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5099 #line 2036 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5101 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5102 GEN_ERROR("fcmp operand types must match");
5103 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5108 #line 2041 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5110 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5111 GEN_ERROR("vicmp operand types must match");
5112 (yyval.ConstVal) = ConstantExpr::getVICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5117 #line 2046 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5119 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
5120 GEN_ERROR("vfcmp operand types must match");
5121 (yyval.ConstVal) = ConstantExpr::getVFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
5126 #line 2051 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5128 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
5129 GEN_ERROR("Invalid extractelement operands");
5130 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
5136 #line 2057 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5138 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5139 GEN_ERROR("Invalid insertelement operands");
5140 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5146 #line 2063 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5148 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
5149 GEN_ERROR("Invalid shufflevector operands");
5150 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
5156 #line 2069 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5158 if (!isa<StructType>((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (5)].ConstVal)->getType()))
5159 GEN_ERROR("ExtractValue requires an aggregate operand");
5161 (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size());
5162 delete (yyvsp[(4) - (5)].ConstantList);
5168 #line 2077 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5170 if (!isa<StructType>((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa<ArrayType>((yyvsp[(3) - (7)].ConstVal)->getType()))
5171 GEN_ERROR("InsertValue requires an aggregate operand");
5173 (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size());
5174 delete (yyvsp[(6) - (7)].ConstantList);
5180 #line 2088 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5182 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
5188 #line 2092 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5190 (yyval.ConstVector) = new std::vector<Constant*>();
5191 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
5197 #line 2100 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5198 { (yyval.BoolVal) = false; ;}
5202 #line 2100 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5203 { (yyval.BoolVal) = true; ;}
5207 #line 2103 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5208 { (yyval.BoolVal) = true; ;}
5212 #line 2103 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5213 { (yyval.BoolVal) = false; ;}
5217 #line 2106 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5219 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
5220 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
5222 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
5224 GEN_ERROR("Aliases can be created only to global values");
5226 (yyval.ConstVal) = Aliasee;
5228 delete (yyvsp[(1) - (2)].TypeVal);
5233 #line 2118 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5235 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
5236 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
5237 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
5238 GEN_ERROR("invalid cast opcode for cast from '" +
5239 Val->getType()->getDescription() + "' to '" +
5240 DestTy->getDescription() + "'");
5242 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
5244 delete (yyvsp[(5) - (6)].TypeVal);
5249 #line 2139 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5251 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5252 CurModule.ModuleDone();
5258 #line 2144 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5260 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
5261 CurModule.ModuleDone();
5267 #line 2157 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5268 { CurFun.isDeclare = false; ;}
5272 #line 2157 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5274 CurFun.FunctionDone();
5280 #line 2161 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5281 { CurFun.isDeclare = true; ;}
5285 #line 2161 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5292 #line 2164 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5299 #line 2167 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5301 if (!UpRefs.empty())
5302 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
5303 // Eagerly resolve types. This is not an optimization, this is a
5304 // requirement that is due to the fact that we could have this:
5306 // %list = type { %list * }
5307 // %list = type { %list * } ; repeated type decl
5309 // If types are not resolved eagerly, then the two types will not be
5310 // determined to be the same type!
5312 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
5314 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5316 // If this is a named type that is not a redefinition, add it to the slot
5318 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
5321 delete (yyvsp[(3) - (3)].TypeVal);
5327 #line 2191 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5329 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
5331 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
5333 // If this is a named type that is not a redefinition, add it to the slot
5335 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
5342 #line 2203 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5344 /* "Externally Visible" Linkage */
5345 if ((yyvsp[(5) - (6)].ConstVal) == 0)
5346 GEN_ERROR("Global value initializer is not a constant");
5347 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5348 (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));
5354 #line 2210 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5361 #line 2214 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5363 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5364 GEN_ERROR("Global value initializer is not a constant");
5365 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));
5371 #line 2219 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5378 #line 2223 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5380 if (!UpRefs.empty())
5381 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5382 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));
5384 delete (yyvsp[(6) - (7)].TypeVal);
5389 #line 2229 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5397 #line 2233 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5400 if ((yyvsp[(1) - (5)].StrVal)) {
5401 Name = *(yyvsp[(1) - (5)].StrVal);
5402 delete (yyvsp[(1) - (5)].StrVal);
5405 GEN_ERROR("Alias name cannot be empty");
5407 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5409 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5411 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5412 CurModule.CurrentModule);
5413 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5414 InsertValue(GA, CurModule.Values);
5417 // If there was a forward reference of this alias, resolve it now.
5421 ID = ValID::createGlobalName(Name);
5423 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5425 if (GlobalValue *FWGV =
5426 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5427 // Replace uses of the fwdref with the actual alias.
5428 FWGV->replaceAllUsesWith(GA);
5429 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5430 GV->eraseFromParent();
5432 cast<Function>(FWGV)->eraseFromParent();
5441 #line 2273 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5448 #line 2276 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5455 #line 2282 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5457 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5458 if (AsmSoFar.empty())
5459 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5461 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5462 delete (yyvsp[(1) - (1)].StrVal);
5468 #line 2292 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5470 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5471 delete (yyvsp[(3) - (3)].StrVal);
5476 #line 2296 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5478 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5479 delete (yyvsp[(3) - (3)].StrVal);
5484 #line 2303 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5486 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5487 delete (yyvsp[(3) - (3)].StrVal);
5493 #line 2308 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5495 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5496 delete (yyvsp[(1) - (1)].StrVal);
5502 #line 2313 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5509 #line 2322 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5511 if (!UpRefs.empty())
5512 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5513 if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType())
5514 GEN_ERROR("Argument types must be first-class");
5515 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].Attributes); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5516 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5517 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5523 #line 2332 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5525 if (!UpRefs.empty())
5526 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5527 if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType())
5528 GEN_ERROR("Argument types must be first-class");
5529 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].Attributes); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5530 (yyval.ArgList) = new ArgListType;
5531 (yyval.ArgList)->push_back(E);
5537 #line 2343 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5539 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5545 #line 2347 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5547 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5548 struct ArgListEntry E;
5549 E.Ty = new PATypeHolder(Type::VoidTy);
5551 E.Attrs = Attribute::None;
5552 (yyval.ArgList)->push_back(E);
5558 #line 2356 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5560 (yyval.ArgList) = new ArgListType;
5561 struct ArgListEntry E;
5562 E.Ty = new PATypeHolder(Type::VoidTy);
5564 E.Attrs = Attribute::None;
5565 (yyval.ArgList)->push_back(E);
5571 #line 2365 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5573 (yyval.ArgList) = 0;
5579 #line 2371 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5581 std::string FunctionName(*(yyvsp[(4) - (11)].StrVal));
5582 delete (yyvsp[(4) - (11)].StrVal); // Free strdup'd memory!
5584 // Check the function result for abstractness if this is a define. We should
5585 // have no abstract types at this point
5586 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(3) - (11)].TypeVal)))
5587 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(3) - (11)].TypeVal)->get()->getDescription());
5589 if (!FunctionType::isValidReturnType(*(yyvsp[(3) - (11)].TypeVal)))
5590 GEN_ERROR("Invalid result type for LLVM function");
5592 std::vector<const Type*> ParamTypeList;
5593 SmallVector<AttributeWithIndex, 8> Attrs;
5594 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
5596 Attributes RetAttrs = (yyvsp[(2) - (11)].Attributes);
5597 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None) {
5598 if ((yyvsp[(8) - (11)].Attributes) & Attribute::ZExt) {
5599 RetAttrs = RetAttrs | Attribute::ZExt;
5600 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::ZExt;
5602 if ((yyvsp[(8) - (11)].Attributes) & Attribute::SExt) {
5603 RetAttrs = RetAttrs | Attribute::SExt;
5604 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::SExt;
5606 if ((yyvsp[(8) - (11)].Attributes) & Attribute::InReg) {
5607 RetAttrs = RetAttrs | Attribute::InReg;
5608 (yyvsp[(8) - (11)].Attributes) = (yyvsp[(8) - (11)].Attributes) ^ Attribute::InReg;
5611 if (RetAttrs != Attribute::None)
5612 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
5613 if ((yyvsp[(6) - (11)].ArgList)) { // If there are arguments...
5615 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin(); I != (yyvsp[(6) - (11)].ArgList)->end(); ++I, ++index) {
5616 const Type* Ty = I->Ty->get();
5617 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5618 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5619 ParamTypeList.push_back(Ty);
5620 if (Ty != Type::VoidTy && I->Attrs != Attribute::None)
5621 Attrs.push_back(AttributeWithIndex::get(index, I->Attrs));
5624 if ((yyvsp[(8) - (11)].Attributes) != Attribute::None)
5625 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(8) - (11)].Attributes)));
5627 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5628 if (isVarArg) ParamTypeList.pop_back();
5632 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
5634 FunctionType *FT = FunctionType::get(*(yyvsp[(3) - (11)].TypeVal), ParamTypeList, isVarArg);
5635 const PointerType *PFT = PointerType::getUnqual(FT);
5636 delete (yyvsp[(3) - (11)].TypeVal);
5639 if (!FunctionName.empty()) {
5640 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5642 ID = ValID::createGlobalID(CurModule.Values.size());
5646 // See if this function was forward referenced. If so, recycle the object.
5647 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5648 // Move the function to the end of the list, from whereever it was
5649 // previously inserted.
5650 Fn = cast<Function>(FWRef);
5651 assert(Fn->getAttributes().isEmpty() &&
5652 "Forward reference has parameter attributes!");
5653 CurModule.CurrentModule->getFunctionList().remove(Fn);
5654 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5655 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5656 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5657 if (Fn->getFunctionType() != FT ) {
5658 // The existing function doesn't have the same type. This is an overload
5660 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5661 } else if (Fn->getAttributes() != PAL) {
5662 // The existing function doesn't have the same parameter attributes.
5663 // This is an overload error.
5664 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5665 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5666 // Neither the existing or the current function is a declaration and they
5667 // have the same name and same type. Clearly this is a redefinition.
5668 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5669 } else if (Fn->isDeclaration()) {
5670 // Make sure to strip off any argument names so we can't get conflicts.
5671 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5675 } else { // Not already defined?
5676 Fn = Function::Create(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5677 CurModule.CurrentModule);
5678 InsertValue(Fn, CurModule.Values);
5682 CurFun.FunctionStart(Fn);
5684 if (CurFun.isDeclare) {
5685 // If we have declaration, always overwrite linkage. This will allow us to
5686 // correctly handle cases, when pointer to function is passed as argument to
5687 // another function.
5688 Fn->setLinkage(CurFun.Linkage);
5689 Fn->setVisibility(CurFun.Visibility);
5691 Fn->setCallingConv((yyvsp[(1) - (11)].UIntVal));
5692 Fn->setAttributes(PAL);
5693 Fn->setAlignment((yyvsp[(10) - (11)].UIntVal));
5694 if ((yyvsp[(9) - (11)].StrVal)) {
5695 Fn->setSection(*(yyvsp[(9) - (11)].StrVal));
5696 delete (yyvsp[(9) - (11)].StrVal);
5698 if ((yyvsp[(11) - (11)].StrVal)) {
5699 Fn->setGC((yyvsp[(11) - (11)].StrVal)->c_str());
5700 delete (yyvsp[(11) - (11)].StrVal);
5703 // Add all of the arguments we parsed to the function...
5704 if ((yyvsp[(6) - (11)].ArgList)) { // Is null if empty...
5705 if (isVarArg) { // Nuke the last entry
5706 assert((yyvsp[(6) - (11)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(6) - (11)].ArgList)->back().Name == 0 &&
5707 "Not a varargs marker!");
5708 delete (yyvsp[(6) - (11)].ArgList)->back().Ty;
5709 (yyvsp[(6) - (11)].ArgList)->pop_back(); // Delete the last entry
5711 Function::arg_iterator ArgIt = Fn->arg_begin();
5712 Function::arg_iterator ArgEnd = Fn->arg_end();
5714 for (ArgListType::iterator I = (yyvsp[(6) - (11)].ArgList)->begin();
5715 I != (yyvsp[(6) - (11)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5716 delete I->Ty; // Delete the typeholder...
5717 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5723 delete (yyvsp[(6) - (11)].ArgList); // We're now done with the argument list
5730 #line 2521 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5732 (yyval.FunctionVal) = CurFun.CurrentFunction;
5734 // Make sure that we keep track of the linkage type even if there was a
5735 // previous "declare".
5736 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5737 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5742 #line 2532 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5744 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5750 #line 2537 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5752 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5753 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5754 (yyval.FunctionVal) = CurFun.CurrentFunction;
5755 CurFun.FunctionDone();
5761 #line 2549 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5763 (yyval.BoolVal) = false;
5769 #line 2553 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5771 (yyval.BoolVal) = true;
5777 #line 2558 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5778 { // A reference to a direct constant
5779 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5785 #line 2562 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5787 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5793 #line 2566 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5794 { // arbitrary precision integer constants
5795 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), true);
5796 delete (yyvsp[(1) - (1)].APIntVal);
5802 #line 2571 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5803 { // arbitrary precision integer constants
5804 (yyval.ValIDVal) = ValID::create(*(yyvsp[(1) - (1)].APIntVal), false);
5805 delete (yyvsp[(1) - (1)].APIntVal);
5811 #line 2576 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5812 { // Perhaps it's an FP constant?
5813 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5819 #line 2580 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5821 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5827 #line 2584 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5829 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5835 #line 2588 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5837 (yyval.ValIDVal) = ValID::createNull();
5843 #line 2592 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5845 (yyval.ValIDVal) = ValID::createUndef();
5851 #line 2596 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5852 { // A vector zero constant.
5853 (yyval.ValIDVal) = ValID::createZeroInit();
5859 #line 2600 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5860 { // Nonempty unsized packed vector
5861 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5862 unsigned NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5864 if (!ETy->isInteger() && !ETy->isFloatingPoint())
5865 GEN_ERROR("Invalid vector element type: " + ETy->getDescription());
5867 VectorType* pt = VectorType::get(ETy, NumElements);
5868 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(pt));
5870 // Verify all elements are correct type!
5871 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5872 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5873 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5874 ETy->getDescription() +"' as required!\nIt is of type '" +
5875 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5878 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5879 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5885 #line 2622 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5886 { // Nonempty unsized arr
5887 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5888 uint64_t NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5890 if (!ETy->isFirstClassType())
5891 GEN_ERROR("Invalid array element type: " + ETy->getDescription());
5893 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5894 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(ATy));
5896 // Verify all elements are correct type!
5897 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5898 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5899 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5900 ETy->getDescription() +"' as required!\nIt is of type '"+
5901 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5904 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, *(yyvsp[(2) - (3)].ConstVector)));
5905 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5911 #line 2644 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5913 // Use undef instead of an array because it's inconvenient to determine
5914 // the element type at this point, there being no elements to examine.
5915 (yyval.ValIDVal) = ValID::createUndef();
5921 #line 2650 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5923 uint64_t NumElements = (yyvsp[(2) - (2)].StrVal)->length();
5924 const Type *ETy = Type::Int8Ty;
5926 ArrayType *ATy = ArrayType::get(ETy, NumElements);
5928 std::vector<Constant*> Vals;
5929 for (unsigned i = 0; i < (yyvsp[(2) - (2)].StrVal)->length(); ++i)
5930 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(2) - (2)].StrVal))[i]));
5931 delete (yyvsp[(2) - (2)].StrVal);
5932 (yyval.ValIDVal) = ValID::create(ConstantArray::get(ATy, Vals));
5938 #line 2663 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5940 std::vector<const Type*> Elements((yyvsp[(2) - (3)].ConstVector)->size());
5941 for (unsigned i = 0, e = (yyvsp[(2) - (3)].ConstVector)->size(); i != e; ++i)
5942 Elements[i] = (*(yyvsp[(2) - (3)].ConstVector))[i]->getType();
5944 const StructType *STy = StructType::get(Elements);
5945 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5947 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(2) - (3)].ConstVector)));
5948 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5954 #line 2675 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5956 const StructType *STy = StructType::get(std::vector<const Type*>());
5957 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5963 #line 2680 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5965 std::vector<const Type*> Elements((yyvsp[(3) - (5)].ConstVector)->size());
5966 for (unsigned i = 0, e = (yyvsp[(3) - (5)].ConstVector)->size(); i != e; ++i)
5967 Elements[i] = (*(yyvsp[(3) - (5)].ConstVector))[i]->getType();
5969 const StructType *STy = StructType::get(Elements, /*isPacked=*/true);
5970 PATypeHolder* PTy = new PATypeHolder(HandleUpRefs(STy));
5972 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, *(yyvsp[(3) - (5)].ConstVector)));
5973 delete PTy; delete (yyvsp[(3) - (5)].ConstVector);
5979 #line 2692 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5981 const StructType *STy = StructType::get(std::vector<const Type*>(),
5983 (yyval.ValIDVal) = ValID::create(ConstantStruct::get(STy, std::vector<Constant*>()));
5989 #line 2698 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5991 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5997 #line 2702 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
5999 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
6000 delete (yyvsp[(3) - (5)].StrVal);
6001 delete (yyvsp[(5) - (5)].StrVal);
6007 #line 2712 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6008 { // Is it an integer reference...?
6009 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
6015 #line 2716 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6017 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
6023 #line 2720 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6024 { // Is it a named reference...?
6025 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
6026 delete (yyvsp[(1) - (1)].StrVal);
6032 #line 2725 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6033 { // Is it a named reference...?
6034 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
6035 delete (yyvsp[(1) - (1)].StrVal);
6041 #line 2738 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6043 if (!UpRefs.empty())
6044 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
6045 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
6046 delete (yyvsp[(1) - (2)].TypeVal);
6052 #line 2747 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6054 (yyval.ValueList) = new std::vector<Value *>();
6055 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
6061 #line 2752 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6063 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
6069 #line 2757 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6071 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6077 #line 2761 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6078 { // Do not allow functions with 0 basic blocks
6079 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
6085 #line 2770 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6087 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
6089 InsertValue((yyvsp[(3) - (3)].TermInstVal));
6090 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6091 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6097 #line 2779 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6100 int ValNum = InsertValue((yyvsp[(3) - (3)].TermInstVal));
6101 if (ValNum != (int)(yyvsp[(2) - (3)].UIntVal))
6102 GEN_ERROR("Result value number %" + utostr((yyvsp[(2) - (3)].UIntVal)) +
6103 " is incorrect, expected %" + utostr((unsigned)ValNum));
6105 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
6106 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
6112 #line 2792 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6114 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
6115 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
6116 if (CI2->getParent() == 0)
6117 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
6118 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
6119 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
6125 #line 2801 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6126 { // Empty space between instruction lists
6127 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
6133 #line 2805 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6134 { // Labelled (named) basic block
6135 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
6136 delete (yyvsp[(1) - (1)].StrVal);
6143 #line 2813 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6144 { // Return with a result...
6145 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
6146 assert(!VL.empty() && "Invalid ret operands!");
6147 const Type *ReturnType = CurFun.CurrentFunction->getReturnType();
6148 if (VL.size() > 1 ||
6149 (isa<StructType>(ReturnType) &&
6150 (VL.empty() || VL[0]->getType() != ReturnType))) {
6151 Value *RV = UndefValue::get(ReturnType);
6152 for (unsigned i = 0, e = VL.size(); i != e; ++i) {
6153 Instruction *I = InsertValueInst::Create(RV, VL[i], i, "mrv");
6154 ((yyvsp[(-1) - (2)].BasicBlockVal))->getInstList().push_back(I);
6157 (yyval.TermInstVal) = ReturnInst::Create(RV);
6159 (yyval.TermInstVal) = ReturnInst::Create(VL[0]);
6161 delete (yyvsp[(2) - (2)].ValueList);
6167 #line 2833 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6168 { // Return with no result...
6169 (yyval.TermInstVal) = ReturnInst::Create();
6175 #line 2837 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6176 { // Unconditional Branch...
6177 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
6179 (yyval.TermInstVal) = BranchInst::Create(tmpBB);
6184 #line 2842 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6186 if (cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1)
6187 GEN_ERROR("Branch condition must have type i1");
6188 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6190 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
6192 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
6194 (yyval.TermInstVal) = BranchInst::Create(tmpBBA, tmpBBB, tmpVal);
6199 #line 2853 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6201 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
6203 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
6205 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
6206 (yyval.TermInstVal) = S;
6208 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
6209 E = (yyvsp[(8) - (9)].JumpTable)->end();
6210 for (; I != E; ++I) {
6211 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
6212 S->addCase(CI, I->second);
6214 GEN_ERROR("Switch case is constant, but not a simple integer");
6216 delete (yyvsp[(8) - (9)].JumpTable);
6222 #line 2872 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6224 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
6226 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
6228 SwitchInst *S = SwitchInst::Create(tmpVal, tmpBB, 0);
6229 (yyval.TermInstVal) = S;
6235 #line 2882 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6238 // Handle the short syntax
6239 const PointerType *PFTy = 0;
6240 const FunctionType *Ty = 0;
6241 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (15)].TypeVal)->get())) ||
6242 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6243 // Pull out the types of all of the arguments...
6244 std::vector<const Type*> ParamTypes;
6245 ParamList::iterator I = (yyvsp[(7) - (15)].ParamList)->begin(), E = (yyvsp[(7) - (15)].ParamList)->end();
6246 for (; I != E; ++I) {
6247 const Type *Ty = I->Val->getType();
6248 if (Ty == Type::VoidTy)
6249 GEN_ERROR("Short call syntax cannot be used with varargs");
6250 ParamTypes.push_back(Ty);
6253 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (15)].TypeVal)))
6254 GEN_ERROR("Invalid result type for LLVM function");
6256 Ty = FunctionType::get((yyvsp[(4) - (15)].TypeVal)->get(), ParamTypes, false);
6257 PFTy = PointerType::getUnqual(Ty);
6260 delete (yyvsp[(4) - (15)].TypeVal);
6262 Value *V = getVal(PFTy, (yyvsp[(5) - (15)].ValIDVal)); // Get the function we're calling...
6264 BasicBlock *Normal = getBBVal((yyvsp[(12) - (15)].ValIDVal));
6266 BasicBlock *Except = getBBVal((yyvsp[(15) - (15)].ValIDVal));
6269 SmallVector<AttributeWithIndex, 8> Attrs;
6270 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6272 Attributes RetAttrs = (yyvsp[(3) - (15)].Attributes);
6273 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None) {
6274 if ((yyvsp[(9) - (15)].Attributes) & Attribute::ZExt) {
6275 RetAttrs = RetAttrs | Attribute::ZExt;
6276 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::ZExt;
6278 if ((yyvsp[(9) - (15)].Attributes) & Attribute::SExt) {
6279 RetAttrs = RetAttrs | Attribute::SExt;
6280 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::SExt;
6282 if ((yyvsp[(9) - (15)].Attributes) & Attribute::InReg) {
6283 RetAttrs = RetAttrs | Attribute::InReg;
6284 (yyvsp[(9) - (15)].Attributes) = (yyvsp[(9) - (15)].Attributes) ^ Attribute::InReg;
6287 if (RetAttrs != Attribute::None)
6288 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6290 // Check the arguments
6292 if ((yyvsp[(7) - (15)].ParamList)->empty()) { // Has no arguments?
6293 // Make sure no arguments is a good thing!
6294 if (Ty->getNumParams() != 0)
6295 GEN_ERROR("No arguments passed to a function that "
6296 "expects arguments");
6297 } else { // Has arguments?
6298 // Loop through FunctionType's arguments and ensure they are specified
6300 FunctionType::param_iterator I = Ty->param_begin();
6301 FunctionType::param_iterator E = Ty->param_end();
6302 ParamList::iterator ArgI = (yyvsp[(7) - (15)].ParamList)->begin(), ArgE = (yyvsp[(7) - (15)].ParamList)->end();
6305 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6306 if (ArgI->Val->getType() != *I)
6307 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6308 (*I)->getDescription() + "'");
6309 Args.push_back(ArgI->Val);
6310 if (ArgI->Attrs != Attribute::None)
6311 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6314 if (Ty->isVarArg()) {
6316 for (; ArgI != ArgE; ++ArgI, ++index) {
6317 Args.push_back(ArgI->Val); // push the remaining varargs
6318 if (ArgI->Attrs != Attribute::None)
6319 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6321 } else if (I != E || ArgI != ArgE)
6322 GEN_ERROR("Invalid number of parameters detected");
6324 if ((yyvsp[(9) - (15)].Attributes) != Attribute::None)
6325 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (15)].Attributes)));
6328 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6330 // Create the InvokeInst
6331 InvokeInst *II = InvokeInst::Create(V, Normal, Except,
6332 Args.begin(), Args.end());
6333 II->setCallingConv((yyvsp[(2) - (15)].UIntVal));
6334 II->setAttributes(PAL);
6335 (yyval.TermInstVal) = II;
6336 delete (yyvsp[(7) - (15)].ParamList);
6342 #line 2985 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6344 (yyval.TermInstVal) = new UnwindInst();
6350 #line 2989 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6352 (yyval.TermInstVal) = new UnreachableInst();
6358 #line 2996 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6360 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
6361 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
6364 GEN_ERROR("May only switch on a constant pool value");
6366 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
6368 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6373 #line 3007 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6375 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
6376 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
6380 GEN_ERROR("May only switch on a constant pool value");
6382 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
6384 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
6389 #line 3020 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6391 // Is this definition named?? if so, assign the name...
6392 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
6394 InsertValue((yyvsp[(2) - (2)].InstVal));
6395 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6401 #line 3029 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6404 int ValNum = InsertValue((yyvsp[(2) - (2)].InstVal));
6406 if (ValNum != (int)(yyvsp[(1) - (2)].UIntVal))
6407 GEN_ERROR("Result value number %" + utostr((yyvsp[(1) - (2)].UIntVal)) +
6408 " is incorrect, expected %" + utostr((unsigned)ValNum));
6410 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
6416 #line 3042 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6417 { // Used for PHI nodes
6418 if (!UpRefs.empty())
6419 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
6420 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
6421 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
6423 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6425 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6426 delete (yyvsp[(1) - (6)].TypeVal);
6431 #line 3053 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6433 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
6434 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
6436 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
6438 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
6443 #line 3063 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6445 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6446 if (!UpRefs.empty())
6447 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
6448 // Used for call and invoke instructions
6449 (yyval.ParamList) = new ParamList();
6450 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
6451 (yyval.ParamList)->push_back(E);
6452 delete (yyvsp[(1) - (4)].TypeVal);
6458 #line 3074 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6460 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6461 // Labels are only valid in ASMs
6462 (yyval.ParamList) = new ParamList();
6463 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].Attributes) | (yyvsp[(4) - (4)].Attributes); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
6464 (yyval.ParamList)->push_back(E);
6470 #line 3082 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6472 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6473 if (!UpRefs.empty())
6474 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6475 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6476 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
6477 (yyval.ParamList)->push_back(E);
6478 delete (yyvsp[(3) - (6)].TypeVal);
6484 #line 3092 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6486 // FIXME: Remove trailing OptAttributes in LLVM 3.0, it was a mistake in 2.0
6487 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
6488 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].Attributes) | (yyvsp[(6) - (6)].Attributes); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
6489 (yyval.ParamList)->push_back(E);
6495 #line 3099 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6496 { (yyval.ParamList) = new ParamList(); ;}
6500 #line 3102 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6501 { (yyval.ValueList) = new std::vector<Value*>(); ;}
6505 #line 3103 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6507 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
6508 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
6514 #line 3111 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6516 (yyval.ConstantList) = new std::vector<unsigned>();
6517 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
6518 GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6519 (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val));
6524 #line 3117 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6526 (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList);
6527 if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val))
6528 GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue.");
6529 (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val));
6535 #line 3126 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6537 (yyval.BoolVal) = true;
6543 #line 3130 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6545 (yyval.BoolVal) = false;
6551 #line 3135 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6553 if (!UpRefs.empty())
6554 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6555 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6556 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6558 "Arithmetic operator requires integer, FP, or packed operands");
6559 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6561 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6563 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6564 if ((yyval.InstVal) == 0)
6565 GEN_ERROR("binary operator returned null");
6566 delete (yyvsp[(2) - (5)].TypeVal);
6571 #line 3151 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6573 if (!UpRefs.empty())
6574 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6575 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6576 if (!isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6577 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6578 GEN_ERROR("Logical operator requires integral operands");
6580 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6582 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6584 (yyval.InstVal) = BinaryOperator::Create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6585 if ((yyval.InstVal) == 0)
6586 GEN_ERROR("binary operator returned null");
6587 delete (yyvsp[(2) - (5)].TypeVal);
6592 #line 3168 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6594 if (!UpRefs.empty())
6595 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6596 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6598 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6600 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6601 if ((yyval.InstVal) == 0)
6602 GEN_ERROR("icmp operator returned null");
6603 delete (yyvsp[(3) - (6)].TypeVal);
6608 #line 3180 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6610 if (!UpRefs.empty())
6611 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6612 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6614 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6616 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6617 if ((yyval.InstVal) == 0)
6618 GEN_ERROR("fcmp operator returned null");
6619 delete (yyvsp[(3) - (6)].TypeVal);
6624 #line 3192 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6626 if (!UpRefs.empty())
6627 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6628 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6629 GEN_ERROR("Scalar types not supported by vicmp instruction");
6630 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6632 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6634 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6635 if ((yyval.InstVal) == 0)
6636 GEN_ERROR("vicmp operator returned null");
6637 delete (yyvsp[(3) - (6)].TypeVal);
6642 #line 3206 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6644 if (!UpRefs.empty())
6645 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6646 if (!isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6647 GEN_ERROR("Scalar types not supported by vfcmp instruction");
6648 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6650 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6652 (yyval.InstVal) = CmpInst::Create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6653 if ((yyval.InstVal) == 0)
6654 GEN_ERROR("vfcmp operator returned null");
6655 delete (yyvsp[(3) - (6)].TypeVal);
6660 #line 3220 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6662 if (!UpRefs.empty())
6663 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6664 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6665 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6666 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6667 GEN_ERROR("invalid cast opcode for cast from '" +
6668 Val->getType()->getDescription() + "' to '" +
6669 DestTy->getDescription() + "'");
6670 (yyval.InstVal) = CastInst::Create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6671 delete (yyvsp[(4) - (4)].TypeVal);
6676 #line 3232 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6678 if (isa<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType())) {
6680 if (!isa<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType())
6681 || !isa<VectorType>((yyvsp[(6) - (6)].ValueVal)->getType()) )
6682 GEN_ERROR("vector select value types must be vector types");
6683 const VectorType* cond_type = cast<VectorType>((yyvsp[(2) - (6)].ValueVal)->getType());
6684 const VectorType* select_type = cast<VectorType>((yyvsp[(4) - (6)].ValueVal)->getType());
6685 if (cond_type->getElementType() != Type::Int1Ty)
6686 GEN_ERROR("vector select condition element type must be boolean");
6687 if (cond_type->getNumElements() != select_type->getNumElements())
6688 GEN_ERROR("vector select number of elements must be the same");
6690 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6691 GEN_ERROR("select condition must be boolean");
6693 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6694 GEN_ERROR("select value types must match");
6695 (yyval.InstVal) = SelectInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6701 #line 3253 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6703 if (!UpRefs.empty())
6704 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6705 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6706 delete (yyvsp[(4) - (4)].TypeVal);
6712 #line 3260 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6714 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6715 GEN_ERROR("Invalid extractelement operands");
6716 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6722 #line 3266 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6724 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6725 GEN_ERROR("Invalid insertelement operands");
6726 (yyval.InstVal) = InsertElementInst::Create((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6732 #line 3272 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6734 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6735 GEN_ERROR("Invalid shufflevector operands");
6736 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6742 #line 3278 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6744 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6745 if (!Ty->isFirstClassType())
6746 GEN_ERROR("PHI node operands must be of first class type");
6747 (yyval.InstVal) = PHINode::Create(Ty);
6748 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6749 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6750 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6751 GEN_ERROR("All elements of a PHI node must be of the same type");
6752 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6753 (yyvsp[(2) - (2)].PHIList)->pop_front();
6755 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6761 #line 3294 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6764 // Handle the short syntax
6765 const PointerType *PFTy = 0;
6766 const FunctionType *Ty = 0;
6767 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(4) - (9)].TypeVal)->get())) ||
6768 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6769 // Pull out the types of all of the arguments...
6770 std::vector<const Type*> ParamTypes;
6771 ParamList::iterator I = (yyvsp[(7) - (9)].ParamList)->begin(), E = (yyvsp[(7) - (9)].ParamList)->end();
6772 for (; I != E; ++I) {
6773 const Type *Ty = I->Val->getType();
6774 if (Ty == Type::VoidTy)
6775 GEN_ERROR("Short call syntax cannot be used with varargs");
6776 ParamTypes.push_back(Ty);
6779 if (!FunctionType::isValidReturnType(*(yyvsp[(4) - (9)].TypeVal)))
6780 GEN_ERROR("Invalid result type for LLVM function");
6782 Ty = FunctionType::get((yyvsp[(4) - (9)].TypeVal)->get(), ParamTypes, false);
6783 PFTy = PointerType::getUnqual(Ty);
6786 Value *V = getVal(PFTy, (yyvsp[(5) - (9)].ValIDVal)); // Get the function we're calling...
6789 // Check for call to invalid intrinsic to avoid crashing later.
6790 if (Function *theF = dyn_cast<Function>(V)) {
6791 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6792 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6793 !theF->getIntrinsicID(true))
6794 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6795 theF->getName() + "'");
6798 // Set up the Attributes for the function
6799 SmallVector<AttributeWithIndex, 8> Attrs;
6800 //FIXME : In 3.0, stop accepting zext, sext and inreg as optional function
6802 Attributes RetAttrs = (yyvsp[(3) - (9)].Attributes);
6803 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None) {
6804 if ((yyvsp[(9) - (9)].Attributes) & Attribute::ZExt) {
6805 RetAttrs = RetAttrs | Attribute::ZExt;
6806 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::ZExt;
6808 if ((yyvsp[(9) - (9)].Attributes) & Attribute::SExt) {
6809 RetAttrs = RetAttrs | Attribute::SExt;
6810 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::SExt;
6812 if ((yyvsp[(9) - (9)].Attributes) & Attribute::InReg) {
6813 RetAttrs = RetAttrs | Attribute::InReg;
6814 (yyvsp[(9) - (9)].Attributes) = (yyvsp[(9) - (9)].Attributes) ^ Attribute::InReg;
6817 if (RetAttrs != Attribute::None)
6818 Attrs.push_back(AttributeWithIndex::get(0, RetAttrs));
6820 // Check the arguments
6822 if ((yyvsp[(7) - (9)].ParamList)->empty()) { // Has no arguments?
6823 // Make sure no arguments is a good thing!
6824 if (Ty->getNumParams() != 0)
6825 GEN_ERROR("No arguments passed to a function that "
6826 "expects arguments");
6827 } else { // Has arguments?
6828 // Loop through FunctionType's arguments and ensure they are specified
6829 // correctly. Also, gather any parameter attributes.
6830 FunctionType::param_iterator I = Ty->param_begin();
6831 FunctionType::param_iterator E = Ty->param_end();
6832 ParamList::iterator ArgI = (yyvsp[(7) - (9)].ParamList)->begin(), ArgE = (yyvsp[(7) - (9)].ParamList)->end();
6835 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6836 if (ArgI->Val->getType() != *I)
6837 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6838 (*I)->getDescription() + "'");
6839 Args.push_back(ArgI->Val);
6840 if (ArgI->Attrs != Attribute::None)
6841 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6843 if (Ty->isVarArg()) {
6845 for (; ArgI != ArgE; ++ArgI, ++index) {
6846 Args.push_back(ArgI->Val); // push the remaining varargs
6847 if (ArgI->Attrs != Attribute::None)
6848 Attrs.push_back(AttributeWithIndex::get(index, ArgI->Attrs));
6850 } else if (I != E || ArgI != ArgE)
6851 GEN_ERROR("Invalid number of parameters detected");
6853 if ((yyvsp[(9) - (9)].Attributes) != Attribute::None)
6854 Attrs.push_back(AttributeWithIndex::get(~0, (yyvsp[(9) - (9)].Attributes)));
6856 // Finish off the Attributes and check them
6859 PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
6861 // Create the call node
6862 CallInst *CI = CallInst::Create(V, Args.begin(), Args.end());
6863 CI->setTailCall((yyvsp[(1) - (9)].BoolVal));
6864 CI->setCallingConv((yyvsp[(2) - (9)].UIntVal));
6865 CI->setAttributes(PAL);
6866 (yyval.InstVal) = CI;
6867 delete (yyvsp[(7) - (9)].ParamList);
6868 delete (yyvsp[(4) - (9)].TypeVal);
6874 #line 3403 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6876 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6882 #line 3408 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6884 (yyval.BoolVal) = true;
6890 #line 3412 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6892 (yyval.BoolVal) = false;
6898 #line 3419 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6900 if (!UpRefs.empty())
6901 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6902 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6903 delete (yyvsp[(2) - (3)].TypeVal);
6909 #line 3426 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6911 if (!UpRefs.empty())
6912 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6913 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6914 GEN_ERROR("Malloc array size is not a 32-bit integer!");
6915 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6917 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6918 delete (yyvsp[(2) - (6)].TypeVal);
6923 #line 3436 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6925 if (!UpRefs.empty())
6926 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6927 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6928 delete (yyvsp[(2) - (3)].TypeVal);
6934 #line 3443 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6936 if (!UpRefs.empty())
6937 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6938 if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty)
6939 GEN_ERROR("Alloca array size is not a 32-bit integer!");
6940 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6942 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6943 delete (yyvsp[(2) - (6)].TypeVal);
6948 #line 3453 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6950 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6951 GEN_ERROR("Trying to free nonpointer type " +
6952 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6953 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6959 #line 3461 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6961 if (!UpRefs.empty())
6962 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6963 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6964 GEN_ERROR("Can't load from nonpointer type: " +
6965 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6966 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6967 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6968 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6969 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6971 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6972 delete (yyvsp[(3) - (5)].TypeVal);
6977 #line 3475 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
6979 if (!UpRefs.empty())
6980 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6981 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6983 GEN_ERROR("Can't store to a nonpointer type: " +
6984 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6985 const Type *ElTy = PT->getElementType();
6986 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6987 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6988 "' into space of type '" + ElTy->getDescription() + "'");
6990 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6992 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6993 delete (yyvsp[(5) - (7)].TypeVal);
6998 #line 3492 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
7000 if (!UpRefs.empty())
7001 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
7002 if (!isa<StructType>((yyvsp[(2) - (5)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (5)].TypeVal)->get()))
7003 GEN_ERROR("getresult insn requires an aggregate operand");
7004 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].UInt64Val)))
7005 GEN_ERROR("Invalid getresult index for type '" +
7006 (*(yyvsp[(2) - (5)].TypeVal))->getDescription()+ "'");
7008 Value *tmpVal = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
7010 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(5) - (5)].UInt64Val));
7011 delete (yyvsp[(2) - (5)].TypeVal);
7016 #line 3506 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
7018 if (!UpRefs.empty())
7019 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
7020 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
7021 GEN_ERROR("getelementptr insn requires pointer operand");
7023 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()))
7024 GEN_ERROR("Invalid getelementptr indices for type '" +
7025 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7026 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7028 (yyval.InstVal) = GetElementPtrInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
7029 delete (yyvsp[(2) - (4)].TypeVal);
7030 delete (yyvsp[(4) - (4)].ValueList);
7035 #line 3521 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
7037 if (!UpRefs.empty())
7038 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
7039 if (!isa<StructType>((yyvsp[(2) - (4)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (4)].TypeVal)->get()))
7040 GEN_ERROR("extractvalue insn requires an aggregate operand");
7042 if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()))
7043 GEN_ERROR("Invalid extractvalue indices for type '" +
7044 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
7045 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
7047 (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end());
7048 delete (yyvsp[(2) - (4)].TypeVal);
7049 delete (yyvsp[(4) - (4)].ConstantList);
7054 #line 3536 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
7056 if (!UpRefs.empty())
7057 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription());
7058 if (!isa<StructType>((yyvsp[(2) - (7)].TypeVal)->get()) && !isa<ArrayType>((yyvsp[(2) - (7)].TypeVal)->get()))
7059 GEN_ERROR("extractvalue insn requires an aggregate operand");
7061 if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get())
7062 GEN_ERROR("Invalid insertvalue indices for type '" +
7063 (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'");
7064 Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal));
7065 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
7067 (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end());
7068 delete (yyvsp[(2) - (7)].TypeVal);
7069 delete (yyvsp[(5) - (7)].TypeVal);
7070 delete (yyvsp[(7) - (7)].ConstantList);
7075 /* Line 1267 of yacc.c. */
7076 #line 7077 "llvmAsmParser.tab.c"
7079 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7083 YY_STACK_PRINT (yyss, yyssp);
7088 /* Now `shift' the result of the reduction. Determine what state
7089 that goes to, based on the state we popped back to and the rule
7090 number reduced by. */
7094 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7095 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7096 yystate = yytable[yystate];
7098 yystate = yydefgoto[yyn - YYNTOKENS];
7103 /*------------------------------------.
7104 | yyerrlab -- here on detecting error |
7105 `------------------------------------*/
7107 /* If not already recovering from an error, report this error. */
7111 #if ! YYERROR_VERBOSE
7112 yyerror (YY_("syntax error"));
7115 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7116 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7118 YYSIZE_T yyalloc = 2 * yysize;
7119 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7120 yyalloc = YYSTACK_ALLOC_MAXIMUM;
7121 if (yymsg != yymsgbuf)
7122 YYSTACK_FREE (yymsg);
7123 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7125 yymsg_alloc = yyalloc;
7129 yymsg_alloc = sizeof yymsgbuf;
7133 if (0 < yysize && yysize <= yymsg_alloc)
7135 (void) yysyntax_error (yymsg, yystate, yychar);
7140 yyerror (YY_("syntax error"));
7142 goto yyexhaustedlab;
7150 if (yyerrstatus == 3)
7152 /* If just tried and failed to reuse look-ahead token after an
7153 error, discard it. */
7155 if (yychar <= YYEOF)
7157 /* Return failure if at end of input. */
7158 if (yychar == YYEOF)
7163 yydestruct ("Error: discarding",
7169 /* Else will try to reuse look-ahead token after shifting the error
7174 /*---------------------------------------------------.
7175 | yyerrorlab -- error raised explicitly by YYERROR. |
7176 `---------------------------------------------------*/
7179 /* Pacify compilers like GCC when the user code never invokes
7180 YYERROR and the label yyerrorlab therefore never appears in user
7182 if (/*CONSTCOND*/ 0)
7185 /* Do not reclaim the symbols of the rule which action triggered
7189 YY_STACK_PRINT (yyss, yyssp);
7194 /*-------------------------------------------------------------.
7195 | yyerrlab1 -- common code for both syntax error and YYERROR. |
7196 `-------------------------------------------------------------*/
7198 yyerrstatus = 3; /* Each real token shifted decrements this. */
7202 yyn = yypact[yystate];
7203 if (yyn != YYPACT_NINF)
7206 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7214 /* Pop the current state because it cannot handle the error token. */
7219 yydestruct ("Error: popping",
7220 yystos[yystate], yyvsp);
7223 YY_STACK_PRINT (yyss, yyssp);
7232 /* Shift the error token. */
7233 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7239 /*-------------------------------------.
7240 | yyacceptlab -- YYACCEPT comes here. |
7241 `-------------------------------------*/
7246 /*-----------------------------------.
7247 | yyabortlab -- YYABORT comes here. |
7248 `-----------------------------------*/
7254 /*-------------------------------------------------.
7255 | yyexhaustedlab -- memory exhaustion comes here. |
7256 `-------------------------------------------------*/
7258 yyerror (YY_("memory exhausted"));
7264 if (yychar != YYEOF && yychar != YYEMPTY)
7265 yydestruct ("Cleanup: discarding lookahead",
7267 /* Do not reclaim the symbols of the rule which action triggered
7268 this YYABORT or YYACCEPT. */
7270 YY_STACK_PRINT (yyss, yyssp);
7271 while (yyssp != yyss)
7273 yydestruct ("Cleanup: popping",
7274 yystos[*yyssp], yyvsp);
7279 YYSTACK_FREE (yyss);
7282 if (yymsg != yymsgbuf)
7283 YYSTACK_FREE (yymsg);
7285 /* Make sure YYID is used. */
7286 return YYID (yyresult);
7290 #line 3555 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
7293 // common code from the two 'RunVMAsmParser' functions
7294 static Module* RunParser(Module * M) {
7295 CurModule.CurrentModule = M;
7296 // Check to make sure the parser succeeded
7299 delete ParserResult;
7303 // Emit an error if there are any unresolved types left.
7304 if (!CurModule.LateResolveTypes.empty()) {
7305 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
7306 if (DID.Type == ValID::LocalName) {
7307 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
7309 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
7312 delete ParserResult;
7316 // Emit an error if there are any unresolved values left.
7317 if (!CurModule.LateResolveValues.empty()) {
7318 Value *V = CurModule.LateResolveValues.back();
7319 std::map<Value*, std::pair<ValID, int> >::iterator I =
7320 CurModule.PlaceHolderInfo.find(V);
7322 if (I != CurModule.PlaceHolderInfo.end()) {
7323 ValID &DID = I->second.first;
7324 if (DID.Type == ValID::LocalName) {
7325 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
7327 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
7330 delete ParserResult;
7335 // Check to make sure that parsing produced a result
7339 // Reset ParserResult variable while saving its value for the result.
7340 Module *Result = ParserResult;
7346 void llvm::GenerateError(const std::string &message, int LineNo) {
7347 if (LineNo == -1) LineNo = LLLgetLineNo();
7348 // TODO: column number in exception
7350 TheParseError->setError(LLLgetFilename(), message, LineNo);
7354 int yyerror(const char *ErrorMsg) {
7355 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
7356 std::string errMsg = where + "error: " + std::string(ErrorMsg);
7357 if (yychar != YYEMPTY && yychar != 0) {
7358 errMsg += " while reading token: '";
7359 errMsg += std::string(LLLgetTokenStart(),
7360 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
7362 GenerateError(errMsg);