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,
139 X86_STDCALLCC_TOK = 320,
140 X86_FASTCALLCC_TOK = 321,
206 EXTRACTELEMENT = 387,
228 #define ESINT64VAL 258
229 #define EUINT64VAL 259
230 #define ESAPINTVAL 260
231 #define EUAPINTVAL 261
232 #define LOCALVAL_ID 262
233 #define GLOBALVAL_ID 263
241 #define PPC_FP128 271
245 #define GLOBALVAR 275
247 #define STRINGCONSTANT 277
248 #define ATSTRINGCONSTANT 278
249 #define PCTSTRINGCONSTANT 279
250 #define ZEROINITIALIZER 280
262 #define THREAD_LOCAL 292
264 #define DOTDOTDOT 294
270 #define APPENDING 300
271 #define DLLIMPORT 301
272 #define DLLEXPORT 302
273 #define EXTERN_WEAK 303
279 #define ADDRSPACE 309
285 #define SIDEEFFECT 315
288 #define FASTCC_TOK 318
289 #define COLDCC_TOK 319
290 #define X86_STDCALLCC_TOK 320
291 #define X86_FASTCALLCC_TOK 321
292 #define DATALAYOUT 322
298 #define UNREACHABLE 328
341 #define GETELEMENTPTR 371
357 #define EXTRACTELEMENT 387
358 #define INSERTELEMENT 388
359 #define SHUFFLEVECTOR 389
360 #define GETRESULT 390
375 #define PROTECTED 405
380 /* Copy the first part of user declarations. */
381 #line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
383 #include "ParserInternals.h"
384 #include "llvm/CallingConv.h"
385 #include "llvm/InlineAsm.h"
386 #include "llvm/Instructions.h"
387 #include "llvm/Module.h"
388 #include "llvm/ValueSymbolTable.h"
389 #include "llvm/AutoUpgrade.h"
390 #include "llvm/Support/GetElementPtrTypeIterator.h"
391 #include "llvm/Support/CommandLine.h"
392 #include "llvm/ADT/SmallVector.h"
393 #include "llvm/ADT/STLExtras.h"
394 #include "llvm/Support/MathExtras.h"
395 #include "llvm/Support/Streams.h"
401 // The following is a gross hack. In order to rid the libAsmParser library of
402 // exceptions, we have to have a way of getting the yyparse function to go into
403 // an error situation. So, whenever we want an error to occur, the GenerateError
404 // function (see bottom of file) sets TriggerError. Then, at the end of each
405 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
406 // (a goto) to put YACC in error state. Furthermore, several calls to
407 // GenerateError are made from inside productions and they must simulate the
408 // previous exception behavior by exiting the production immediately. We have
409 // replaced these with the GEN_ERROR macro which calls GeneratError and then
410 // immediately invokes YYERROR. This would be so much cleaner if it was a
411 // recursive descent parser.
412 static bool TriggerError = false;
413 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
414 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
416 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
417 int yylex(); // declaration" of xxx warnings.
419 using namespace llvm;
421 static Module *ParserResult;
423 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
424 // relating to upreferences in the input stream.
426 //#define DEBUG_UPREFS 1
428 #define UR_OUT(X) cerr << X
433 #define YYERROR_VERBOSE 1
435 static GlobalVariable *CurGV;
438 // This contains info used when building the body of a function. It is
439 // destroyed when the function is completed.
441 typedef std::vector<Value *> ValueList; // Numbered defs
444 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
446 static struct PerModuleInfo {
447 Module *CurrentModule;
448 ValueList Values; // Module level numbered definitions
449 ValueList LateResolveValues;
450 std::vector<PATypeHolder> Types;
451 std::map<ValID, PATypeHolder> LateResolveTypes;
453 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
454 /// how they were referenced and on which line of the input they came from so
455 /// that we can resolve them later and print error messages as appropriate.
456 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
458 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
459 // references to global values. Global values may be referenced before they
460 // are defined, and if so, the temporary object that they represent is held
461 // here. This is used for forward references of GlobalValues.
463 typedef std::map<std::pair<const PointerType *,
464 ValID>, GlobalValue*> GlobalRefsType;
465 GlobalRefsType GlobalRefs;
468 // If we could not resolve some functions at function compilation time
469 // (calls to functions before they are defined), resolve them now... Types
470 // are resolved when the constant pool has been completely parsed.
472 ResolveDefinitions(LateResolveValues);
476 // Check to make sure that all global value forward references have been
479 if (!GlobalRefs.empty()) {
480 std::string UndefinedReferences = "Unresolved global references exist:\n";
482 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
484 UndefinedReferences += " " + I->first.first->getDescription() + " " +
485 I->first.second.getName() + "\n";
487 GenerateError(UndefinedReferences);
491 // Look for intrinsic functions and CallInst that need to be upgraded
492 for (Module::iterator FI = CurrentModule->begin(),
493 FE = CurrentModule->end(); FI != FE; )
494 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
496 Values.clear(); // Clear out function local definitions
501 // GetForwardRefForGlobal - Check to see if there is a forward reference
502 // for this global. If so, remove it from the GlobalRefs map and return it.
503 // If not, just return null.
504 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
505 // Check to see if there is a forward reference to this global variable...
506 // if there is, eliminate it and patch the reference to use the new def'n.
507 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
508 GlobalValue *Ret = 0;
509 if (I != GlobalRefs.end()) {
516 bool TypeIsUnresolved(PATypeHolder* PATy) {
517 // If it isn't abstract, its resolved
518 const Type* Ty = PATy->get();
519 if (!Ty->isAbstract())
521 // Traverse the type looking for abstract types. If it isn't abstract then
522 // we don't need to traverse that leg of the type.
523 std::vector<const Type*> WorkList, SeenList;
524 WorkList.push_back(Ty);
525 while (!WorkList.empty()) {
526 const Type* Ty = WorkList.back();
527 SeenList.push_back(Ty);
529 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
530 // Check to see if this is an unresolved type
531 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
532 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
533 for ( ; I != E; ++I) {
534 if (I->second.get() == OpTy)
537 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
538 const Type* TheTy = SeqTy->getElementType();
539 if (TheTy->isAbstract() && TheTy != Ty) {
540 std::vector<const Type*>::iterator I = SeenList.begin(),
546 WorkList.push_back(TheTy);
548 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
549 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
550 const Type* TheTy = StrTy->getElementType(i);
551 if (TheTy->isAbstract() && TheTy != Ty) {
552 std::vector<const Type*>::iterator I = SeenList.begin(),
558 WorkList.push_back(TheTy);
567 static struct PerFunctionInfo {
568 Function *CurrentFunction; // Pointer to current function being created
570 ValueList Values; // Keep track of #'d definitions
572 ValueList LateResolveValues;
573 bool isDeclare; // Is this function a forward declararation?
574 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
575 GlobalValue::VisibilityTypes Visibility;
577 /// BBForwardRefs - When we see forward references to basic blocks, keep
578 /// track of them here.
579 std::map<ValID, BasicBlock*> BBForwardRefs;
581 inline PerFunctionInfo() {
584 Linkage = GlobalValue::ExternalLinkage;
585 Visibility = GlobalValue::DefaultVisibility;
588 inline void FunctionStart(Function *M) {
593 void FunctionDone() {
594 // Any forward referenced blocks left?
595 if (!BBForwardRefs.empty()) {
596 GenerateError("Undefined reference to label " +
597 BBForwardRefs.begin()->second->getName());
601 // Resolve all forward references now.
602 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
604 Values.clear(); // Clear out function local definitions
605 BBForwardRefs.clear();
608 Linkage = GlobalValue::ExternalLinkage;
609 Visibility = GlobalValue::DefaultVisibility;
611 } CurFun; // Info for the current function...
613 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
616 //===----------------------------------------------------------------------===//
617 // Code to handle definitions of all the types
618 //===----------------------------------------------------------------------===//
620 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
621 // Things that have names or are void typed don't get slot numbers
622 if (V->hasName() || (V->getType() == Type::VoidTy))
625 // In the case of function values, we have to allow for the forward reference
626 // of basic blocks, which are included in the numbering. Consequently, we keep
627 // track of the next insertion location with NextValNum. When a BB gets
628 // inserted, it could change the size of the CurFun.Values vector.
629 if (&ValueTab == &CurFun.Values) {
630 if (ValueTab.size() <= CurFun.NextValNum)
631 ValueTab.resize(CurFun.NextValNum+1);
632 ValueTab[CurFun.NextValNum++] = V;
635 // For all other lists, its okay to just tack it on the back of the vector.
636 ValueTab.push_back(V);
639 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
641 case ValID::LocalID: // Is it a numbered definition?
642 // Module constants occupy the lowest numbered slots...
643 if (D.Num < CurModule.Types.size())
644 return CurModule.Types[D.Num];
646 case ValID::LocalName: // Is it a named definition?
647 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
648 D.destroy(); // Free old strdup'd memory...
653 GenerateError("Internal parser error: Invalid symbol type reference");
657 // If we reached here, we referenced either a symbol that we don't know about
658 // or an id number that hasn't been read yet. We may be referencing something
659 // forward, so just create an entry to be resolved later and get to it...
661 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
664 if (inFunctionScope()) {
665 if (D.Type == ValID::LocalName) {
666 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
669 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
674 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
675 if (I != CurModule.LateResolveTypes.end())
678 Type *Typ = OpaqueType::get();
679 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
683 // getExistingVal - Look up the value specified by the provided type and
684 // the provided ValID. If the value exists and has already been defined, return
685 // it. Otherwise return null.
687 static Value *getExistingVal(const Type *Ty, const ValID &D) {
688 if (isa<FunctionType>(Ty)) {
689 GenerateError("Functions are not values and "
690 "must be referenced as pointers");
695 case ValID::LocalID: { // Is it a numbered definition?
696 // Check that the number is within bounds.
697 if (D.Num >= CurFun.Values.size())
699 Value *Result = CurFun.Values[D.Num];
700 if (Ty != Result->getType()) {
701 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
702 Result->getType()->getDescription() + "' does not match "
703 "expected type, '" + Ty->getDescription() + "'");
708 case ValID::GlobalID: { // Is it a numbered definition?
709 if (D.Num >= CurModule.Values.size())
711 Value *Result = CurModule.Values[D.Num];
712 if (Ty != Result->getType()) {
713 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
714 Result->getType()->getDescription() + "' does not match "
715 "expected type, '" + Ty->getDescription() + "'");
721 case ValID::LocalName: { // Is it a named definition?
722 if (!inFunctionScope())
724 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
725 Value *N = SymTab.lookup(D.getName());
728 if (N->getType() != Ty)
731 D.destroy(); // Free old strdup'd memory...
734 case ValID::GlobalName: { // Is it a named definition?
735 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
736 Value *N = SymTab.lookup(D.getName());
739 if (N->getType() != Ty)
742 D.destroy(); // Free old strdup'd memory...
746 // Check to make sure that "Ty" is an integral type, and that our
747 // value will fit into the specified type...
748 case ValID::ConstSIntVal: // Is it a constant pool reference??
749 if (!isa<IntegerType>(Ty) ||
750 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
751 GenerateError("Signed integral constant '" +
752 itostr(D.ConstPool64) + "' is invalid for type '" +
753 Ty->getDescription() + "'");
756 return ConstantInt::get(Ty, D.ConstPool64, true);
758 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
759 if (isa<IntegerType>(Ty) &&
760 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
761 return ConstantInt::get(Ty, D.UConstPool64);
763 if (!isa<IntegerType>(Ty) ||
764 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
765 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
766 "' is invalid or out of range for type '" +
767 Ty->getDescription() + "'");
770 // This is really a signed reference. Transmogrify.
771 return ConstantInt::get(Ty, D.ConstPool64, true);
773 case ValID::ConstFPVal: // Is it a floating point const pool reference?
774 if (!Ty->isFloatingPoint() ||
775 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
776 GenerateError("FP constant invalid for type");
779 // Lexer has no type info, so builds all float and double FP constants
780 // as double. Fix this here. Long double does not need this.
781 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
783 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
784 return ConstantFP::get(Ty, *D.ConstPoolFP);
786 case ValID::ConstNullVal: // Is it a null value?
787 if (!isa<PointerType>(Ty)) {
788 GenerateError("Cannot create a a non pointer null");
791 return ConstantPointerNull::get(cast<PointerType>(Ty));
793 case ValID::ConstUndefVal: // Is it an undef value?
794 return UndefValue::get(Ty);
796 case ValID::ConstZeroVal: // Is it a zero value?
797 return Constant::getNullValue(Ty);
799 case ValID::ConstantVal: // Fully resolved constant?
800 if (D.ConstantValue->getType() != Ty) {
801 GenerateError("Constant expression type different from required type");
804 return D.ConstantValue;
806 case ValID::InlineAsmVal: { // Inline asm expression
807 const PointerType *PTy = dyn_cast<PointerType>(Ty);
808 const FunctionType *FTy =
809 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
810 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
811 GenerateError("Invalid type for asm constraint string");
814 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
815 D.IAD->HasSideEffects);
816 D.destroy(); // Free InlineAsmDescriptor.
820 assert(0 && "Unhandled case!");
824 assert(0 && "Unhandled case!");
828 // getVal - This function is identical to getExistingVal, except that if a
829 // value is not already defined, it "improvises" by creating a placeholder var
830 // that looks and acts just like the requested variable. When the value is
831 // defined later, all uses of the placeholder variable are replaced with the
834 static Value *getVal(const Type *Ty, const ValID &ID) {
835 if (Ty == Type::LabelTy) {
836 GenerateError("Cannot use a basic block here");
840 // See if the value has already been defined.
841 Value *V = getExistingVal(Ty, ID);
843 if (TriggerError) return 0;
845 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
846 GenerateError("Invalid use of a composite type");
850 // If we reached here, we referenced either a symbol that we don't know about
851 // or an id number that hasn't been read yet. We may be referencing something
852 // forward, so just create an entry to be resolved later and get to it...
855 case ValID::GlobalName:
856 case ValID::GlobalID: {
857 const PointerType *PTy = dyn_cast<PointerType>(Ty);
859 GenerateError("Invalid type for reference to global" );
862 const Type* ElTy = PTy->getElementType();
863 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
864 V = new Function(FTy, GlobalValue::ExternalLinkage);
866 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
867 (Module*)0, false, PTy->getAddressSpace());
871 V = new Argument(Ty);
874 // Remember where this forward reference came from. FIXME, shouldn't we try
875 // to recycle these things??
876 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
879 if (inFunctionScope())
880 InsertValue(V, CurFun.LateResolveValues);
882 InsertValue(V, CurModule.LateResolveValues);
886 /// defineBBVal - This is a definition of a new basic block with the specified
887 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
888 static BasicBlock *defineBBVal(const ValID &ID) {
889 assert(inFunctionScope() && "Can't get basic block at global scope!");
893 // First, see if this was forward referenced
895 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
896 if (BBI != CurFun.BBForwardRefs.end()) {
898 // The forward declaration could have been inserted anywhere in the
899 // function: insert it into the correct place now.
900 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
901 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
903 // We're about to erase the entry, save the key so we can clean it up.
904 ValID Tmp = BBI->first;
906 // Erase the forward ref from the map as its no longer "forward"
907 CurFun.BBForwardRefs.erase(ID);
909 // The key has been removed from the map but so we don't want to leave
910 // strdup'd memory around so destroy it too.
913 // If its a numbered definition, bump the number and set the BB value.
914 if (ID.Type == ValID::LocalID) {
915 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
923 // We haven't seen this BB before and its first mention is a definition.
924 // Just create it and return it.
925 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
926 BB = new BasicBlock(Name, CurFun.CurrentFunction);
927 if (ID.Type == ValID::LocalID) {
928 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
932 ID.destroy(); // Free strdup'd memory
936 /// getBBVal - get an existing BB value or create a forward reference for it.
938 static BasicBlock *getBBVal(const ValID &ID) {
939 assert(inFunctionScope() && "Can't get basic block at global scope!");
943 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
944 if (BBI != CurFun.BBForwardRefs.end()) {
946 } if (ID.Type == ValID::LocalName) {
947 std::string Name = ID.getName();
948 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
950 if (N->getType()->getTypeID() == Type::LabelTyID)
951 BB = cast<BasicBlock>(N);
953 GenerateError("Reference to label '" + Name + "' is actually of type '"+
954 N->getType()->getDescription() + "'");
956 } else if (ID.Type == ValID::LocalID) {
957 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
958 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
959 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
961 GenerateError("Reference to label '%" + utostr(ID.Num) +
962 "' is actually of type '"+
963 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
966 GenerateError("Illegal label reference " + ID.getName());
970 // If its already been defined, return it now.
972 ID.destroy(); // Free strdup'd memory.
976 // Otherwise, this block has not been seen before, create it.
978 if (ID.Type == ValID::LocalName)
980 BB = new BasicBlock(Name, CurFun.CurrentFunction);
982 // Insert it in the forward refs map.
983 CurFun.BBForwardRefs[ID] = BB;
989 //===----------------------------------------------------------------------===//
990 // Code to handle forward references in instructions
991 //===----------------------------------------------------------------------===//
993 // This code handles the late binding needed with statements that reference
994 // values not defined yet... for example, a forward branch, or the PHI node for
997 // This keeps a table (CurFun.LateResolveValues) of all such forward references
998 // and back patchs after we are done.
1001 // ResolveDefinitions - If we could not resolve some defs at parsing
1002 // time (forward branches, phi functions for loops, etc...) resolve the
1006 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1007 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1008 while (!LateResolvers.empty()) {
1009 Value *V = LateResolvers.back();
1010 LateResolvers.pop_back();
1012 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1013 CurModule.PlaceHolderInfo.find(V);
1014 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1016 ValID &DID = PHI->second.first;
1018 Value *TheRealValue = getExistingVal(V->getType(), DID);
1022 V->replaceAllUsesWith(TheRealValue);
1024 CurModule.PlaceHolderInfo.erase(PHI);
1025 } else if (FutureLateResolvers) {
1026 // Functions have their unresolved items forwarded to the module late
1028 InsertValue(V, *FutureLateResolvers);
1030 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1031 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1032 "' of type '" + V->getType()->getDescription() + "'",
1033 PHI->second.second);
1036 GenerateError("Reference to an invalid definition: #" +
1037 itostr(DID.Num) + " of type '" +
1038 V->getType()->getDescription() + "'",
1039 PHI->second.second);
1044 LateResolvers.clear();
1047 // ResolveTypeTo - A brand new type was just declared. This means that (if
1048 // name is not null) things referencing Name can be resolved. Otherwise, things
1049 // refering to the number can be resolved. Do this now.
1051 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1054 D = ValID::createLocalName(*Name);
1056 D = ValID::createLocalID(CurModule.Types.size());
1058 std::map<ValID, PATypeHolder>::iterator I =
1059 CurModule.LateResolveTypes.find(D);
1060 if (I != CurModule.LateResolveTypes.end()) {
1061 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1062 CurModule.LateResolveTypes.erase(I);
1066 // setValueName - Set the specified value to the name given. The name may be
1067 // null potentially, in which case this is a noop. The string passed in is
1068 // assumed to be a malloc'd string buffer, and is free'd by this function.
1070 static void setValueName(Value *V, std::string *NameStr) {
1071 if (!NameStr) return;
1072 std::string Name(*NameStr); // Copy string
1073 delete NameStr; // Free old string
1075 if (V->getType() == Type::VoidTy) {
1076 GenerateError("Can't assign name '" + Name+"' to value with void type");
1080 assert(inFunctionScope() && "Must be in function scope!");
1081 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1082 if (ST.lookup(Name)) {
1083 GenerateError("Redefinition of value '" + Name + "' of type '" +
1084 V->getType()->getDescription() + "'");
1092 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1093 /// this is a declaration, otherwise it is a definition.
1094 static GlobalVariable *
1095 ParseGlobalVariable(std::string *NameStr,
1096 GlobalValue::LinkageTypes Linkage,
1097 GlobalValue::VisibilityTypes Visibility,
1098 bool isConstantGlobal, const Type *Ty,
1099 Constant *Initializer, bool IsThreadLocal,
1100 unsigned AddressSpace = 0) {
1101 if (isa<FunctionType>(Ty)) {
1102 GenerateError("Cannot declare global vars of function type");
1106 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1110 Name = *NameStr; // Copy string
1111 delete NameStr; // Free old string
1114 // See if this global value was forward referenced. If so, recycle the
1117 if (!Name.empty()) {
1118 ID = ValID::createGlobalName(Name);
1120 ID = ValID::createGlobalID(CurModule.Values.size());
1123 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1124 // Move the global to the end of the list, from whereever it was
1125 // previously inserted.
1126 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1127 CurModule.CurrentModule->getGlobalList().remove(GV);
1128 CurModule.CurrentModule->getGlobalList().push_back(GV);
1129 GV->setInitializer(Initializer);
1130 GV->setLinkage(Linkage);
1131 GV->setVisibility(Visibility);
1132 GV->setConstant(isConstantGlobal);
1133 GV->setThreadLocal(IsThreadLocal);
1134 InsertValue(GV, CurModule.Values);
1138 // If this global has a name
1139 if (!Name.empty()) {
1140 // if the global we're parsing has an initializer (is a definition) and
1141 // has external linkage.
1142 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1143 // If there is already a global with external linkage with this name
1144 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1145 // If we allow this GVar to get created, it will be renamed in the
1146 // symbol table because it conflicts with an existing GVar. We can't
1147 // allow redefinition of GVars whose linking indicates that their name
1148 // must stay the same. Issue the error.
1149 GenerateError("Redefinition of global variable named '" + Name +
1150 "' of type '" + Ty->getDescription() + "'");
1155 // Otherwise there is no existing GV to use, create one now.
1156 GlobalVariable *GV =
1157 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1158 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1159 GV->setVisibility(Visibility);
1160 InsertValue(GV, CurModule.Values);
1164 // setTypeName - Set the specified type to the name given. The name may be
1165 // null potentially, in which case this is a noop. The string passed in is
1166 // assumed to be a malloc'd string buffer, and is freed by this function.
1168 // This function returns true if the type has already been defined, but is
1169 // allowed to be redefined in the specified context. If the name is a new name
1170 // for the type plane, it is inserted and false is returned.
1171 static bool setTypeName(const Type *T, std::string *NameStr) {
1172 assert(!inFunctionScope() && "Can't give types function-local names!");
1173 if (NameStr == 0) return false;
1175 std::string Name(*NameStr); // Copy string
1176 delete NameStr; // Free old string
1178 // We don't allow assigning names to void type
1179 if (T == Type::VoidTy) {
1180 GenerateError("Can't assign name '" + Name + "' to the void type");
1184 // Set the type name, checking for conflicts as we do so.
1185 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1187 if (AlreadyExists) { // Inserting a name that is already defined???
1188 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1189 assert(Existing && "Conflict but no matching type?!");
1191 // There is only one case where this is allowed: when we are refining an
1192 // opaque type. In this case, Existing will be an opaque type.
1193 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1194 // We ARE replacing an opaque type!
1195 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1199 // Otherwise, this is an attempt to redefine a type. That's okay if
1200 // the redefinition is identical to the original. This will be so if
1201 // Existing and T point to the same Type object. In this one case we
1202 // allow the equivalent redefinition.
1203 if (Existing == T) return true; // Yes, it's equal.
1205 // Any other kind of (non-equivalent) redefinition is an error.
1206 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1207 T->getDescription() + "'");
1213 //===----------------------------------------------------------------------===//
1214 // Code for handling upreferences in type names...
1217 // TypeContains - Returns true if Ty directly contains E in it.
1219 static bool TypeContains(const Type *Ty, const Type *E) {
1220 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1221 E) != Ty->subtype_end();
1225 struct UpRefRecord {
1226 // NestingLevel - The number of nesting levels that need to be popped before
1227 // this type is resolved.
1228 unsigned NestingLevel;
1230 // LastContainedTy - This is the type at the current binding level for the
1231 // type. Every time we reduce the nesting level, this gets updated.
1232 const Type *LastContainedTy;
1234 // UpRefTy - This is the actual opaque type that the upreference is
1235 // represented with.
1236 OpaqueType *UpRefTy;
1238 UpRefRecord(unsigned NL, OpaqueType *URTy)
1239 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1243 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1244 static std::vector<UpRefRecord> UpRefs;
1246 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1247 /// called. It loops through the UpRefs vector, which is a list of the
1248 /// currently active types. For each type, if the up reference is contained in
1249 /// the newly completed type, we decrement the level count. When the level
1250 /// count reaches zero, the upreferenced type is the type that is passed in:
1251 /// thus we can complete the cycle.
1253 static PATypeHolder HandleUpRefs(const Type *ty) {
1254 // If Ty isn't abstract, or if there are no up-references in it, then there is
1255 // nothing to resolve here.
1256 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1258 PATypeHolder Ty(ty);
1259 UR_OUT("Type '" << Ty->getDescription() <<
1260 "' newly formed. Resolving upreferences.\n" <<
1261 UpRefs.size() << " upreferences active!\n");
1263 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1264 // to zero), we resolve them all together before we resolve them to Ty. At
1265 // the end of the loop, if there is anything to resolve to Ty, it will be in
1267 OpaqueType *TypeToResolve = 0;
1269 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1270 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1271 << UpRefs[i].second->getDescription() << ") = "
1272 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1273 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1274 // Decrement level of upreference
1275 unsigned Level = --UpRefs[i].NestingLevel;
1276 UpRefs[i].LastContainedTy = Ty;
1277 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1278 if (Level == 0) { // Upreference should be resolved!
1279 if (!TypeToResolve) {
1280 TypeToResolve = UpRefs[i].UpRefTy;
1282 UR_OUT(" * Resolving upreference for "
1283 << UpRefs[i].second->getDescription() << "\n";
1284 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1285 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1286 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1287 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1289 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1290 --i; // Do not skip the next element...
1295 if (TypeToResolve) {
1296 UR_OUT(" * Resolving upreference for "
1297 << UpRefs[i].second->getDescription() << "\n";
1298 std::string OldName = TypeToResolve->getDescription());
1299 TypeToResolve->refineAbstractTypeTo(Ty);
1305 //===----------------------------------------------------------------------===//
1306 // RunVMAsmParser - Define an interface to this parser
1307 //===----------------------------------------------------------------------===//
1309 static Module* RunParser(Module * M);
1311 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1313 Module *M = RunParser(new Module(LLLgetFilename()));
1320 /* Enabling traces. */
1325 /* Enabling verbose error messages. */
1326 #ifdef YYERROR_VERBOSE
1327 # undef YYERROR_VERBOSE
1328 # define YYERROR_VERBOSE 1
1330 # define YYERROR_VERBOSE 0
1333 /* Enabling the token table. */
1334 #ifndef YYTOKEN_TABLE
1335 # define YYTOKEN_TABLE 0
1338 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1339 typedef union YYSTYPE
1340 #line 952 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
1342 llvm::Module *ModuleVal;
1343 llvm::Function *FunctionVal;
1344 llvm::BasicBlock *BasicBlockVal;
1345 llvm::TerminatorInst *TermInstVal;
1346 llvm::Instruction *InstVal;
1347 llvm::Constant *ConstVal;
1349 const llvm::Type *PrimType;
1350 std::list<llvm::PATypeHolder> *TypeList;
1351 llvm::PATypeHolder *TypeVal;
1352 llvm::Value *ValueVal;
1353 std::vector<llvm::Value*> *ValueList;
1354 llvm::ArgListType *ArgList;
1355 llvm::TypeWithAttrs TypeWithAttrs;
1356 llvm::TypeWithAttrsList *TypeWithAttrsList;
1357 llvm::ParamList *ParamList;
1359 // Represent the RHS of PHI node
1360 std::list<std::pair<llvm::Value*,
1361 llvm::BasicBlock*> > *PHIList;
1362 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1363 std::vector<llvm::Constant*> *ConstVector;
1365 llvm::GlobalValue::LinkageTypes Linkage;
1366 llvm::GlobalValue::VisibilityTypes Visibility;
1367 llvm::ParameterAttributes ParamAttrs;
1368 llvm::APInt *APIntVal;
1373 llvm::APFloat *FPVal;
1376 std::string *StrVal; // This memory must be deleted
1377 llvm::ValID ValIDVal;
1379 llvm::Instruction::BinaryOps BinaryOpVal;
1380 llvm::Instruction::TermOps TermOpVal;
1381 llvm::Instruction::MemoryOps MemOpVal;
1382 llvm::Instruction::CastOps CastOpVal;
1383 llvm::Instruction::OtherOps OtherOpVal;
1384 llvm::ICmpInst::Predicate IPredicate;
1385 llvm::FCmpInst::Predicate FPredicate;
1387 /* Line 193 of yacc.c. */
1388 #line 1389 "llvmAsmParser.tab.c"
1390 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1391 # define YYSTYPE_IS_DECLARED 1
1392 # define YYSTYPE_IS_TRIVIAL 1
1397 /* Copy the second part of user declarations. */
1400 /* Line 216 of yacc.c. */
1401 #line 1402 "llvmAsmParser.tab.c"
1408 typedef YYTYPE_UINT8 yytype_uint8;
1410 typedef unsigned char yytype_uint8;
1414 typedef YYTYPE_INT8 yytype_int8;
1415 #elif (defined __STDC__ || defined __C99__FUNC__ \
1416 || defined __cplusplus || defined _MSC_VER)
1417 typedef signed char yytype_int8;
1419 typedef short int yytype_int8;
1422 #ifdef YYTYPE_UINT16
1423 typedef YYTYPE_UINT16 yytype_uint16;
1425 typedef unsigned short int yytype_uint16;
1429 typedef YYTYPE_INT16 yytype_int16;
1431 typedef short int yytype_int16;
1435 # ifdef __SIZE_TYPE__
1436 # define YYSIZE_T __SIZE_TYPE__
1437 # elif defined size_t
1438 # define YYSIZE_T size_t
1439 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1440 || defined __cplusplus || defined _MSC_VER)
1441 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1442 # define YYSIZE_T size_t
1444 # define YYSIZE_T unsigned int
1448 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1451 # if defined YYENABLE_NLS && YYENABLE_NLS
1453 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1454 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1458 # define YY_(msgid) msgid
1462 /* Suppress unused-variable warnings by "using" E. */
1463 #if ! defined lint || defined __GNUC__
1464 # define YYUSE(e) ((void) (e))
1466 # define YYUSE(e) /* empty */
1469 /* Identity function, used to suppress warnings about constant conditions. */
1471 # define YYID(n) (n)
1473 #if (defined __STDC__ || defined __C99__FUNC__ \
1474 || defined __cplusplus || defined _MSC_VER)
1487 #if ! defined yyoverflow || YYERROR_VERBOSE
1489 /* The parser invokes alloca or malloc; define the necessary symbols. */
1491 # ifdef YYSTACK_USE_ALLOCA
1492 # if YYSTACK_USE_ALLOCA
1494 # define YYSTACK_ALLOC __builtin_alloca
1495 # elif defined __BUILTIN_VA_ARG_INCR
1496 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1498 # define YYSTACK_ALLOC __alloca
1499 # elif defined _MSC_VER
1500 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1501 # define alloca _alloca
1503 # define YYSTACK_ALLOC alloca
1504 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1505 || defined __cplusplus || defined _MSC_VER)
1506 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1508 # define _STDLIB_H 1
1515 # ifdef YYSTACK_ALLOC
1516 /* Pacify GCC's `empty if-body' warning. */
1517 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1518 # ifndef YYSTACK_ALLOC_MAXIMUM
1519 /* The OS might guarantee only one guard page at the bottom of the stack,
1520 and a page size can be as small as 4096 bytes. So we cannot safely
1521 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1522 to allow for a few compiler-allocated temporary stack slots. */
1523 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1526 # define YYSTACK_ALLOC YYMALLOC
1527 # define YYSTACK_FREE YYFREE
1528 # ifndef YYSTACK_ALLOC_MAXIMUM
1529 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1531 # if (defined __cplusplus && ! defined _STDLIB_H \
1532 && ! ((defined YYMALLOC || defined malloc) \
1533 && (defined YYFREE || defined free)))
1534 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1536 # define _STDLIB_H 1
1540 # define YYMALLOC malloc
1541 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1542 || defined __cplusplus || defined _MSC_VER)
1543 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1547 # define YYFREE free
1548 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1549 || defined __cplusplus || defined _MSC_VER)
1550 void free (void *); /* INFRINGES ON USER NAME SPACE */
1554 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1557 #if (! defined yyoverflow \
1558 && (! defined __cplusplus \
1559 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1561 /* A type that is properly aligned for any stack member. */
1568 /* The size of the maximum gap between one aligned stack and the next. */
1569 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1571 /* The size of an array large to enough to hold all stacks, each with
1573 # define YYSTACK_BYTES(N) \
1574 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1575 + YYSTACK_GAP_MAXIMUM)
1577 /* Copy COUNT objects from FROM to TO. The source and destination do
1580 # if defined __GNUC__ && 1 < __GNUC__
1581 # define YYCOPY(To, From, Count) \
1582 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1584 # define YYCOPY(To, From, Count) \
1588 for (yyi = 0; yyi < (Count); yyi++) \
1589 (To)[yyi] = (From)[yyi]; \
1595 /* Relocate STACK from its old location to the new one. The
1596 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1597 elements in the stack, and YYPTR gives the new location of the
1598 stack. Advance YYPTR to a properly aligned location for the next
1600 # define YYSTACK_RELOCATE(Stack) \
1603 YYSIZE_T yynewbytes; \
1604 YYCOPY (&yyptr->Stack, Stack, yysize); \
1605 Stack = &yyptr->Stack; \
1606 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1607 yyptr += yynewbytes / sizeof (*yyptr); \
1613 /* YYFINAL -- State number of the termination state. */
1615 /* YYLAST -- Last index in YYTABLE. */
1618 /* YYNTOKENS -- Number of terminals. */
1619 #define YYNTOKENS 165
1620 /* YYNNTS -- Number of nonterminals. */
1622 /* YYNRULES -- Number of rules. */
1623 #define YYNRULES 322
1624 /* YYNRULES -- Number of states. */
1625 #define YYNSTATES 629
1627 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1628 #define YYUNDEFTOK 2
1629 #define YYMAXUTOK 405
1631 #define YYTRANSLATE(YYX) \
1632 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1634 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1635 static const yytype_uint8 yytranslate[] =
1637 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1641 151, 152, 155, 2, 154, 2, 2, 2, 2, 2,
1642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1643 160, 153, 161, 2, 2, 2, 2, 2, 2, 2,
1644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1646 2, 157, 156, 159, 2, 2, 2, 2, 2, 164,
1647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1649 158, 2, 2, 162, 2, 163, 2, 2, 2, 2,
1650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1660 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1661 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1662 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1663 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1664 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1665 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1666 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1667 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1668 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1669 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1670 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1671 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1672 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1673 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1674 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1675 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1676 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1677 145, 146, 147, 148, 149, 150
1681 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1683 static const yytype_uint16 yyprhs[] =
1685 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1686 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1687 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1688 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1689 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1690 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1691 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1692 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1693 160, 162, 164, 166, 167, 169, 171, 173, 174, 176,
1694 178, 179, 181, 183, 185, 187, 188, 190, 192, 193,
1695 195, 197, 199, 201, 203, 206, 208, 210, 212, 214,
1696 216, 218, 220, 222, 224, 227, 228, 231, 233, 235,
1697 237, 239, 241, 243, 244, 247, 248, 251, 252, 255,
1698 256, 260, 263, 264, 266, 267, 271, 273, 276, 278,
1699 280, 282, 284, 286, 288, 290, 292, 294, 298, 300,
1700 303, 309, 315, 321, 327, 331, 334, 340, 345, 348,
1701 350, 352, 354, 358, 360, 364, 366, 367, 369, 373,
1702 378, 382, 386, 391, 396, 400, 407, 413, 416, 419,
1703 422, 425, 428, 431, 434, 437, 440, 443, 446, 449,
1704 456, 462, 471, 478, 485, 493, 501, 508, 517, 526,
1705 530, 532, 534, 536, 538, 539, 542, 549, 551, 552,
1706 554, 557, 558, 562, 563, 567, 571, 575, 579, 580,
1707 589, 590, 600, 601, 611, 617, 620, 624, 626, 630,
1708 634, 638, 642, 644, 645, 651, 655, 657, 661, 663,
1709 664, 675, 677, 679, 684, 686, 688, 691, 695, 696,
1710 698, 700, 702, 704, 706, 708, 710, 712, 714, 718,
1711 720, 726, 728, 730, 732, 734, 736, 738, 741, 743,
1712 747, 750, 753, 757, 760, 761, 763, 766, 769, 773,
1713 783, 793, 802, 817, 819, 821, 828, 834, 837, 844,
1714 852, 857, 862, 869, 876, 877, 878, 882, 885, 887,
1715 893, 899, 906, 913, 918, 925, 930, 935, 942, 949,
1716 952, 961, 963, 965, 966, 970, 977, 981, 988, 991,
1720 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1721 static const yytype_int16 yyrhs[] =
1723 211, 0, -1, 74, -1, 75, -1, 76, -1, 77,
1724 -1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
1725 -1, 86, -1, 87, -1, 88, -1, 83, -1, 84,
1726 -1, 85, -1, 117, -1, 118, -1, 119, -1, 120,
1727 -1, 121, -1, 122, -1, 123, -1, 124, -1, 125,
1728 -1, 126, -1, 127, -1, 128, -1, 91, -1, 92,
1729 -1, 93, -1, 94, -1, 95, -1, 96, -1, 97,
1730 -1, 98, -1, 99, -1, 100, -1, 101, -1, 102,
1731 -1, 103, -1, 104, -1, 105, -1, 106, -1, 107,
1732 -1, 108, -1, 109, -1, 110, -1, 97, -1, 98,
1733 -1, 99, -1, 100, -1, 26, -1, 27, -1, 11,
1734 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1735 -1, 19, -1, 22, -1, 24, -1, 173, -1, -1,
1736 54, 151, 4, 152, -1, -1, 173, 153, -1, -1,
1737 20, -1, 23, -1, 179, -1, -1, 177, 153, -1,
1738 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1739 46, -1, 48, -1, 50, -1, -1, 148, -1, 149,
1740 -1, 150, -1, -1, 46, -1, 48, -1, -1, 42,
1741 -1, 43, -1, 44, -1, 47, -1, -1, 44, -1,
1742 42, -1, -1, 62, -1, 63, -1, 64, -1, 65,
1743 -1, 66, -1, 61, 4, -1, 137, -1, 118, -1,
1744 136, -1, 119, -1, 139, -1, 140, -1, 142, -1,
1745 143, -1, 144, -1, 53, 4, -1, -1, 188, 187,
1746 -1, 138, -1, 141, -1, 137, -1, 136, -1, 145,
1747 -1, 146, -1, -1, 190, 189, -1, -1, 147, 22,
1748 -1, -1, 53, 4, -1, -1, 154, 53, 4, -1,
1749 34, 22, -1, -1, 194, -1, -1, 154, 197, 196,
1750 -1, 194, -1, 53, 4, -1, 11, -1, 12, -1,
1751 13, -1, 16, -1, 15, -1, 14, -1, 17, -1,
1752 49, -1, 198, -1, 199, 175, 155, -1, 233, -1,
1753 156, 4, -1, 199, 151, 203, 152, 190, -1, 10,
1754 151, 203, 152, 190, -1, 157, 4, 158, 199, 159,
1755 -1, 160, 4, 158, 199, 161, -1, 162, 204, 163,
1756 -1, 162, 163, -1, 160, 162, 204, 163, 161, -1,
1757 160, 162, 163, 161, -1, 199, 188, -1, 199, -1,
1758 10, -1, 200, -1, 202, 154, 200, -1, 202, -1,
1759 202, 154, 39, -1, 39, -1, -1, 199, -1, 204,
1760 154, 199, -1, 199, 157, 207, 159, -1, 199, 157,
1761 159, -1, 199, 164, 22, -1, 199, 160, 207, 161,
1762 -1, 199, 162, 207, 163, -1, 199, 162, 163, -1,
1763 199, 160, 162, 207, 163, 161, -1, 199, 160, 162,
1764 163, 161, -1, 199, 40, -1, 199, 41, -1, 199,
1765 233, -1, 199, 206, -1, 199, 25, -1, 171, 3,
1766 -1, 171, 5, -1, 171, 4, -1, 171, 6, -1,
1767 11, 26, -1, 11, 27, -1, 172, 9, -1, 168,
1768 151, 205, 38, 199, 152, -1, 116, 151, 205, 245,
1769 152, -1, 130, 151, 205, 154, 205, 154, 205, 152,
1770 -1, 166, 151, 205, 154, 205, 152, -1, 167, 151,
1771 205, 154, 205, 152, -1, 89, 169, 151, 205, 154,
1772 205, 152, -1, 90, 170, 151, 205, 154, 205, 152,
1773 -1, 132, 151, 205, 154, 205, 152, -1, 133, 151,
1774 205, 154, 205, 154, 205, 152, -1, 134, 151, 205,
1775 154, 205, 154, 205, 152, -1, 207, 154, 205, -1,
1776 205, -1, 32, -1, 33, -1, 37, -1, -1, 201,
1777 233, -1, 122, 151, 210, 38, 199, 152, -1, 212,
1778 -1, -1, 213, -1, 212, 213, -1, -1, 31, 214,
1779 229, -1, -1, 30, 215, 230, -1, 59, 58, 219,
1780 -1, 176, 18, 199, -1, 176, 18, 10, -1, -1,
1781 178, 182, 209, 208, 205, 175, 216, 196, -1, -1,
1782 178, 180, 182, 209, 208, 205, 175, 217, 196, -1,
1783 -1, 178, 181, 182, 209, 208, 199, 175, 218, 196,
1784 -1, 178, 182, 35, 185, 210, -1, 51, 220, -1,
1785 55, 153, 221, -1, 22, -1, 52, 153, 22, -1,
1786 67, 153, 22, -1, 157, 222, 159, -1, 222, 154,
1787 22, -1, 22, -1, -1, 223, 154, 199, 188, 174,
1788 -1, 199, 188, 174, -1, 223, -1, 223, 154, 39,
1789 -1, 39, -1, -1, 186, 201, 177, 151, 224, 152,
1790 190, 195, 192, 191, -1, 28, -1, 162, -1, 184,
1791 182, 225, 226, -1, 29, -1, 163, -1, 237, 228,
1792 -1, 183, 182, 225, -1, -1, 60, -1, 3, -1,
1793 4, -1, 9, -1, 26, -1, 27, -1, 40, -1,
1794 41, -1, 25, -1, 160, 207, 161, -1, 206, -1,
1795 58, 231, 22, 154, 22, -1, 7, -1, 8, -1,
1796 173, -1, 177, -1, 233, -1, 232, -1, 199, 234,
1797 -1, 235, -1, 236, 154, 205, -1, 237, 238, -1,
1798 227, 238, -1, 239, 176, 240, -1, 239, 242, -1,
1799 -1, 21, -1, 68, 236, -1, 68, 10, -1, 69,
1800 17, 234, -1, 69, 11, 234, 154, 17, 234, 154,
1801 17, 234, -1, 70, 171, 234, 154, 17, 234, 157,
1802 241, 159, -1, 70, 171, 234, 154, 17, 234, 157,
1803 159, -1, 71, 186, 201, 234, 151, 244, 152, 190,
1804 38, 17, 234, 72, 17, 234, -1, 72, -1, 73,
1805 -1, 241, 171, 232, 154, 17, 234, -1, 171, 232,
1806 154, 17, 234, -1, 176, 247, -1, 199, 157, 234,
1807 154, 234, 159, -1, 243, 154, 157, 234, 154, 234,
1808 159, -1, 199, 188, 234, 188, -1, 17, 188, 234,
1809 188, -1, 244, 154, 199, 188, 234, 188, -1, 244,
1810 154, 17, 188, 234, 188, -1, -1, -1, 245, 154,
1811 235, -1, 57, 56, -1, 56, -1, 166, 199, 234,
1812 154, 234, -1, 167, 199, 234, 154, 234, -1, 89,
1813 169, 199, 234, 154, 234, -1, 90, 170, 199, 234,
1814 154, 234, -1, 168, 235, 38, 199, -1, 130, 235,
1815 154, 235, 154, 235, -1, 131, 235, 154, 199, -1,
1816 132, 235, 154, 235, -1, 133, 235, 154, 235, 154,
1817 235, -1, 134, 235, 154, 235, 154, 235, -1, 129,
1818 243, -1, 246, 186, 201, 234, 151, 244, 152, 190,
1819 -1, 249, -1, 36, -1, -1, 111, 199, 193, -1,
1820 111, 199, 154, 11, 234, 193, -1, 112, 199, 193,
1821 -1, 112, 199, 154, 11, 234, 193, -1, 113, 235,
1822 -1, 248, 114, 199, 234, 193, -1, 248, 115, 235,
1823 154, 199, 234, 193, -1, 135, 199, 173, 154, 4,
1824 -1, 116, 199, 234, 245, -1
1827 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1828 static const yytype_uint16 yyrline[] =
1830 0, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114,
1831 1114, 1115, 1115, 1115, 1115, 1115, 1115, 1116, 1116, 1116,
1832 1116, 1116, 1116, 1117, 1117, 1117, 1117, 1117, 1117, 1120,
1833 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1128,
1834 1128, 1129, 1129, 1130, 1130, 1131, 1131, 1132, 1132, 1133,
1835 1133, 1134, 1134, 1135, 1136, 1141, 1142, 1142, 1142, 1142,
1836 1142, 1144, 1144, 1144, 1145, 1145, 1147, 1148, 1152, 1156,
1837 1161, 1161, 1163, 1164, 1169, 1175, 1176, 1177, 1178, 1179,
1838 1183, 1184, 1185, 1189, 1190, 1191, 1192, 1196, 1197, 1198,
1839 1202, 1203, 1204, 1205, 1206, 1210, 1211, 1212, 1215, 1216,
1840 1217, 1218, 1219, 1220, 1221, 1228, 1229, 1230, 1231, 1232,
1841 1233, 1234, 1235, 1236, 1237, 1241, 1242, 1247, 1248, 1249,
1842 1250, 1251, 1252, 1255, 1256, 1261, 1262, 1269, 1270, 1276,
1843 1277, 1286, 1294, 1295, 1300, 1301, 1302, 1307, 1320, 1320,
1844 1320, 1320, 1320, 1320, 1320, 1323, 1327, 1331, 1338, 1343,
1845 1351, 1381, 1406, 1411, 1421, 1431, 1435, 1445, 1452, 1461,
1846 1468, 1473, 1478, 1485, 1486, 1493, 1500, 1508, 1514, 1526,
1847 1554, 1570, 1597, 1625, 1651, 1671, 1697, 1717, 1729, 1736,
1848 1802, 1812, 1822, 1828, 1838, 1844, 1854, 1859, 1864, 1877,
1849 1889, 1911, 1919, 1925, 1936, 1941, 1946, 1952, 1958, 1967,
1850 1971, 1979, 1979, 1982, 1982, 1985, 1997, 2018, 2023, 2031,
1851 2032, 2036, 2036, 2040, 2040, 2043, 2046, 2070, 2082, 2081,
1852 2093, 2092, 2102, 2101, 2112, 2152, 2155, 2161, 2171, 2175,
1853 2180, 2182, 2187, 2192, 2201, 2211, 2222, 2226, 2235, 2244,
1854 2249, 2383, 2383, 2385, 2394, 2394, 2396, 2401, 2413, 2417,
1855 2422, 2426, 2430, 2434, 2438, 2442, 2446, 2450, 2454, 2479,
1856 2483, 2493, 2497, 2501, 2506, 2513, 2513, 2519, 2528, 2533,
1857 2538, 2542, 2551, 2560, 2569, 2573, 2581, 2607, 2611, 2616,
1858 2626, 2645, 2654, 2745, 2749, 2756, 2767, 2780, 2790, 2801,
1859 2811, 2822, 2830, 2840, 2847, 2850, 2851, 2858, 2862, 2867,
1860 2883, 2900, 2914, 2928, 2940, 2948, 2955, 2961, 2967, 2973,
1861 2988, 3086, 3091, 3095, 3102, 3109, 3117, 3124, 3132, 3140,
1866 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1867 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1868 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1869 static const char *const yytname[] =
1871 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1872 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1873 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1874 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1875 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1876 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1877 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1878 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1879 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
1880 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1881 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1882 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1883 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1884 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1885 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE",
1886 "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE",
1887 "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC",
1888 "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT",
1889 "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI",
1890 "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "VAARG",
1891 "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "GETRESULT",
1892 "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS",
1893 "BYVAL", "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN",
1894 "PROTECTED", "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'",
1895 "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps",
1896 "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType",
1897 "FPType", "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign",
1898 "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1899 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1900 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1901 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1902 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1903 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1904 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1905 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1906 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1907 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1908 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1909 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1910 "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1911 "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1912 "JumpTable", "Inst", "PHIList", "ParamList", "IndexList", "OptTailCall",
1913 "InstVal", "OptVolatile", "MemoryInst", 0
1918 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1920 static const yytype_uint16 yytoknum[] =
1922 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1923 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1924 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1925 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1926 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1927 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1928 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1929 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1930 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1931 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1932 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1933 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1934 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1935 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1936 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1937 405, 40, 41, 61, 44, 42, 92, 91, 120, 93,
1938 60, 62, 123, 125, 99
1942 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1943 static const yytype_uint8 yyr1[] =
1945 0, 165, 166, 166, 166, 166, 166, 166, 166, 166,
1946 166, 167, 167, 167, 167, 167, 167, 168, 168, 168,
1947 168, 168, 168, 168, 168, 168, 168, 168, 168, 169,
1948 169, 169, 169, 169, 169, 169, 169, 169, 169, 170,
1949 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
1950 170, 170, 170, 170, 170, 171, 172, 172, 172, 172,
1951 172, 173, 173, 173, 174, 174, 175, 175, 176, 176,
1952 177, 177, 178, 178, 179, 180, 180, 180, 180, 180,
1953 181, 181, 181, 182, 182, 182, 182, 183, 183, 183,
1954 184, 184, 184, 184, 184, 185, 185, 185, 186, 186,
1955 186, 186, 186, 186, 186, 187, 187, 187, 187, 187,
1956 187, 187, 187, 187, 187, 188, 188, 189, 189, 189,
1957 189, 189, 189, 190, 190, 191, 191, 192, 192, 193,
1958 193, 194, 195, 195, 196, 196, 197, 197, 198, 198,
1959 198, 198, 198, 198, 198, 199, 199, 199, 199, 199,
1960 199, 199, 199, 199, 199, 199, 199, 199, 200, 201,
1961 201, 202, 202, 203, 203, 203, 203, 204, 204, 205,
1962 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
1963 205, 205, 205, 205, 205, 205, 205, 205, 205, 206,
1964 206, 206, 206, 206, 206, 206, 206, 206, 206, 207,
1965 207, 208, 208, 209, 209, 210, 210, 211, 211, 212,
1966 212, 214, 213, 215, 213, 213, 213, 213, 216, 213,
1967 217, 213, 218, 213, 213, 213, 213, 219, 220, 220,
1968 221, 222, 222, 222, 223, 223, 224, 224, 224, 224,
1969 225, 226, 226, 227, 228, 228, 229, 230, 231, 231,
1970 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
1971 232, 233, 233, 233, 233, 234, 234, 235, 236, 236,
1972 237, 237, 238, 239, 239, 239, 240, 240, 240, 240,
1973 240, 240, 240, 240, 240, 241, 241, 242, 243, 243,
1974 244, 244, 244, 244, 244, 245, 245, 246, 246, 247,
1975 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
1976 247, 247, 248, 248, 249, 249, 249, 249, 249, 249,
1980 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1981 static const yytype_uint8 yyr2[] =
1983 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1984 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1985 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1986 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1987 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1988 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1989 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
1990 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
1991 1, 1, 1, 0, 1, 1, 1, 0, 1, 1,
1992 0, 1, 1, 1, 1, 0, 1, 1, 0, 1,
1993 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
1994 1, 1, 1, 1, 2, 0, 2, 1, 1, 1,
1995 1, 1, 1, 0, 2, 0, 2, 0, 2, 0,
1996 3, 2, 0, 1, 0, 3, 1, 2, 1, 1,
1997 1, 1, 1, 1, 1, 1, 1, 3, 1, 2,
1998 5, 5, 5, 5, 3, 2, 5, 4, 2, 1,
1999 1, 1, 3, 1, 3, 1, 0, 1, 3, 4,
2000 3, 3, 4, 4, 3, 6, 5, 2, 2, 2,
2001 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,
2002 5, 8, 6, 6, 7, 7, 6, 8, 8, 3,
2003 1, 1, 1, 1, 0, 2, 6, 1, 0, 1,
2004 2, 0, 3, 0, 3, 3, 3, 3, 0, 8,
2005 0, 9, 0, 9, 5, 2, 3, 1, 3, 3,
2006 3, 3, 1, 0, 5, 3, 1, 3, 1, 0,
2007 10, 1, 1, 4, 1, 1, 2, 3, 0, 1,
2008 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2009 5, 1, 1, 1, 1, 1, 1, 2, 1, 3,
2010 2, 2, 3, 2, 0, 1, 2, 2, 3, 9,
2011 9, 8, 14, 1, 1, 6, 5, 2, 6, 7,
2012 4, 4, 6, 6, 0, 0, 3, 2, 1, 5,
2013 5, 6, 6, 4, 6, 4, 4, 6, 6, 2,
2014 8, 1, 1, 0, 3, 6, 3, 6, 2, 5,
2018 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2019 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2020 means the default is an error. */
2021 static const yytype_uint16 yydefact[] =
2023 73, 61, 70, 62, 71, 63, 213, 211, 0, 0,
2024 0, 0, 0, 0, 83, 72, 0, 73, 209, 87,
2025 90, 0, 0, 225, 0, 0, 68, 0, 74, 75,
2026 77, 76, 78, 80, 79, 81, 82, 84, 85, 86,
2027 83, 83, 204, 1, 210, 88, 89, 83, 214, 91,
2028 92, 93, 94, 83, 274, 212, 274, 0, 0, 233,
2029 226, 227, 215, 261, 262, 217, 138, 139, 140, 143,
2030 142, 141, 144, 145, 0, 0, 0, 0, 263, 264,
2031 146, 216, 148, 204, 204, 95, 203, 0, 98, 98,
2032 275, 271, 69, 244, 245, 246, 270, 228, 229, 232,
2033 0, 166, 149, 0, 0, 0, 0, 155, 167, 0,
2034 0, 166, 0, 0, 0, 97, 96, 0, 201, 202,
2035 0, 0, 99, 100, 101, 102, 103, 0, 247, 0,
2036 313, 273, 0, 230, 165, 115, 161, 163, 0, 0,
2037 0, 0, 0, 0, 154, 0, 0, 147, 0, 0,
2038 160, 0, 159, 0, 224, 138, 139, 140, 143, 142,
2039 141, 0, 0, 67, 67, 104, 0, 241, 242, 243,
2040 312, 298, 0, 0, 0, 0, 98, 283, 284, 2,
2041 3, 4, 5, 6, 7, 8, 9, 10, 14, 15,
2042 16, 11, 12, 13, 0, 0, 0, 0, 0, 0,
2043 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
2044 27, 28, 0, 0, 0, 0, 0, 0, 0, 0,
2045 0, 0, 272, 98, 287, 0, 311, 231, 158, 0,
2046 123, 67, 67, 157, 0, 168, 0, 123, 67, 67,
2047 0, 205, 186, 187, 182, 184, 183, 185, 188, 181,
2048 177, 178, 0, 0, 0, 0, 0, 0, 0, 0,
2049 0, 0, 0, 0, 0, 0, 180, 179, 218, 0,
2050 297, 277, 67, 268, 276, 0, 0, 55, 0, 0,
2051 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
2052 0, 53, 54, 49, 50, 51, 52, 39, 40, 41,
2053 42, 43, 44, 45, 46, 47, 48, 0, 129, 129,
2054 318, 67, 67, 309, 0, 0, 0, 0, 0, 67,
2055 67, 67, 0, 0, 0, 0, 0, 106, 108, 107,
2056 105, 109, 110, 111, 112, 113, 116, 164, 162, 151,
2057 152, 153, 156, 66, 150, 220, 222, 0, 0, 0,
2058 0, 0, 0, 0, 0, 170, 200, 0, 0, 0,
2059 174, 0, 171, 0, 0, 0, 134, 239, 250, 251,
2060 252, 257, 253, 254, 255, 256, 248, 0, 259, 266,
2061 265, 267, 0, 0, 278, 0, 0, 67, 67, 0,
2062 314, 0, 316, 295, 0, 0, 0, 0, 0, 0,
2063 0, 0, 0, 0, 0, 0, 67, 0, 114, 120,
2064 119, 117, 118, 121, 122, 124, 134, 134, 0, 0,
2065 0, 295, 0, 0, 0, 0, 0, 169, 155, 167,
2066 0, 172, 173, 0, 0, 0, 0, 219, 238, 115,
2067 236, 0, 249, 0, 0, 269, 0, 0, 0, 0,
2068 0, 0, 0, 0, 322, 0, 0, 0, 305, 306,
2069 0, 0, 0, 0, 0, 303, 0, 129, 0, 221,
2070 223, 67, 0, 0, 0, 0, 0, 0, 0, 199,
2071 176, 0, 0, 0, 0, 0, 0, 136, 134, 65,
2072 0, 123, 0, 258, 0, 0, 294, 0, 0, 129,
2073 130, 129, 0, 0, 0, 0, 0, 0, 321, 299,
2074 300, 294, 0, 319, 67, 206, 0, 0, 190, 0,
2075 0, 0, 0, 175, 0, 0, 67, 131, 137, 135,
2076 64, 235, 237, 115, 132, 0, 0, 0, 115, 115,
2077 0, 301, 302, 315, 317, 296, 0, 0, 304, 307,
2078 308, 0, 129, 0, 0, 0, 196, 0, 0, 192,
2079 193, 189, 65, 133, 127, 260, 0, 0, 0, 0,
2080 123, 0, 288, 0, 123, 320, 194, 195, 0, 0,
2081 0, 234, 0, 125, 0, 281, 0, 0, 106, 108,
2082 115, 115, 0, 115, 115, 289, 310, 191, 197, 198,
2083 128, 0, 240, 279, 0, 280, 0, 291, 290, 0,
2084 0, 0, 126, 0, 0, 0, 115, 115, 0, 0,
2085 0, 293, 292, 286, 0, 0, 285, 0, 282
2088 /* YYDEFGOTO[NTERM-NUM]. */
2089 static const yytype_int16 yydefgoto[] =
2091 -1, 263, 264, 265, 290, 307, 161, 162, 78, 531,
2092 112, 12, 79, 14, 15, 40, 41, 42, 47, 53,
2093 117, 127, 336, 228, 415, 339, 602, 583, 390, 487,
2094 564, 437, 488, 80, 163, 136, 153, 137, 138, 109,
2095 356, 378, 357, 120, 87, 154, 16, 17, 18, 20,
2096 19, 366, 416, 417, 62, 23, 60, 100, 440, 441,
2097 128, 169, 54, 95, 55, 48, 443, 379, 82, 381,
2098 273, 274, 56, 91, 92, 222, 587, 131, 313, 540,
2099 454, 223, 224, 225, 226
2102 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2104 #define YYPACT_NINF -571
2105 static const yytype_int16 yypact[] =
2107 39, -571, -571, -571, -571, -571, -571, -571, -12, -138,
2108 -25, -108, 49, -75, 258, -571, 83, 883, -571, 54,
2109 187, -54, -50, -571, -38, 105, -571, 1464, -571, -571,
2110 -571, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2111 106, 106, 178, -571, -571, -571, -571, 106, -571, -571,
2112 -571, -571, -571, 106, 110, -571, -10, 158, 176, 184,
2113 -571, -571, -571, -571, -571, 58, -571, -571, -571, -571,
2114 -571, -571, -571, -571, 239, 242, 2, 126, -571, -571,
2115 -571, 12, -571, 232, 232, 234, -571, 127, 175, 175,
2116 -571, -571, 255, -571, -571, -571, -571, -571, -571, -571,
2117 62, 1059, -571, 117, 122, 506, 58, -571, 12, -111,
2118 141, 1059, 129, 127, 127, -571, -571, 1014, -571, -571,
2119 1504, 292, -571, -571, -571, -571, -571, 1562, -571, -6,
2120 1843, -571, 291, -571, -571, 12, -571, 166, 174, 1620,
2121 1620, 170, -110, 1620, -571, 329, 183, -571, 1504, 1620,
2122 58, 188, 12, 336, -571, 311, 333, 337, 338, 339,
2123 340, 262, 341, 1115, 297, -571, 26, -571, -571, -571,
2124 -571, -571, 289, 1660, 194, 343, 175, -571, -571, -571,
2125 -571, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2126 -571, -571, -571, -571, 511, 787, 1620, 1620, 1620, 1620,
2127 -571, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2128 -571, -571, 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
2129 1620, 1620, -571, 175, -571, 135, -571, -571, 434, 1345,
2130 -571, -7, -33, -571, 191, 12, 209, -571, 297, -19,
2131 1014, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2132 -571, -571, 511, 787, 211, 212, 213, 214, 217, 1385,
2133 1678, 609, 347, 225, 228, 230, -571, -571, -571, 231,
2134 -571, 58, 702, -571, 235, 841, 841, -571, 841, 1562,
2135 -571, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2136 1620, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2137 -571, -571, -571, -571, -571, -571, -571, 1620, 11, 97,
2138 -571, 702, -31, 241, 244, 245, 249, 250, 251, 10,
2139 702, 702, 355, 1562, 1620, 1620, 392, -571, -571, -571,
2140 -571, -571, -571, -571, -571, -571, -571, -571, -571, -65,
2141 -571, -571, -571, -571, -65, -571, 129, 371, 259, 260,
2142 1504, 1504, 1504, 1504, 1504, -571, -571, 88, 788, -57,
2143 -571, -68, -571, 1504, 1504, 1504, 261, 1406, -571, -571,
2144 -571, -571, -571, -571, -571, -571, 352, 1504, -571, -571,
2145 -571, -571, 1504, 263, -571, 266, 841, 702, 702, 7,
2146 -571, 15, -571, -571, 841, 256, 1620, 1620, 1620, 1620,
2147 1620, 269, 272, 274, 1620, 841, 702, 275, -571, -571,
2148 -571, -571, -571, -571, -571, -571, 261, 261, 1620, 1504,
2149 1504, -571, 276, 277, 281, 282, 1504, -571, 278, 969,
2150 -58, -571, -571, 283, 287, 378, -3, -571, -571, 12,
2151 290, 293, -571, 421, 43, -571, 429, 430, 298, 294,
2152 296, 841, 449, 841, 300, 301, 841, 302, 12, -571,
2153 303, 305, 456, 841, 841, 12, 310, 308, 1620, -571,
2154 -571, -45, 313, 314, 133, 1504, 1504, 1504, 1504, -571,
2155 -571, 312, 1504, 1504, 1620, 447, 468, -571, 261, 1746,
2156 1446, -571, 320, -571, 841, 841, 1718, 841, 841, 308,
2157 -571, 308, 1620, 841, 321, 1620, 1620, 1620, -571, -571,
2158 -571, 1718, 424, -571, 702, -571, 1504, 1504, -571, 324,
2159 330, 332, 334, -571, 331, 342, -30, -571, -571, -571,
2160 -571, -571, -571, 12, 81, 462, 344, 346, 28, 12,
2161 155, -571, -571, -571, -571, -571, 345, 841, -571, -571,
2162 -571, 171, 308, 348, 349, 1504, -571, 1504, 1504, -571,
2163 -571, -571, 1746, -571, 437, -571, 474, -4, 560, 560,
2164 -571, 1736, -571, 353, -571, -571, -571, -571, 354, 359,
2165 363, -571, 491, 358, 841, -571, 1255, -1, 356, 373,
2166 -571, -571, 87, 28, 12, -571, -65, -571, -571, -571,
2167 -571, 505, -571, -571, 377, -571, 1255, 434, 434, 479,
2168 560, 560, -571, 515, 379, 841, -571, -571, 841, 519,
2169 465, 434, 434, -571, 841, 521, -571, 841, -571
2172 /* YYPGOTO[NTERM-NUM]. */
2173 static const yytype_int16 yypgoto[] =
2175 -571, 416, 417, 420, 304, 306, -173, -571, 0, -8,
2176 -150, 466, 8, -571, -571, -571, -571, 1, -571, -571,
2177 -571, -149, -571, -409, -571, -234, -571, -571, -289, 23,
2178 -571, -404, -571, -571, -26, 360, -122, -571, 450, 460,
2179 -92, -159, -223, 55, 93, 326, -571, -571, 555, -571,
2180 -571, -571, -571, -571, -571, -571, -571, -571, -571, -571,
2181 486, -571, -571, -571, -571, -571, -571, -570, -76, 46,
2182 -105, -571, -571, 525, -571, -571, -571, -571, -571, 77,
2183 169, -571, -571, -571, -571
2186 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2187 positive, shift that token. If negative, reduce the rule which
2188 number is the opposite. If zero, do what YYDEFACT says.
2189 If YYTABLE_NINF, syntax error. */
2190 #define YYTABLE_NINF -209
2191 static const yytype_int16 yytable[] =
2193 11, 81, 278, 344, 266, 166, 104, 277, 13, 110,
2194 277, 90, 469, 470, 268, 24, 604, 11, 451, 93,
2195 392, 110, 167, 110, 110, 13, 453, 279, 164, 1,
2196 489, 485, 3, 25, 5, 110, 614, 359, 361, -208,
2197 21, 83, 84, 143, 143, 26, 2, 110, 88, 4,
2198 486, 108, 144, 234, 89, 22, 238, -69, 1, 2,
2199 452, 3, 4, 5, 110, 110, 110, 27, 452, 6,
2200 7, 409, 410, 411, 323, 135, 412, 241, 28, 108,
2201 413, 414, -144, 43, 529, 135, 426, 267, 345, 346,
2202 8, 152, 11, 310, 9, 432, 426, 426, 10, 57,
2203 45, 152, 46, 58, 431, 481, 111, 515, 314, 315,
2204 316, 317, 318, 231, 232, 485, 322, 235, 111, 59,
2205 111, 111, 561, 239, 562, 609, 394, 61, 341, 568,
2206 569, 90, 111, 63, 64, 430, 106, 66, 67, 68,
2207 69, 70, 71, 72, 111, 1, 2, 272, 3, 4,
2208 5, 110, 340, 94, 444, 585, 168, 386, 605, 118,
2209 119, 111, 111, 111, 105, 389, -67, -67, 148, 149,
2210 308, 309, 272, 311, 269, 73, 113, 114, 513, -144,
2211 97, 607, 608, -144, 610, 611, 312, 272, 272, 272,
2212 272, 272, 319, 320, 321, 272, 380, 426, 98, 380,
2213 380, 405, 380, 135, 493, 275, 99, 621, 622, 101,
2214 543, 276, 544, 85, 152, 86, 132, 409, 410, 411,
2215 407, 133, 412, 409, 410, 411, 413, 414, 412, 49,
2216 50, 51, 413, 414, 52, 380, 121, 122, 123, 124,
2217 125, 126, 426, 102, 380, 380, 103, 427, 111, 324,
2218 325, 391, -67, 152, 37, 38, 39, 534, 421, 422,
2219 423, 424, 425, 575, 387, 244, 245, 246, 247, 86,
2220 266, 433, 434, 435, 1, 139, 115, 3, 116, 5,
2221 140, 388, 74, 75, 147, 518, 76, 502, 77, 107,
2222 445, 457, 145, 459, 460, 461, 165, 152, 406, 272,
2223 29, 30, 31, 32, 33, 34, 35, 570, 36, 571,
2224 380, 380, 380, 227, -55, -55, -55, -55, 380, 401,
2225 229, 383, 384, 574, 385, 571, 230, 472, 473, 380,
2226 380, 233, 429, 236, 479, 237, 592, 242, 243, 240,
2227 596, 439, -56, 63, 64, 270, -57, -60, -59, -58,
2228 248, 110, 342, 267, 277, 1, 2, 393, 3, 4,
2229 5, 343, 350, 351, 352, 353, 402, 403, 354, 362,
2230 272, 458, 272, 272, 272, 380, 363, 380, 465, 364,
2231 380, 365, 367, 519, 520, 521, 522, 380, 380, 382,
2232 524, 525, 471, 404, 586, 395, 408, 545, 396, 397,
2233 548, 549, 550, 398, 399, 400, 37, 38, 39, 418,
2234 419, 420, 442, 456, 606, 436, 484, 446, 380, 380,
2235 447, 380, 380, 462, 553, 554, 463, 380, 464, 468,
2236 475, 476, 448, 449, 450, 477, 478, 482, 380, 480,
2237 455, 483, 514, 492, 490, 491, 494, 495, 497, 496,
2238 498, 466, 467, 500, 502, 503, 505, 506, 526, 507,
2239 508, 511, 512, 578, 533, 579, 580, 516, 517, 527,
2240 539, 380, 528, 523, 535, 547, 272, 452, 555, 272,
2241 272, 272, 556, 559, 565, 539, 557, 326, 558, 530,
2242 582, 584, 380, 380, 560, 600, 615, 499, 566, 501,
2243 576, 577, 504, 567, 572, 601, 597, -18, 380, 509,
2244 510, 598, 595, 63, 64, 599, 106, 66, 67, 68,
2245 69, 70, 71, 72, -19, 1, 2, 612, 3, 4,
2246 5, 613, 618, 619, 380, 380, 624, 625, 627, 380,
2247 536, 537, 380, 541, 542, 594, 219, 220, 380, 546,
2248 221, 380, 327, 328, 581, 73, 348, 563, 130, 349,
2249 552, 146, 530, 368, 369, 142, 347, 63, 64, 370,
2250 329, 330, 44, 331, 332, 129, 333, 334, 335, 1,
2251 2, 96, 3, 4, 5, 371, 372, 373, 551, 338,
2252 474, 0, 0, 573, 0, 0, 0, 0, 0, 0,
2253 374, 375, 280, 281, 282, 283, 284, 285, 286, 287,
2254 288, 289, 0, 326, 590, 591, 63, 64, 376, 106,
2255 155, 156, 157, 158, 159, 160, 72, 0, 1, 2,
2256 603, 3, 4, 5, 179, 180, 181, 182, 183, 184,
2257 185, 186, 187, 188, 189, 190, 191, 192, 193, 252,
2258 253, 0, 0, 0, 0, 0, 616, 617, 73, 0,
2259 0, 620, 74, 75, 623, 0, 76, 0, 77, 141,
2260 626, 0, 0, 628, 0, 0, 254, 200, 588, 589,
2261 203, 204, 205, 206, 207, 208, 209, 210, 211, 0,
2262 255, 0, 256, 257, 258, 0, 329, 330, 0, 331,
2263 332, 0, 333, 334, 335, 368, 369, 0, 0, 63,
2264 64, 370, 0, 0, 0, 0, 0, 0, 0, 0,
2265 377, 1, 2, 0, 3, 4, 5, 371, 372, 373,
2266 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2267 0, 0, 374, 375, 0, 0, 0, 0, 0, 0,
2268 0, 0, 0, 0, 0, 0, 110, 0, 0, 0,
2269 376, 0, 0, 0, 0, 74, 75, 0, 0, 76,
2270 0, 77, 360, 0, 0, 0, 179, 180, 181, 182,
2271 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2272 193, 252, 253, 0, 0, 63, 64, 0, 106, 155,
2273 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
2274 3, 4, 5, 291, 292, 0, 0, 0, 254, 200,
2275 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
2276 211, 0, 255, 0, 256, 257, 258, 73, 0, 0,
2277 0, 0, 0, 0, 368, 369, 0, 0, 63, 64,
2278 370, 0, 0, 111, 0, 0, 0, 0, 0, 0,
2279 1, 2, 377, 3, 4, 5, 371, 372, 373, 0,
2280 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2281 0, 374, 375, -207, 293, 294, 295, 296, 297, 298,
2282 299, 300, 301, 302, 303, 304, 305, 306, 0, 376,
2283 0, -69, 1, 2, 0, 3, 4, 5, 0, 0,
2284 0, 0, 0, 6, 7, 179, 180, 181, 182, 183,
2285 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2286 252, 253, 0, 0, 8, 0, 0, 0, 9, 0,
2287 0, 0, 10, 0, 74, 75, 0, 0, 76, 0,
2288 77, 428, 0, 0, 0, 0, 0, 254, 200, 201,
2289 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
2290 0, 255, 0, 256, 257, 258, 63, 64, 0, 0,
2291 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
2292 0, 3, 4, 5, 249, 0, 0, 0, 0, 0,
2293 0, 377, 0, 0, 0, 0, 0, 0, 0, 250,
2294 251, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2295 0, 63, 64, 110, 150, 66, 67, 68, 69, 70,
2296 71, 72, 0, 1, 2, 0, 3, 4, 5, 0,
2297 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
2298 186, 187, 188, 189, 190, 191, 192, 193, 252, 253,
2299 0, 0, 0, 73, 0, 0, 63, 64, 0, 106,
2300 66, 67, 68, 69, 70, 71, 72, 0, 1, 2,
2301 0, 3, 4, 5, 0, 254, 200, 201, 202, 203,
2302 204, 205, 206, 207, 208, 209, 210, 211, 134, 255,
2303 0, 256, 257, 258, 0, 0, 0, 0, 73, 0,
2304 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2305 111, 0, 63, 64, -67, 0, 259, 0, 0, 260,
2306 0, 261, 0, 262, 1, 2, 151, 3, 4, 5,
2307 249, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2308 0, 0, 0, 0, 0, 250, 251, 0, 0, 0,
2309 0, 0, 0, 0, 0, 0, 0, 0, 0, 110,
2310 74, 75, 0, 0, 76, 0, 77, 0, 0, 0,
2311 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
2312 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2313 190, 191, 192, 193, 252, 253, 0, 0, 0, 0,
2314 0, 0, 0, 0, 0, 74, 75, 0, 0, 76,
2315 0, 77, 0, 0, 0, 0, 0, 0, 0, 0,
2316 0, 254, 200, 201, 202, 203, 204, 205, 206, 207,
2317 208, 209, 210, 211, 0, 255, 0, 256, 257, 258,
2318 0, 0, 0, 0, 0, 0, 0, 0, 368, 369,
2319 0, 0, 0, 0, 370, 0, 111, 0, 0, 0,
2320 0, 0, 259, 0, 0, 260, 0, 261, 0, 262,
2321 371, 372, 373, 0, 0, 0, 0, 0, 0, 0,
2322 0, 0, 0, 0, 0, 374, 375, 0, 0, 0,
2323 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2324 0, 0, 0, 376, 0, 0, 0, 0, 0, 0,
2325 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
2326 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2327 190, 191, 192, 193, 252, 253, 0, 0, 0, 0,
2328 0, 0, 63, 64, 0, 106, 66, 67, 68, 69,
2329 70, 71, 72, 0, 1, 2, 0, 3, 4, 5,
2330 0, 254, 200, 201, 202, 203, 204, 205, 206, 207,
2331 208, 209, 210, 211, 337, 255, 0, 256, 257, 258,
2332 0, 0, 63, 64, 73, 106, 155, 156, 157, 158,
2333 159, 160, 72, 0, 1, 2, 0, 3, 4, 5,
2334 0, 0, 0, 63, 64, 377, 106, 66, 67, 68,
2335 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
2336 5, 0, 0, 0, 73, 0, 0, 0, 0, 0,
2337 0, 0, 0, 0, 0, 438, 0, 0, 0, 0,
2338 0, 0, 0, 63, 64, 73, 106, 66, 67, 68,
2339 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
2340 5, 63, 64, 0, 65, 66, 67, 68, 69, 70,
2341 71, 72, 0, 1, 2, 532, 3, 4, 5, 0,
2342 0, 0, 0, 0, 0, 73, 0, 0, 0, 0,
2343 0, 74, 75, 0, 0, 76, 0, 77, 0, 0,
2344 0, 63, 64, 73, 106, 155, 156, 157, 158, 159,
2345 160, 72, 0, 1, 2, 0, 3, 4, 5, 0,
2346 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2347 0, 74, 75, 0, 355, 76, 0, 77, 0, 0,
2348 0, 0, 0, 73, 0, 0, 0, 0, 0, 0,
2349 0, 0, 74, 75, 0, 0, 76, 0, 77, 63,
2350 64, 0, 150, 66, 67, 68, 69, 70, 71, 72,
2351 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2352 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2353 0, 0, 74, 75, 0, 0, 76, 0, 77, 0,
2354 0, 73, 0, 0, 0, 0, 0, 0, 0, 0,
2355 74, 75, 0, 0, 76, 0, 77, 63, 64, 0,
2356 106, 66, 67, 68, 69, 70, 71, 72, 0, 1,
2357 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2358 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2359 74, 75, 0, 0, 76, 0, 77, 63, 64, 73,
2360 271, 66, 67, 68, 69, 70, 71, 72, 0, 1,
2361 2, 0, 3, 4, 5, 63, 64, 0, 106, 155,
2362 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
2363 3, 4, 5, 0, 0, 0, 0, 0, 0, 73,
2364 0, 0, 0, 0, 0, 0, 0, 0, 74, 75,
2365 0, 0, 76, 0, 77, 63, 64, 73, 106, 66,
2366 67, 68, 69, 70, 71, 538, 0, 1, 2, 0,
2367 3, 4, 5, 63, 64, 0, 106, 66, 67, 68,
2368 69, 70, 71, 593, 0, 1, 2, 0, 3, 4,
2369 5, 0, 0, 0, 0, 1, 0, 73, 3, 0,
2370 5, 0, 0, 0, 0, 0, 74, 75, 0, 0,
2371 76, 0, 77, 0, 0, 73, 0, 0, 0, 0,
2372 0, 0, 0, 0, 0, 0, 0, 0, 0, 326,
2373 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2374 0, 0, 0, 0, 0, 0, 74, 75, 0, 0,
2375 76, 0, 77, 0, 0, 0, 0, 0, 0, 0,
2376 0, 0, 0, 0, 74, 75, 0, 0, 76, 0,
2377 358, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2378 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2379 0, 0, 0, 0, 327, 328, 0, 0, 0, 0,
2380 0, 0, 0, 0, 74, 75, 0, 0, 76, 170,
2381 77, 0, 329, 330, 0, 331, 332, 0, 333, 334,
2382 335, 0, 74, 75, 0, 0, 76, 0, 77, 171,
2383 172, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2384 0, 173, 174, 175, 176, 177, 178, 179, 180, 181,
2385 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
2386 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
2387 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2388 0, 0, 0, 0, 196, 197, 198, 0, 0, 199,
2389 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
2390 210, 211, 212, 213, 214, 215, 216, 217, 218
2393 static const yytype_int16 yycheck[] =
2395 0, 27, 175, 237, 163, 127, 4, 11, 0, 54,
2396 11, 21, 416, 417, 164, 153, 586, 17, 11, 29,
2397 309, 54, 28, 54, 54, 17, 11, 176, 120, 19,
2398 439, 34, 22, 58, 24, 54, 606, 260, 261, 0,
2399 52, 40, 41, 154, 154, 153, 20, 54, 47, 23,
2400 53, 77, 163, 163, 53, 67, 148, 18, 19, 20,
2401 53, 22, 23, 24, 54, 54, 54, 18, 53, 30,
2402 31, 136, 137, 138, 223, 101, 141, 153, 153, 105,
2403 145, 146, 54, 0, 488, 111, 154, 163, 238, 239,
2404 51, 117, 92, 198, 55, 163, 154, 154, 59, 153,
2405 46, 127, 48, 153, 161, 163, 151, 152, 213, 214,
2406 215, 216, 217, 139, 140, 34, 221, 143, 151, 157,
2407 151, 151, 152, 149, 533, 38, 157, 22, 161, 538,
2408 539, 21, 151, 7, 8, 358, 10, 11, 12, 13,
2409 14, 15, 16, 17, 151, 19, 20, 173, 22, 23,
2410 24, 54, 159, 163, 377, 159, 162, 279, 159, 32,
2411 33, 151, 151, 151, 162, 154, 155, 155, 113, 114,
2412 196, 197, 198, 199, 166, 49, 83, 84, 467, 151,
2413 22, 590, 591, 155, 593, 594, 212, 213, 214, 215,
2414 216, 217, 218, 219, 220, 221, 272, 154, 22, 275,
2415 276, 323, 278, 229, 161, 11, 22, 616, 617, 151,
2416 499, 17, 501, 35, 240, 37, 154, 136, 137, 138,
2417 325, 159, 141, 136, 137, 138, 145, 146, 141, 42,
2418 43, 44, 145, 146, 47, 311, 61, 62, 63, 64,
2419 65, 66, 154, 4, 320, 321, 4, 159, 151, 114,
2420 115, 154, 155, 279, 148, 149, 150, 491, 350, 351,
2421 352, 353, 354, 552, 290, 3, 4, 5, 6, 37,
2422 429, 363, 364, 365, 19, 158, 42, 22, 44, 24,
2423 158, 307, 156, 157, 155, 152, 160, 154, 162, 163,
2424 382, 396, 151, 398, 399, 400, 4, 323, 324, 325,
2425 42, 43, 44, 45, 46, 47, 48, 152, 50, 154,
2426 386, 387, 388, 22, 3, 4, 5, 6, 394, 319,
2427 154, 275, 276, 152, 278, 154, 152, 419, 420, 405,
2428 406, 161, 358, 4, 426, 152, 570, 26, 27, 151,
2429 574, 367, 9, 7, 8, 56, 9, 9, 9, 9,
2430 9, 54, 161, 429, 11, 19, 20, 311, 22, 23,
2431 24, 152, 151, 151, 151, 151, 320, 321, 151, 22,
2432 396, 397, 398, 399, 400, 451, 151, 453, 404, 151,
2433 456, 151, 151, 475, 476, 477, 478, 463, 464, 154,
2434 482, 483, 418, 38, 567, 154, 4, 502, 154, 154,
2435 505, 506, 507, 154, 154, 154, 148, 149, 150, 38,
2436 151, 151, 60, 157, 587, 154, 38, 154, 494, 495,
2437 154, 497, 498, 154, 516, 517, 154, 503, 154, 154,
2438 154, 154, 386, 387, 388, 154, 154, 154, 514, 161,
2439 394, 154, 468, 22, 154, 152, 17, 17, 154, 151,
2440 154, 405, 406, 4, 154, 154, 154, 154, 484, 154,
2441 4, 151, 154, 555, 490, 557, 558, 154, 154, 22,
2442 496, 547, 4, 161, 154, 154, 502, 53, 154, 505,
2443 506, 507, 152, 152, 22, 511, 154, 53, 154, 489,
2444 53, 17, 568, 569, 152, 4, 17, 451, 154, 453,
2445 152, 152, 456, 157, 159, 147, 152, 151, 584, 463,
2446 464, 152, 159, 7, 8, 152, 10, 11, 12, 13,
2447 14, 15, 16, 17, 151, 19, 20, 22, 22, 23,
2448 24, 154, 17, 154, 610, 611, 17, 72, 17, 615,
2449 494, 495, 618, 497, 498, 571, 130, 130, 624, 503,
2450 130, 627, 118, 119, 562, 49, 252, 534, 92, 253,
2451 514, 111, 562, 3, 4, 105, 240, 7, 8, 9,
2452 136, 137, 17, 139, 140, 89, 142, 143, 144, 19,
2453 20, 56, 22, 23, 24, 25, 26, 27, 511, 229,
2454 421, -1, -1, 547, -1, -1, -1, -1, -1, -1,
2455 40, 41, 91, 92, 93, 94, 95, 96, 97, 98,
2456 99, 100, -1, 53, 568, 569, 7, 8, 58, 10,
2457 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2458 584, 22, 23, 24, 74, 75, 76, 77, 78, 79,
2459 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2460 90, -1, -1, -1, -1, -1, 610, 611, 49, -1,
2461 -1, 615, 156, 157, 618, -1, 160, -1, 162, 163,
2462 624, -1, -1, 627, -1, -1, 116, 117, 118, 119,
2463 120, 121, 122, 123, 124, 125, 126, 127, 128, -1,
2464 130, -1, 132, 133, 134, -1, 136, 137, -1, 139,
2465 140, -1, 142, 143, 144, 3, 4, -1, -1, 7,
2466 8, 9, -1, -1, -1, -1, -1, -1, -1, -1,
2467 160, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2468 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2469 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2470 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
2471 58, -1, -1, -1, -1, 156, 157, -1, -1, 160,
2472 -1, 162, 163, -1, -1, -1, 74, 75, 76, 77,
2473 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2474 88, 89, 90, -1, -1, 7, 8, -1, 10, 11,
2475 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2476 22, 23, 24, 26, 27, -1, -1, -1, 116, 117,
2477 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2478 128, -1, 130, -1, 132, 133, 134, 49, -1, -1,
2479 -1, -1, -1, -1, 3, 4, -1, -1, 7, 8,
2480 9, -1, -1, 151, -1, -1, -1, -1, -1, -1,
2481 19, 20, 160, 22, 23, 24, 25, 26, 27, -1,
2482 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2483 -1, 40, 41, 0, 97, 98, 99, 100, 101, 102,
2484 103, 104, 105, 106, 107, 108, 109, 110, -1, 58,
2485 -1, 18, 19, 20, -1, 22, 23, 24, -1, -1,
2486 -1, -1, -1, 30, 31, 74, 75, 76, 77, 78,
2487 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2488 89, 90, -1, -1, 51, -1, -1, -1, 55, -1,
2489 -1, -1, 59, -1, 156, 157, -1, -1, 160, -1,
2490 162, 163, -1, -1, -1, -1, -1, 116, 117, 118,
2491 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2492 -1, 130, -1, 132, 133, 134, 7, 8, -1, -1,
2493 -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
2494 -1, 22, 23, 24, 25, -1, -1, -1, -1, -1,
2495 -1, 160, -1, -1, -1, -1, -1, -1, -1, 40,
2496 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2497 -1, 7, 8, 54, 10, 11, 12, 13, 14, 15,
2498 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2499 -1, -1, -1, 74, 75, 76, 77, 78, 79, 80,
2500 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2501 -1, -1, -1, 49, -1, -1, 7, 8, -1, 10,
2502 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2503 -1, 22, 23, 24, -1, 116, 117, 118, 119, 120,
2504 121, 122, 123, 124, 125, 126, 127, 128, 39, 130,
2505 -1, 132, 133, 134, -1, -1, -1, -1, 49, -1,
2506 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2507 151, -1, 7, 8, 155, -1, 157, -1, -1, 160,
2508 -1, 162, -1, 164, 19, 20, 122, 22, 23, 24,
2509 25, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2510 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2511 -1, -1, -1, -1, -1, -1, -1, -1, -1, 54,
2512 156, 157, -1, -1, 160, -1, 162, -1, -1, -1,
2513 -1, -1, -1, -1, -1, -1, -1, -1, -1, 74,
2514 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2515 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
2516 -1, -1, -1, -1, -1, 156, 157, -1, -1, 160,
2517 -1, 162, -1, -1, -1, -1, -1, -1, -1, -1,
2518 -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
2519 125, 126, 127, 128, -1, 130, -1, 132, 133, 134,
2520 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
2521 -1, -1, -1, -1, 9, -1, 151, -1, -1, -1,
2522 -1, -1, 157, -1, -1, 160, -1, 162, -1, 164,
2523 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
2524 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2525 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2526 -1, -1, -1, 58, -1, -1, -1, -1, -1, -1,
2527 -1, -1, -1, -1, -1, -1, -1, -1, -1, 74,
2528 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2529 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
2530 -1, -1, 7, 8, -1, 10, 11, 12, 13, 14,
2531 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2532 -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
2533 125, 126, 127, 128, 39, 130, -1, 132, 133, 134,
2534 -1, -1, 7, 8, 49, 10, 11, 12, 13, 14,
2535 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2536 -1, -1, -1, 7, 8, 160, 10, 11, 12, 13,
2537 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2538 24, -1, -1, -1, 49, -1, -1, -1, -1, -1,
2539 -1, -1, -1, -1, -1, 39, -1, -1, -1, -1,
2540 -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
2541 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2542 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2543 16, 17, -1, 19, 20, 39, 22, 23, 24, -1,
2544 -1, -1, -1, -1, -1, 49, -1, -1, -1, -1,
2545 -1, 156, 157, -1, -1, 160, -1, 162, -1, -1,
2546 -1, 7, 8, 49, 10, 11, 12, 13, 14, 15,
2547 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2548 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2549 -1, 156, 157, -1, 159, 160, -1, 162, -1, -1,
2550 -1, -1, -1, 49, -1, -1, -1, -1, -1, -1,
2551 -1, -1, 156, 157, -1, -1, 160, -1, 162, 7,
2552 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2553 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2554 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2555 -1, -1, 156, 157, -1, -1, 160, -1, 162, -1,
2556 -1, 49, -1, -1, -1, -1, -1, -1, -1, -1,
2557 156, 157, -1, -1, 160, -1, 162, 7, 8, -1,
2558 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2559 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2560 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2561 156, 157, -1, -1, 160, -1, 162, 7, 8, 49,
2562 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2563 20, -1, 22, 23, 24, 7, 8, -1, 10, 11,
2564 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2565 22, 23, 24, -1, -1, -1, -1, -1, -1, 49,
2566 -1, -1, -1, -1, -1, -1, -1, -1, 156, 157,
2567 -1, -1, 160, -1, 162, 7, 8, 49, 10, 11,
2568 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2569 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
2570 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2571 24, -1, -1, -1, -1, 19, -1, 49, 22, -1,
2572 24, -1, -1, -1, -1, -1, 156, 157, -1, -1,
2573 160, -1, 162, -1, -1, 49, -1, -1, -1, -1,
2574 -1, -1, -1, -1, -1, -1, -1, -1, -1, 53,
2575 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2576 -1, -1, -1, -1, -1, -1, 156, 157, -1, -1,
2577 160, -1, 162, -1, -1, -1, -1, -1, -1, -1,
2578 -1, -1, -1, -1, 156, 157, -1, -1, 160, -1,
2579 162, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2580 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2581 -1, -1, -1, -1, 118, 119, -1, -1, -1, -1,
2582 -1, -1, -1, -1, 156, 157, -1, -1, 160, 36,
2583 162, -1, 136, 137, -1, 139, 140, -1, 142, 143,
2584 144, -1, 156, 157, -1, -1, 160, -1, 162, 56,
2585 57, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2586 -1, 68, 69, 70, 71, 72, 73, 74, 75, 76,
2587 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2588 87, 88, 89, 90, -1, -1, -1, -1, -1, -1,
2589 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2590 -1, -1, -1, -1, 111, 112, 113, -1, -1, 116,
2591 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
2592 127, 128, 129, 130, 131, 132, 133, 134, 135
2595 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2596 symbol of state STATE-NUM. */
2597 static const yytype_uint8 yystos[] =
2599 0, 19, 20, 22, 23, 24, 30, 31, 51, 55,
2600 59, 173, 176, 177, 178, 179, 211, 212, 213, 215,
2601 214, 52, 67, 220, 153, 58, 153, 18, 153, 42,
2602 43, 44, 45, 46, 47, 48, 50, 148, 149, 150,
2603 180, 181, 182, 0, 213, 46, 48, 183, 230, 42,
2604 43, 44, 47, 184, 227, 229, 237, 153, 153, 157,
2605 221, 22, 219, 7, 8, 10, 11, 12, 13, 14,
2606 15, 16, 17, 49, 156, 157, 160, 162, 173, 177,
2607 198, 199, 233, 182, 182, 35, 37, 209, 182, 182,
2608 21, 238, 239, 29, 163, 228, 238, 22, 22, 22,
2609 222, 151, 4, 4, 4, 162, 10, 163, 199, 204,
2610 54, 151, 175, 209, 209, 42, 44, 185, 32, 33,
2611 208, 61, 62, 63, 64, 65, 66, 186, 225, 225,
2612 176, 242, 154, 159, 39, 199, 200, 202, 203, 158,
2613 158, 163, 204, 154, 163, 151, 203, 155, 208, 208,
2614 10, 122, 199, 201, 210, 11, 12, 13, 14, 15,
2615 16, 171, 172, 199, 205, 4, 201, 28, 162, 226,
2616 36, 56, 57, 68, 69, 70, 71, 72, 73, 74,
2617 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2618 85, 86, 87, 88, 89, 90, 111, 112, 113, 116,
2619 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
2620 127, 128, 129, 130, 131, 132, 133, 134, 135, 166,
2621 167, 168, 240, 246, 247, 248, 249, 22, 188, 154,
2622 152, 199, 199, 161, 163, 199, 4, 152, 205, 199,
2623 151, 233, 26, 27, 3, 4, 5, 6, 9, 25,
2624 40, 41, 89, 90, 116, 130, 132, 133, 134, 157,
2625 160, 162, 164, 166, 167, 168, 206, 233, 175, 177,
2626 56, 10, 199, 235, 236, 11, 17, 11, 171, 186,
2627 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
2628 169, 26, 27, 97, 98, 99, 100, 101, 102, 103,
2629 104, 105, 106, 107, 108, 109, 110, 170, 199, 199,
2630 235, 199, 199, 243, 235, 235, 235, 235, 235, 199,
2631 199, 199, 235, 186, 114, 115, 53, 118, 119, 136,
2632 137, 139, 140, 142, 143, 144, 187, 39, 200, 190,
2633 159, 161, 161, 152, 190, 175, 175, 210, 169, 170,
2634 151, 151, 151, 151, 151, 159, 205, 207, 162, 207,
2635 163, 207, 22, 151, 151, 151, 216, 151, 3, 4,
2636 9, 25, 26, 27, 40, 41, 58, 160, 206, 232,
2637 233, 234, 154, 234, 234, 234, 201, 199, 199, 154,
2638 193, 154, 193, 234, 157, 154, 154, 154, 154, 154,
2639 154, 173, 234, 234, 38, 201, 199, 235, 4, 136,
2640 137, 138, 141, 145, 146, 189, 217, 218, 38, 151,
2641 151, 205, 205, 205, 205, 205, 154, 159, 163, 199,
2642 207, 161, 163, 205, 205, 205, 154, 196, 39, 199,
2643 223, 224, 60, 231, 207, 205, 154, 154, 234, 234,
2644 234, 11, 53, 11, 245, 234, 157, 235, 199, 235,
2645 235, 235, 154, 154, 154, 199, 234, 234, 154, 196,
2646 196, 199, 205, 205, 245, 154, 154, 154, 154, 205,
2647 161, 163, 154, 154, 38, 34, 53, 194, 197, 188,
2648 154, 152, 22, 161, 17, 17, 151, 154, 154, 234,
2649 4, 234, 154, 154, 234, 154, 154, 154, 4, 234,
2650 234, 151, 154, 193, 199, 152, 154, 154, 152, 205,
2651 205, 205, 205, 161, 205, 205, 199, 22, 4, 196,
2652 173, 174, 39, 199, 190, 154, 234, 234, 17, 199,
2653 244, 234, 234, 193, 193, 235, 234, 154, 235, 235,
2654 235, 244, 234, 205, 205, 154, 152, 154, 154, 152,
2655 152, 152, 188, 194, 195, 22, 154, 157, 188, 188,
2656 152, 154, 159, 234, 152, 193, 152, 152, 205, 205,
2657 205, 174, 53, 192, 17, 159, 171, 241, 118, 119,
2658 234, 234, 190, 17, 199, 159, 190, 152, 152, 152,
2659 4, 147, 191, 234, 232, 159, 171, 188, 188, 38,
2660 188, 188, 22, 154, 232, 17, 234, 234, 17, 154,
2661 234, 188, 188, 234, 17, 72, 234, 17, 234
2664 #define yyerrok (yyerrstatus = 0)
2665 #define yyclearin (yychar = YYEMPTY)
2666 #define YYEMPTY (-2)
2669 #define YYACCEPT goto yyacceptlab
2670 #define YYABORT goto yyabortlab
2671 #define YYERROR goto yyerrorlab
2674 /* Like YYERROR except do call yyerror. This remains here temporarily
2675 to ease the transition to the new meaning of YYERROR, for GCC.
2676 Once GCC version 2 has supplanted version 1, this can go. */
2678 #define YYFAIL goto yyerrlab
2680 #define YYRECOVERING() (!!yyerrstatus)
2682 #define YYBACKUP(Token, Value) \
2684 if (yychar == YYEMPTY && yylen == 1) \
2688 yytoken = YYTRANSLATE (yychar); \
2694 yyerror (YY_("syntax error: cannot back up")); \
2701 #define YYERRCODE 256
2704 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2705 If N is 0, then set CURRENT to the empty location which ends
2706 the previous symbol: RHS[0] (always defined). */
2708 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2709 #ifndef YYLLOC_DEFAULT
2710 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2714 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2715 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2716 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2717 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2721 (Current).first_line = (Current).last_line = \
2722 YYRHSLOC (Rhs, 0).last_line; \
2723 (Current).first_column = (Current).last_column = \
2724 YYRHSLOC (Rhs, 0).last_column; \
2730 /* YY_LOCATION_PRINT -- Print the location on the stream.
2731 This macro was not mandated originally: define only if we know
2732 we won't break user code: when these are the locations we know. */
2734 #ifndef YY_LOCATION_PRINT
2735 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2736 # define YY_LOCATION_PRINT(File, Loc) \
2737 fprintf (File, "%d.%d-%d.%d", \
2738 (Loc).first_line, (Loc).first_column, \
2739 (Loc).last_line, (Loc).last_column)
2741 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2746 /* YYLEX -- calling `yylex' with the right arguments. */
2749 # define YYLEX yylex (YYLEX_PARAM)
2751 # define YYLEX yylex ()
2754 /* Enable debugging if requested. */
2758 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2759 # define YYFPRINTF fprintf
2762 # define YYDPRINTF(Args) \
2768 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2772 YYFPRINTF (stderr, "%s ", Title); \
2773 yy_symbol_print (stderr, \
2775 YYFPRINTF (stderr, "\n"); \
2780 /*--------------------------------.
2781 | Print this symbol on YYOUTPUT. |
2782 `--------------------------------*/
2785 #if (defined __STDC__ || defined __C99__FUNC__ \
2786 || defined __cplusplus || defined _MSC_VER)
2788 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2791 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2794 YYSTYPE const * const yyvaluep;
2800 if (yytype < YYNTOKENS)
2801 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2813 /*--------------------------------.
2814 | Print this symbol on YYOUTPUT. |
2815 `--------------------------------*/
2817 #if (defined __STDC__ || defined __C99__FUNC__ \
2818 || defined __cplusplus || defined _MSC_VER)
2820 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2823 yy_symbol_print (yyoutput, yytype, yyvaluep)
2826 YYSTYPE const * const yyvaluep;
2829 if (yytype < YYNTOKENS)
2830 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2832 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2834 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2835 YYFPRINTF (yyoutput, ")");
2838 /*------------------------------------------------------------------.
2839 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2841 `------------------------------------------------------------------*/
2843 #if (defined __STDC__ || defined __C99__FUNC__ \
2844 || defined __cplusplus || defined _MSC_VER)
2846 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2849 yy_stack_print (bottom, top)
2850 yytype_int16 *bottom;
2854 YYFPRINTF (stderr, "Stack now");
2855 for (; bottom <= top; ++bottom)
2856 YYFPRINTF (stderr, " %d", *bottom);
2857 YYFPRINTF (stderr, "\n");
2860 # define YY_STACK_PRINT(Bottom, Top) \
2863 yy_stack_print ((Bottom), (Top)); \
2867 /*------------------------------------------------.
2868 | Report that the YYRULE is going to be reduced. |
2869 `------------------------------------------------*/
2871 #if (defined __STDC__ || defined __C99__FUNC__ \
2872 || defined __cplusplus || defined _MSC_VER)
2874 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
2877 yy_reduce_print (yyvsp, yyrule)
2882 int yynrhs = yyr2[yyrule];
2884 unsigned long int yylno = yyrline[yyrule];
2885 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2887 /* The symbols being reduced. */
2888 for (yyi = 0; yyi < yynrhs; yyi++)
2890 fprintf (stderr, " $%d = ", yyi + 1);
2891 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2892 &(yyvsp[(yyi + 1) - (yynrhs)])
2894 fprintf (stderr, "\n");
2898 # define YY_REDUCE_PRINT(Rule) \
2901 yy_reduce_print (yyvsp, Rule); \
2904 /* Nonzero means print parse trace. It is left uninitialized so that
2905 multiple parsers can coexist. */
2907 #else /* !YYDEBUG */
2908 # define YYDPRINTF(Args)
2909 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2910 # define YY_STACK_PRINT(Bottom, Top)
2911 # define YY_REDUCE_PRINT(Rule)
2912 #endif /* !YYDEBUG */
2915 /* YYINITDEPTH -- initial size of the parser's stacks. */
2917 # define YYINITDEPTH 200
2920 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2921 if the built-in stack extension method is used).
2923 Do not make this value too large; the results are undefined if
2924 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2925 evaluated with infinite-precision integer arithmetic. */
2928 # define YYMAXDEPTH 10000
2936 # if defined __GLIBC__ && defined _STRING_H
2937 # define yystrlen strlen
2939 /* Return the length of YYSTR. */
2940 #if (defined __STDC__ || defined __C99__FUNC__ \
2941 || defined __cplusplus || defined _MSC_VER)
2943 yystrlen (const char *yystr)
2951 for (yylen = 0; yystr[yylen]; yylen++)
2959 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2960 # define yystpcpy stpcpy
2962 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2964 #if (defined __STDC__ || defined __C99__FUNC__ \
2965 || defined __cplusplus || defined _MSC_VER)
2967 yystpcpy (char *yydest, const char *yysrc)
2970 yystpcpy (yydest, yysrc)
2976 const char *yys = yysrc;
2978 while ((*yyd++ = *yys++) != '\0')
2987 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2988 quotes and backslashes, so that it's suitable for yyerror. The
2989 heuristic is that double-quoting is unnecessary unless the string
2990 contains an apostrophe, a comma, or backslash (other than
2991 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2992 null, do not copy; instead, return the length of what the result
2995 yytnamerr (char *yyres, const char *yystr)
3000 char const *yyp = yystr;
3007 goto do_not_strip_quotes;
3011 goto do_not_strip_quotes;
3024 do_not_strip_quotes: ;
3028 return yystrlen (yystr);
3030 return yystpcpy (yyres, yystr) - yyres;
3034 /* Copy into YYRESULT an error message about the unexpected token
3035 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3036 including the terminating null byte. If YYRESULT is null, do not
3037 copy anything; just return the number of bytes that would be
3038 copied. As a special case, return 0 if an ordinary "syntax error"
3039 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3040 size calculation. */
3042 yysyntax_error (char *yyresult, int yystate, int yychar)
3044 int yyn = yypact[yystate];
3046 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3050 int yytype = YYTRANSLATE (yychar);
3051 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3052 YYSIZE_T yysize = yysize0;
3054 int yysize_overflow = 0;
3055 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3056 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3060 /* This is so xgettext sees the translatable formats that are
3061 constructed on the fly. */
3062 YY_("syntax error, unexpected %s");
3063 YY_("syntax error, unexpected %s, expecting %s");
3064 YY_("syntax error, unexpected %s, expecting %s or %s");
3065 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3066 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3070 static char const yyunexpected[] = "syntax error, unexpected %s";
3071 static char const yyexpecting[] = ", expecting %s";
3072 static char const yyor[] = " or %s";
3073 char yyformat[sizeof yyunexpected
3074 + sizeof yyexpecting - 1
3075 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3076 * (sizeof yyor - 1))];
3077 char const *yyprefix = yyexpecting;
3079 /* Start YYX at -YYN if negative to avoid negative indexes in
3081 int yyxbegin = yyn < 0 ? -yyn : 0;
3083 /* Stay within bounds of both yycheck and yytname. */
3084 int yychecklim = YYLAST - yyn + 1;
3085 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3088 yyarg[0] = yytname[yytype];
3089 yyfmt = yystpcpy (yyformat, yyunexpected);
3091 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3092 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3094 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3098 yyformat[sizeof yyunexpected - 1] = '\0';
3101 yyarg[yycount++] = yytname[yyx];
3102 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3103 yysize_overflow |= (yysize1 < yysize);
3105 yyfmt = yystpcpy (yyfmt, yyprefix);
3109 yyf = YY_(yyformat);
3110 yysize1 = yysize + yystrlen (yyf);
3111 yysize_overflow |= (yysize1 < yysize);
3114 if (yysize_overflow)
3115 return YYSIZE_MAXIMUM;
3119 /* Avoid sprintf, as that infringes on the user's name space.
3120 Don't have undefined behavior even if the translation
3121 produced a string with the wrong number of "%s"s. */
3122 char *yyp = yyresult;
3124 while ((*yyp = *yyf) != '\0')
3126 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3128 yyp += yytnamerr (yyp, yyarg[yyi++]);
3141 #endif /* YYERROR_VERBOSE */
3144 /*-----------------------------------------------.
3145 | Release the memory associated to this symbol. |
3146 `-----------------------------------------------*/
3149 #if (defined __STDC__ || defined __C99__FUNC__ \
3150 || defined __cplusplus || defined _MSC_VER)
3152 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3155 yydestruct (yymsg, yytype, yyvaluep)
3165 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3176 /* Prevent warnings from -Wmissing-prototypes. */
3178 #ifdef YYPARSE_PARAM
3179 #if defined __STDC__ || defined __cplusplus
3180 int yyparse (void *YYPARSE_PARAM);
3184 #else /* ! YYPARSE_PARAM */
3185 #if defined __STDC__ || defined __cplusplus
3190 #endif /* ! YYPARSE_PARAM */
3194 /* The look-ahead symbol. */
3197 /* The semantic value of the look-ahead symbol. */
3200 /* Number of syntax errors so far. */
3209 #ifdef YYPARSE_PARAM
3210 #if (defined __STDC__ || defined __C99__FUNC__ \
3211 || defined __cplusplus || defined _MSC_VER)
3213 yyparse (void *YYPARSE_PARAM)
3216 yyparse (YYPARSE_PARAM)
3217 void *YYPARSE_PARAM;
3219 #else /* ! YYPARSE_PARAM */
3220 #if (defined __STDC__ || defined __C99__FUNC__ \
3221 || defined __cplusplus || defined _MSC_VER)
3235 /* Number of tokens to shift before error messages enabled. */
3237 /* Look-ahead token as an internal (translated) token number. */
3240 /* Buffer for error messages, and its allocated size. */
3242 char *yymsg = yymsgbuf;
3243 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3246 /* Three stacks and their tools:
3247 `yyss': related to states,
3248 `yyvs': related to semantic values,
3249 `yyls': related to locations.
3251 Refer to the stacks thru separate pointers, to allow yyoverflow
3252 to reallocate them elsewhere. */
3254 /* The state stack. */
3255 yytype_int16 yyssa[YYINITDEPTH];
3256 yytype_int16 *yyss = yyssa;
3257 yytype_int16 *yyssp;
3259 /* The semantic value stack. */
3260 YYSTYPE yyvsa[YYINITDEPTH];
3261 YYSTYPE *yyvs = yyvsa;
3266 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3268 YYSIZE_T yystacksize = YYINITDEPTH;
3270 /* The variables used to return semantic value and location from the
3275 /* The number of symbols on the RHS of the reduced rule.
3276 Keep to zero when no symbol should be popped. */
3279 YYDPRINTF ((stderr, "Starting parse\n"));
3284 yychar = YYEMPTY; /* Cause a token to be read. */
3286 /* Initialize stack pointers.
3287 Waste one element of value and location stack
3288 so that they stay on the same level as the state stack.
3289 The wasted elements are never initialized. */
3296 /*------------------------------------------------------------.
3297 | yynewstate -- Push a new state, which is found in yystate. |
3298 `------------------------------------------------------------*/
3300 /* In all cases, when you get here, the value and location stacks
3301 have just been pushed. So pushing a state here evens the stacks. */
3307 if (yyss + yystacksize - 1 <= yyssp)
3309 /* Get the current used size of the three stacks, in elements. */
3310 YYSIZE_T yysize = yyssp - yyss + 1;
3314 /* Give user a chance to reallocate the stack. Use copies of
3315 these so that the &'s don't force the real ones into
3317 YYSTYPE *yyvs1 = yyvs;
3318 yytype_int16 *yyss1 = yyss;
3321 /* Each stack pointer address is followed by the size of the
3322 data in use in that stack, in bytes. This used to be a
3323 conditional around just the two extra args, but that might
3324 be undefined if yyoverflow is a macro. */
3325 yyoverflow (YY_("memory exhausted"),
3326 &yyss1, yysize * sizeof (*yyssp),
3327 &yyvs1, yysize * sizeof (*yyvsp),
3334 #else /* no yyoverflow */
3335 # ifndef YYSTACK_RELOCATE
3336 goto yyexhaustedlab;
3338 /* Extend the stack our own way. */
3339 if (YYMAXDEPTH <= yystacksize)
3340 goto yyexhaustedlab;
3342 if (YYMAXDEPTH < yystacksize)
3343 yystacksize = YYMAXDEPTH;
3346 yytype_int16 *yyss1 = yyss;
3347 union yyalloc *yyptr =
3348 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3350 goto yyexhaustedlab;
3351 YYSTACK_RELOCATE (yyss);
3352 YYSTACK_RELOCATE (yyvs);
3354 # undef YYSTACK_RELOCATE
3356 YYSTACK_FREE (yyss1);
3359 #endif /* no yyoverflow */
3361 yyssp = yyss + yysize - 1;
3362 yyvsp = yyvs + yysize - 1;
3365 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3366 (unsigned long int) yystacksize));
3368 if (yyss + yystacksize - 1 <= yyssp)
3372 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3381 /* Do appropriate processing given the current state. Read a
3382 look-ahead token if we need one and don't already have one. */
3384 /* First try to decide what to do without reference to look-ahead token. */
3385 yyn = yypact[yystate];
3386 if (yyn == YYPACT_NINF)
3389 /* Not known => get a look-ahead token if don't already have one. */
3391 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3392 if (yychar == YYEMPTY)
3394 YYDPRINTF ((stderr, "Reading a token: "));
3398 if (yychar <= YYEOF)
3400 yychar = yytoken = YYEOF;
3401 YYDPRINTF ((stderr, "Now at end of input.\n"));
3405 yytoken = YYTRANSLATE (yychar);
3406 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3409 /* If the proper action on seeing token YYTOKEN is to reduce or to
3410 detect an error, take that action. */
3412 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3417 if (yyn == 0 || yyn == YYTABLE_NINF)
3426 /* Count tokens shifted since error; after three, turn off error
3431 /* Shift the look-ahead token. */
3432 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3434 /* Discard the shifted token unless it is eof. */
3435 if (yychar != YYEOF)
3444 /*-----------------------------------------------------------.
3445 | yydefault -- do the default action for the current state. |
3446 `-----------------------------------------------------------*/
3448 yyn = yydefact[yystate];
3454 /*-----------------------------.
3455 | yyreduce -- Do a reduction. |
3456 `-----------------------------*/
3458 /* yyn is the number of a rule to reduce with. */
3461 /* If YYLEN is nonzero, implement the default value of the action:
3464 Otherwise, the following line sets YYVAL to garbage.
3465 This behavior is undocumented and Bison
3466 users should not rely upon it. Assigning to YYVAL
3467 unconditionally makes the parser a bit smaller, and it avoids a
3468 GCC warning that YYVAL may be used uninitialized. */
3469 yyval = yyvsp[1-yylen];
3472 YY_REDUCE_PRINT (yyn);
3476 #line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3477 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3481 #line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3482 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3486 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3487 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3491 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3492 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3496 #line 1122 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3497 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3501 #line 1122 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3502 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3506 #line 1123 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3507 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3511 #line 1123 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3512 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3516 #line 1124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3517 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3521 #line 1124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3522 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3526 #line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3527 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3531 #line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3532 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3536 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3537 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3541 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3542 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3546 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3547 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3551 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3552 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3556 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3557 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3561 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3562 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3566 #line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3567 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3571 #line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3572 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3576 #line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3577 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3581 #line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3582 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3586 #line 1134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3587 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3591 #line 1134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3592 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3596 #line 1135 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3597 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3601 #line 1136 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3602 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3606 #line 1145 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3607 { (yyval.StrVal) = 0; ;}
3611 #line 1147 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3612 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3616 #line 1148 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3617 { (yyval.UIntVal)=0; ;}
3621 #line 1152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3623 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3629 #line 1156 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3637 #line 1164 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3645 #line 1169 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3647 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3653 #line 1175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3654 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3658 #line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3659 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3663 #line 1177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3664 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3668 #line 1178 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3669 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3673 #line 1179 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3674 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3678 #line 1183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3679 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3683 #line 1184 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3684 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3688 #line 1185 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3689 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3693 #line 1189 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3694 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3698 #line 1190 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3699 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3703 #line 1191 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3704 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3708 #line 1192 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3709 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3713 #line 1196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3714 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3718 #line 1197 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3719 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3723 #line 1198 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3724 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3728 #line 1202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3729 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3733 #line 1203 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3734 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3738 #line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3739 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3743 #line 1205 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3744 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3748 #line 1206 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3749 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3753 #line 1210 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3754 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3758 #line 1211 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3759 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3763 #line 1212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3764 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3768 #line 1215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3769 { (yyval.UIntVal) = CallingConv::C; ;}
3773 #line 1216 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3774 { (yyval.UIntVal) = CallingConv::C; ;}
3778 #line 1217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3779 { (yyval.UIntVal) = CallingConv::Fast; ;}
3783 #line 1218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3784 { (yyval.UIntVal) = CallingConv::Cold; ;}
3788 #line 1219 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3789 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3793 #line 1220 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3794 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3798 #line 1221 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3800 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3801 GEN_ERROR("Calling conv too large");
3802 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3808 #line 1228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3809 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3813 #line 1229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3814 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3818 #line 1230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3819 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3823 #line 1231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3824 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3828 #line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3829 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3833 #line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3834 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3838 #line 1234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3839 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
3843 #line 1235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3844 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
3848 #line 1236 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3849 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
3853 #line 1237 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3854 { (yyval.ParamAttrs) =
3855 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
3859 #line 1241 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3860 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3864 #line 1242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3866 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3871 #line 1247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
3876 #line 1248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
3881 #line 1249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3886 #line 1250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3891 #line 1251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3892 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
3896 #line 1252 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3897 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
3901 #line 1255 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3902 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3906 #line 1256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3908 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3913 #line 1261 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3914 { (yyval.StrVal) = 0; ;}
3918 #line 1262 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3920 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3925 #line 1269 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3926 { (yyval.UIntVal) = 0; ;}
3930 #line 1270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3932 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3933 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3934 GEN_ERROR("Alignment must be a power of two");
3940 #line 1276 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3941 { (yyval.UIntVal) = 0; ;}
3945 #line 1277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3947 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
3948 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3949 GEN_ERROR("Alignment must be a power of two");
3955 #line 1286 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3957 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
3958 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
3959 GEN_ERROR("Invalid character in section name");
3960 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3966 #line 1294 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3967 { (yyval.StrVal) = 0; ;}
3971 #line 1295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3972 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
3976 #line 1300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3981 #line 1301 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3986 #line 1302 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3988 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
3989 delete (yyvsp[(1) - (1)].StrVal);
3995 #line 1307 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3997 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
3998 GEN_ERROR("Alignment must be a power of two");
3999 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4005 #line 1323 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4007 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4013 #line 1327 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4015 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4021 #line 1331 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4023 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4024 GEN_ERROR("Cannot form a pointer to a basic block");
4025 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4026 delete (yyvsp[(1) - (3)].TypeVal);
4032 #line 1338 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4033 { // Named types are also simple types...
4034 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4036 (yyval.TypeVal) = new PATypeHolder(tmp);
4041 #line 1343 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4042 { // Type UpReference
4043 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4044 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4045 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4046 (yyval.TypeVal) = new PATypeHolder(OT);
4047 UR_OUT("New Upreference!\n");
4053 #line 1351 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4055 // Allow but ignore attributes on function types; this permits auto-upgrade.
4056 // FIXME: remove in LLVM 3.0.
4057 const Type* RetTy = *(yyvsp[(1) - (5)].TypeVal);
4058 if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy ||
4059 isa<OpaqueType>(RetTy)))
4060 GEN_ERROR("LLVM Functions cannot return aggregates");
4062 std::vector<const Type*> Params;
4063 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4064 for (; I != E; ++I ) {
4065 const Type *Ty = I->Ty->get();
4066 Params.push_back(Ty);
4069 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4070 if (isVarArg) Params.pop_back();
4072 for (unsigned i = 0; i != Params.size(); ++i)
4073 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4074 GEN_ERROR("Function arguments must be value types!");
4078 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4079 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4080 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4081 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4087 #line 1381 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4089 // Allow but ignore attributes on function types; this permits auto-upgrade.
4090 // FIXME: remove in LLVM 3.0.
4091 std::vector<const Type*> Params;
4092 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4093 for ( ; I != E; ++I ) {
4094 const Type* Ty = I->Ty->get();
4095 Params.push_back(Ty);
4098 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4099 if (isVarArg) Params.pop_back();
4101 for (unsigned i = 0; i != Params.size(); ++i)
4102 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4103 GEN_ERROR("Function arguments must be value types!");
4107 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4108 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4109 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4115 #line 1406 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4116 { // Sized array type?
4117 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4118 delete (yyvsp[(4) - (5)].TypeVal);
4124 #line 1411 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4126 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4127 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4128 GEN_ERROR("Unsigned result not equal to signed result");
4129 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4130 GEN_ERROR("Element type of a VectorType must be primitive");
4131 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4132 delete (yyvsp[(4) - (5)].TypeVal);
4138 #line 1421 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4139 { // Structure type?
4140 std::vector<const Type*> Elements;
4141 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4142 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4143 Elements.push_back(*I);
4145 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4146 delete (yyvsp[(2) - (3)].TypeList);
4152 #line 1431 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4153 { // Empty structure type?
4154 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4160 #line 1435 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4162 std::vector<const Type*> Elements;
4163 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4164 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4165 Elements.push_back(*I);
4167 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4168 delete (yyvsp[(3) - (5)].TypeList);
4174 #line 1445 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4175 { // Empty structure type?
4176 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4182 #line 1452 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4184 // Allow but ignore attributes on function types; this permits auto-upgrade.
4185 // FIXME: remove in LLVM 3.0.
4186 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4187 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4192 #line 1461 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4194 if (!UpRefs.empty())
4195 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4196 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && (*(yyvsp[(1) - (1)].TypeVal))->getTypeID() != Type::StructTyID)
4197 GEN_ERROR("LLVM functions cannot return aggregate types");
4198 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4203 #line 1468 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4205 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4210 #line 1473 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4212 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4213 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4219 #line 1478 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4221 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4227 #line 1486 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4229 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4230 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4231 TWA.Ty = new PATypeHolder(Type::VoidTy);
4232 (yyval.TypeWithAttrsList)->push_back(TWA);
4238 #line 1493 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4240 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4241 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4242 TWA.Ty = new PATypeHolder(Type::VoidTy);
4243 (yyval.TypeWithAttrsList)->push_back(TWA);
4249 #line 1500 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4251 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4257 #line 1508 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4259 (yyval.TypeList) = new std::list<PATypeHolder>();
4260 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4261 delete (yyvsp[(1) - (1)].TypeVal);
4267 #line 1514 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4269 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4270 delete (yyvsp[(3) - (3)].TypeVal);
4276 #line 1526 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4277 { // Nonempty unsized arr
4278 if (!UpRefs.empty())
4279 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4280 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4282 GEN_ERROR("Cannot make array constant with type: '" +
4283 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4284 const Type *ETy = ATy->getElementType();
4285 int NumElements = ATy->getNumElements();
4287 // Verify that we have the correct size...
4288 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4289 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4290 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4291 itostr(NumElements) + "");
4293 // Verify all elements are correct type!
4294 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4295 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4296 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4297 ETy->getDescription() +"' as required!\nIt is of type '"+
4298 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4301 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4302 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4308 #line 1554 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4310 if (!UpRefs.empty())
4311 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4312 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4314 GEN_ERROR("Cannot make array constant with type: '" +
4315 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4317 int NumElements = ATy->getNumElements();
4318 if (NumElements != -1 && NumElements != 0)
4319 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4320 " arguments, but has size of " + itostr(NumElements) +"");
4321 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4322 delete (yyvsp[(1) - (3)].TypeVal);
4328 #line 1570 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4330 if (!UpRefs.empty())
4331 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4332 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4334 GEN_ERROR("Cannot make array constant with type: '" +
4335 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4337 int NumElements = ATy->getNumElements();
4338 const Type *ETy = ATy->getElementType();
4339 if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
4340 GEN_ERROR("Can't build string constant of size " +
4341 itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
4342 " when array has size " + itostr(NumElements) + "");
4343 std::vector<Constant*> Vals;
4344 if (ETy == Type::Int8Ty) {
4345 for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4346 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4348 delete (yyvsp[(3) - (3)].StrVal);
4349 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4351 delete (yyvsp[(3) - (3)].StrVal);
4352 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4353 delete (yyvsp[(1) - (3)].TypeVal);
4359 #line 1597 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4360 { // Nonempty unsized arr
4361 if (!UpRefs.empty())
4362 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4363 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4365 GEN_ERROR("Cannot make packed constant with type: '" +
4366 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4367 const Type *ETy = PTy->getElementType();
4368 int NumElements = PTy->getNumElements();
4370 // Verify that we have the correct size...
4371 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4372 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4373 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4374 itostr(NumElements) + "");
4376 // Verify all elements are correct type!
4377 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4378 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4379 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4380 ETy->getDescription() +"' as required!\nIt is of type '"+
4381 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4384 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4385 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4391 #line 1625 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4393 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4395 GEN_ERROR("Cannot make struct constant with type: '" +
4396 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4398 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4399 GEN_ERROR("Illegal number of initializers for structure type");
4401 // Check to ensure that constants are compatible with the type initializer!
4402 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4403 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4404 GEN_ERROR("Expected type '" +
4405 STy->getElementType(i)->getDescription() +
4406 "' for element #" + utostr(i) +
4407 " of structure initializer");
4409 // Check to ensure that Type is not packed
4410 if (STy->isPacked())
4411 GEN_ERROR("Unpacked Initializer to vector type '" +
4412 STy->getDescription() + "'");
4414 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4415 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4421 #line 1651 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4423 if (!UpRefs.empty())
4424 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4425 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4427 GEN_ERROR("Cannot make struct constant with type: '" +
4428 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4430 if (STy->getNumContainedTypes() != 0)
4431 GEN_ERROR("Illegal number of initializers for structure type");
4433 // Check to ensure that Type is not packed
4434 if (STy->isPacked())
4435 GEN_ERROR("Unpacked Initializer to vector type '" +
4436 STy->getDescription() + "'");
4438 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4439 delete (yyvsp[(1) - (3)].TypeVal);
4445 #line 1671 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4447 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4449 GEN_ERROR("Cannot make struct constant with type: '" +
4450 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4452 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4453 GEN_ERROR("Illegal number of initializers for structure type");
4455 // Check to ensure that constants are compatible with the type initializer!
4456 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4457 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4458 GEN_ERROR("Expected type '" +
4459 STy->getElementType(i)->getDescription() +
4460 "' for element #" + utostr(i) +
4461 " of structure initializer");
4463 // Check to ensure that Type is packed
4464 if (!STy->isPacked())
4465 GEN_ERROR("Vector initializer to non-vector type '" +
4466 STy->getDescription() + "'");
4468 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4469 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4475 #line 1697 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4477 if (!UpRefs.empty())
4478 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4479 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4481 GEN_ERROR("Cannot make struct constant with type: '" +
4482 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4484 if (STy->getNumContainedTypes() != 0)
4485 GEN_ERROR("Illegal number of initializers for structure type");
4487 // Check to ensure that Type is packed
4488 if (!STy->isPacked())
4489 GEN_ERROR("Vector initializer to non-vector type '" +
4490 STy->getDescription() + "'");
4492 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4493 delete (yyvsp[(1) - (5)].TypeVal);
4499 #line 1717 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4501 if (!UpRefs.empty())
4502 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4503 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4505 GEN_ERROR("Cannot make null pointer constant with type: '" +
4506 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4508 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4509 delete (yyvsp[(1) - (2)].TypeVal);
4515 #line 1729 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4517 if (!UpRefs.empty())
4518 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4519 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4520 delete (yyvsp[(1) - (2)].TypeVal);
4526 #line 1736 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4528 if (!UpRefs.empty())
4529 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4530 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4532 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4534 // ConstExprs can exist in the body of a function, thus creating
4535 // GlobalValues whenever they refer to a variable. Because we are in
4536 // the context of a function, getExistingVal will search the functions
4537 // symbol table instead of the module symbol table for the global symbol,
4538 // which throws things all off. To get around this, we just tell
4539 // getExistingVal that we are at global scope here.
4541 Function *SavedCurFn = CurFun.CurrentFunction;
4542 CurFun.CurrentFunction = 0;
4544 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4547 CurFun.CurrentFunction = SavedCurFn;
4549 // If this is an initializer for a constant pointer, which is referencing a
4550 // (currently) undefined variable, create a stub now that shall be replaced
4551 // in the future with the right type of variable.
4554 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4555 const PointerType *PT = cast<PointerType>(Ty);
4557 // First check to see if the forward references value is already created!
4558 PerModuleInfo::GlobalRefsType::iterator I =
4559 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4561 if (I != CurModule.GlobalRefs.end()) {
4562 V = I->second; // Placeholder already exists, use it...
4563 (yyvsp[(2) - (2)].ValIDVal).destroy();
4566 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4567 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4568 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4569 GEN_ERROR("Invalid reference to global");
4571 // Create the forward referenced global.
4573 if (const FunctionType *FTy =
4574 dyn_cast<FunctionType>(PT->getElementType())) {
4575 GV = new Function(FTy, GlobalValue::ExternalWeakLinkage, Name,
4576 CurModule.CurrentModule);
4578 GV = new GlobalVariable(PT->getElementType(), false,
4579 GlobalValue::ExternalWeakLinkage, 0,
4580 Name, CurModule.CurrentModule);
4583 // Keep track of the fact that we have a forward ref to recycle it
4584 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4589 (yyval.ConstVal) = cast<GlobalValue>(V);
4590 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4596 #line 1802 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4598 if (!UpRefs.empty())
4599 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4600 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4601 GEN_ERROR("Mismatched types for constant expression: " +
4602 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4603 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4604 delete (yyvsp[(1) - (2)].TypeVal);
4610 #line 1812 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4612 if (!UpRefs.empty())
4613 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4614 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4615 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4616 GEN_ERROR("Cannot create a null initialized value of this type");
4617 (yyval.ConstVal) = Constant::getNullValue(Ty);
4618 delete (yyvsp[(1) - (2)].TypeVal);
4624 #line 1822 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4625 { // integral constants
4626 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4627 GEN_ERROR("Constant value doesn't fit in type");
4628 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4634 #line 1828 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4635 { // arbitrary precision integer constants
4636 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4637 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4638 GEN_ERROR("Constant value does not fit in type");
4640 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4641 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4642 delete (yyvsp[(2) - (2)].APIntVal);
4648 #line 1838 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4649 { // integral constants
4650 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4651 GEN_ERROR("Constant value doesn't fit in type");
4652 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4658 #line 1844 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4659 { // arbitrary precision integer constants
4660 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4661 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4662 GEN_ERROR("Constant value does not fit in type");
4664 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4665 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4666 delete (yyvsp[(2) - (2)].APIntVal);
4672 #line 1854 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4673 { // Boolean constants
4674 assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4675 (yyval.ConstVal) = ConstantInt::getTrue();
4681 #line 1859 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4682 { // Boolean constants
4683 assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4684 (yyval.ConstVal) = ConstantInt::getFalse();
4690 #line 1864 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4691 { // Floating point constants
4692 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4693 GEN_ERROR("Floating point constant invalid for type");
4694 // Lexer has no type info, so builds all float and double FP constants
4695 // as double. Fix this here. Long double is done right.
4696 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4697 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4698 (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal));
4699 delete (yyvsp[(2) - (2)].FPVal);
4705 #line 1877 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4707 if (!UpRefs.empty())
4708 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4709 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4710 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4711 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4712 GEN_ERROR("invalid cast opcode for cast from '" +
4713 Val->getType()->getDescription() + "' to '" +
4714 DestTy->getDescription() + "'");
4715 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4716 delete (yyvsp[(5) - (6)].TypeVal);
4721 #line 1889 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4723 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4724 GEN_ERROR("GetElementPtr requires a pointer operand");
4727 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(),
4730 GEN_ERROR("Index list invalid for constant getelementptr");
4732 SmallVector<Constant*, 8> IdxVec;
4733 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4734 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4735 IdxVec.push_back(C);
4737 GEN_ERROR("Indices to constant getelementptr must be constants");
4739 delete (yyvsp[(4) - (5)].ValueList);
4741 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4747 #line 1911 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4749 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4750 GEN_ERROR("Select condition must be of boolean type");
4751 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4752 GEN_ERROR("Select operand types must match");
4753 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4759 #line 1919 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4761 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4762 GEN_ERROR("Binary operator types must match");
4764 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4769 #line 1925 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4771 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4772 GEN_ERROR("Logical operator types must match");
4773 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4774 if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4775 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4776 GEN_ERROR("Logical operator requires integral operands");
4778 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4784 #line 1936 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4786 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4787 GEN_ERROR("icmp operand types must match");
4788 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4793 #line 1941 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4795 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4796 GEN_ERROR("fcmp operand types must match");
4797 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4802 #line 1946 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4804 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4805 GEN_ERROR("Invalid extractelement operands");
4806 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4812 #line 1952 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4814 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4815 GEN_ERROR("Invalid insertelement operands");
4816 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4822 #line 1958 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4824 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4825 GEN_ERROR("Invalid shufflevector operands");
4826 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4832 #line 1967 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4834 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
4840 #line 1971 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4842 (yyval.ConstVector) = new std::vector<Constant*>();
4843 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
4849 #line 1979 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4850 { (yyval.BoolVal) = false; ;}
4854 #line 1979 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4855 { (yyval.BoolVal) = true; ;}
4859 #line 1982 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4860 { (yyval.BoolVal) = true; ;}
4864 #line 1982 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4865 { (yyval.BoolVal) = false; ;}
4869 #line 1985 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4871 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
4872 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
4874 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
4876 GEN_ERROR("Aliases can be created only to global values");
4878 (yyval.ConstVal) = Aliasee;
4880 delete (yyvsp[(1) - (2)].TypeVal);
4885 #line 1997 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4887 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4888 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4889 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4890 GEN_ERROR("invalid cast opcode for cast from '" +
4891 Val->getType()->getDescription() + "' to '" +
4892 DestTy->getDescription() + "'");
4894 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4896 delete (yyvsp[(5) - (6)].TypeVal);
4901 #line 2018 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4903 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
4904 CurModule.ModuleDone();
4910 #line 2023 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4912 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
4913 CurModule.ModuleDone();
4919 #line 2036 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4920 { CurFun.isDeclare = false; ;}
4924 #line 2036 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4926 CurFun.FunctionDone();
4932 #line 2040 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4933 { CurFun.isDeclare = true; ;}
4937 #line 2040 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4944 #line 2043 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4951 #line 2046 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4953 if (!UpRefs.empty())
4954 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
4955 // Eagerly resolve types. This is not an optimization, this is a
4956 // requirement that is due to the fact that we could have this:
4958 // %list = type { %list * }
4959 // %list = type { %list * } ; repeated type decl
4961 // If types are not resolved eagerly, then the two types will not be
4962 // determined to be the same type!
4964 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
4966 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4968 // If this is a named type that is not a redefinition, add it to the slot
4970 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
4973 delete (yyvsp[(3) - (3)].TypeVal);
4979 #line 2070 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4981 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
4983 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4985 // If this is a named type that is not a redefinition, add it to the slot
4987 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
4994 #line 2082 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4996 /* "Externally Visible" Linkage */
4997 if ((yyvsp[(5) - (6)].ConstVal) == 0)
4998 GEN_ERROR("Global value initializer is not a constant");
4999 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5000 (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));
5006 #line 2089 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5013 #line 2093 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5015 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5016 GEN_ERROR("Global value initializer is not a constant");
5017 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));
5023 #line 2098 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5030 #line 2102 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5032 if (!UpRefs.empty())
5033 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5034 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));
5036 delete (yyvsp[(6) - (7)].TypeVal);
5041 #line 2108 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5049 #line 2112 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5052 if ((yyvsp[(1) - (5)].StrVal)) {
5053 Name = *(yyvsp[(1) - (5)].StrVal);
5054 delete (yyvsp[(1) - (5)].StrVal);
5057 GEN_ERROR("Alias name cannot be empty");
5059 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5061 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5063 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5064 CurModule.CurrentModule);
5065 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5066 InsertValue(GA, CurModule.Values);
5069 // If there was a forward reference of this alias, resolve it now.
5073 ID = ValID::createGlobalName(Name);
5075 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5077 if (GlobalValue *FWGV =
5078 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5079 // Replace uses of the fwdref with the actual alias.
5080 FWGV->replaceAllUsesWith(GA);
5081 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5082 GV->eraseFromParent();
5084 cast<Function>(FWGV)->eraseFromParent();
5093 #line 2152 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5100 #line 2155 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5107 #line 2161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5109 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5110 if (AsmSoFar.empty())
5111 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5113 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5114 delete (yyvsp[(1) - (1)].StrVal);
5120 #line 2171 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5122 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5123 delete (yyvsp[(3) - (3)].StrVal);
5128 #line 2175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5130 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5131 delete (yyvsp[(3) - (3)].StrVal);
5136 #line 2182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5138 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5139 delete (yyvsp[(3) - (3)].StrVal);
5145 #line 2187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5147 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5148 delete (yyvsp[(1) - (1)].StrVal);
5154 #line 2192 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5161 #line 2201 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5163 if (!UpRefs.empty())
5164 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5165 if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy)
5166 GEN_ERROR("void typed arguments are invalid");
5167 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5168 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5169 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5175 #line 2211 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5177 if (!UpRefs.empty())
5178 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5179 if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy)
5180 GEN_ERROR("void typed arguments are invalid");
5181 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5182 (yyval.ArgList) = new ArgListType;
5183 (yyval.ArgList)->push_back(E);
5189 #line 2222 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5191 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5197 #line 2226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5199 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5200 struct ArgListEntry E;
5201 E.Ty = new PATypeHolder(Type::VoidTy);
5203 E.Attrs = ParamAttr::None;
5204 (yyval.ArgList)->push_back(E);
5210 #line 2235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5212 (yyval.ArgList) = new ArgListType;
5213 struct ArgListEntry E;
5214 E.Ty = new PATypeHolder(Type::VoidTy);
5216 E.Attrs = ParamAttr::None;
5217 (yyval.ArgList)->push_back(E);
5223 #line 2244 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5225 (yyval.ArgList) = 0;
5231 #line 2250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5233 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5234 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5236 // Check the function result for abstractness if this is a define. We should
5237 // have no abstract types at this point
5238 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5239 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5241 std::vector<const Type*> ParamTypeList;
5242 ParamAttrsVector Attrs;
5243 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) {
5244 ParamAttrsWithIndex PAWI;
5246 PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs);
5247 Attrs.push_back(PAWI);
5249 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5251 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5252 const Type* Ty = I->Ty->get();
5253 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5254 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5255 ParamTypeList.push_back(Ty);
5256 if (Ty != Type::VoidTy)
5257 if (I->Attrs != ParamAttr::None) {
5258 ParamAttrsWithIndex PAWI;
5260 PAWI.attrs = I->Attrs;
5261 Attrs.push_back(PAWI);
5266 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5267 if (isVarArg) ParamTypeList.pop_back();
5269 const ParamAttrsList *PAL = 0;
5271 PAL = ParamAttrsList::get(Attrs);
5273 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5274 const PointerType *PFT = PointerType::getUnqual(FT);
5275 delete (yyvsp[(2) - (10)].TypeVal);
5278 if (!FunctionName.empty()) {
5279 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5281 ID = ValID::createGlobalID(CurModule.Values.size());
5285 // See if this function was forward referenced. If so, recycle the object.
5286 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5287 // Move the function to the end of the list, from whereever it was
5288 // previously inserted.
5289 Fn = cast<Function>(FWRef);
5290 assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
5291 CurModule.CurrentModule->getFunctionList().remove(Fn);
5292 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5293 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5294 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5295 if (Fn->getFunctionType() != FT ) {
5296 // The existing function doesn't have the same type. This is an overload
5298 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5299 } else if (Fn->getParamAttrs() != PAL) {
5300 // The existing function doesn't have the same parameter attributes.
5301 // This is an overload error.
5302 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5303 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5304 // Neither the existing or the current function is a declaration and they
5305 // have the same name and same type. Clearly this is a redefinition.
5306 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5307 } else if (Fn->isDeclaration()) {
5308 // Make sure to strip off any argument names so we can't get conflicts.
5309 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5313 } else { // Not already defined?
5314 Fn = new Function(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5315 CurModule.CurrentModule);
5316 InsertValue(Fn, CurModule.Values);
5319 CurFun.FunctionStart(Fn);
5321 if (CurFun.isDeclare) {
5322 // If we have declaration, always overwrite linkage. This will allow us to
5323 // correctly handle cases, when pointer to function is passed as argument to
5324 // another function.
5325 Fn->setLinkage(CurFun.Linkage);
5326 Fn->setVisibility(CurFun.Visibility);
5328 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5329 Fn->setParamAttrs(PAL);
5330 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5331 if ((yyvsp[(8) - (10)].StrVal)) {
5332 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5333 delete (yyvsp[(8) - (10)].StrVal);
5335 if ((yyvsp[(10) - (10)].StrVal)) {
5336 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5337 delete (yyvsp[(10) - (10)].StrVal);
5340 // Add all of the arguments we parsed to the function...
5341 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5342 if (isVarArg) { // Nuke the last entry
5343 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5344 "Not a varargs marker!");
5345 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5346 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5348 Function::arg_iterator ArgIt = Fn->arg_begin();
5349 Function::arg_iterator ArgEnd = Fn->arg_end();
5351 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5352 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5353 delete I->Ty; // Delete the typeholder...
5354 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5360 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5367 #line 2385 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5369 (yyval.FunctionVal) = CurFun.CurrentFunction;
5371 // Make sure that we keep track of the linkage type even if there was a
5372 // previous "declare".
5373 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5374 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5379 #line 2396 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5381 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5387 #line 2401 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5389 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5390 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5391 (yyval.FunctionVal) = CurFun.CurrentFunction;
5392 CurFun.FunctionDone();
5398 #line 2413 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5400 (yyval.BoolVal) = false;
5406 #line 2417 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5408 (yyval.BoolVal) = true;
5414 #line 2422 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5415 { // A reference to a direct constant
5416 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5422 #line 2426 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5424 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5430 #line 2430 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5431 { // Perhaps it's an FP constant?
5432 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5438 #line 2434 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5440 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5446 #line 2438 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5448 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5454 #line 2442 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5456 (yyval.ValIDVal) = ValID::createNull();
5462 #line 2446 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5464 (yyval.ValIDVal) = ValID::createUndef();
5470 #line 2450 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5471 { // A vector zero constant.
5472 (yyval.ValIDVal) = ValID::createZeroInit();
5478 #line 2454 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5479 { // Nonempty unsized packed vector
5480 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5481 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5483 VectorType* pt = VectorType::get(ETy, NumElements);
5484 PATypeHolder* PTy = new PATypeHolder(
5492 // Verify all elements are correct type!
5493 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5494 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5495 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5496 ETy->getDescription() +"' as required!\nIt is of type '" +
5497 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5500 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5501 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5507 #line 2479 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5509 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5515 #line 2483 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5517 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5518 delete (yyvsp[(3) - (5)].StrVal);
5519 delete (yyvsp[(5) - (5)].StrVal);
5525 #line 2493 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5526 { // Is it an integer reference...?
5527 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5533 #line 2497 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5535 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5541 #line 2501 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5542 { // Is it a named reference...?
5543 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5544 delete (yyvsp[(1) - (1)].StrVal);
5550 #line 2506 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5551 { // Is it a named reference...?
5552 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5553 delete (yyvsp[(1) - (1)].StrVal);
5559 #line 2519 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5561 if (!UpRefs.empty())
5562 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5563 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5564 delete (yyvsp[(1) - (2)].TypeVal);
5570 #line 2528 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5572 (yyval.ValueList) = new std::vector<Value *>();
5573 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5579 #line 2533 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5581 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ConstVal));
5587 #line 2538 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5589 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5595 #line 2542 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5596 { // Do not allow functions with 0 basic blocks
5597 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5603 #line 2551 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5605 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5607 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5608 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5609 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5615 #line 2560 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5617 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5618 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5619 if (CI2->getParent() == 0)
5620 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5621 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5622 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5628 #line 2569 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5629 { // Empty space between instruction lists
5630 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5636 #line 2573 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5637 { // Labelled (named) basic block
5638 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5639 delete (yyvsp[(1) - (1)].StrVal);
5646 #line 2581 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5647 { // Return with a result...
5648 if((yyvsp[(2) - (2)].ValueList)->size() == 1)
5649 (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueList)->back());
5652 std::vector<const Type*> Elements;
5653 std::vector<Constant*> Vals;
5654 for (std::vector<Value *>::iterator I = (yyvsp[(2) - (2)].ValueList)->begin(),
5655 E = (yyvsp[(2) - (2)].ValueList)->end(); I != E; ++I) {
5657 Constant *C = cast<Constant>(V);
5658 Elements.push_back(V->getType());
5662 const StructType *STy = StructType::get(Elements);
5664 new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
5666 Constant *CS = ConstantStruct::get(STy, Vals); // *$2);
5667 (yyval.TermInstVal) = new ReturnInst(CS);
5670 delete (yyvsp[(2) - (2)].ValueList);
5676 #line 2607 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5677 { // Return with no result...
5678 (yyval.TermInstVal) = new ReturnInst();
5684 #line 2611 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5685 { // Unconditional Branch...
5686 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5688 (yyval.TermInstVal) = new BranchInst(tmpBB);
5693 #line 2616 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5695 assert(cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
5696 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5698 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5700 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5702 (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal);
5707 #line 2626 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5709 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
5711 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5713 SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
5714 (yyval.TermInstVal) = S;
5716 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
5717 E = (yyvsp[(8) - (9)].JumpTable)->end();
5718 for (; I != E; ++I) {
5719 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
5720 S->addCase(CI, I->second);
5722 GEN_ERROR("Switch case is constant, but not a simple integer");
5724 delete (yyvsp[(8) - (9)].JumpTable);
5730 #line 2645 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5732 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
5734 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
5736 SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0);
5737 (yyval.TermInstVal) = S;
5743 #line 2655 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5746 // Handle the short syntax
5747 const PointerType *PFTy = 0;
5748 const FunctionType *Ty = 0;
5749 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
5750 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
5751 // Pull out the types of all of the arguments...
5752 std::vector<const Type*> ParamTypes;
5753 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
5754 for (; I != E; ++I) {
5755 const Type *Ty = I->Val->getType();
5756 if (Ty == Type::VoidTy)
5757 GEN_ERROR("Short call syntax cannot be used with varargs");
5758 ParamTypes.push_back(Ty);
5760 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
5761 PFTy = PointerType::getUnqual(Ty);
5764 delete (yyvsp[(3) - (14)].TypeVal);
5766 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
5768 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
5770 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
5773 ParamAttrsVector Attrs;
5774 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) {
5775 ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs);
5776 Attrs.push_back(PAWI);
5779 // Check the arguments
5781 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
5782 // Make sure no arguments is a good thing!
5783 if (Ty->getNumParams() != 0)
5784 GEN_ERROR("No arguments passed to a function that "
5785 "expects arguments");
5786 } else { // Has arguments?
5787 // Loop through FunctionType's arguments and ensure they are specified
5789 FunctionType::param_iterator I = Ty->param_begin();
5790 FunctionType::param_iterator E = Ty->param_end();
5791 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
5794 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
5795 if (ArgI->Val->getType() != *I)
5796 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
5797 (*I)->getDescription() + "'");
5798 Args.push_back(ArgI->Val);
5799 if (ArgI->Attrs != ParamAttr::None) {
5800 ParamAttrsWithIndex PAWI;
5802 PAWI.attrs = ArgI->Attrs;
5803 Attrs.push_back(PAWI);
5807 if (Ty->isVarArg()) {
5809 for (; ArgI != ArgE; ++ArgI, ++index) {
5810 Args.push_back(ArgI->Val); // push the remaining varargs
5811 if (ArgI->Attrs != ParamAttr::None) {
5812 ParamAttrsWithIndex PAWI;
5814 PAWI.attrs = ArgI->Attrs;
5815 Attrs.push_back(PAWI);
5818 } else if (I != E || ArgI != ArgE)
5819 GEN_ERROR("Invalid number of parameters detected");
5822 const ParamAttrsList *PAL = 0;
5824 PAL = ParamAttrsList::get(Attrs);
5826 // Create the InvokeInst
5827 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
5828 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
5829 II->setParamAttrs(PAL);
5830 (yyval.TermInstVal) = II;
5831 delete (yyvsp[(6) - (14)].ParamList);
5837 #line 2745 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5839 (yyval.TermInstVal) = new UnwindInst();
5845 #line 2749 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5847 (yyval.TermInstVal) = new UnreachableInst();
5853 #line 2756 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5855 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
5856 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
5859 GEN_ERROR("May only switch on a constant pool value");
5861 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
5863 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5868 #line 2767 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5870 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
5871 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
5875 GEN_ERROR("May only switch on a constant pool value");
5877 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
5879 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5884 #line 2780 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5886 // Is this definition named?? if so, assign the name...
5887 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
5889 InsertValue((yyvsp[(2) - (2)].InstVal));
5890 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
5896 #line 2790 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5897 { // Used for PHI nodes
5898 if (!UpRefs.empty())
5899 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
5900 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
5901 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
5903 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
5905 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
5906 delete (yyvsp[(1) - (6)].TypeVal);
5911 #line 2801 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5913 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
5914 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
5916 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
5918 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
5923 #line 2811 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5925 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5926 if (!UpRefs.empty())
5927 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
5928 // Used for call and invoke instructions
5929 (yyval.ParamList) = new ParamList();
5930 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
5931 (yyval.ParamList)->push_back(E);
5932 delete (yyvsp[(1) - (4)].TypeVal);
5938 #line 2822 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5940 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5941 // Labels are only valid in ASMs
5942 (yyval.ParamList) = new ParamList();
5943 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
5944 (yyval.ParamList)->push_back(E);
5950 #line 2830 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5952 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5953 if (!UpRefs.empty())
5954 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
5955 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
5956 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
5957 (yyval.ParamList)->push_back(E);
5958 delete (yyvsp[(3) - (6)].TypeVal);
5964 #line 2840 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5966 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5967 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
5968 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
5969 (yyval.ParamList)->push_back(E);
5975 #line 2847 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5976 { (yyval.ParamList) = new ParamList(); ;}
5980 #line 2850 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5981 { (yyval.ValueList) = new std::vector<Value*>(); ;}
5985 #line 2851 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5987 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
5988 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
5994 #line 2858 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5996 (yyval.BoolVal) = true;
6002 #line 2862 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6004 (yyval.BoolVal) = false;
6010 #line 2867 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6012 if (!UpRefs.empty())
6013 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6014 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6015 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6017 "Arithmetic operator requires integer, FP, or packed operands");
6018 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6020 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6022 (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6023 if ((yyval.InstVal) == 0)
6024 GEN_ERROR("binary operator returned null");
6025 delete (yyvsp[(2) - (5)].TypeVal);
6030 #line 2883 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6032 if (!UpRefs.empty())
6033 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6034 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6035 if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6036 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6037 GEN_ERROR("Logical operator requires integral operands");
6039 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6041 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6043 (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6044 if ((yyval.InstVal) == 0)
6045 GEN_ERROR("binary operator returned null");
6046 delete (yyvsp[(2) - (5)].TypeVal);
6051 #line 2900 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6053 if (!UpRefs.empty())
6054 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6055 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6056 GEN_ERROR("Vector types not supported by icmp instruction");
6057 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6059 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6061 (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6062 if ((yyval.InstVal) == 0)
6063 GEN_ERROR("icmp operator returned null");
6064 delete (yyvsp[(3) - (6)].TypeVal);
6069 #line 2914 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6071 if (!UpRefs.empty())
6072 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6073 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6074 GEN_ERROR("Vector types not supported by fcmp instruction");
6075 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6077 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6079 (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6080 if ((yyval.InstVal) == 0)
6081 GEN_ERROR("fcmp operator returned null");
6082 delete (yyvsp[(3) - (6)].TypeVal);
6087 #line 2928 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6089 if (!UpRefs.empty())
6090 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6091 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6092 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6093 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6094 GEN_ERROR("invalid cast opcode for cast from '" +
6095 Val->getType()->getDescription() + "' to '" +
6096 DestTy->getDescription() + "'");
6097 (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6098 delete (yyvsp[(4) - (4)].TypeVal);
6103 #line 2940 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6105 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6106 GEN_ERROR("select condition must be boolean");
6107 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6108 GEN_ERROR("select value types should match");
6109 (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6115 #line 2948 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6117 if (!UpRefs.empty())
6118 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6119 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6120 delete (yyvsp[(4) - (4)].TypeVal);
6126 #line 2955 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6128 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6129 GEN_ERROR("Invalid extractelement operands");
6130 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6136 #line 2961 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6138 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6139 GEN_ERROR("Invalid insertelement operands");
6140 (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6146 #line 2967 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6148 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6149 GEN_ERROR("Invalid shufflevector operands");
6150 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6156 #line 2973 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6158 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6159 if (!Ty->isFirstClassType())
6160 GEN_ERROR("PHI node operands must be of first class type");
6161 (yyval.InstVal) = new PHINode(Ty);
6162 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6163 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6164 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6165 GEN_ERROR("All elements of a PHI node must be of the same type");
6166 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6167 (yyvsp[(2) - (2)].PHIList)->pop_front();
6169 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6175 #line 2989 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6178 // Handle the short syntax
6179 const PointerType *PFTy = 0;
6180 const FunctionType *Ty = 0;
6181 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6182 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6183 // Pull out the types of all of the arguments...
6184 std::vector<const Type*> ParamTypes;
6185 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6186 for (; I != E; ++I) {
6187 const Type *Ty = I->Val->getType();
6188 if (Ty == Type::VoidTy)
6189 GEN_ERROR("Short call syntax cannot be used with varargs");
6190 ParamTypes.push_back(Ty);
6192 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6193 PFTy = PointerType::getUnqual(Ty);
6196 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6199 // Check for call to invalid intrinsic to avoid crashing later.
6200 if (Function *theF = dyn_cast<Function>(V)) {
6201 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6202 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6203 !theF->getIntrinsicID(true))
6204 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6205 theF->getName() + "'");
6208 // Set up the ParamAttrs for the function
6209 ParamAttrsVector Attrs;
6210 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) {
6211 ParamAttrsWithIndex PAWI;
6213 PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs);
6214 Attrs.push_back(PAWI);
6216 // Check the arguments
6218 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6219 // Make sure no arguments is a good thing!
6220 if (Ty->getNumParams() != 0)
6221 GEN_ERROR("No arguments passed to a function that "
6222 "expects arguments");
6223 } else { // Has arguments?
6224 // Loop through FunctionType's arguments and ensure they are specified
6225 // correctly. Also, gather any parameter attributes.
6226 FunctionType::param_iterator I = Ty->param_begin();
6227 FunctionType::param_iterator E = Ty->param_end();
6228 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6231 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6232 if (ArgI->Val->getType() != *I)
6233 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6234 (*I)->getDescription() + "'");
6235 Args.push_back(ArgI->Val);
6236 if (ArgI->Attrs != ParamAttr::None) {
6237 ParamAttrsWithIndex PAWI;
6239 PAWI.attrs = ArgI->Attrs;
6240 Attrs.push_back(PAWI);
6243 if (Ty->isVarArg()) {
6245 for (; ArgI != ArgE; ++ArgI, ++index) {
6246 Args.push_back(ArgI->Val); // push the remaining varargs
6247 if (ArgI->Attrs != ParamAttr::None) {
6248 ParamAttrsWithIndex PAWI;
6250 PAWI.attrs = ArgI->Attrs;
6251 Attrs.push_back(PAWI);
6254 } else if (I != E || ArgI != ArgE)
6255 GEN_ERROR("Invalid number of parameters detected");
6258 // Finish off the ParamAttrs and check them
6259 const ParamAttrsList *PAL = 0;
6261 PAL = ParamAttrsList::get(Attrs);
6263 // Create the call node
6264 CallInst *CI = new CallInst(V, Args.begin(), Args.end());
6265 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6266 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6267 CI->setParamAttrs(PAL);
6268 (yyval.InstVal) = CI;
6269 delete (yyvsp[(6) - (8)].ParamList);
6270 delete (yyvsp[(3) - (8)].TypeVal);
6276 #line 3086 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6278 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6284 #line 3091 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6286 (yyval.BoolVal) = true;
6292 #line 3095 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6294 (yyval.BoolVal) = false;
6300 #line 3102 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6302 if (!UpRefs.empty())
6303 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6304 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6305 delete (yyvsp[(2) - (3)].TypeVal);
6311 #line 3109 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6313 if (!UpRefs.empty())
6314 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6315 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6317 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6318 delete (yyvsp[(2) - (6)].TypeVal);
6323 #line 3117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6325 if (!UpRefs.empty())
6326 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6327 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6328 delete (yyvsp[(2) - (3)].TypeVal);
6334 #line 3124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6336 if (!UpRefs.empty())
6337 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6338 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6340 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6341 delete (yyvsp[(2) - (6)].TypeVal);
6346 #line 3132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6348 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6349 GEN_ERROR("Trying to free nonpointer type " +
6350 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6351 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6357 #line 3140 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6359 if (!UpRefs.empty())
6360 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6361 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6362 GEN_ERROR("Can't load from nonpointer type: " +
6363 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6364 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6365 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6366 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6367 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6369 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6370 delete (yyvsp[(3) - (5)].TypeVal);
6375 #line 3154 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6377 if (!UpRefs.empty())
6378 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6379 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6381 GEN_ERROR("Can't store to a nonpointer type: " +
6382 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6383 const Type *ElTy = PT->getElementType();
6384 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6385 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6386 "' into space of type '" + ElTy->getDescription() + "'");
6388 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6390 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6391 delete (yyvsp[(5) - (7)].TypeVal);
6396 #line 3171 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6398 ValID TmpVID = ValID::createLocalName(*(yyvsp[(3) - (5)].StrVal));
6399 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), TmpVID);
6400 if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
6401 GEN_ERROR("Invalid getresult operands");
6402 (yyval.InstVal) = new GetResultInst(TmpVal, (yyvsp[(5) - (5)].UInt64Val));
6408 #line 3179 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6410 if (!UpRefs.empty())
6411 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6412 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6413 GEN_ERROR("getelementptr insn requires pointer operand");
6415 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true))
6416 GEN_ERROR("Invalid getelementptr indices for type '" +
6417 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6418 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6420 (yyval.InstVal) = new GetElementPtrInst(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6421 delete (yyvsp[(2) - (4)].TypeVal);
6422 delete (yyvsp[(4) - (4)].ValueList);
6427 /* Line 1267 of yacc.c. */
6428 #line 6429 "llvmAsmParser.tab.c"
6431 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6435 YY_STACK_PRINT (yyss, yyssp);
6440 /* Now `shift' the result of the reduction. Determine what state
6441 that goes to, based on the state we popped back to and the rule
6442 number reduced by. */
6446 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6447 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6448 yystate = yytable[yystate];
6450 yystate = yydefgoto[yyn - YYNTOKENS];
6455 /*------------------------------------.
6456 | yyerrlab -- here on detecting error |
6457 `------------------------------------*/
6459 /* If not already recovering from an error, report this error. */
6463 #if ! YYERROR_VERBOSE
6464 yyerror (YY_("syntax error"));
6467 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6468 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6470 YYSIZE_T yyalloc = 2 * yysize;
6471 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6472 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6473 if (yymsg != yymsgbuf)
6474 YYSTACK_FREE (yymsg);
6475 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6477 yymsg_alloc = yyalloc;
6481 yymsg_alloc = sizeof yymsgbuf;
6485 if (0 < yysize && yysize <= yymsg_alloc)
6487 (void) yysyntax_error (yymsg, yystate, yychar);
6492 yyerror (YY_("syntax error"));
6494 goto yyexhaustedlab;
6502 if (yyerrstatus == 3)
6504 /* If just tried and failed to reuse look-ahead token after an
6505 error, discard it. */
6507 if (yychar <= YYEOF)
6509 /* Return failure if at end of input. */
6510 if (yychar == YYEOF)
6515 yydestruct ("Error: discarding",
6521 /* Else will try to reuse look-ahead token after shifting the error
6526 /*---------------------------------------------------.
6527 | yyerrorlab -- error raised explicitly by YYERROR. |
6528 `---------------------------------------------------*/
6531 /* Pacify compilers like GCC when the user code never invokes
6532 YYERROR and the label yyerrorlab therefore never appears in user
6534 if (/*CONSTCOND*/ 0)
6537 /* Do not reclaim the symbols of the rule which action triggered
6541 YY_STACK_PRINT (yyss, yyssp);
6546 /*-------------------------------------------------------------.
6547 | yyerrlab1 -- common code for both syntax error and YYERROR. |
6548 `-------------------------------------------------------------*/
6550 yyerrstatus = 3; /* Each real token shifted decrements this. */
6554 yyn = yypact[yystate];
6555 if (yyn != YYPACT_NINF)
6558 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6566 /* Pop the current state because it cannot handle the error token. */
6571 yydestruct ("Error: popping",
6572 yystos[yystate], yyvsp);
6575 YY_STACK_PRINT (yyss, yyssp);
6584 /* Shift the error token. */
6585 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6591 /*-------------------------------------.
6592 | yyacceptlab -- YYACCEPT comes here. |
6593 `-------------------------------------*/
6598 /*-----------------------------------.
6599 | yyabortlab -- YYABORT comes here. |
6600 `-----------------------------------*/
6606 /*-------------------------------------------------.
6607 | yyexhaustedlab -- memory exhaustion comes here. |
6608 `-------------------------------------------------*/
6610 yyerror (YY_("memory exhausted"));
6616 if (yychar != YYEOF && yychar != YYEMPTY)
6617 yydestruct ("Cleanup: discarding lookahead",
6619 /* Do not reclaim the symbols of the rule which action triggered
6620 this YYABORT or YYACCEPT. */
6622 YY_STACK_PRINT (yyss, yyssp);
6623 while (yyssp != yyss)
6625 yydestruct ("Cleanup: popping",
6626 yystos[*yyssp], yyvsp);
6631 YYSTACK_FREE (yyss);
6634 if (yymsg != yymsgbuf)
6635 YYSTACK_FREE (yymsg);
6637 /* Make sure YYID is used. */
6638 return YYID (yyresult);
6642 #line 3196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6645 // common code from the two 'RunVMAsmParser' functions
6646 static Module* RunParser(Module * M) {
6647 CurModule.CurrentModule = M;
6648 // Check to make sure the parser succeeded
6651 delete ParserResult;
6655 // Emit an error if there are any unresolved types left.
6656 if (!CurModule.LateResolveTypes.empty()) {
6657 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
6658 if (DID.Type == ValID::LocalName) {
6659 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
6661 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
6664 delete ParserResult;
6668 // Emit an error if there are any unresolved values left.
6669 if (!CurModule.LateResolveValues.empty()) {
6670 Value *V = CurModule.LateResolveValues.back();
6671 std::map<Value*, std::pair<ValID, int> >::iterator I =
6672 CurModule.PlaceHolderInfo.find(V);
6674 if (I != CurModule.PlaceHolderInfo.end()) {
6675 ValID &DID = I->second.first;
6676 if (DID.Type == ValID::LocalName) {
6677 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
6679 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
6682 delete ParserResult;
6687 // Check to make sure that parsing produced a result
6691 // Reset ParserResult variable while saving its value for the result.
6692 Module *Result = ParserResult;
6698 void llvm::GenerateError(const std::string &message, int LineNo) {
6699 if (LineNo == -1) LineNo = LLLgetLineNo();
6700 // TODO: column number in exception
6702 TheParseError->setError(LLLgetFilename(), message, LineNo);
6706 int yyerror(const char *ErrorMsg) {
6707 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
6708 std::string errMsg = where + "error: " + std::string(ErrorMsg);
6709 if (yychar != YYEMPTY && yychar != 0) {
6710 errMsg += " while reading token: '";
6711 errMsg += std::string(LLLgetTokenStart(),
6712 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
6714 GenerateError(errMsg);