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"
396 #include "llvm/ParamAttrsList.h"
402 // The following is a gross hack. In order to rid the libAsmParser library of
403 // exceptions, we have to have a way of getting the yyparse function to go into
404 // an error situation. So, whenever we want an error to occur, the GenerateError
405 // function (see bottom of file) sets TriggerError. Then, at the end of each
406 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
407 // (a goto) to put YACC in error state. Furthermore, several calls to
408 // GenerateError are made from inside productions and they must simulate the
409 // previous exception behavior by exiting the production immediately. We have
410 // replaced these with the GEN_ERROR macro which calls GeneratError and then
411 // immediately invokes YYERROR. This would be so much cleaner if it was a
412 // recursive descent parser.
413 static bool TriggerError = false;
414 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
415 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
417 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
418 int yylex(); // declaration" of xxx warnings.
420 using namespace llvm;
422 static Module *ParserResult;
424 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
425 // relating to upreferences in the input stream.
427 //#define DEBUG_UPREFS 1
429 #define UR_OUT(X) cerr << X
434 #define YYERROR_VERBOSE 1
436 static GlobalVariable *CurGV;
439 // This contains info used when building the body of a function. It is
440 // destroyed when the function is completed.
442 typedef std::vector<Value *> ValueList; // Numbered defs
445 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
447 static struct PerModuleInfo {
448 Module *CurrentModule;
449 ValueList Values; // Module level numbered definitions
450 ValueList LateResolveValues;
451 std::vector<PATypeHolder> Types;
452 std::map<ValID, PATypeHolder> LateResolveTypes;
454 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
455 /// how they were referenced and on which line of the input they came from so
456 /// that we can resolve them later and print error messages as appropriate.
457 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
459 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
460 // references to global values. Global values may be referenced before they
461 // are defined, and if so, the temporary object that they represent is held
462 // here. This is used for forward references of GlobalValues.
464 typedef std::map<std::pair<const PointerType *,
465 ValID>, GlobalValue*> GlobalRefsType;
466 GlobalRefsType GlobalRefs;
469 // If we could not resolve some functions at function compilation time
470 // (calls to functions before they are defined), resolve them now... Types
471 // are resolved when the constant pool has been completely parsed.
473 ResolveDefinitions(LateResolveValues);
477 // Check to make sure that all global value forward references have been
480 if (!GlobalRefs.empty()) {
481 std::string UndefinedReferences = "Unresolved global references exist:\n";
483 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
485 UndefinedReferences += " " + I->first.first->getDescription() + " " +
486 I->first.second.getName() + "\n";
488 GenerateError(UndefinedReferences);
492 // Look for intrinsic functions and CallInst that need to be upgraded
493 for (Module::iterator FI = CurrentModule->begin(),
494 FE = CurrentModule->end(); FI != FE; )
495 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
497 Values.clear(); // Clear out function local definitions
502 // GetForwardRefForGlobal - Check to see if there is a forward reference
503 // for this global. If so, remove it from the GlobalRefs map and return it.
504 // If not, just return null.
505 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
506 // Check to see if there is a forward reference to this global variable...
507 // if there is, eliminate it and patch the reference to use the new def'n.
508 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
509 GlobalValue *Ret = 0;
510 if (I != GlobalRefs.end()) {
517 bool TypeIsUnresolved(PATypeHolder* PATy) {
518 // If it isn't abstract, its resolved
519 const Type* Ty = PATy->get();
520 if (!Ty->isAbstract())
522 // Traverse the type looking for abstract types. If it isn't abstract then
523 // we don't need to traverse that leg of the type.
524 std::vector<const Type*> WorkList, SeenList;
525 WorkList.push_back(Ty);
526 while (!WorkList.empty()) {
527 const Type* Ty = WorkList.back();
528 SeenList.push_back(Ty);
530 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
531 // Check to see if this is an unresolved type
532 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
533 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
534 for ( ; I != E; ++I) {
535 if (I->second.get() == OpTy)
538 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
539 const Type* TheTy = SeqTy->getElementType();
540 if (TheTy->isAbstract() && TheTy != Ty) {
541 std::vector<const Type*>::iterator I = SeenList.begin(),
547 WorkList.push_back(TheTy);
549 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
550 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
551 const Type* TheTy = StrTy->getElementType(i);
552 if (TheTy->isAbstract() && TheTy != Ty) {
553 std::vector<const Type*>::iterator I = SeenList.begin(),
559 WorkList.push_back(TheTy);
568 static struct PerFunctionInfo {
569 Function *CurrentFunction; // Pointer to current function being created
571 ValueList Values; // Keep track of #'d definitions
573 ValueList LateResolveValues;
574 bool isDeclare; // Is this function a forward declararation?
575 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
576 GlobalValue::VisibilityTypes Visibility;
578 /// BBForwardRefs - When we see forward references to basic blocks, keep
579 /// track of them here.
580 std::map<ValID, BasicBlock*> BBForwardRefs;
582 inline PerFunctionInfo() {
585 Linkage = GlobalValue::ExternalLinkage;
586 Visibility = GlobalValue::DefaultVisibility;
589 inline void FunctionStart(Function *M) {
594 void FunctionDone() {
595 // Any forward referenced blocks left?
596 if (!BBForwardRefs.empty()) {
597 GenerateError("Undefined reference to label " +
598 BBForwardRefs.begin()->second->getName());
602 // Resolve all forward references now.
603 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
605 Values.clear(); // Clear out function local definitions
606 BBForwardRefs.clear();
609 Linkage = GlobalValue::ExternalLinkage;
610 Visibility = GlobalValue::DefaultVisibility;
612 } CurFun; // Info for the current function...
614 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
617 //===----------------------------------------------------------------------===//
618 // Code to handle definitions of all the types
619 //===----------------------------------------------------------------------===//
621 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
622 // Things that have names or are void typed don't get slot numbers
623 if (V->hasName() || (V->getType() == Type::VoidTy))
626 // In the case of function values, we have to allow for the forward reference
627 // of basic blocks, which are included in the numbering. Consequently, we keep
628 // track of the next insertion location with NextValNum. When a BB gets
629 // inserted, it could change the size of the CurFun.Values vector.
630 if (&ValueTab == &CurFun.Values) {
631 if (ValueTab.size() <= CurFun.NextValNum)
632 ValueTab.resize(CurFun.NextValNum+1);
633 ValueTab[CurFun.NextValNum++] = V;
636 // For all other lists, its okay to just tack it on the back of the vector.
637 ValueTab.push_back(V);
640 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
642 case ValID::LocalID: // Is it a numbered definition?
643 // Module constants occupy the lowest numbered slots...
644 if (D.Num < CurModule.Types.size())
645 return CurModule.Types[D.Num];
647 case ValID::LocalName: // Is it a named definition?
648 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
649 D.destroy(); // Free old strdup'd memory...
654 GenerateError("Internal parser error: Invalid symbol type reference");
658 // If we reached here, we referenced either a symbol that we don't know about
659 // or an id number that hasn't been read yet. We may be referencing something
660 // forward, so just create an entry to be resolved later and get to it...
662 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
665 if (inFunctionScope()) {
666 if (D.Type == ValID::LocalName) {
667 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
670 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
675 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
676 if (I != CurModule.LateResolveTypes.end())
679 Type *Typ = OpaqueType::get();
680 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
684 // getExistingVal - Look up the value specified by the provided type and
685 // the provided ValID. If the value exists and has already been defined, return
686 // it. Otherwise return null.
688 static Value *getExistingVal(const Type *Ty, const ValID &D) {
689 if (isa<FunctionType>(Ty)) {
690 GenerateError("Functions are not values and "
691 "must be referenced as pointers");
696 case ValID::LocalID: { // Is it a numbered definition?
697 // Check that the number is within bounds.
698 if (D.Num >= CurFun.Values.size())
700 Value *Result = CurFun.Values[D.Num];
701 if (Ty != Result->getType()) {
702 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
703 Result->getType()->getDescription() + "' does not match "
704 "expected type, '" + Ty->getDescription() + "'");
709 case ValID::GlobalID: { // Is it a numbered definition?
710 if (D.Num >= CurModule.Values.size())
712 Value *Result = CurModule.Values[D.Num];
713 if (Ty != Result->getType()) {
714 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
715 Result->getType()->getDescription() + "' does not match "
716 "expected type, '" + Ty->getDescription() + "'");
722 case ValID::LocalName: { // Is it a named definition?
723 if (!inFunctionScope())
725 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
726 Value *N = SymTab.lookup(D.getName());
729 if (N->getType() != Ty)
732 D.destroy(); // Free old strdup'd memory...
735 case ValID::GlobalName: { // Is it a named definition?
736 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
737 Value *N = SymTab.lookup(D.getName());
740 if (N->getType() != Ty)
743 D.destroy(); // Free old strdup'd memory...
747 // Check to make sure that "Ty" is an integral type, and that our
748 // value will fit into the specified type...
749 case ValID::ConstSIntVal: // Is it a constant pool reference??
750 if (!isa<IntegerType>(Ty) ||
751 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
752 GenerateError("Signed integral constant '" +
753 itostr(D.ConstPool64) + "' is invalid for type '" +
754 Ty->getDescription() + "'");
757 return ConstantInt::get(Ty, D.ConstPool64, true);
759 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
760 if (isa<IntegerType>(Ty) &&
761 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
762 return ConstantInt::get(Ty, D.UConstPool64);
764 if (!isa<IntegerType>(Ty) ||
765 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
766 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
767 "' is invalid or out of range for type '" +
768 Ty->getDescription() + "'");
771 // This is really a signed reference. Transmogrify.
772 return ConstantInt::get(Ty, D.ConstPool64, true);
774 case ValID::ConstFPVal: // Is it a floating point const pool reference?
775 if (!Ty->isFloatingPoint() ||
776 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
777 GenerateError("FP constant invalid for type");
780 // Lexer has no type info, so builds all float and double FP constants
781 // as double. Fix this here. Long double does not need this.
782 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
784 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
785 return ConstantFP::get(Ty, *D.ConstPoolFP);
787 case ValID::ConstNullVal: // Is it a null value?
788 if (!isa<PointerType>(Ty)) {
789 GenerateError("Cannot create a a non pointer null");
792 return ConstantPointerNull::get(cast<PointerType>(Ty));
794 case ValID::ConstUndefVal: // Is it an undef value?
795 return UndefValue::get(Ty);
797 case ValID::ConstZeroVal: // Is it a zero value?
798 return Constant::getNullValue(Ty);
800 case ValID::ConstantVal: // Fully resolved constant?
801 if (D.ConstantValue->getType() != Ty) {
802 GenerateError("Constant expression type different from required type");
805 return D.ConstantValue;
807 case ValID::InlineAsmVal: { // Inline asm expression
808 const PointerType *PTy = dyn_cast<PointerType>(Ty);
809 const FunctionType *FTy =
810 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
811 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
812 GenerateError("Invalid type for asm constraint string");
815 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
816 D.IAD->HasSideEffects);
817 D.destroy(); // Free InlineAsmDescriptor.
821 assert(0 && "Unhandled case!");
825 assert(0 && "Unhandled case!");
829 // getVal - This function is identical to getExistingVal, except that if a
830 // value is not already defined, it "improvises" by creating a placeholder var
831 // that looks and acts just like the requested variable. When the value is
832 // defined later, all uses of the placeholder variable are replaced with the
835 static Value *getVal(const Type *Ty, const ValID &ID) {
836 if (Ty == Type::LabelTy) {
837 GenerateError("Cannot use a basic block here");
841 // See if the value has already been defined.
842 Value *V = getExistingVal(Ty, ID);
844 if (TriggerError) return 0;
846 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
847 GenerateError("Invalid use of a composite type");
851 // If we reached here, we referenced either a symbol that we don't know about
852 // or an id number that hasn't been read yet. We may be referencing something
853 // forward, so just create an entry to be resolved later and get to it...
856 case ValID::GlobalName:
857 case ValID::GlobalID: {
858 const PointerType *PTy = dyn_cast<PointerType>(Ty);
860 GenerateError("Invalid type for reference to global" );
863 const Type* ElTy = PTy->getElementType();
864 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
865 V = new Function(FTy, GlobalValue::ExternalLinkage);
867 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
868 (Module*)0, false, PTy->getAddressSpace());
872 V = new Argument(Ty);
875 // Remember where this forward reference came from. FIXME, shouldn't we try
876 // to recycle these things??
877 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
880 if (inFunctionScope())
881 InsertValue(V, CurFun.LateResolveValues);
883 InsertValue(V, CurModule.LateResolveValues);
887 /// defineBBVal - This is a definition of a new basic block with the specified
888 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
889 static BasicBlock *defineBBVal(const ValID &ID) {
890 assert(inFunctionScope() && "Can't get basic block at global scope!");
894 // First, see if this was forward referenced
896 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
897 if (BBI != CurFun.BBForwardRefs.end()) {
899 // The forward declaration could have been inserted anywhere in the
900 // function: insert it into the correct place now.
901 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
902 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
904 // We're about to erase the entry, save the key so we can clean it up.
905 ValID Tmp = BBI->first;
907 // Erase the forward ref from the map as its no longer "forward"
908 CurFun.BBForwardRefs.erase(ID);
910 // The key has been removed from the map but so we don't want to leave
911 // strdup'd memory around so destroy it too.
914 // If its a numbered definition, bump the number and set the BB value.
915 if (ID.Type == ValID::LocalID) {
916 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
924 // We haven't seen this BB before and its first mention is a definition.
925 // Just create it and return it.
926 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
927 BB = new BasicBlock(Name, CurFun.CurrentFunction);
928 if (ID.Type == ValID::LocalID) {
929 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
933 ID.destroy(); // Free strdup'd memory
937 /// getBBVal - get an existing BB value or create a forward reference for it.
939 static BasicBlock *getBBVal(const ValID &ID) {
940 assert(inFunctionScope() && "Can't get basic block at global scope!");
944 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
945 if (BBI != CurFun.BBForwardRefs.end()) {
947 } if (ID.Type == ValID::LocalName) {
948 std::string Name = ID.getName();
949 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
951 if (N->getType()->getTypeID() == Type::LabelTyID)
952 BB = cast<BasicBlock>(N);
954 GenerateError("Reference to label '" + Name + "' is actually of type '"+
955 N->getType()->getDescription() + "'");
957 } else if (ID.Type == ValID::LocalID) {
958 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
959 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
960 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
962 GenerateError("Reference to label '%" + utostr(ID.Num) +
963 "' is actually of type '"+
964 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
967 GenerateError("Illegal label reference " + ID.getName());
971 // If its already been defined, return it now.
973 ID.destroy(); // Free strdup'd memory.
977 // Otherwise, this block has not been seen before, create it.
979 if (ID.Type == ValID::LocalName)
981 BB = new BasicBlock(Name, CurFun.CurrentFunction);
983 // Insert it in the forward refs map.
984 CurFun.BBForwardRefs[ID] = BB;
990 //===----------------------------------------------------------------------===//
991 // Code to handle forward references in instructions
992 //===----------------------------------------------------------------------===//
994 // This code handles the late binding needed with statements that reference
995 // values not defined yet... for example, a forward branch, or the PHI node for
998 // This keeps a table (CurFun.LateResolveValues) of all such forward references
999 // and back patchs after we are done.
1002 // ResolveDefinitions - If we could not resolve some defs at parsing
1003 // time (forward branches, phi functions for loops, etc...) resolve the
1007 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1008 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1009 while (!LateResolvers.empty()) {
1010 Value *V = LateResolvers.back();
1011 LateResolvers.pop_back();
1013 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1014 CurModule.PlaceHolderInfo.find(V);
1015 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1017 ValID &DID = PHI->second.first;
1019 Value *TheRealValue = getExistingVal(V->getType(), DID);
1023 V->replaceAllUsesWith(TheRealValue);
1025 CurModule.PlaceHolderInfo.erase(PHI);
1026 } else if (FutureLateResolvers) {
1027 // Functions have their unresolved items forwarded to the module late
1029 InsertValue(V, *FutureLateResolvers);
1031 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1032 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1033 "' of type '" + V->getType()->getDescription() + "'",
1034 PHI->second.second);
1037 GenerateError("Reference to an invalid definition: #" +
1038 itostr(DID.Num) + " of type '" +
1039 V->getType()->getDescription() + "'",
1040 PHI->second.second);
1045 LateResolvers.clear();
1048 // ResolveTypeTo - A brand new type was just declared. This means that (if
1049 // name is not null) things referencing Name can be resolved. Otherwise, things
1050 // refering to the number can be resolved. Do this now.
1052 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1055 D = ValID::createLocalName(*Name);
1057 D = ValID::createLocalID(CurModule.Types.size());
1059 std::map<ValID, PATypeHolder>::iterator I =
1060 CurModule.LateResolveTypes.find(D);
1061 if (I != CurModule.LateResolveTypes.end()) {
1062 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1063 CurModule.LateResolveTypes.erase(I);
1067 // setValueName - Set the specified value to the name given. The name may be
1068 // null potentially, in which case this is a noop. The string passed in is
1069 // assumed to be a malloc'd string buffer, and is free'd by this function.
1071 static void setValueName(Value *V, std::string *NameStr) {
1072 if (!NameStr) return;
1073 std::string Name(*NameStr); // Copy string
1074 delete NameStr; // Free old string
1076 if (V->getType() == Type::VoidTy) {
1077 GenerateError("Can't assign name '" + Name+"' to value with void type");
1081 assert(inFunctionScope() && "Must be in function scope!");
1082 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1083 if (ST.lookup(Name)) {
1084 GenerateError("Redefinition of value '" + Name + "' of type '" +
1085 V->getType()->getDescription() + "'");
1093 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1094 /// this is a declaration, otherwise it is a definition.
1095 static GlobalVariable *
1096 ParseGlobalVariable(std::string *NameStr,
1097 GlobalValue::LinkageTypes Linkage,
1098 GlobalValue::VisibilityTypes Visibility,
1099 bool isConstantGlobal, const Type *Ty,
1100 Constant *Initializer, bool IsThreadLocal,
1101 unsigned AddressSpace = 0) {
1102 if (isa<FunctionType>(Ty)) {
1103 GenerateError("Cannot declare global vars of function type");
1107 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1111 Name = *NameStr; // Copy string
1112 delete NameStr; // Free old string
1115 // See if this global value was forward referenced. If so, recycle the
1118 if (!Name.empty()) {
1119 ID = ValID::createGlobalName(Name);
1121 ID = ValID::createGlobalID(CurModule.Values.size());
1124 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1125 // Move the global to the end of the list, from whereever it was
1126 // previously inserted.
1127 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1128 CurModule.CurrentModule->getGlobalList().remove(GV);
1129 CurModule.CurrentModule->getGlobalList().push_back(GV);
1130 GV->setInitializer(Initializer);
1131 GV->setLinkage(Linkage);
1132 GV->setVisibility(Visibility);
1133 GV->setConstant(isConstantGlobal);
1134 GV->setThreadLocal(IsThreadLocal);
1135 InsertValue(GV, CurModule.Values);
1139 // If this global has a name
1140 if (!Name.empty()) {
1141 // if the global we're parsing has an initializer (is a definition) and
1142 // has external linkage.
1143 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1144 // If there is already a global with external linkage with this name
1145 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1146 // If we allow this GVar to get created, it will be renamed in the
1147 // symbol table because it conflicts with an existing GVar. We can't
1148 // allow redefinition of GVars whose linking indicates that their name
1149 // must stay the same. Issue the error.
1150 GenerateError("Redefinition of global variable named '" + Name +
1151 "' of type '" + Ty->getDescription() + "'");
1156 // Otherwise there is no existing GV to use, create one now.
1157 GlobalVariable *GV =
1158 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1159 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1160 GV->setVisibility(Visibility);
1161 InsertValue(GV, CurModule.Values);
1165 // setTypeName - Set the specified type to the name given. The name may be
1166 // null potentially, in which case this is a noop. The string passed in is
1167 // assumed to be a malloc'd string buffer, and is freed by this function.
1169 // This function returns true if the type has already been defined, but is
1170 // allowed to be redefined in the specified context. If the name is a new name
1171 // for the type plane, it is inserted and false is returned.
1172 static bool setTypeName(const Type *T, std::string *NameStr) {
1173 assert(!inFunctionScope() && "Can't give types function-local names!");
1174 if (NameStr == 0) return false;
1176 std::string Name(*NameStr); // Copy string
1177 delete NameStr; // Free old string
1179 // We don't allow assigning names to void type
1180 if (T == Type::VoidTy) {
1181 GenerateError("Can't assign name '" + Name + "' to the void type");
1185 // Set the type name, checking for conflicts as we do so.
1186 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1188 if (AlreadyExists) { // Inserting a name that is already defined???
1189 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1190 assert(Existing && "Conflict but no matching type?!");
1192 // There is only one case where this is allowed: when we are refining an
1193 // opaque type. In this case, Existing will be an opaque type.
1194 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1195 // We ARE replacing an opaque type!
1196 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1200 // Otherwise, this is an attempt to redefine a type. That's okay if
1201 // the redefinition is identical to the original. This will be so if
1202 // Existing and T point to the same Type object. In this one case we
1203 // allow the equivalent redefinition.
1204 if (Existing == T) return true; // Yes, it's equal.
1206 // Any other kind of (non-equivalent) redefinition is an error.
1207 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1208 T->getDescription() + "'");
1214 //===----------------------------------------------------------------------===//
1215 // Code for handling upreferences in type names...
1218 // TypeContains - Returns true if Ty directly contains E in it.
1220 static bool TypeContains(const Type *Ty, const Type *E) {
1221 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1222 E) != Ty->subtype_end();
1226 struct UpRefRecord {
1227 // NestingLevel - The number of nesting levels that need to be popped before
1228 // this type is resolved.
1229 unsigned NestingLevel;
1231 // LastContainedTy - This is the type at the current binding level for the
1232 // type. Every time we reduce the nesting level, this gets updated.
1233 const Type *LastContainedTy;
1235 // UpRefTy - This is the actual opaque type that the upreference is
1236 // represented with.
1237 OpaqueType *UpRefTy;
1239 UpRefRecord(unsigned NL, OpaqueType *URTy)
1240 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1244 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1245 static std::vector<UpRefRecord> UpRefs;
1247 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1248 /// called. It loops through the UpRefs vector, which is a list of the
1249 /// currently active types. For each type, if the up reference is contained in
1250 /// the newly completed type, we decrement the level count. When the level
1251 /// count reaches zero, the upreferenced type is the type that is passed in:
1252 /// thus we can complete the cycle.
1254 static PATypeHolder HandleUpRefs(const Type *ty) {
1255 // If Ty isn't abstract, or if there are no up-references in it, then there is
1256 // nothing to resolve here.
1257 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1259 PATypeHolder Ty(ty);
1260 UR_OUT("Type '" << Ty->getDescription() <<
1261 "' newly formed. Resolving upreferences.\n" <<
1262 UpRefs.size() << " upreferences active!\n");
1264 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1265 // to zero), we resolve them all together before we resolve them to Ty. At
1266 // the end of the loop, if there is anything to resolve to Ty, it will be in
1268 OpaqueType *TypeToResolve = 0;
1270 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1271 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1272 << UpRefs[i].second->getDescription() << ") = "
1273 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1274 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1275 // Decrement level of upreference
1276 unsigned Level = --UpRefs[i].NestingLevel;
1277 UpRefs[i].LastContainedTy = Ty;
1278 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1279 if (Level == 0) { // Upreference should be resolved!
1280 if (!TypeToResolve) {
1281 TypeToResolve = UpRefs[i].UpRefTy;
1283 UR_OUT(" * Resolving upreference for "
1284 << UpRefs[i].second->getDescription() << "\n";
1285 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1286 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1287 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1288 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1290 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1291 --i; // Do not skip the next element...
1296 if (TypeToResolve) {
1297 UR_OUT(" * Resolving upreference for "
1298 << UpRefs[i].second->getDescription() << "\n";
1299 std::string OldName = TypeToResolve->getDescription());
1300 TypeToResolve->refineAbstractTypeTo(Ty);
1306 //===----------------------------------------------------------------------===//
1307 // RunVMAsmParser - Define an interface to this parser
1308 //===----------------------------------------------------------------------===//
1310 static Module* RunParser(Module * M);
1312 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1314 Module *M = RunParser(new Module(LLLgetFilename()));
1321 /* Enabling traces. */
1326 /* Enabling verbose error messages. */
1327 #ifdef YYERROR_VERBOSE
1328 # undef YYERROR_VERBOSE
1329 # define YYERROR_VERBOSE 1
1331 # define YYERROR_VERBOSE 0
1334 /* Enabling the token table. */
1335 #ifndef YYTOKEN_TABLE
1336 # define YYTOKEN_TABLE 0
1339 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1340 typedef union YYSTYPE
1341 #line 953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
1343 llvm::Module *ModuleVal;
1344 llvm::Function *FunctionVal;
1345 llvm::BasicBlock *BasicBlockVal;
1346 llvm::TerminatorInst *TermInstVal;
1347 llvm::Instruction *InstVal;
1348 llvm::Constant *ConstVal;
1350 const llvm::Type *PrimType;
1351 std::list<llvm::PATypeHolder> *TypeList;
1352 llvm::PATypeHolder *TypeVal;
1353 llvm::Value *ValueVal;
1354 std::vector<llvm::Value*> *ValueList;
1355 llvm::ArgListType *ArgList;
1356 llvm::TypeWithAttrs TypeWithAttrs;
1357 llvm::TypeWithAttrsList *TypeWithAttrsList;
1358 llvm::ParamList *ParamList;
1360 // Represent the RHS of PHI node
1361 std::list<std::pair<llvm::Value*,
1362 llvm::BasicBlock*> > *PHIList;
1363 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1364 std::vector<llvm::Constant*> *ConstVector;
1366 llvm::GlobalValue::LinkageTypes Linkage;
1367 llvm::GlobalValue::VisibilityTypes Visibility;
1368 llvm::ParameterAttributes ParamAttrs;
1369 llvm::APInt *APIntVal;
1374 llvm::APFloat *FPVal;
1377 std::string *StrVal; // This memory must be deleted
1378 llvm::ValID ValIDVal;
1380 llvm::Instruction::BinaryOps BinaryOpVal;
1381 llvm::Instruction::TermOps TermOpVal;
1382 llvm::Instruction::MemoryOps MemOpVal;
1383 llvm::Instruction::CastOps CastOpVal;
1384 llvm::Instruction::OtherOps OtherOpVal;
1385 llvm::ICmpInst::Predicate IPredicate;
1386 llvm::FCmpInst::Predicate FPredicate;
1388 /* Line 193 of yacc.c. */
1389 #line 1390 "llvmAsmParser.tab.c"
1391 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1392 # define YYSTYPE_IS_DECLARED 1
1393 # define YYSTYPE_IS_TRIVIAL 1
1398 /* Copy the second part of user declarations. */
1401 /* Line 216 of yacc.c. */
1402 #line 1403 "llvmAsmParser.tab.c"
1409 typedef YYTYPE_UINT8 yytype_uint8;
1411 typedef unsigned char yytype_uint8;
1415 typedef YYTYPE_INT8 yytype_int8;
1416 #elif (defined __STDC__ || defined __C99__FUNC__ \
1417 || defined __cplusplus || defined _MSC_VER)
1418 typedef signed char yytype_int8;
1420 typedef short int yytype_int8;
1423 #ifdef YYTYPE_UINT16
1424 typedef YYTYPE_UINT16 yytype_uint16;
1426 typedef unsigned short int yytype_uint16;
1430 typedef YYTYPE_INT16 yytype_int16;
1432 typedef short int yytype_int16;
1436 # ifdef __SIZE_TYPE__
1437 # define YYSIZE_T __SIZE_TYPE__
1438 # elif defined size_t
1439 # define YYSIZE_T size_t
1440 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1441 || defined __cplusplus || defined _MSC_VER)
1442 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1443 # define YYSIZE_T size_t
1445 # define YYSIZE_T unsigned int
1449 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1452 # if defined YYENABLE_NLS && YYENABLE_NLS
1454 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1455 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1459 # define YY_(msgid) msgid
1463 /* Suppress unused-variable warnings by "using" E. */
1464 #if ! defined lint || defined __GNUC__
1465 # define YYUSE(e) ((void) (e))
1467 # define YYUSE(e) /* empty */
1470 /* Identity function, used to suppress warnings about constant conditions. */
1472 # define YYID(n) (n)
1474 #if (defined __STDC__ || defined __C99__FUNC__ \
1475 || defined __cplusplus || defined _MSC_VER)
1488 #if ! defined yyoverflow || YYERROR_VERBOSE
1490 /* The parser invokes alloca or malloc; define the necessary symbols. */
1492 # ifdef YYSTACK_USE_ALLOCA
1493 # if YYSTACK_USE_ALLOCA
1495 # define YYSTACK_ALLOC __builtin_alloca
1496 # elif defined __BUILTIN_VA_ARG_INCR
1497 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1499 # define YYSTACK_ALLOC __alloca
1500 # elif defined _MSC_VER
1501 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1502 # define alloca _alloca
1504 # define YYSTACK_ALLOC alloca
1505 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1506 || defined __cplusplus || defined _MSC_VER)
1507 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1509 # define _STDLIB_H 1
1516 # ifdef YYSTACK_ALLOC
1517 /* Pacify GCC's `empty if-body' warning. */
1518 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1519 # ifndef YYSTACK_ALLOC_MAXIMUM
1520 /* The OS might guarantee only one guard page at the bottom of the stack,
1521 and a page size can be as small as 4096 bytes. So we cannot safely
1522 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1523 to allow for a few compiler-allocated temporary stack slots. */
1524 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1527 # define YYSTACK_ALLOC YYMALLOC
1528 # define YYSTACK_FREE YYFREE
1529 # ifndef YYSTACK_ALLOC_MAXIMUM
1530 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1532 # if (defined __cplusplus && ! defined _STDLIB_H \
1533 && ! ((defined YYMALLOC || defined malloc) \
1534 && (defined YYFREE || defined free)))
1535 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1537 # define _STDLIB_H 1
1541 # define YYMALLOC malloc
1542 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1543 || defined __cplusplus || defined _MSC_VER)
1544 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1548 # define YYFREE free
1549 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1550 || defined __cplusplus || defined _MSC_VER)
1551 void free (void *); /* INFRINGES ON USER NAME SPACE */
1555 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1558 #if (! defined yyoverflow \
1559 && (! defined __cplusplus \
1560 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1562 /* A type that is properly aligned for any stack member. */
1569 /* The size of the maximum gap between one aligned stack and the next. */
1570 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1572 /* The size of an array large to enough to hold all stacks, each with
1574 # define YYSTACK_BYTES(N) \
1575 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1576 + YYSTACK_GAP_MAXIMUM)
1578 /* Copy COUNT objects from FROM to TO. The source and destination do
1581 # if defined __GNUC__ && 1 < __GNUC__
1582 # define YYCOPY(To, From, Count) \
1583 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1585 # define YYCOPY(To, From, Count) \
1589 for (yyi = 0; yyi < (Count); yyi++) \
1590 (To)[yyi] = (From)[yyi]; \
1596 /* Relocate STACK from its old location to the new one. The
1597 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1598 elements in the stack, and YYPTR gives the new location of the
1599 stack. Advance YYPTR to a properly aligned location for the next
1601 # define YYSTACK_RELOCATE(Stack) \
1604 YYSIZE_T yynewbytes; \
1605 YYCOPY (&yyptr->Stack, Stack, yysize); \
1606 Stack = &yyptr->Stack; \
1607 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1608 yyptr += yynewbytes / sizeof (*yyptr); \
1614 /* YYFINAL -- State number of the termination state. */
1616 /* YYLAST -- Last index in YYTABLE. */
1619 /* YYNTOKENS -- Number of terminals. */
1620 #define YYNTOKENS 165
1621 /* YYNNTS -- Number of nonterminals. */
1623 /* YYNRULES -- Number of rules. */
1624 #define YYNRULES 322
1625 /* YYNRULES -- Number of states. */
1626 #define YYNSTATES 629
1628 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1629 #define YYUNDEFTOK 2
1630 #define YYMAXUTOK 405
1632 #define YYTRANSLATE(YYX) \
1633 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1635 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1636 static const yytype_uint8 yytranslate[] =
1638 0, 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 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1642 151, 152, 155, 2, 154, 2, 2, 2, 2, 2,
1643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1644 160, 153, 161, 2, 2, 2, 2, 2, 2, 2,
1645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1647 2, 157, 156, 159, 2, 2, 2, 2, 2, 164,
1648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1650 158, 2, 2, 162, 2, 163, 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, 2, 2, 2, 2,
1663 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1664 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1665 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1666 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1667 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1668 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1669 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1670 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1671 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1672 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1673 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1674 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1675 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1676 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1677 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1678 145, 146, 147, 148, 149, 150
1682 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1684 static const yytype_uint16 yyprhs[] =
1686 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1687 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1688 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1689 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1690 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1691 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1692 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1693 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1694 160, 162, 164, 166, 167, 169, 171, 173, 174, 176,
1695 178, 179, 181, 183, 185, 187, 188, 190, 192, 193,
1696 195, 197, 199, 201, 203, 206, 208, 210, 212, 214,
1697 216, 218, 220, 222, 224, 227, 228, 231, 233, 235,
1698 237, 239, 241, 243, 244, 247, 248, 251, 252, 255,
1699 256, 260, 263, 264, 266, 267, 271, 273, 276, 278,
1700 280, 282, 284, 286, 288, 290, 292, 294, 298, 300,
1701 303, 309, 315, 321, 327, 331, 334, 340, 345, 348,
1702 350, 352, 354, 358, 360, 364, 366, 367, 369, 373,
1703 378, 382, 386, 391, 396, 400, 407, 413, 416, 419,
1704 422, 425, 428, 431, 434, 437, 440, 443, 446, 449,
1705 456, 462, 471, 478, 485, 493, 501, 508, 517, 526,
1706 530, 532, 534, 536, 538, 539, 542, 549, 551, 552,
1707 554, 557, 558, 562, 563, 567, 571, 575, 579, 580,
1708 589, 590, 600, 601, 611, 617, 620, 624, 626, 630,
1709 634, 638, 642, 644, 645, 651, 655, 657, 661, 663,
1710 664, 675, 677, 679, 684, 686, 688, 691, 695, 696,
1711 698, 700, 702, 704, 706, 708, 710, 712, 714, 718,
1712 720, 726, 728, 730, 732, 734, 736, 738, 741, 743,
1713 747, 750, 753, 757, 760, 761, 763, 766, 769, 773,
1714 783, 793, 802, 817, 819, 821, 828, 834, 837, 844,
1715 852, 857, 862, 869, 876, 877, 878, 882, 885, 887,
1716 893, 899, 906, 913, 918, 925, 930, 935, 942, 949,
1717 952, 961, 963, 965, 966, 970, 977, 981, 988, 991,
1721 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1722 static const yytype_int16 yyrhs[] =
1724 211, 0, -1, 74, -1, 75, -1, 76, -1, 77,
1725 -1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
1726 -1, 86, -1, 87, -1, 88, -1, 83, -1, 84,
1727 -1, 85, -1, 117, -1, 118, -1, 119, -1, 120,
1728 -1, 121, -1, 122, -1, 123, -1, 124, -1, 125,
1729 -1, 126, -1, 127, -1, 128, -1, 91, -1, 92,
1730 -1, 93, -1, 94, -1, 95, -1, 96, -1, 97,
1731 -1, 98, -1, 99, -1, 100, -1, 101, -1, 102,
1732 -1, 103, -1, 104, -1, 105, -1, 106, -1, 107,
1733 -1, 108, -1, 109, -1, 110, -1, 97, -1, 98,
1734 -1, 99, -1, 100, -1, 26, -1, 27, -1, 11,
1735 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1736 -1, 19, -1, 22, -1, 24, -1, 173, -1, -1,
1737 54, 151, 4, 152, -1, -1, 173, 153, -1, -1,
1738 20, -1, 23, -1, 179, -1, -1, 177, 153, -1,
1739 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1740 46, -1, 48, -1, 50, -1, -1, 148, -1, 149,
1741 -1, 150, -1, -1, 46, -1, 48, -1, -1, 42,
1742 -1, 43, -1, 44, -1, 47, -1, -1, 44, -1,
1743 42, -1, -1, 62, -1, 63, -1, 64, -1, 65,
1744 -1, 66, -1, 61, 4, -1, 137, -1, 118, -1,
1745 136, -1, 119, -1, 139, -1, 140, -1, 142, -1,
1746 143, -1, 144, -1, 53, 4, -1, -1, 188, 187,
1747 -1, 138, -1, 141, -1, 137, -1, 136, -1, 145,
1748 -1, 146, -1, -1, 190, 189, -1, -1, 147, 22,
1749 -1, -1, 53, 4, -1, -1, 154, 53, 4, -1,
1750 34, 22, -1, -1, 194, -1, -1, 154, 197, 196,
1751 -1, 194, -1, 53, 4, -1, 11, -1, 12, -1,
1752 13, -1, 16, -1, 15, -1, 14, -1, 17, -1,
1753 49, -1, 198, -1, 199, 175, 155, -1, 233, -1,
1754 156, 4, -1, 199, 151, 203, 152, 190, -1, 10,
1755 151, 203, 152, 190, -1, 157, 4, 158, 199, 159,
1756 -1, 160, 4, 158, 199, 161, -1, 162, 204, 163,
1757 -1, 162, 163, -1, 160, 162, 204, 163, 161, -1,
1758 160, 162, 163, 161, -1, 199, 188, -1, 199, -1,
1759 10, -1, 200, -1, 202, 154, 200, -1, 202, -1,
1760 202, 154, 39, -1, 39, -1, -1, 199, -1, 204,
1761 154, 199, -1, 199, 157, 207, 159, -1, 199, 157,
1762 159, -1, 199, 164, 22, -1, 199, 160, 207, 161,
1763 -1, 199, 162, 207, 163, -1, 199, 162, 163, -1,
1764 199, 160, 162, 207, 163, 161, -1, 199, 160, 162,
1765 163, 161, -1, 199, 40, -1, 199, 41, -1, 199,
1766 233, -1, 199, 206, -1, 199, 25, -1, 171, 3,
1767 -1, 171, 5, -1, 171, 4, -1, 171, 6, -1,
1768 11, 26, -1, 11, 27, -1, 172, 9, -1, 168,
1769 151, 205, 38, 199, 152, -1, 116, 151, 205, 245,
1770 152, -1, 130, 151, 205, 154, 205, 154, 205, 152,
1771 -1, 166, 151, 205, 154, 205, 152, -1, 167, 151,
1772 205, 154, 205, 152, -1, 89, 169, 151, 205, 154,
1773 205, 152, -1, 90, 170, 151, 205, 154, 205, 152,
1774 -1, 132, 151, 205, 154, 205, 152, -1, 133, 151,
1775 205, 154, 205, 154, 205, 152, -1, 134, 151, 205,
1776 154, 205, 154, 205, 152, -1, 207, 154, 205, -1,
1777 205, -1, 32, -1, 33, -1, 37, -1, -1, 201,
1778 233, -1, 122, 151, 210, 38, 199, 152, -1, 212,
1779 -1, -1, 213, -1, 212, 213, -1, -1, 31, 214,
1780 229, -1, -1, 30, 215, 230, -1, 59, 58, 219,
1781 -1, 176, 18, 199, -1, 176, 18, 10, -1, -1,
1782 178, 182, 209, 208, 205, 175, 216, 196, -1, -1,
1783 178, 180, 182, 209, 208, 205, 175, 217, 196, -1,
1784 -1, 178, 181, 182, 209, 208, 199, 175, 218, 196,
1785 -1, 178, 182, 35, 185, 210, -1, 51, 220, -1,
1786 55, 153, 221, -1, 22, -1, 52, 153, 22, -1,
1787 67, 153, 22, -1, 157, 222, 159, -1, 222, 154,
1788 22, -1, 22, -1, -1, 223, 154, 199, 188, 174,
1789 -1, 199, 188, 174, -1, 223, -1, 223, 154, 39,
1790 -1, 39, -1, -1, 186, 201, 177, 151, 224, 152,
1791 190, 195, 192, 191, -1, 28, -1, 162, -1, 184,
1792 182, 225, 226, -1, 29, -1, 163, -1, 237, 228,
1793 -1, 183, 182, 225, -1, -1, 60, -1, 3, -1,
1794 4, -1, 9, -1, 26, -1, 27, -1, 40, -1,
1795 41, -1, 25, -1, 160, 207, 161, -1, 206, -1,
1796 58, 231, 22, 154, 22, -1, 7, -1, 8, -1,
1797 173, -1, 177, -1, 233, -1, 232, -1, 199, 234,
1798 -1, 235, -1, 236, 154, 205, -1, 237, 238, -1,
1799 227, 238, -1, 239, 176, 240, -1, 239, 242, -1,
1800 -1, 21, -1, 68, 236, -1, 68, 10, -1, 69,
1801 17, 234, -1, 69, 11, 234, 154, 17, 234, 154,
1802 17, 234, -1, 70, 171, 234, 154, 17, 234, 157,
1803 241, 159, -1, 70, 171, 234, 154, 17, 234, 157,
1804 159, -1, 71, 186, 201, 234, 151, 244, 152, 190,
1805 38, 17, 234, 72, 17, 234, -1, 72, -1, 73,
1806 -1, 241, 171, 232, 154, 17, 234, -1, 171, 232,
1807 154, 17, 234, -1, 176, 247, -1, 199, 157, 234,
1808 154, 234, 159, -1, 243, 154, 157, 234, 154, 234,
1809 159, -1, 199, 188, 234, 188, -1, 17, 188, 234,
1810 188, -1, 244, 154, 199, 188, 234, 188, -1, 244,
1811 154, 17, 188, 234, 188, -1, -1, -1, 245, 154,
1812 235, -1, 57, 56, -1, 56, -1, 166, 199, 234,
1813 154, 234, -1, 167, 199, 234, 154, 234, -1, 89,
1814 169, 199, 234, 154, 234, -1, 90, 170, 199, 234,
1815 154, 234, -1, 168, 235, 38, 199, -1, 130, 235,
1816 154, 235, 154, 235, -1, 131, 235, 154, 199, -1,
1817 132, 235, 154, 235, -1, 133, 235, 154, 235, 154,
1818 235, -1, 134, 235, 154, 235, 154, 235, -1, 129,
1819 243, -1, 246, 186, 201, 234, 151, 244, 152, 190,
1820 -1, 249, -1, 36, -1, -1, 111, 199, 193, -1,
1821 111, 199, 154, 11, 234, 193, -1, 112, 199, 193,
1822 -1, 112, 199, 154, 11, 234, 193, -1, 113, 235,
1823 -1, 248, 114, 199, 234, 193, -1, 248, 115, 235,
1824 154, 199, 234, 193, -1, 135, 199, 233, 154, 4,
1825 -1, 116, 199, 234, 245, -1
1828 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1829 static const yytype_uint16 yyrline[] =
1831 0, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115,
1832 1115, 1116, 1116, 1116, 1116, 1116, 1116, 1117, 1117, 1117,
1833 1117, 1117, 1117, 1118, 1118, 1118, 1118, 1118, 1118, 1121,
1834 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1129,
1835 1129, 1130, 1130, 1131, 1131, 1132, 1132, 1133, 1133, 1134,
1836 1134, 1135, 1135, 1136, 1137, 1142, 1143, 1143, 1143, 1143,
1837 1143, 1145, 1145, 1145, 1146, 1146, 1148, 1149, 1153, 1157,
1838 1162, 1162, 1164, 1165, 1170, 1176, 1177, 1178, 1179, 1180,
1839 1184, 1185, 1186, 1190, 1191, 1192, 1193, 1197, 1198, 1199,
1840 1203, 1204, 1205, 1206, 1207, 1211, 1212, 1213, 1216, 1217,
1841 1218, 1219, 1220, 1221, 1222, 1229, 1230, 1231, 1232, 1233,
1842 1234, 1235, 1236, 1237, 1238, 1242, 1243, 1248, 1249, 1250,
1843 1251, 1252, 1253, 1256, 1257, 1262, 1263, 1270, 1271, 1277,
1844 1278, 1287, 1295, 1296, 1301, 1302, 1303, 1308, 1321, 1321,
1845 1321, 1321, 1321, 1321, 1321, 1324, 1328, 1332, 1339, 1344,
1846 1352, 1382, 1407, 1412, 1422, 1432, 1436, 1446, 1453, 1462,
1847 1469, 1474, 1479, 1486, 1487, 1494, 1501, 1509, 1515, 1527,
1848 1555, 1571, 1598, 1626, 1652, 1672, 1698, 1718, 1730, 1737,
1849 1803, 1813, 1823, 1829, 1839, 1845, 1855, 1860, 1865, 1878,
1850 1890, 1912, 1920, 1926, 1937, 1942, 1947, 1953, 1959, 1968,
1851 1972, 1980, 1980, 1983, 1983, 1986, 1998, 2019, 2024, 2032,
1852 2033, 2037, 2037, 2041, 2041, 2044, 2047, 2071, 2083, 2082,
1853 2094, 2093, 2103, 2102, 2113, 2153, 2156, 2162, 2172, 2176,
1854 2181, 2183, 2188, 2193, 2202, 2212, 2223, 2227, 2236, 2245,
1855 2250, 2384, 2384, 2386, 2395, 2395, 2397, 2402, 2414, 2418,
1856 2423, 2427, 2431, 2435, 2439, 2443, 2447, 2451, 2455, 2480,
1857 2484, 2494, 2498, 2502, 2507, 2514, 2514, 2520, 2529, 2534,
1858 2539, 2543, 2552, 2561, 2570, 2574, 2582, 2608, 2612, 2617,
1859 2627, 2646, 2655, 2746, 2750, 2757, 2768, 2781, 2791, 2802,
1860 2812, 2823, 2831, 2841, 2848, 2851, 2852, 2859, 2863, 2868,
1861 2884, 2901, 2915, 2929, 2941, 2949, 2956, 2962, 2968, 2974,
1862 2989, 3087, 3092, 3096, 3103, 3110, 3118, 3125, 3133, 3141,
1867 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1868 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1869 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1870 static const char *const yytname[] =
1872 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1873 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1874 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1875 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1876 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1877 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1878 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1879 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1880 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
1881 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1882 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1883 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1884 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1885 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1886 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE",
1887 "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE",
1888 "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC",
1889 "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT",
1890 "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI",
1891 "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "VAARG",
1892 "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "GETRESULT",
1893 "SIGNEXT", "ZEROEXT", "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS",
1894 "BYVAL", "NEST", "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN",
1895 "PROTECTED", "'('", "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'",
1896 "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps",
1897 "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType",
1898 "FPType", "LocalName", "OptLocalName", "OptAddrSpace", "OptLocalAssign",
1899 "GlobalName", "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1900 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1901 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1902 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1903 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1904 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1905 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1906 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1907 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1908 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1909 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1910 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1911 "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal",
1912 "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst",
1913 "JumpTable", "Inst", "PHIList", "ParamList", "IndexList", "OptTailCall",
1914 "InstVal", "OptVolatile", "MemoryInst", 0
1919 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1921 static const yytype_uint16 yytoknum[] =
1923 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1924 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1925 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1926 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1927 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1928 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1929 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1930 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1931 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1932 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1933 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1934 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1935 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1936 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1937 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1938 405, 40, 41, 61, 44, 42, 92, 91, 120, 93,
1939 60, 62, 123, 125, 99
1943 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1944 static const yytype_uint8 yyr1[] =
1946 0, 165, 166, 166, 166, 166, 166, 166, 166, 166,
1947 166, 167, 167, 167, 167, 167, 167, 168, 168, 168,
1948 168, 168, 168, 168, 168, 168, 168, 168, 168, 169,
1949 169, 169, 169, 169, 169, 169, 169, 169, 169, 170,
1950 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
1951 170, 170, 170, 170, 170, 171, 172, 172, 172, 172,
1952 172, 173, 173, 173, 174, 174, 175, 175, 176, 176,
1953 177, 177, 178, 178, 179, 180, 180, 180, 180, 180,
1954 181, 181, 181, 182, 182, 182, 182, 183, 183, 183,
1955 184, 184, 184, 184, 184, 185, 185, 185, 186, 186,
1956 186, 186, 186, 186, 186, 187, 187, 187, 187, 187,
1957 187, 187, 187, 187, 187, 188, 188, 189, 189, 189,
1958 189, 189, 189, 190, 190, 191, 191, 192, 192, 193,
1959 193, 194, 195, 195, 196, 196, 197, 197, 198, 198,
1960 198, 198, 198, 198, 198, 199, 199, 199, 199, 199,
1961 199, 199, 199, 199, 199, 199, 199, 199, 200, 201,
1962 201, 202, 202, 203, 203, 203, 203, 204, 204, 205,
1963 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
1964 205, 205, 205, 205, 205, 205, 205, 205, 205, 206,
1965 206, 206, 206, 206, 206, 206, 206, 206, 206, 207,
1966 207, 208, 208, 209, 209, 210, 210, 211, 211, 212,
1967 212, 214, 213, 215, 213, 213, 213, 213, 216, 213,
1968 217, 213, 218, 213, 213, 213, 213, 219, 220, 220,
1969 221, 222, 222, 222, 223, 223, 224, 224, 224, 224,
1970 225, 226, 226, 227, 228, 228, 229, 230, 231, 231,
1971 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
1972 232, 233, 233, 233, 233, 234, 234, 235, 236, 236,
1973 237, 237, 238, 239, 239, 239, 240, 240, 240, 240,
1974 240, 240, 240, 240, 240, 241, 241, 242, 243, 243,
1975 244, 244, 244, 244, 244, 245, 245, 246, 246, 247,
1976 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
1977 247, 247, 248, 248, 249, 249, 249, 249, 249, 249,
1981 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1982 static const yytype_uint8 yyr2[] =
1984 0, 2, 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, 1, 1, 1, 1, 1,
1990 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
1991 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
1992 1, 1, 1, 0, 1, 1, 1, 0, 1, 1,
1993 0, 1, 1, 1, 1, 0, 1, 1, 0, 1,
1994 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
1995 1, 1, 1, 1, 2, 0, 2, 1, 1, 1,
1996 1, 1, 1, 0, 2, 0, 2, 0, 2, 0,
1997 3, 2, 0, 1, 0, 3, 1, 2, 1, 1,
1998 1, 1, 1, 1, 1, 1, 1, 3, 1, 2,
1999 5, 5, 5, 5, 3, 2, 5, 4, 2, 1,
2000 1, 1, 3, 1, 3, 1, 0, 1, 3, 4,
2001 3, 3, 4, 4, 3, 6, 5, 2, 2, 2,
2002 2, 2, 2, 2, 2, 2, 2, 2, 2, 6,
2003 5, 8, 6, 6, 7, 7, 6, 8, 8, 3,
2004 1, 1, 1, 1, 0, 2, 6, 1, 0, 1,
2005 2, 0, 3, 0, 3, 3, 3, 3, 0, 8,
2006 0, 9, 0, 9, 5, 2, 3, 1, 3, 3,
2007 3, 3, 1, 0, 5, 3, 1, 3, 1, 0,
2008 10, 1, 1, 4, 1, 1, 2, 3, 0, 1,
2009 1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
2010 5, 1, 1, 1, 1, 1, 1, 2, 1, 3,
2011 2, 2, 3, 2, 0, 1, 2, 2, 3, 9,
2012 9, 8, 14, 1, 1, 6, 5, 2, 6, 7,
2013 4, 4, 6, 6, 0, 0, 3, 2, 1, 5,
2014 5, 6, 6, 4, 6, 4, 4, 6, 6, 2,
2015 8, 1, 1, 0, 3, 6, 3, 6, 2, 5,
2019 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2020 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2021 means the default is an error. */
2022 static const yytype_uint16 yydefact[] =
2024 73, 61, 70, 62, 71, 63, 213, 211, 0, 0,
2025 0, 0, 0, 0, 83, 72, 0, 73, 209, 87,
2026 90, 0, 0, 225, 0, 0, 68, 0, 74, 75,
2027 77, 76, 78, 80, 79, 81, 82, 84, 85, 86,
2028 83, 83, 204, 1, 210, 88, 89, 83, 214, 91,
2029 92, 93, 94, 83, 274, 212, 274, 0, 0, 233,
2030 226, 227, 215, 261, 262, 217, 138, 139, 140, 143,
2031 142, 141, 144, 145, 0, 0, 0, 0, 263, 264,
2032 146, 216, 148, 204, 204, 95, 203, 0, 98, 98,
2033 275, 271, 69, 244, 245, 246, 270, 228, 229, 232,
2034 0, 166, 149, 0, 0, 0, 0, 155, 167, 0,
2035 0, 166, 0, 0, 0, 97, 96, 0, 201, 202,
2036 0, 0, 99, 100, 101, 102, 103, 0, 247, 0,
2037 313, 273, 0, 230, 165, 115, 161, 163, 0, 0,
2038 0, 0, 0, 0, 154, 0, 0, 147, 0, 0,
2039 160, 0, 159, 0, 224, 138, 139, 140, 143, 142,
2040 141, 0, 0, 67, 67, 104, 0, 241, 242, 243,
2041 312, 298, 0, 0, 0, 0, 98, 283, 284, 2,
2042 3, 4, 5, 6, 7, 8, 9, 10, 14, 15,
2043 16, 11, 12, 13, 0, 0, 0, 0, 0, 0,
2044 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
2045 27, 28, 0, 0, 0, 0, 0, 0, 0, 0,
2046 0, 0, 272, 98, 287, 0, 311, 231, 158, 0,
2047 123, 67, 67, 157, 0, 168, 0, 123, 67, 67,
2048 0, 205, 186, 187, 182, 184, 183, 185, 188, 181,
2049 177, 178, 0, 0, 0, 0, 0, 0, 0, 0,
2050 0, 0, 0, 0, 0, 0, 180, 179, 218, 0,
2051 297, 277, 67, 268, 276, 0, 0, 55, 0, 0,
2052 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
2053 0, 53, 54, 49, 50, 51, 52, 39, 40, 41,
2054 42, 43, 44, 45, 46, 47, 48, 0, 129, 129,
2055 318, 67, 67, 309, 0, 0, 0, 0, 0, 67,
2056 67, 67, 0, 0, 0, 0, 0, 106, 108, 107,
2057 105, 109, 110, 111, 112, 113, 116, 164, 162, 151,
2058 152, 153, 156, 66, 150, 220, 222, 0, 0, 0,
2059 0, 0, 0, 0, 0, 170, 200, 0, 0, 0,
2060 174, 0, 171, 0, 0, 0, 134, 239, 250, 251,
2061 252, 257, 253, 254, 255, 256, 248, 0, 259, 266,
2062 265, 267, 0, 0, 278, 0, 0, 67, 67, 0,
2063 314, 0, 316, 295, 0, 0, 0, 0, 0, 0,
2064 0, 0, 0, 0, 0, 0, 67, 0, 114, 120,
2065 119, 117, 118, 121, 122, 124, 134, 134, 0, 0,
2066 0, 295, 0, 0, 0, 0, 0, 169, 155, 167,
2067 0, 172, 173, 0, 0, 0, 0, 219, 238, 115,
2068 236, 0, 249, 0, 0, 269, 0, 0, 0, 0,
2069 0, 0, 0, 0, 322, 0, 0, 0, 305, 306,
2070 0, 0, 0, 0, 0, 303, 0, 129, 0, 221,
2071 223, 67, 0, 0, 0, 0, 0, 0, 0, 199,
2072 176, 0, 0, 0, 0, 0, 0, 136, 134, 65,
2073 0, 123, 0, 258, 0, 0, 294, 0, 0, 129,
2074 130, 129, 0, 0, 0, 0, 0, 0, 321, 299,
2075 300, 294, 0, 319, 67, 206, 0, 0, 190, 0,
2076 0, 0, 0, 175, 0, 0, 67, 131, 137, 135,
2077 64, 235, 237, 115, 132, 0, 0, 0, 115, 115,
2078 0, 301, 302, 315, 317, 296, 0, 0, 304, 307,
2079 308, 0, 129, 0, 0, 0, 196, 0, 0, 192,
2080 193, 189, 65, 133, 127, 260, 0, 0, 0, 0,
2081 123, 0, 288, 0, 123, 320, 194, 195, 0, 0,
2082 0, 234, 0, 125, 0, 281, 0, 0, 106, 108,
2083 115, 115, 0, 115, 115, 289, 310, 191, 197, 198,
2084 128, 0, 240, 279, 0, 280, 0, 291, 290, 0,
2085 0, 0, 126, 0, 0, 0, 115, 115, 0, 0,
2086 0, 293, 292, 286, 0, 0, 285, 0, 282
2089 /* YYDEFGOTO[NTERM-NUM]. */
2090 static const yytype_int16 yydefgoto[] =
2092 -1, 263, 264, 265, 290, 307, 161, 162, 78, 531,
2093 112, 12, 79, 14, 15, 40, 41, 42, 47, 53,
2094 117, 127, 336, 228, 415, 339, 602, 583, 390, 487,
2095 564, 437, 488, 80, 163, 136, 153, 137, 138, 109,
2096 356, 378, 357, 120, 87, 154, 16, 17, 18, 20,
2097 19, 366, 416, 417, 62, 23, 60, 100, 440, 441,
2098 128, 169, 54, 95, 55, 48, 443, 379, 82, 381,
2099 273, 274, 56, 91, 92, 222, 587, 131, 313, 540,
2100 454, 223, 224, 225, 226
2103 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2105 #define YYPACT_NINF -572
2106 static const yytype_int16 yypact[] =
2108 284, -572, -572, -572, -572, -572, -572, -572, -13, -121,
2109 12, -94, 78, -48, 19, -572, 127, 883, -572, 113,
2110 162, -18, 13, -572, 23, 140, -572, 1464, -572, -572,
2111 -572, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2112 106, 106, 176, -572, -572, -572, -572, 106, -572, -572,
2113 -572, -572, -572, 106, 155, -572, -10, 199, 209, 212,
2114 -572, -572, -572, -572, -572, 90, -572, -572, -572, -572,
2115 -572, -572, -572, -572, 242, 246, 2, 126, -572, -572,
2116 -572, 1, -572, 228, 228, 205, -572, 9, 297, 297,
2117 -572, -572, 80, -572, -572, -572, -572, -572, -572, -572,
2118 -81, 1059, -572, 134, 138, 506, 90, -572, 1, -114,
2119 149, 1059, 146, 9, 9, -572, -572, 1014, -572, -572,
2120 1504, 301, -572, -572, -572, -572, -572, 1562, -572, -2,
2121 1843, -572, 287, -572, -572, 1, -572, 159, 164, 1620,
2122 1620, 156, -83, 1620, -572, 315, 168, -572, 1504, 1620,
2123 90, 172, 1, 388, -572, 342, 316, 317, 322, 324,
2124 328, 234, 329, 1115, 288, -572, 99, -572, -572, -572,
2125 -572, -572, 293, 1660, 83, 333, 297, -572, -572, -572,
2126 -572, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2127 -572, -572, -572, -572, 511, 787, 1620, 1620, 1620, 1620,
2128 -572, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2129 -572, -572, 1620, 1620, 1620, 1620, 1620, 1620, 1620, 1620,
2130 1620, 1620, -572, 297, -572, 161, -572, -572, 434, 1345,
2131 -572, -31, -30, -572, 190, 1, 198, -572, 288, 3,
2132 1014, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2133 -572, -572, 511, 787, 201, 203, 204, 213, 214, 1385,
2134 1678, 609, 334, 225, 230, 231, -572, -572, -572, 238,
2135 -572, 90, 702, -572, 239, 841, 841, -572, 841, 1562,
2136 -572, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2137 1620, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2138 -572, -572, -572, -572, -572, -572, -572, 1620, 97, 123,
2139 -572, 702, -25, 244, 245, 249, 250, 251, 252, 14,
2140 702, 702, 341, 1562, 1620, 1620, 405, -572, -572, -572,
2141 -572, -572, -572, -572, -572, -572, -572, -572, -572, -93,
2142 -572, -572, -572, -572, -93, -572, 146, 375, 264, 265,
2143 1504, 1504, 1504, 1504, 1504, -572, -572, -56, 788, -78,
2144 -572, -82, -572, 1504, 1504, 1504, 263, 1406, -572, -572,
2145 -572, -572, -572, -572, -572, -572, 360, 1504, -572, -572,
2146 -572, -572, 1504, 269, -572, 272, 841, 702, 702, 5,
2147 -572, 7, -572, -572, 841, 271, 1620, 1620, 1620, 1620,
2148 1620, 275, 276, 277, 1620, 841, 702, 281, -572, -572,
2149 -572, -572, -572, -572, -572, -572, 263, 263, 1620, 1504,
2150 1504, -572, 282, 283, 285, 289, 1504, -572, 280, 969,
2151 -68, -572, -572, 290, 291, 408, -3, -572, -572, 1,
2152 294, 295, -572, 427, -64, -572, 433, 436, 303, 302,
2153 305, 841, 451, 841, 306, 307, 841, 308, 1, -572,
2154 313, 314, 453, 841, 841, 1, 318, 319, 1620, -572,
2155 -572, -45, 320, 321, 114, 1504, 1504, 1504, 1504, -572,
2156 -572, 311, 1504, 1504, 1620, 455, 474, -572, 263, 1746,
2157 1446, -572, 330, -572, 841, 841, 1718, 841, 841, 319,
2158 -572, 319, 1620, 841, 332, 1620, 1620, 1620, -572, -572,
2159 -572, 1718, 429, -572, 702, -572, 1504, 1504, -572, 336,
2160 331, 337, 340, -572, 343, 344, 64, -572, -572, -572,
2161 -572, -572, -572, 1, 81, 466, 346, 347, 28, 1,
2162 115, -572, -572, -572, -572, -572, 339, 841, -572, -572,
2163 -572, 133, 319, 349, 351, 1504, -572, 1504, 1504, -572,
2164 -572, -572, 1746, -572, 452, -572, 489, -4, 560, 560,
2165 -572, 1736, -572, 348, -572, -572, -572, -572, 359, 363,
2166 372, -572, 508, 380, 841, -572, 1255, -1, 381, 382,
2167 -572, -572, 87, 28, 1, -572, -93, -572, -572, -572,
2168 -572, 509, -572, -572, 383, -572, 1255, 434, 434, 519,
2169 560, 560, -572, 521, 392, 841, -572, -572, 841, 530,
2170 478, 434, 434, -572, 841, 537, -572, 841, -572
2173 /* YYPGOTO[NTERM-NUM]. */
2174 static const yytype_int16 yypgoto[] =
2176 -572, 426, 428, 431, 323, 304, -173, -572, 0, 4,
2177 -150, 467, 8, -572, -572, -572, -572, 189, -572, -572,
2178 -572, -149, -572, -409, -572, -234, -572, -572, -289, 31,
2179 -572, -404, -572, -572, -26, 352, -122, -572, 461, 483,
2180 -92, -159, -214, 84, 196, 350, -572, -572, 572, -572,
2181 -572, -572, -572, -572, -572, -572, -572, -572, -572, -572,
2182 502, -572, -572, -572, -572, -572, -572, -571, -76, 46,
2183 -105, -572, -572, 536, -572, -572, -572, -572, -572, 85,
2184 173, -572, -572, -572, -572
2187 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2188 positive, shift that token. If negative, reduce the rule which
2189 number is the opposite. If zero, do what YYDEFACT says.
2190 If YYTABLE_NINF, syntax error. */
2191 #define YYTABLE_NINF -209
2192 static const yytype_int16 yytable[] =
2194 11, 81, 278, 344, 266, 166, 104, 277, 13, 110,
2195 277, 90, 469, 470, 268, 604, 451, 11, 453, 93,
2196 392, 63, 64, 110, 110, 13, 167, 279, 164, 110,
2197 489, 485, 24, 1, 2, 614, 3, 4, 5, 21,
2198 143, 118, 119, 409, 410, 411, 359, 361, 412, 144,
2199 486, 108, 413, 414, 22, 110, 238, 110, 452, 26,
2200 452, 29, 30, 31, 32, 33, 34, 35, 110, 36,
2201 25, 143, 426, 132, 323, 135, 426, 241, 133, 108,
2202 234, 432, -144, 431, 529, 135, 426, 267, 345, 346,
2203 426, 152, 11, 310, 275, 481, 27, 493, 426, 1,
2204 276, 152, 3, 427, 5, 28, 111, 515, 314, 315,
2205 316, 317, 318, 231, 232, 485, 322, 235, 110, 2,
2206 111, 111, 4, 239, 562, 609, 111, 43, 340, 568,
2207 569, 341, 394, 63, 64, 57, 106, 66, 67, 68,
2208 69, 70, 71, 72, 430, 1, 2, 272, 3, 4,
2209 5, 110, 111, 94, 111, 585, -67, 386, 605, 45,
2210 168, 46, 61, 444, 105, 111, 58, 37, 38, 39,
2211 308, 309, 272, 311, 269, 73, 90, 110, 513, -144,
2212 59, 607, 608, -144, 610, 611, 312, 272, 272, 272,
2213 272, 272, 319, 320, 321, 272, 380, 148, 149, 380,
2214 380, 405, 380, 135, 49, 50, 51, 621, 622, 52,
2215 543, 85, 544, 86, 152, 111, 561, 409, 410, 411,
2216 407, 97, 412, 409, 410, 411, 413, 414, 412, 83,
2217 84, 98, 413, 414, 99, 380, 88, 244, 245, 246,
2218 247, 101, 89, 401, 380, 380, 102, 115, 111, 116,
2219 103, 389, -67, 152, 37, 38, 39, 534, 421, 422,
2220 423, 424, 425, 575, 387, 86, 518, 570, 502, 571,
2221 266, 433, 434, 435, 111, 324, 325, 391, -67, 113,
2222 114, 388, 74, 75, -208, 574, 76, 571, 77, 107,
2223 445, 457, 139, 459, 460, 461, 140, 152, 406, 272,
2224 145, 147, -69, 1, 2, 165, 3, 4, 5, 227,
2225 380, 380, 380, 229, 6, 7, 230, 233, 380, 236,
2226 237, 383, 384, 240, 385, -56, -57, 472, 473, 380,
2227 380, -60, 429, -59, 479, 8, 592, -58, 248, 9,
2228 596, 439, 110, 10, 277, -55, -55, -55, -55, 270,
2229 343, 342, 350, 267, 351, 352, 362, 393, 121, 122,
2230 123, 124, 125, 126, 353, 354, 402, 403, 242, 243,
2231 272, 458, 272, 272, 272, 380, 363, 380, 465, 404,
2232 380, 364, 365, 519, 520, 521, 522, 380, 380, 367,
2233 524, 525, 471, 382, 586, 63, 64, 545, 395, 396,
2234 548, 549, 550, 397, 398, 399, 400, 1, 2, 408,
2235 3, 4, 5, 418, 606, 419, 420, 436, 380, 380,
2236 442, 380, 380, 446, 553, 554, 447, 380, 456, 462,
2237 463, 464, 448, 449, 450, 468, 475, 476, 380, 477,
2238 455, 480, 514, 478, 482, 483, 484, 491, 490, 492,
2239 494, 466, 467, 495, 496, 500, 497, 508, 526, 498,
2240 502, 503, 505, 578, 533, 579, 580, 506, 507, 511,
2241 539, 380, 523, 512, 516, 517, 272, 527, 528, 272,
2242 272, 272, 452, 556, 535, 539, 547, 326, 565, 530,
2243 555, 557, 380, 380, 558, 559, 560, 499, 572, 501,
2244 566, 576, 504, 577, 567, 582, 584, 595, 380, 509,
2245 510, 597, 600, 63, 64, 598, 106, 66, 67, 68,
2246 69, 70, 71, 72, 599, 1, 2, 601, 3, 4,
2247 5, 612, -18, -19, 380, 380, 615, 613, 618, 380,
2248 536, 537, 380, 541, 542, 594, 619, 624, 380, 546,
2249 625, 380, 327, 328, 627, 73, 219, 349, 220, 130,
2250 552, 221, 530, 368, 369, 563, 581, 63, 64, 370,
2251 329, 330, 146, 331, 332, 348, 333, 334, 335, 1,
2252 2, 338, 3, 4, 5, 371, 372, 373, 142, 44,
2253 347, 129, 96, 573, 474, 0, 551, 0, 0, 0,
2254 374, 375, 280, 281, 282, 283, 284, 285, 286, 287,
2255 288, 289, 0, 326, 590, 591, 63, 64, 376, 106,
2256 155, 156, 157, 158, 159, 160, 72, 0, 1, 2,
2257 603, 3, 4, 5, 179, 180, 181, 182, 183, 184,
2258 185, 186, 187, 188, 189, 190, 191, 192, 193, 252,
2259 253, 0, 0, 0, 0, 0, 616, 617, 73, 0,
2260 0, 620, 74, 75, 623, 0, 76, 0, 77, 141,
2261 626, 0, 0, 628, 0, 0, 254, 200, 588, 589,
2262 203, 204, 205, 206, 207, 208, 209, 210, 211, 0,
2263 255, 0, 256, 257, 258, 0, 329, 330, 0, 331,
2264 332, 0, 333, 334, 335, 368, 369, 0, 0, 63,
2265 64, 370, 0, 0, 0, 0, 0, 0, 0, 0,
2266 377, 1, 2, 0, 3, 4, 5, 371, 372, 373,
2267 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2268 0, 0, 374, 375, 0, 0, 0, 0, 0, 0,
2269 0, 0, 0, 0, 0, 0, 110, 0, 0, 0,
2270 376, 0, 0, 0, 0, 74, 75, 0, 0, 76,
2271 0, 77, 360, 0, 0, 0, 179, 180, 181, 182,
2272 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
2273 193, 252, 253, 0, 0, 63, 64, 0, 106, 155,
2274 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
2275 3, 4, 5, 291, 292, 0, 0, 0, 254, 200,
2276 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
2277 211, 0, 255, 0, 256, 257, 258, 73, 0, 0,
2278 0, 0, 0, 0, 368, 369, 0, 0, 63, 64,
2279 370, 0, 0, 111, 0, 0, 0, 0, 0, 0,
2280 1, 2, 377, 3, 4, 5, 371, 372, 373, 0,
2281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2282 0, 374, 375, -207, 293, 294, 295, 296, 297, 298,
2283 299, 300, 301, 302, 303, 304, 305, 306, 0, 376,
2284 0, -69, 1, 2, 0, 3, 4, 5, 0, 0,
2285 0, 0, 0, 6, 7, 179, 180, 181, 182, 183,
2286 184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
2287 252, 253, 0, 0, 8, 0, 0, 0, 9, 0,
2288 0, 0, 10, 0, 74, 75, 0, 0, 76, 0,
2289 77, 428, 0, 0, 0, 0, 0, 254, 200, 201,
2290 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
2291 0, 255, 0, 256, 257, 258, 63, 64, 0, 0,
2292 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
2293 0, 3, 4, 5, 249, 0, 0, 0, 0, 0,
2294 0, 377, 0, 0, 0, 0, 0, 0, 0, 250,
2295 251, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2296 0, 63, 64, 110, 150, 66, 67, 68, 69, 70,
2297 71, 72, 0, 1, 2, 0, 3, 4, 5, 0,
2298 0, 0, 0, 179, 180, 181, 182, 183, 184, 185,
2299 186, 187, 188, 189, 190, 191, 192, 193, 252, 253,
2300 0, 0, 0, 73, 0, 0, 63, 64, 0, 106,
2301 66, 67, 68, 69, 70, 71, 72, 0, 1, 2,
2302 0, 3, 4, 5, 0, 254, 200, 201, 202, 203,
2303 204, 205, 206, 207, 208, 209, 210, 211, 134, 255,
2304 0, 256, 257, 258, 0, 0, 0, 0, 73, 0,
2305 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2306 111, 0, 63, 64, -67, 0, 259, 0, 0, 260,
2307 0, 261, 0, 262, 1, 2, 151, 3, 4, 5,
2308 249, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2309 0, 0, 0, 0, 0, 250, 251, 0, 0, 0,
2310 0, 0, 0, 0, 0, 0, 0, 0, 0, 110,
2311 74, 75, 0, 0, 76, 0, 77, 0, 0, 0,
2312 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
2313 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2314 190, 191, 192, 193, 252, 253, 0, 0, 0, 0,
2315 0, 0, 0, 0, 0, 74, 75, 0, 0, 76,
2316 0, 77, 0, 0, 0, 0, 0, 0, 0, 0,
2317 0, 254, 200, 201, 202, 203, 204, 205, 206, 207,
2318 208, 209, 210, 211, 0, 255, 0, 256, 257, 258,
2319 0, 0, 0, 0, 0, 0, 0, 0, 368, 369,
2320 0, 0, 0, 0, 370, 0, 111, 0, 0, 0,
2321 0, 0, 259, 0, 0, 260, 0, 261, 0, 262,
2322 371, 372, 373, 0, 0, 0, 0, 0, 0, 0,
2323 0, 0, 0, 0, 0, 374, 375, 0, 0, 0,
2324 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2325 0, 0, 0, 376, 0, 0, 0, 0, 0, 0,
2326 0, 0, 0, 0, 0, 0, 0, 0, 0, 179,
2327 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2328 190, 191, 192, 193, 252, 253, 0, 0, 0, 0,
2329 0, 0, 63, 64, 0, 106, 66, 67, 68, 69,
2330 70, 71, 72, 0, 1, 2, 0, 3, 4, 5,
2331 0, 254, 200, 201, 202, 203, 204, 205, 206, 207,
2332 208, 209, 210, 211, 337, 255, 0, 256, 257, 258,
2333 0, 0, 63, 64, 73, 106, 155, 156, 157, 158,
2334 159, 160, 72, 0, 1, 2, 0, 3, 4, 5,
2335 0, 0, 0, 63, 64, 377, 106, 66, 67, 68,
2336 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
2337 5, 0, 0, 0, 73, 0, 0, 0, 0, 0,
2338 0, 0, 0, 0, 0, 438, 0, 0, 0, 0,
2339 0, 0, 0, 63, 64, 73, 106, 66, 67, 68,
2340 69, 70, 71, 72, 0, 1, 2, 0, 3, 4,
2341 5, 63, 64, 0, 65, 66, 67, 68, 69, 70,
2342 71, 72, 0, 1, 2, 532, 3, 4, 5, 0,
2343 0, 0, 0, 0, 0, 73, 0, 0, 0, 0,
2344 0, 74, 75, 0, 0, 76, 0, 77, 0, 0,
2345 0, 63, 64, 73, 106, 155, 156, 157, 158, 159,
2346 160, 72, 0, 1, 2, 0, 3, 4, 5, 0,
2347 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2348 0, 74, 75, 0, 355, 76, 0, 77, 0, 0,
2349 0, 0, 0, 73, 0, 0, 0, 0, 0, 0,
2350 0, 0, 74, 75, 0, 0, 76, 0, 77, 63,
2351 64, 0, 150, 66, 67, 68, 69, 70, 71, 72,
2352 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2353 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2354 0, 0, 74, 75, 0, 0, 76, 0, 77, 0,
2355 0, 73, 0, 0, 0, 0, 0, 0, 0, 0,
2356 74, 75, 0, 0, 76, 0, 77, 63, 64, 0,
2357 106, 66, 67, 68, 69, 70, 71, 72, 0, 1,
2358 2, 0, 3, 4, 5, 0, 0, 0, 0, 0,
2359 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2360 74, 75, 0, 0, 76, 0, 77, 63, 64, 73,
2361 271, 66, 67, 68, 69, 70, 71, 72, 0, 1,
2362 2, 0, 3, 4, 5, 63, 64, 0, 106, 155,
2363 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
2364 3, 4, 5, 0, 0, 0, 0, 0, 0, 73,
2365 0, 0, 0, 0, 0, 0, 0, 0, 74, 75,
2366 0, 0, 76, 0, 77, 63, 64, 73, 106, 66,
2367 67, 68, 69, 70, 71, 538, 0, 1, 2, 0,
2368 3, 4, 5, 63, 64, 0, 106, 66, 67, 68,
2369 69, 70, 71, 593, 0, 1, 2, 0, 3, 4,
2370 5, 0, 0, 0, 0, 1, 0, 73, 3, 0,
2371 5, 0, 0, 0, 0, 0, 74, 75, 0, 0,
2372 76, 0, 77, 0, 0, 73, 0, 0, 0, 0,
2373 0, 0, 0, 0, 0, 0, 0, 0, 0, 326,
2374 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2375 0, 0, 0, 0, 0, 0, 74, 75, 0, 0,
2376 76, 0, 77, 0, 0, 0, 0, 0, 0, 0,
2377 0, 0, 0, 0, 74, 75, 0, 0, 76, 0,
2378 358, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2379 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2380 0, 0, 0, 0, 327, 328, 0, 0, 0, 0,
2381 0, 0, 0, 0, 74, 75, 0, 0, 76, 170,
2382 77, 0, 329, 330, 0, 331, 332, 0, 333, 334,
2383 335, 0, 74, 75, 0, 0, 76, 0, 77, 171,
2384 172, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2385 0, 173, 174, 175, 176, 177, 178, 179, 180, 181,
2386 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
2387 192, 193, 194, 195, 0, 0, 0, 0, 0, 0,
2388 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2389 0, 0, 0, 0, 196, 197, 198, 0, 0, 199,
2390 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
2391 210, 211, 212, 213, 214, 215, 216, 217, 218
2394 static const yytype_int16 yycheck[] =
2396 0, 27, 175, 237, 163, 127, 4, 11, 0, 54,
2397 11, 21, 416, 417, 164, 586, 11, 17, 11, 29,
2398 309, 7, 8, 54, 54, 17, 28, 176, 120, 54,
2399 439, 34, 153, 19, 20, 606, 22, 23, 24, 52,
2400 154, 32, 33, 136, 137, 138, 260, 261, 141, 163,
2401 53, 77, 145, 146, 67, 54, 148, 54, 53, 153,
2402 53, 42, 43, 44, 45, 46, 47, 48, 54, 50,
2403 58, 154, 154, 154, 223, 101, 154, 153, 159, 105,
2404 163, 163, 54, 161, 488, 111, 154, 163, 238, 239,
2405 154, 117, 92, 198, 11, 163, 18, 161, 154, 19,
2406 17, 127, 22, 159, 24, 153, 151, 152, 213, 214,
2407 215, 216, 217, 139, 140, 34, 221, 143, 54, 20,
2408 151, 151, 23, 149, 533, 38, 151, 0, 159, 538,
2409 539, 161, 157, 7, 8, 153, 10, 11, 12, 13,
2410 14, 15, 16, 17, 358, 19, 20, 173, 22, 23,
2411 24, 54, 151, 163, 151, 159, 155, 279, 159, 46,
2412 162, 48, 22, 377, 162, 151, 153, 148, 149, 150,
2413 196, 197, 198, 199, 166, 49, 21, 54, 467, 151,
2414 157, 590, 591, 155, 593, 594, 212, 213, 214, 215,
2415 216, 217, 218, 219, 220, 221, 272, 113, 114, 275,
2416 276, 323, 278, 229, 42, 43, 44, 616, 617, 47,
2417 499, 35, 501, 37, 240, 151, 152, 136, 137, 138,
2418 325, 22, 141, 136, 137, 138, 145, 146, 141, 40,
2419 41, 22, 145, 146, 22, 311, 47, 3, 4, 5,
2420 6, 151, 53, 319, 320, 321, 4, 42, 151, 44,
2421 4, 154, 155, 279, 148, 149, 150, 491, 350, 351,
2422 352, 353, 354, 552, 290, 37, 152, 152, 154, 154,
2423 429, 363, 364, 365, 151, 114, 115, 154, 155, 83,
2424 84, 307, 156, 157, 0, 152, 160, 154, 162, 163,
2425 382, 396, 158, 398, 399, 400, 158, 323, 324, 325,
2426 151, 155, 18, 19, 20, 4, 22, 23, 24, 22,
2427 386, 387, 388, 154, 30, 31, 152, 161, 394, 4,
2428 152, 275, 276, 151, 278, 9, 9, 419, 420, 405,
2429 406, 9, 358, 9, 426, 51, 570, 9, 9, 55,
2430 574, 367, 54, 59, 11, 3, 4, 5, 6, 56,
2431 152, 161, 151, 429, 151, 151, 22, 311, 61, 62,
2432 63, 64, 65, 66, 151, 151, 320, 321, 26, 27,
2433 396, 397, 398, 399, 400, 451, 151, 453, 404, 38,
2434 456, 151, 151, 475, 476, 477, 478, 463, 464, 151,
2435 482, 483, 418, 154, 567, 7, 8, 502, 154, 154,
2436 505, 506, 507, 154, 154, 154, 154, 19, 20, 4,
2437 22, 23, 24, 38, 587, 151, 151, 154, 494, 495,
2438 60, 497, 498, 154, 516, 517, 154, 503, 157, 154,
2439 154, 154, 386, 387, 388, 154, 154, 154, 514, 154,
2440 394, 161, 468, 154, 154, 154, 38, 152, 154, 22,
2441 17, 405, 406, 17, 151, 4, 154, 4, 484, 154,
2442 154, 154, 154, 555, 490, 557, 558, 154, 154, 151,
2443 496, 547, 161, 154, 154, 154, 502, 22, 4, 505,
2444 506, 507, 53, 152, 154, 511, 154, 53, 22, 489,
2445 154, 154, 568, 569, 154, 152, 152, 451, 159, 453,
2446 154, 152, 456, 152, 157, 53, 17, 159, 584, 463,
2447 464, 152, 4, 7, 8, 152, 10, 11, 12, 13,
2448 14, 15, 16, 17, 152, 19, 20, 147, 22, 23,
2449 24, 22, 151, 151, 610, 611, 17, 154, 17, 615,
2450 494, 495, 618, 497, 498, 571, 154, 17, 624, 503,
2451 72, 627, 118, 119, 17, 49, 130, 253, 130, 92,
2452 514, 130, 562, 3, 4, 534, 562, 7, 8, 9,
2453 136, 137, 111, 139, 140, 252, 142, 143, 144, 19,
2454 20, 229, 22, 23, 24, 25, 26, 27, 105, 17,
2455 240, 89, 56, 547, 421, -1, 511, -1, -1, -1,
2456 40, 41, 91, 92, 93, 94, 95, 96, 97, 98,
2457 99, 100, -1, 53, 568, 569, 7, 8, 58, 10,
2458 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2459 584, 22, 23, 24, 74, 75, 76, 77, 78, 79,
2460 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2461 90, -1, -1, -1, -1, -1, 610, 611, 49, -1,
2462 -1, 615, 156, 157, 618, -1, 160, -1, 162, 163,
2463 624, -1, -1, 627, -1, -1, 116, 117, 118, 119,
2464 120, 121, 122, 123, 124, 125, 126, 127, 128, -1,
2465 130, -1, 132, 133, 134, -1, 136, 137, -1, 139,
2466 140, -1, 142, 143, 144, 3, 4, -1, -1, 7,
2467 8, 9, -1, -1, -1, -1, -1, -1, -1, -1,
2468 160, 19, 20, -1, 22, 23, 24, 25, 26, 27,
2469 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2470 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
2471 -1, -1, -1, -1, -1, -1, 54, -1, -1, -1,
2472 58, -1, -1, -1, -1, 156, 157, -1, -1, 160,
2473 -1, 162, 163, -1, -1, -1, 74, 75, 76, 77,
2474 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
2475 88, 89, 90, -1, -1, 7, 8, -1, 10, 11,
2476 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2477 22, 23, 24, 26, 27, -1, -1, -1, 116, 117,
2478 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
2479 128, -1, 130, -1, 132, 133, 134, 49, -1, -1,
2480 -1, -1, -1, -1, 3, 4, -1, -1, 7, 8,
2481 9, -1, -1, 151, -1, -1, -1, -1, -1, -1,
2482 19, 20, 160, 22, 23, 24, 25, 26, 27, -1,
2483 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2484 -1, 40, 41, 0, 97, 98, 99, 100, 101, 102,
2485 103, 104, 105, 106, 107, 108, 109, 110, -1, 58,
2486 -1, 18, 19, 20, -1, 22, 23, 24, -1, -1,
2487 -1, -1, -1, 30, 31, 74, 75, 76, 77, 78,
2488 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
2489 89, 90, -1, -1, 51, -1, -1, -1, 55, -1,
2490 -1, -1, 59, -1, 156, 157, -1, -1, 160, -1,
2491 162, 163, -1, -1, -1, -1, -1, 116, 117, 118,
2492 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
2493 -1, 130, -1, 132, 133, 134, 7, 8, -1, -1,
2494 -1, -1, -1, -1, -1, -1, -1, -1, 19, 20,
2495 -1, 22, 23, 24, 25, -1, -1, -1, -1, -1,
2496 -1, 160, -1, -1, -1, -1, -1, -1, -1, 40,
2497 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2498 -1, 7, 8, 54, 10, 11, 12, 13, 14, 15,
2499 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2500 -1, -1, -1, 74, 75, 76, 77, 78, 79, 80,
2501 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2502 -1, -1, -1, 49, -1, -1, 7, 8, -1, 10,
2503 11, 12, 13, 14, 15, 16, 17, -1, 19, 20,
2504 -1, 22, 23, 24, -1, 116, 117, 118, 119, 120,
2505 121, 122, 123, 124, 125, 126, 127, 128, 39, 130,
2506 -1, 132, 133, 134, -1, -1, -1, -1, 49, -1,
2507 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2508 151, -1, 7, 8, 155, -1, 157, -1, -1, 160,
2509 -1, 162, -1, 164, 19, 20, 122, 22, 23, 24,
2510 25, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2511 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2512 -1, -1, -1, -1, -1, -1, -1, -1, -1, 54,
2513 156, 157, -1, -1, 160, -1, 162, -1, -1, -1,
2514 -1, -1, -1, -1, -1, -1, -1, -1, -1, 74,
2515 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2516 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
2517 -1, -1, -1, -1, -1, 156, 157, -1, -1, 160,
2518 -1, 162, -1, -1, -1, -1, -1, -1, -1, -1,
2519 -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
2520 125, 126, 127, 128, -1, 130, -1, 132, 133, 134,
2521 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
2522 -1, -1, -1, -1, 9, -1, 151, -1, -1, -1,
2523 -1, -1, 157, -1, -1, 160, -1, 162, -1, 164,
2524 25, 26, 27, -1, -1, -1, -1, -1, -1, -1,
2525 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2526 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2527 -1, -1, -1, 58, -1, -1, -1, -1, -1, -1,
2528 -1, -1, -1, -1, -1, -1, -1, -1, -1, 74,
2529 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2530 85, 86, 87, 88, 89, 90, -1, -1, -1, -1,
2531 -1, -1, 7, 8, -1, 10, 11, 12, 13, 14,
2532 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2533 -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
2534 125, 126, 127, 128, 39, 130, -1, 132, 133, 134,
2535 -1, -1, 7, 8, 49, 10, 11, 12, 13, 14,
2536 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2537 -1, -1, -1, 7, 8, 160, 10, 11, 12, 13,
2538 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2539 24, -1, -1, -1, 49, -1, -1, -1, -1, -1,
2540 -1, -1, -1, -1, -1, 39, -1, -1, -1, -1,
2541 -1, -1, -1, 7, 8, 49, 10, 11, 12, 13,
2542 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2543 24, 7, 8, -1, 10, 11, 12, 13, 14, 15,
2544 16, 17, -1, 19, 20, 39, 22, 23, 24, -1,
2545 -1, -1, -1, -1, -1, 49, -1, -1, -1, -1,
2546 -1, 156, 157, -1, -1, 160, -1, 162, -1, -1,
2547 -1, 7, 8, 49, 10, 11, 12, 13, 14, 15,
2548 16, 17, -1, 19, 20, -1, 22, 23, 24, -1,
2549 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2550 -1, 156, 157, -1, 159, 160, -1, 162, -1, -1,
2551 -1, -1, -1, 49, -1, -1, -1, -1, -1, -1,
2552 -1, -1, 156, 157, -1, -1, 160, -1, 162, 7,
2553 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2554 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2555 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2556 -1, -1, 156, 157, -1, -1, 160, -1, 162, -1,
2557 -1, 49, -1, -1, -1, -1, -1, -1, -1, -1,
2558 156, 157, -1, -1, 160, -1, 162, 7, 8, -1,
2559 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2560 20, -1, 22, 23, 24, -1, -1, -1, -1, -1,
2561 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2562 156, 157, -1, -1, 160, -1, 162, 7, 8, 49,
2563 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2564 20, -1, 22, 23, 24, 7, 8, -1, 10, 11,
2565 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2566 22, 23, 24, -1, -1, -1, -1, -1, -1, 49,
2567 -1, -1, -1, -1, -1, -1, -1, -1, 156, 157,
2568 -1, -1, 160, -1, 162, 7, 8, 49, 10, 11,
2569 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2570 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
2571 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2572 24, -1, -1, -1, -1, 19, -1, 49, 22, -1,
2573 24, -1, -1, -1, -1, -1, 156, 157, -1, -1,
2574 160, -1, 162, -1, -1, 49, -1, -1, -1, -1,
2575 -1, -1, -1, -1, -1, -1, -1, -1, -1, 53,
2576 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2577 -1, -1, -1, -1, -1, -1, 156, 157, -1, -1,
2578 160, -1, 162, -1, -1, -1, -1, -1, -1, -1,
2579 -1, -1, -1, -1, 156, 157, -1, -1, 160, -1,
2580 162, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2581 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2582 -1, -1, -1, -1, 118, 119, -1, -1, -1, -1,
2583 -1, -1, -1, -1, 156, 157, -1, -1, 160, 36,
2584 162, -1, 136, 137, -1, 139, 140, -1, 142, 143,
2585 144, -1, 156, 157, -1, -1, 160, -1, 162, 56,
2586 57, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2587 -1, 68, 69, 70, 71, 72, 73, 74, 75, 76,
2588 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
2589 87, 88, 89, 90, -1, -1, -1, -1, -1, -1,
2590 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2591 -1, -1, -1, -1, 111, 112, 113, -1, -1, 116,
2592 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
2593 127, 128, 129, 130, 131, 132, 133, 134, 135
2596 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2597 symbol of state STATE-NUM. */
2598 static const yytype_uint8 yystos[] =
2600 0, 19, 20, 22, 23, 24, 30, 31, 51, 55,
2601 59, 173, 176, 177, 178, 179, 211, 212, 213, 215,
2602 214, 52, 67, 220, 153, 58, 153, 18, 153, 42,
2603 43, 44, 45, 46, 47, 48, 50, 148, 149, 150,
2604 180, 181, 182, 0, 213, 46, 48, 183, 230, 42,
2605 43, 44, 47, 184, 227, 229, 237, 153, 153, 157,
2606 221, 22, 219, 7, 8, 10, 11, 12, 13, 14,
2607 15, 16, 17, 49, 156, 157, 160, 162, 173, 177,
2608 198, 199, 233, 182, 182, 35, 37, 209, 182, 182,
2609 21, 238, 239, 29, 163, 228, 238, 22, 22, 22,
2610 222, 151, 4, 4, 4, 162, 10, 163, 199, 204,
2611 54, 151, 175, 209, 209, 42, 44, 185, 32, 33,
2612 208, 61, 62, 63, 64, 65, 66, 186, 225, 225,
2613 176, 242, 154, 159, 39, 199, 200, 202, 203, 158,
2614 158, 163, 204, 154, 163, 151, 203, 155, 208, 208,
2615 10, 122, 199, 201, 210, 11, 12, 13, 14, 15,
2616 16, 171, 172, 199, 205, 4, 201, 28, 162, 226,
2617 36, 56, 57, 68, 69, 70, 71, 72, 73, 74,
2618 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2619 85, 86, 87, 88, 89, 90, 111, 112, 113, 116,
2620 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
2621 127, 128, 129, 130, 131, 132, 133, 134, 135, 166,
2622 167, 168, 240, 246, 247, 248, 249, 22, 188, 154,
2623 152, 199, 199, 161, 163, 199, 4, 152, 205, 199,
2624 151, 233, 26, 27, 3, 4, 5, 6, 9, 25,
2625 40, 41, 89, 90, 116, 130, 132, 133, 134, 157,
2626 160, 162, 164, 166, 167, 168, 206, 233, 175, 177,
2627 56, 10, 199, 235, 236, 11, 17, 11, 171, 186,
2628 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
2629 169, 26, 27, 97, 98, 99, 100, 101, 102, 103,
2630 104, 105, 106, 107, 108, 109, 110, 170, 199, 199,
2631 235, 199, 199, 243, 235, 235, 235, 235, 235, 199,
2632 199, 199, 235, 186, 114, 115, 53, 118, 119, 136,
2633 137, 139, 140, 142, 143, 144, 187, 39, 200, 190,
2634 159, 161, 161, 152, 190, 175, 175, 210, 169, 170,
2635 151, 151, 151, 151, 151, 159, 205, 207, 162, 207,
2636 163, 207, 22, 151, 151, 151, 216, 151, 3, 4,
2637 9, 25, 26, 27, 40, 41, 58, 160, 206, 232,
2638 233, 234, 154, 234, 234, 234, 201, 199, 199, 154,
2639 193, 154, 193, 234, 157, 154, 154, 154, 154, 154,
2640 154, 233, 234, 234, 38, 201, 199, 235, 4, 136,
2641 137, 138, 141, 145, 146, 189, 217, 218, 38, 151,
2642 151, 205, 205, 205, 205, 205, 154, 159, 163, 199,
2643 207, 161, 163, 205, 205, 205, 154, 196, 39, 199,
2644 223, 224, 60, 231, 207, 205, 154, 154, 234, 234,
2645 234, 11, 53, 11, 245, 234, 157, 235, 199, 235,
2646 235, 235, 154, 154, 154, 199, 234, 234, 154, 196,
2647 196, 199, 205, 205, 245, 154, 154, 154, 154, 205,
2648 161, 163, 154, 154, 38, 34, 53, 194, 197, 188,
2649 154, 152, 22, 161, 17, 17, 151, 154, 154, 234,
2650 4, 234, 154, 154, 234, 154, 154, 154, 4, 234,
2651 234, 151, 154, 193, 199, 152, 154, 154, 152, 205,
2652 205, 205, 205, 161, 205, 205, 199, 22, 4, 196,
2653 173, 174, 39, 199, 190, 154, 234, 234, 17, 199,
2654 244, 234, 234, 193, 193, 235, 234, 154, 235, 235,
2655 235, 244, 234, 205, 205, 154, 152, 154, 154, 152,
2656 152, 152, 188, 194, 195, 22, 154, 157, 188, 188,
2657 152, 154, 159, 234, 152, 193, 152, 152, 205, 205,
2658 205, 174, 53, 192, 17, 159, 171, 241, 118, 119,
2659 234, 234, 190, 17, 199, 159, 190, 152, 152, 152,
2660 4, 147, 191, 234, 232, 159, 171, 188, 188, 38,
2661 188, 188, 22, 154, 232, 17, 234, 234, 17, 154,
2662 234, 188, 188, 234, 17, 72, 234, 17, 234
2665 #define yyerrok (yyerrstatus = 0)
2666 #define yyclearin (yychar = YYEMPTY)
2667 #define YYEMPTY (-2)
2670 #define YYACCEPT goto yyacceptlab
2671 #define YYABORT goto yyabortlab
2672 #define YYERROR goto yyerrorlab
2675 /* Like YYERROR except do call yyerror. This remains here temporarily
2676 to ease the transition to the new meaning of YYERROR, for GCC.
2677 Once GCC version 2 has supplanted version 1, this can go. */
2679 #define YYFAIL goto yyerrlab
2681 #define YYRECOVERING() (!!yyerrstatus)
2683 #define YYBACKUP(Token, Value) \
2685 if (yychar == YYEMPTY && yylen == 1) \
2689 yytoken = YYTRANSLATE (yychar); \
2695 yyerror (YY_("syntax error: cannot back up")); \
2702 #define YYERRCODE 256
2705 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2706 If N is 0, then set CURRENT to the empty location which ends
2707 the previous symbol: RHS[0] (always defined). */
2709 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2710 #ifndef YYLLOC_DEFAULT
2711 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2715 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2716 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2717 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2718 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2722 (Current).first_line = (Current).last_line = \
2723 YYRHSLOC (Rhs, 0).last_line; \
2724 (Current).first_column = (Current).last_column = \
2725 YYRHSLOC (Rhs, 0).last_column; \
2731 /* YY_LOCATION_PRINT -- Print the location on the stream.
2732 This macro was not mandated originally: define only if we know
2733 we won't break user code: when these are the locations we know. */
2735 #ifndef YY_LOCATION_PRINT
2736 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2737 # define YY_LOCATION_PRINT(File, Loc) \
2738 fprintf (File, "%d.%d-%d.%d", \
2739 (Loc).first_line, (Loc).first_column, \
2740 (Loc).last_line, (Loc).last_column)
2742 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2747 /* YYLEX -- calling `yylex' with the right arguments. */
2750 # define YYLEX yylex (YYLEX_PARAM)
2752 # define YYLEX yylex ()
2755 /* Enable debugging if requested. */
2759 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2760 # define YYFPRINTF fprintf
2763 # define YYDPRINTF(Args) \
2769 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2773 YYFPRINTF (stderr, "%s ", Title); \
2774 yy_symbol_print (stderr, \
2776 YYFPRINTF (stderr, "\n"); \
2781 /*--------------------------------.
2782 | Print this symbol on YYOUTPUT. |
2783 `--------------------------------*/
2786 #if (defined __STDC__ || defined __C99__FUNC__ \
2787 || defined __cplusplus || defined _MSC_VER)
2789 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2792 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2795 YYSTYPE const * const yyvaluep;
2801 if (yytype < YYNTOKENS)
2802 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2814 /*--------------------------------.
2815 | Print this symbol on YYOUTPUT. |
2816 `--------------------------------*/
2818 #if (defined __STDC__ || defined __C99__FUNC__ \
2819 || defined __cplusplus || defined _MSC_VER)
2821 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2824 yy_symbol_print (yyoutput, yytype, yyvaluep)
2827 YYSTYPE const * const yyvaluep;
2830 if (yytype < YYNTOKENS)
2831 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2833 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2835 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2836 YYFPRINTF (yyoutput, ")");
2839 /*------------------------------------------------------------------.
2840 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2842 `------------------------------------------------------------------*/
2844 #if (defined __STDC__ || defined __C99__FUNC__ \
2845 || defined __cplusplus || defined _MSC_VER)
2847 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2850 yy_stack_print (bottom, top)
2851 yytype_int16 *bottom;
2855 YYFPRINTF (stderr, "Stack now");
2856 for (; bottom <= top; ++bottom)
2857 YYFPRINTF (stderr, " %d", *bottom);
2858 YYFPRINTF (stderr, "\n");
2861 # define YY_STACK_PRINT(Bottom, Top) \
2864 yy_stack_print ((Bottom), (Top)); \
2868 /*------------------------------------------------.
2869 | Report that the YYRULE is going to be reduced. |
2870 `------------------------------------------------*/
2872 #if (defined __STDC__ || defined __C99__FUNC__ \
2873 || defined __cplusplus || defined _MSC_VER)
2875 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
2878 yy_reduce_print (yyvsp, yyrule)
2883 int yynrhs = yyr2[yyrule];
2885 unsigned long int yylno = yyrline[yyrule];
2886 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2888 /* The symbols being reduced. */
2889 for (yyi = 0; yyi < yynrhs; yyi++)
2891 fprintf (stderr, " $%d = ", yyi + 1);
2892 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2893 &(yyvsp[(yyi + 1) - (yynrhs)])
2895 fprintf (stderr, "\n");
2899 # define YY_REDUCE_PRINT(Rule) \
2902 yy_reduce_print (yyvsp, Rule); \
2905 /* Nonzero means print parse trace. It is left uninitialized so that
2906 multiple parsers can coexist. */
2908 #else /* !YYDEBUG */
2909 # define YYDPRINTF(Args)
2910 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2911 # define YY_STACK_PRINT(Bottom, Top)
2912 # define YY_REDUCE_PRINT(Rule)
2913 #endif /* !YYDEBUG */
2916 /* YYINITDEPTH -- initial size of the parser's stacks. */
2918 # define YYINITDEPTH 200
2921 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2922 if the built-in stack extension method is used).
2924 Do not make this value too large; the results are undefined if
2925 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2926 evaluated with infinite-precision integer arithmetic. */
2929 # define YYMAXDEPTH 10000
2937 # if defined __GLIBC__ && defined _STRING_H
2938 # define yystrlen strlen
2940 /* Return the length of YYSTR. */
2941 #if (defined __STDC__ || defined __C99__FUNC__ \
2942 || defined __cplusplus || defined _MSC_VER)
2944 yystrlen (const char *yystr)
2952 for (yylen = 0; yystr[yylen]; yylen++)
2960 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2961 # define yystpcpy stpcpy
2963 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2965 #if (defined __STDC__ || defined __C99__FUNC__ \
2966 || defined __cplusplus || defined _MSC_VER)
2968 yystpcpy (char *yydest, const char *yysrc)
2971 yystpcpy (yydest, yysrc)
2977 const char *yys = yysrc;
2979 while ((*yyd++ = *yys++) != '\0')
2988 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2989 quotes and backslashes, so that it's suitable for yyerror. The
2990 heuristic is that double-quoting is unnecessary unless the string
2991 contains an apostrophe, a comma, or backslash (other than
2992 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2993 null, do not copy; instead, return the length of what the result
2996 yytnamerr (char *yyres, const char *yystr)
3001 char const *yyp = yystr;
3008 goto do_not_strip_quotes;
3012 goto do_not_strip_quotes;
3025 do_not_strip_quotes: ;
3029 return yystrlen (yystr);
3031 return yystpcpy (yyres, yystr) - yyres;
3035 /* Copy into YYRESULT an error message about the unexpected token
3036 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3037 including the terminating null byte. If YYRESULT is null, do not
3038 copy anything; just return the number of bytes that would be
3039 copied. As a special case, return 0 if an ordinary "syntax error"
3040 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3041 size calculation. */
3043 yysyntax_error (char *yyresult, int yystate, int yychar)
3045 int yyn = yypact[yystate];
3047 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3051 int yytype = YYTRANSLATE (yychar);
3052 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3053 YYSIZE_T yysize = yysize0;
3055 int yysize_overflow = 0;
3056 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3057 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3061 /* This is so xgettext sees the translatable formats that are
3062 constructed on the fly. */
3063 YY_("syntax error, unexpected %s");
3064 YY_("syntax error, unexpected %s, expecting %s");
3065 YY_("syntax error, unexpected %s, expecting %s or %s");
3066 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3067 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3071 static char const yyunexpected[] = "syntax error, unexpected %s";
3072 static char const yyexpecting[] = ", expecting %s";
3073 static char const yyor[] = " or %s";
3074 char yyformat[sizeof yyunexpected
3075 + sizeof yyexpecting - 1
3076 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3077 * (sizeof yyor - 1))];
3078 char const *yyprefix = yyexpecting;
3080 /* Start YYX at -YYN if negative to avoid negative indexes in
3082 int yyxbegin = yyn < 0 ? -yyn : 0;
3084 /* Stay within bounds of both yycheck and yytname. */
3085 int yychecklim = YYLAST - yyn + 1;
3086 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3089 yyarg[0] = yytname[yytype];
3090 yyfmt = yystpcpy (yyformat, yyunexpected);
3092 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3093 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3095 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3099 yyformat[sizeof yyunexpected - 1] = '\0';
3102 yyarg[yycount++] = yytname[yyx];
3103 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3104 yysize_overflow |= (yysize1 < yysize);
3106 yyfmt = yystpcpy (yyfmt, yyprefix);
3110 yyf = YY_(yyformat);
3111 yysize1 = yysize + yystrlen (yyf);
3112 yysize_overflow |= (yysize1 < yysize);
3115 if (yysize_overflow)
3116 return YYSIZE_MAXIMUM;
3120 /* Avoid sprintf, as that infringes on the user's name space.
3121 Don't have undefined behavior even if the translation
3122 produced a string with the wrong number of "%s"s. */
3123 char *yyp = yyresult;
3125 while ((*yyp = *yyf) != '\0')
3127 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3129 yyp += yytnamerr (yyp, yyarg[yyi++]);
3142 #endif /* YYERROR_VERBOSE */
3145 /*-----------------------------------------------.
3146 | Release the memory associated to this symbol. |
3147 `-----------------------------------------------*/
3150 #if (defined __STDC__ || defined __C99__FUNC__ \
3151 || defined __cplusplus || defined _MSC_VER)
3153 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3156 yydestruct (yymsg, yytype, yyvaluep)
3166 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3177 /* Prevent warnings from -Wmissing-prototypes. */
3179 #ifdef YYPARSE_PARAM
3180 #if defined __STDC__ || defined __cplusplus
3181 int yyparse (void *YYPARSE_PARAM);
3185 #else /* ! YYPARSE_PARAM */
3186 #if defined __STDC__ || defined __cplusplus
3191 #endif /* ! YYPARSE_PARAM */
3195 /* The look-ahead symbol. */
3198 /* The semantic value of the look-ahead symbol. */
3201 /* Number of syntax errors so far. */
3210 #ifdef YYPARSE_PARAM
3211 #if (defined __STDC__ || defined __C99__FUNC__ \
3212 || defined __cplusplus || defined _MSC_VER)
3214 yyparse (void *YYPARSE_PARAM)
3217 yyparse (YYPARSE_PARAM)
3218 void *YYPARSE_PARAM;
3220 #else /* ! YYPARSE_PARAM */
3221 #if (defined __STDC__ || defined __C99__FUNC__ \
3222 || defined __cplusplus || defined _MSC_VER)
3236 /* Number of tokens to shift before error messages enabled. */
3238 /* Look-ahead token as an internal (translated) token number. */
3241 /* Buffer for error messages, and its allocated size. */
3243 char *yymsg = yymsgbuf;
3244 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3247 /* Three stacks and their tools:
3248 `yyss': related to states,
3249 `yyvs': related to semantic values,
3250 `yyls': related to locations.
3252 Refer to the stacks thru separate pointers, to allow yyoverflow
3253 to reallocate them elsewhere. */
3255 /* The state stack. */
3256 yytype_int16 yyssa[YYINITDEPTH];
3257 yytype_int16 *yyss = yyssa;
3258 yytype_int16 *yyssp;
3260 /* The semantic value stack. */
3261 YYSTYPE yyvsa[YYINITDEPTH];
3262 YYSTYPE *yyvs = yyvsa;
3267 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3269 YYSIZE_T yystacksize = YYINITDEPTH;
3271 /* The variables used to return semantic value and location from the
3276 /* The number of symbols on the RHS of the reduced rule.
3277 Keep to zero when no symbol should be popped. */
3280 YYDPRINTF ((stderr, "Starting parse\n"));
3285 yychar = YYEMPTY; /* Cause a token to be read. */
3287 /* Initialize stack pointers.
3288 Waste one element of value and location stack
3289 so that they stay on the same level as the state stack.
3290 The wasted elements are never initialized. */
3297 /*------------------------------------------------------------.
3298 | yynewstate -- Push a new state, which is found in yystate. |
3299 `------------------------------------------------------------*/
3301 /* In all cases, when you get here, the value and location stacks
3302 have just been pushed. So pushing a state here evens the stacks. */
3308 if (yyss + yystacksize - 1 <= yyssp)
3310 /* Get the current used size of the three stacks, in elements. */
3311 YYSIZE_T yysize = yyssp - yyss + 1;
3315 /* Give user a chance to reallocate the stack. Use copies of
3316 these so that the &'s don't force the real ones into
3318 YYSTYPE *yyvs1 = yyvs;
3319 yytype_int16 *yyss1 = yyss;
3322 /* Each stack pointer address is followed by the size of the
3323 data in use in that stack, in bytes. This used to be a
3324 conditional around just the two extra args, but that might
3325 be undefined if yyoverflow is a macro. */
3326 yyoverflow (YY_("memory exhausted"),
3327 &yyss1, yysize * sizeof (*yyssp),
3328 &yyvs1, yysize * sizeof (*yyvsp),
3335 #else /* no yyoverflow */
3336 # ifndef YYSTACK_RELOCATE
3337 goto yyexhaustedlab;
3339 /* Extend the stack our own way. */
3340 if (YYMAXDEPTH <= yystacksize)
3341 goto yyexhaustedlab;
3343 if (YYMAXDEPTH < yystacksize)
3344 yystacksize = YYMAXDEPTH;
3347 yytype_int16 *yyss1 = yyss;
3348 union yyalloc *yyptr =
3349 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3351 goto yyexhaustedlab;
3352 YYSTACK_RELOCATE (yyss);
3353 YYSTACK_RELOCATE (yyvs);
3355 # undef YYSTACK_RELOCATE
3357 YYSTACK_FREE (yyss1);
3360 #endif /* no yyoverflow */
3362 yyssp = yyss + yysize - 1;
3363 yyvsp = yyvs + yysize - 1;
3366 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3367 (unsigned long int) yystacksize));
3369 if (yyss + yystacksize - 1 <= yyssp)
3373 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3382 /* Do appropriate processing given the current state. Read a
3383 look-ahead token if we need one and don't already have one. */
3385 /* First try to decide what to do without reference to look-ahead token. */
3386 yyn = yypact[yystate];
3387 if (yyn == YYPACT_NINF)
3390 /* Not known => get a look-ahead token if don't already have one. */
3392 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3393 if (yychar == YYEMPTY)
3395 YYDPRINTF ((stderr, "Reading a token: "));
3399 if (yychar <= YYEOF)
3401 yychar = yytoken = YYEOF;
3402 YYDPRINTF ((stderr, "Now at end of input.\n"));
3406 yytoken = YYTRANSLATE (yychar);
3407 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3410 /* If the proper action on seeing token YYTOKEN is to reduce or to
3411 detect an error, take that action. */
3413 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3418 if (yyn == 0 || yyn == YYTABLE_NINF)
3427 /* Count tokens shifted since error; after three, turn off error
3432 /* Shift the look-ahead token. */
3433 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3435 /* Discard the shifted token unless it is eof. */
3436 if (yychar != YYEOF)
3445 /*-----------------------------------------------------------.
3446 | yydefault -- do the default action for the current state. |
3447 `-----------------------------------------------------------*/
3449 yyn = yydefact[yystate];
3455 /*-----------------------------.
3456 | yyreduce -- Do a reduction. |
3457 `-----------------------------*/
3459 /* yyn is the number of a rule to reduce with. */
3462 /* If YYLEN is nonzero, implement the default value of the action:
3465 Otherwise, the following line sets YYVAL to garbage.
3466 This behavior is undocumented and Bison
3467 users should not rely upon it. Assigning to YYVAL
3468 unconditionally makes the parser a bit smaller, and it avoids a
3469 GCC warning that YYVAL may be used uninitialized. */
3470 yyval = yyvsp[1-yylen];
3473 YY_REDUCE_PRINT (yyn);
3477 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3478 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3482 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3483 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3487 #line 1122 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3488 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3492 #line 1122 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3493 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3497 #line 1123 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3498 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3502 #line 1123 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3503 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3507 #line 1124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3508 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3512 #line 1124 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3513 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3517 #line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3518 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3522 #line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3523 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3527 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3528 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3532 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3533 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3537 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3538 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3542 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3543 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3547 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3548 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3552 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3553 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3557 #line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3558 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3562 #line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3563 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3567 #line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3568 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3572 #line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3573 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3577 #line 1134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3578 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3582 #line 1134 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3583 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3587 #line 1135 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3588 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3592 #line 1135 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3593 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3597 #line 1136 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3598 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3602 #line 1137 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3603 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3607 #line 1146 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3608 { (yyval.StrVal) = 0; ;}
3612 #line 1148 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3613 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3617 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3618 { (yyval.UIntVal)=0; ;}
3622 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3624 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3630 #line 1157 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3638 #line 1165 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3646 #line 1170 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3648 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3654 #line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3655 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3659 #line 1177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3660 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3664 #line 1178 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3665 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3669 #line 1179 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3670 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3674 #line 1180 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3675 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3679 #line 1184 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3680 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3684 #line 1185 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3685 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3689 #line 1186 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3690 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3694 #line 1190 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3695 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3699 #line 1191 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3700 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3704 #line 1192 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3705 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3709 #line 1193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3710 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3714 #line 1197 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3715 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3719 #line 1198 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3720 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3724 #line 1199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3725 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3729 #line 1203 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3730 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3734 #line 1204 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3735 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3739 #line 1205 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3740 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3744 #line 1206 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3745 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3749 #line 1207 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3750 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3754 #line 1211 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3755 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3759 #line 1212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3760 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3764 #line 1213 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3765 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3769 #line 1216 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3770 { (yyval.UIntVal) = CallingConv::C; ;}
3774 #line 1217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3775 { (yyval.UIntVal) = CallingConv::C; ;}
3779 #line 1218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3780 { (yyval.UIntVal) = CallingConv::Fast; ;}
3784 #line 1219 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3785 { (yyval.UIntVal) = CallingConv::Cold; ;}
3789 #line 1220 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3790 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3794 #line 1221 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3795 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3799 #line 1222 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3801 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3802 GEN_ERROR("Calling conv too large");
3803 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3809 #line 1229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3810 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3814 #line 1230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3815 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3819 #line 1231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3820 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3824 #line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3825 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3829 #line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3830 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3834 #line 1234 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3835 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3839 #line 1235 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3840 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
3844 #line 1236 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3845 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
3849 #line 1237 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3850 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
3854 #line 1238 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3855 { (yyval.ParamAttrs) =
3856 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
3860 #line 1242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3861 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3865 #line 1243 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3867 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3872 #line 1248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3873 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
3877 #line 1249 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3878 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
3882 #line 1250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3883 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3887 #line 1251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3888 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3892 #line 1252 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3893 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
3897 #line 1253 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3898 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
3902 #line 1256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3903 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3907 #line 1257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3909 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3914 #line 1262 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3915 { (yyval.StrVal) = 0; ;}
3919 #line 1263 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3921 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3926 #line 1270 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3927 { (yyval.UIntVal) = 0; ;}
3931 #line 1271 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3933 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3934 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3935 GEN_ERROR("Alignment must be a power of two");
3941 #line 1277 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3942 { (yyval.UIntVal) = 0; ;}
3946 #line 1278 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3948 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
3949 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3950 GEN_ERROR("Alignment must be a power of two");
3956 #line 1287 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3958 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
3959 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
3960 GEN_ERROR("Invalid character in section name");
3961 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3967 #line 1295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3968 { (yyval.StrVal) = 0; ;}
3972 #line 1296 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3973 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
3977 #line 1301 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3982 #line 1302 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3987 #line 1303 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3989 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
3990 delete (yyvsp[(1) - (1)].StrVal);
3996 #line 1308 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3998 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
3999 GEN_ERROR("Alignment must be a power of two");
4000 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
4006 #line 1324 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4008 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
4014 #line 1328 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4016 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4022 #line 1332 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4024 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4025 GEN_ERROR("Cannot form a pointer to a basic block");
4026 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4027 delete (yyvsp[(1) - (3)].TypeVal);
4033 #line 1339 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4034 { // Named types are also simple types...
4035 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4037 (yyval.TypeVal) = new PATypeHolder(tmp);
4042 #line 1344 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4043 { // Type UpReference
4044 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4045 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4046 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4047 (yyval.TypeVal) = new PATypeHolder(OT);
4048 UR_OUT("New Upreference!\n");
4054 #line 1352 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4056 // Allow but ignore attributes on function types; this permits auto-upgrade.
4057 // FIXME: remove in LLVM 3.0.
4058 const Type* RetTy = *(yyvsp[(1) - (5)].TypeVal);
4059 if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy ||
4060 isa<OpaqueType>(RetTy)))
4061 GEN_ERROR("LLVM Functions cannot return aggregates");
4063 std::vector<const Type*> Params;
4064 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4065 for (; I != E; ++I ) {
4066 const Type *Ty = I->Ty->get();
4067 Params.push_back(Ty);
4070 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4071 if (isVarArg) Params.pop_back();
4073 for (unsigned i = 0; i != Params.size(); ++i)
4074 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4075 GEN_ERROR("Function arguments must be value types!");
4079 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4080 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4081 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4082 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4088 #line 1382 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4090 // Allow but ignore attributes on function types; this permits auto-upgrade.
4091 // FIXME: remove in LLVM 3.0.
4092 std::vector<const Type*> Params;
4093 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4094 for ( ; I != E; ++I ) {
4095 const Type* Ty = I->Ty->get();
4096 Params.push_back(Ty);
4099 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4100 if (isVarArg) Params.pop_back();
4102 for (unsigned i = 0; i != Params.size(); ++i)
4103 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4104 GEN_ERROR("Function arguments must be value types!");
4108 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4109 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4110 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4116 #line 1407 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4117 { // Sized array type?
4118 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4119 delete (yyvsp[(4) - (5)].TypeVal);
4125 #line 1412 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4127 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4128 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4129 GEN_ERROR("Unsigned result not equal to signed result");
4130 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4131 GEN_ERROR("Element type of a VectorType must be primitive");
4132 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4133 delete (yyvsp[(4) - (5)].TypeVal);
4139 #line 1422 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4140 { // Structure type?
4141 std::vector<const Type*> Elements;
4142 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4143 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4144 Elements.push_back(*I);
4146 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4147 delete (yyvsp[(2) - (3)].TypeList);
4153 #line 1432 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4154 { // Empty structure type?
4155 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4161 #line 1436 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4163 std::vector<const Type*> Elements;
4164 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4165 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4166 Elements.push_back(*I);
4168 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4169 delete (yyvsp[(3) - (5)].TypeList);
4175 #line 1446 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4176 { // Empty structure type?
4177 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4183 #line 1453 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4185 // Allow but ignore attributes on function types; this permits auto-upgrade.
4186 // FIXME: remove in LLVM 3.0.
4187 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4188 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4193 #line 1462 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4195 if (!UpRefs.empty())
4196 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4197 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType() && (*(yyvsp[(1) - (1)].TypeVal))->getTypeID() != Type::StructTyID)
4198 GEN_ERROR("LLVM functions cannot return aggregate types");
4199 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4204 #line 1469 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4206 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4211 #line 1474 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4213 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4214 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4220 #line 1479 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4222 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4228 #line 1487 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4230 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4231 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4232 TWA.Ty = new PATypeHolder(Type::VoidTy);
4233 (yyval.TypeWithAttrsList)->push_back(TWA);
4239 #line 1494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4241 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4242 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4243 TWA.Ty = new PATypeHolder(Type::VoidTy);
4244 (yyval.TypeWithAttrsList)->push_back(TWA);
4250 #line 1501 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4252 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4258 #line 1509 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4260 (yyval.TypeList) = new std::list<PATypeHolder>();
4261 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4262 delete (yyvsp[(1) - (1)].TypeVal);
4268 #line 1515 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4270 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4271 delete (yyvsp[(3) - (3)].TypeVal);
4277 #line 1527 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4278 { // Nonempty unsized arr
4279 if (!UpRefs.empty())
4280 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4281 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4283 GEN_ERROR("Cannot make array constant with type: '" +
4284 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4285 const Type *ETy = ATy->getElementType();
4286 int NumElements = ATy->getNumElements();
4288 // Verify that we have the correct size...
4289 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4290 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4291 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4292 itostr(NumElements) + "");
4294 // Verify all elements are correct type!
4295 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4296 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4297 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4298 ETy->getDescription() +"' as required!\nIt is of type '"+
4299 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4302 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4303 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4309 #line 1555 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4311 if (!UpRefs.empty())
4312 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4313 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4315 GEN_ERROR("Cannot make array constant with type: '" +
4316 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4318 int NumElements = ATy->getNumElements();
4319 if (NumElements != -1 && NumElements != 0)
4320 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4321 " arguments, but has size of " + itostr(NumElements) +"");
4322 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4323 delete (yyvsp[(1) - (3)].TypeVal);
4329 #line 1571 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4331 if (!UpRefs.empty())
4332 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4333 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4335 GEN_ERROR("Cannot make array constant with type: '" +
4336 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4338 int NumElements = ATy->getNumElements();
4339 const Type *ETy = ATy->getElementType();
4340 if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
4341 GEN_ERROR("Can't build string constant of size " +
4342 itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
4343 " when array has size " + itostr(NumElements) + "");
4344 std::vector<Constant*> Vals;
4345 if (ETy == Type::Int8Ty) {
4346 for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4347 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4349 delete (yyvsp[(3) - (3)].StrVal);
4350 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4352 delete (yyvsp[(3) - (3)].StrVal);
4353 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4354 delete (yyvsp[(1) - (3)].TypeVal);
4360 #line 1598 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4361 { // Nonempty unsized arr
4362 if (!UpRefs.empty())
4363 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4364 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4366 GEN_ERROR("Cannot make packed constant with type: '" +
4367 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4368 const Type *ETy = PTy->getElementType();
4369 int NumElements = PTy->getNumElements();
4371 // Verify that we have the correct size...
4372 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4373 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4374 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4375 itostr(NumElements) + "");
4377 // Verify all elements are correct type!
4378 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4379 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4380 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4381 ETy->getDescription() +"' as required!\nIt is of type '"+
4382 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4385 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4386 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4392 #line 1626 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4394 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4396 GEN_ERROR("Cannot make struct constant with type: '" +
4397 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4399 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4400 GEN_ERROR("Illegal number of initializers for structure type");
4402 // Check to ensure that constants are compatible with the type initializer!
4403 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4404 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4405 GEN_ERROR("Expected type '" +
4406 STy->getElementType(i)->getDescription() +
4407 "' for element #" + utostr(i) +
4408 " of structure initializer");
4410 // Check to ensure that Type is not packed
4411 if (STy->isPacked())
4412 GEN_ERROR("Unpacked Initializer to vector type '" +
4413 STy->getDescription() + "'");
4415 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4416 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4422 #line 1652 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4424 if (!UpRefs.empty())
4425 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4426 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4428 GEN_ERROR("Cannot make struct constant with type: '" +
4429 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4431 if (STy->getNumContainedTypes() != 0)
4432 GEN_ERROR("Illegal number of initializers for structure type");
4434 // Check to ensure that Type is not packed
4435 if (STy->isPacked())
4436 GEN_ERROR("Unpacked Initializer to vector type '" +
4437 STy->getDescription() + "'");
4439 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4440 delete (yyvsp[(1) - (3)].TypeVal);
4446 #line 1672 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4448 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4450 GEN_ERROR("Cannot make struct constant with type: '" +
4451 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4453 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4454 GEN_ERROR("Illegal number of initializers for structure type");
4456 // Check to ensure that constants are compatible with the type initializer!
4457 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4458 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4459 GEN_ERROR("Expected type '" +
4460 STy->getElementType(i)->getDescription() +
4461 "' for element #" + utostr(i) +
4462 " of structure initializer");
4464 // Check to ensure that Type is packed
4465 if (!STy->isPacked())
4466 GEN_ERROR("Vector initializer to non-vector type '" +
4467 STy->getDescription() + "'");
4469 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4470 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4476 #line 1698 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4478 if (!UpRefs.empty())
4479 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4480 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4482 GEN_ERROR("Cannot make struct constant with type: '" +
4483 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4485 if (STy->getNumContainedTypes() != 0)
4486 GEN_ERROR("Illegal number of initializers for structure type");
4488 // Check to ensure that Type is packed
4489 if (!STy->isPacked())
4490 GEN_ERROR("Vector initializer to non-vector type '" +
4491 STy->getDescription() + "'");
4493 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4494 delete (yyvsp[(1) - (5)].TypeVal);
4500 #line 1718 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4502 if (!UpRefs.empty())
4503 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4504 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4506 GEN_ERROR("Cannot make null pointer constant with type: '" +
4507 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4509 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4510 delete (yyvsp[(1) - (2)].TypeVal);
4516 #line 1730 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4518 if (!UpRefs.empty())
4519 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4520 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4521 delete (yyvsp[(1) - (2)].TypeVal);
4527 #line 1737 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4529 if (!UpRefs.empty())
4530 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4531 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4533 GEN_ERROR("Global const reference must be a pointer type " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4535 // ConstExprs can exist in the body of a function, thus creating
4536 // GlobalValues whenever they refer to a variable. Because we are in
4537 // the context of a function, getExistingVal will search the functions
4538 // symbol table instead of the module symbol table for the global symbol,
4539 // which throws things all off. To get around this, we just tell
4540 // getExistingVal that we are at global scope here.
4542 Function *SavedCurFn = CurFun.CurrentFunction;
4543 CurFun.CurrentFunction = 0;
4545 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4548 CurFun.CurrentFunction = SavedCurFn;
4550 // If this is an initializer for a constant pointer, which is referencing a
4551 // (currently) undefined variable, create a stub now that shall be replaced
4552 // in the future with the right type of variable.
4555 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4556 const PointerType *PT = cast<PointerType>(Ty);
4558 // First check to see if the forward references value is already created!
4559 PerModuleInfo::GlobalRefsType::iterator I =
4560 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4562 if (I != CurModule.GlobalRefs.end()) {
4563 V = I->second; // Placeholder already exists, use it...
4564 (yyvsp[(2) - (2)].ValIDVal).destroy();
4567 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4568 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4569 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4570 GEN_ERROR("Invalid reference to global");
4572 // Create the forward referenced global.
4574 if (const FunctionType *FTy =
4575 dyn_cast<FunctionType>(PT->getElementType())) {
4576 GV = new Function(FTy, GlobalValue::ExternalWeakLinkage, Name,
4577 CurModule.CurrentModule);
4579 GV = new GlobalVariable(PT->getElementType(), false,
4580 GlobalValue::ExternalWeakLinkage, 0,
4581 Name, CurModule.CurrentModule);
4584 // Keep track of the fact that we have a forward ref to recycle it
4585 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4590 (yyval.ConstVal) = cast<GlobalValue>(V);
4591 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4597 #line 1803 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4599 if (!UpRefs.empty())
4600 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4601 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4602 GEN_ERROR("Mismatched types for constant expression: " +
4603 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4604 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4605 delete (yyvsp[(1) - (2)].TypeVal);
4611 #line 1813 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4613 if (!UpRefs.empty())
4614 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4615 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4616 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4617 GEN_ERROR("Cannot create a null initialized value of this type");
4618 (yyval.ConstVal) = Constant::getNullValue(Ty);
4619 delete (yyvsp[(1) - (2)].TypeVal);
4625 #line 1823 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4626 { // integral constants
4627 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4628 GEN_ERROR("Constant value doesn't fit in type");
4629 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4635 #line 1829 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4636 { // arbitrary precision integer constants
4637 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4638 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4639 GEN_ERROR("Constant value does not fit in type");
4641 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4642 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4643 delete (yyvsp[(2) - (2)].APIntVal);
4649 #line 1839 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4650 { // integral constants
4651 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4652 GEN_ERROR("Constant value doesn't fit in type");
4653 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4659 #line 1845 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4660 { // arbitrary precision integer constants
4661 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4662 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4663 GEN_ERROR("Constant value does not fit in type");
4665 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4666 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4667 delete (yyvsp[(2) - (2)].APIntVal);
4673 #line 1855 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4674 { // Boolean constants
4675 assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4676 (yyval.ConstVal) = ConstantInt::getTrue();
4682 #line 1860 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4683 { // Boolean constants
4684 assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4685 (yyval.ConstVal) = ConstantInt::getFalse();
4691 #line 1865 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4692 { // Floating point constants
4693 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4694 GEN_ERROR("Floating point constant invalid for type");
4695 // Lexer has no type info, so builds all float and double FP constants
4696 // as double. Fix this here. Long double is done right.
4697 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4698 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4699 (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal));
4700 delete (yyvsp[(2) - (2)].FPVal);
4706 #line 1878 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4708 if (!UpRefs.empty())
4709 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4710 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4711 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4712 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4713 GEN_ERROR("invalid cast opcode for cast from '" +
4714 Val->getType()->getDescription() + "' to '" +
4715 DestTy->getDescription() + "'");
4716 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4717 delete (yyvsp[(5) - (6)].TypeVal);
4722 #line 1890 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4724 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4725 GEN_ERROR("GetElementPtr requires a pointer operand");
4728 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(),
4731 GEN_ERROR("Index list invalid for constant getelementptr");
4733 SmallVector<Constant*, 8> IdxVec;
4734 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4735 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4736 IdxVec.push_back(C);
4738 GEN_ERROR("Indices to constant getelementptr must be constants");
4740 delete (yyvsp[(4) - (5)].ValueList);
4742 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4748 #line 1912 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4750 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4751 GEN_ERROR("Select condition must be of boolean type");
4752 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4753 GEN_ERROR("Select operand types must match");
4754 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4760 #line 1920 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4762 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4763 GEN_ERROR("Binary operator types must match");
4765 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4770 #line 1926 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4772 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4773 GEN_ERROR("Logical operator types must match");
4774 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4775 if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4776 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4777 GEN_ERROR("Logical operator requires integral operands");
4779 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4785 #line 1937 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4787 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4788 GEN_ERROR("icmp operand types must match");
4789 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4794 #line 1942 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4796 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4797 GEN_ERROR("fcmp operand types must match");
4798 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4803 #line 1947 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4805 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4806 GEN_ERROR("Invalid extractelement operands");
4807 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4813 #line 1953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4815 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4816 GEN_ERROR("Invalid insertelement operands");
4817 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4823 #line 1959 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4825 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4826 GEN_ERROR("Invalid shufflevector operands");
4827 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4833 #line 1968 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4835 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
4841 #line 1972 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4843 (yyval.ConstVector) = new std::vector<Constant*>();
4844 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
4850 #line 1980 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4851 { (yyval.BoolVal) = false; ;}
4855 #line 1980 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4856 { (yyval.BoolVal) = true; ;}
4860 #line 1983 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4861 { (yyval.BoolVal) = true; ;}
4865 #line 1983 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4866 { (yyval.BoolVal) = false; ;}
4870 #line 1986 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4872 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
4873 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
4875 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
4877 GEN_ERROR("Aliases can be created only to global values");
4879 (yyval.ConstVal) = Aliasee;
4881 delete (yyvsp[(1) - (2)].TypeVal);
4886 #line 1998 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4888 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4889 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4890 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4891 GEN_ERROR("invalid cast opcode for cast from '" +
4892 Val->getType()->getDescription() + "' to '" +
4893 DestTy->getDescription() + "'");
4895 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4897 delete (yyvsp[(5) - (6)].TypeVal);
4902 #line 2019 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4904 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
4905 CurModule.ModuleDone();
4911 #line 2024 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4913 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
4914 CurModule.ModuleDone();
4920 #line 2037 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4921 { CurFun.isDeclare = false; ;}
4925 #line 2037 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4927 CurFun.FunctionDone();
4933 #line 2041 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4934 { CurFun.isDeclare = true; ;}
4938 #line 2041 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4945 #line 2044 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4952 #line 2047 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4954 if (!UpRefs.empty())
4955 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
4956 // Eagerly resolve types. This is not an optimization, this is a
4957 // requirement that is due to the fact that we could have this:
4959 // %list = type { %list * }
4960 // %list = type { %list * } ; repeated type decl
4962 // If types are not resolved eagerly, then the two types will not be
4963 // determined to be the same type!
4965 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
4967 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4969 // If this is a named type that is not a redefinition, add it to the slot
4971 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
4974 delete (yyvsp[(3) - (3)].TypeVal);
4980 #line 2071 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4982 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
4984 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4986 // If this is a named type that is not a redefinition, add it to the slot
4988 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
4995 #line 2083 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4997 /* "Externally Visible" Linkage */
4998 if ((yyvsp[(5) - (6)].ConstVal) == 0)
4999 GEN_ERROR("Global value initializer is not a constant");
5000 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
5001 (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));
5007 #line 2090 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5014 #line 2094 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5016 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5017 GEN_ERROR("Global value initializer is not a constant");
5018 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));
5024 #line 2099 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5031 #line 2103 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5033 if (!UpRefs.empty())
5034 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5035 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));
5037 delete (yyvsp[(6) - (7)].TypeVal);
5042 #line 2109 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5050 #line 2113 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5053 if ((yyvsp[(1) - (5)].StrVal)) {
5054 Name = *(yyvsp[(1) - (5)].StrVal);
5055 delete (yyvsp[(1) - (5)].StrVal);
5058 GEN_ERROR("Alias name cannot be empty");
5060 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5062 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5064 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5065 CurModule.CurrentModule);
5066 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5067 InsertValue(GA, CurModule.Values);
5070 // If there was a forward reference of this alias, resolve it now.
5074 ID = ValID::createGlobalName(Name);
5076 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5078 if (GlobalValue *FWGV =
5079 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5080 // Replace uses of the fwdref with the actual alias.
5081 FWGV->replaceAllUsesWith(GA);
5082 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5083 GV->eraseFromParent();
5085 cast<Function>(FWGV)->eraseFromParent();
5094 #line 2153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5101 #line 2156 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5108 #line 2162 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5110 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5111 if (AsmSoFar.empty())
5112 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5114 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5115 delete (yyvsp[(1) - (1)].StrVal);
5121 #line 2172 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5123 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5124 delete (yyvsp[(3) - (3)].StrVal);
5129 #line 2176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5131 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5132 delete (yyvsp[(3) - (3)].StrVal);
5137 #line 2183 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5139 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5140 delete (yyvsp[(3) - (3)].StrVal);
5146 #line 2188 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5148 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5149 delete (yyvsp[(1) - (1)].StrVal);
5155 #line 2193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5162 #line 2202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5164 if (!UpRefs.empty())
5165 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5166 if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy)
5167 GEN_ERROR("void typed arguments are invalid");
5168 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5169 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5170 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5176 #line 2212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5178 if (!UpRefs.empty())
5179 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5180 if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy)
5181 GEN_ERROR("void typed arguments are invalid");
5182 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5183 (yyval.ArgList) = new ArgListType;
5184 (yyval.ArgList)->push_back(E);
5190 #line 2223 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5192 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5198 #line 2227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5200 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5201 struct ArgListEntry E;
5202 E.Ty = new PATypeHolder(Type::VoidTy);
5204 E.Attrs = ParamAttr::None;
5205 (yyval.ArgList)->push_back(E);
5211 #line 2236 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5213 (yyval.ArgList) = new ArgListType;
5214 struct ArgListEntry E;
5215 E.Ty = new PATypeHolder(Type::VoidTy);
5217 E.Attrs = ParamAttr::None;
5218 (yyval.ArgList)->push_back(E);
5224 #line 2245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5226 (yyval.ArgList) = 0;
5232 #line 2251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5234 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5235 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5237 // Check the function result for abstractness if this is a define. We should
5238 // have no abstract types at this point
5239 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5240 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5242 std::vector<const Type*> ParamTypeList;
5243 ParamAttrsVector Attrs;
5244 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) {
5245 ParamAttrsWithIndex PAWI;
5247 PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs);
5248 Attrs.push_back(PAWI);
5250 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5252 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5253 const Type* Ty = I->Ty->get();
5254 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5255 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5256 ParamTypeList.push_back(Ty);
5257 if (Ty != Type::VoidTy)
5258 if (I->Attrs != ParamAttr::None) {
5259 ParamAttrsWithIndex PAWI;
5261 PAWI.attrs = I->Attrs;
5262 Attrs.push_back(PAWI);
5267 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5268 if (isVarArg) ParamTypeList.pop_back();
5270 const ParamAttrsList *PAL = 0;
5272 PAL = ParamAttrsList::get(Attrs);
5274 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5275 const PointerType *PFT = PointerType::getUnqual(FT);
5276 delete (yyvsp[(2) - (10)].TypeVal);
5279 if (!FunctionName.empty()) {
5280 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5282 ID = ValID::createGlobalID(CurModule.Values.size());
5286 // See if this function was forward referenced. If so, recycle the object.
5287 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5288 // Move the function to the end of the list, from whereever it was
5289 // previously inserted.
5290 Fn = cast<Function>(FWRef);
5291 assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
5292 CurModule.CurrentModule->getFunctionList().remove(Fn);
5293 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5294 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5295 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5296 if (Fn->getFunctionType() != FT ) {
5297 // The existing function doesn't have the same type. This is an overload
5299 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5300 } else if (Fn->getParamAttrs() != PAL) {
5301 // The existing function doesn't have the same parameter attributes.
5302 // This is an overload error.
5303 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5304 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5305 // Neither the existing or the current function is a declaration and they
5306 // have the same name and same type. Clearly this is a redefinition.
5307 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5308 } else if (Fn->isDeclaration()) {
5309 // Make sure to strip off any argument names so we can't get conflicts.
5310 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5314 } else { // Not already defined?
5315 Fn = new Function(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5316 CurModule.CurrentModule);
5317 InsertValue(Fn, CurModule.Values);
5320 CurFun.FunctionStart(Fn);
5322 if (CurFun.isDeclare) {
5323 // If we have declaration, always overwrite linkage. This will allow us to
5324 // correctly handle cases, when pointer to function is passed as argument to
5325 // another function.
5326 Fn->setLinkage(CurFun.Linkage);
5327 Fn->setVisibility(CurFun.Visibility);
5329 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5330 Fn->setParamAttrs(PAL);
5331 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5332 if ((yyvsp[(8) - (10)].StrVal)) {
5333 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5334 delete (yyvsp[(8) - (10)].StrVal);
5336 if ((yyvsp[(10) - (10)].StrVal)) {
5337 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5338 delete (yyvsp[(10) - (10)].StrVal);
5341 // Add all of the arguments we parsed to the function...
5342 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5343 if (isVarArg) { // Nuke the last entry
5344 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5345 "Not a varargs marker!");
5346 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5347 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5349 Function::arg_iterator ArgIt = Fn->arg_begin();
5350 Function::arg_iterator ArgEnd = Fn->arg_end();
5352 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5353 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5354 delete I->Ty; // Delete the typeholder...
5355 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5361 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5368 #line 2386 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5370 (yyval.FunctionVal) = CurFun.CurrentFunction;
5372 // Make sure that we keep track of the linkage type even if there was a
5373 // previous "declare".
5374 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5375 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5380 #line 2397 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5382 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5388 #line 2402 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5390 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5391 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5392 (yyval.FunctionVal) = CurFun.CurrentFunction;
5393 CurFun.FunctionDone();
5399 #line 2414 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5401 (yyval.BoolVal) = false;
5407 #line 2418 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5409 (yyval.BoolVal) = true;
5415 #line 2423 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5416 { // A reference to a direct constant
5417 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5423 #line 2427 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5425 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5431 #line 2431 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5432 { // Perhaps it's an FP constant?
5433 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5439 #line 2435 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5441 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5447 #line 2439 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5449 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5455 #line 2443 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5457 (yyval.ValIDVal) = ValID::createNull();
5463 #line 2447 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5465 (yyval.ValIDVal) = ValID::createUndef();
5471 #line 2451 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5472 { // A vector zero constant.
5473 (yyval.ValIDVal) = ValID::createZeroInit();
5479 #line 2455 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5480 { // Nonempty unsized packed vector
5481 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5482 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5484 VectorType* pt = VectorType::get(ETy, NumElements);
5485 PATypeHolder* PTy = new PATypeHolder(
5493 // Verify all elements are correct type!
5494 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5495 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5496 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5497 ETy->getDescription() +"' as required!\nIt is of type '" +
5498 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5501 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5502 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5508 #line 2480 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5510 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5516 #line 2484 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5518 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5519 delete (yyvsp[(3) - (5)].StrVal);
5520 delete (yyvsp[(5) - (5)].StrVal);
5526 #line 2494 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5527 { // Is it an integer reference...?
5528 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5534 #line 2498 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5536 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5542 #line 2502 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5543 { // Is it a named reference...?
5544 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5545 delete (yyvsp[(1) - (1)].StrVal);
5551 #line 2507 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5552 { // Is it a named reference...?
5553 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5554 delete (yyvsp[(1) - (1)].StrVal);
5560 #line 2520 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5562 if (!UpRefs.empty())
5563 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5564 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5565 delete (yyvsp[(1) - (2)].TypeVal);
5571 #line 2529 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5573 (yyval.ValueList) = new std::vector<Value *>();
5574 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
5580 #line 2534 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5582 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ConstVal));
5588 #line 2539 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5590 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5596 #line 2543 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5597 { // Do not allow functions with 0 basic blocks
5598 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5604 #line 2552 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5606 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5608 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5609 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5610 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5616 #line 2561 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5618 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5619 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5620 if (CI2->getParent() == 0)
5621 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5622 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5623 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5629 #line 2570 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5630 { // Empty space between instruction lists
5631 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5637 #line 2574 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5638 { // Labelled (named) basic block
5639 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5640 delete (yyvsp[(1) - (1)].StrVal);
5647 #line 2582 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5648 { // Return with a result...
5649 if((yyvsp[(2) - (2)].ValueList)->size() == 1)
5650 (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueList)->back());
5653 std::vector<const Type*> Elements;
5654 std::vector<Constant*> Vals;
5655 for (std::vector<Value *>::iterator I = (yyvsp[(2) - (2)].ValueList)->begin(),
5656 E = (yyvsp[(2) - (2)].ValueList)->end(); I != E; ++I) {
5658 Constant *C = cast<Constant>(V);
5659 Elements.push_back(V->getType());
5663 const StructType *STy = StructType::get(Elements);
5665 new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
5667 Constant *CS = ConstantStruct::get(STy, Vals); // *$2);
5668 (yyval.TermInstVal) = new ReturnInst(CS);
5671 delete (yyvsp[(2) - (2)].ValueList);
5677 #line 2608 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5678 { // Return with no result...
5679 (yyval.TermInstVal) = new ReturnInst();
5685 #line 2612 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5686 { // Unconditional Branch...
5687 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5689 (yyval.TermInstVal) = new BranchInst(tmpBB);
5694 #line 2617 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5696 assert(cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
5697 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5699 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5701 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5703 (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal);
5708 #line 2627 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5710 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
5712 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5714 SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
5715 (yyval.TermInstVal) = S;
5717 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
5718 E = (yyvsp[(8) - (9)].JumpTable)->end();
5719 for (; I != E; ++I) {
5720 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
5721 S->addCase(CI, I->second);
5723 GEN_ERROR("Switch case is constant, but not a simple integer");
5725 delete (yyvsp[(8) - (9)].JumpTable);
5731 #line 2646 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5733 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
5735 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
5737 SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0);
5738 (yyval.TermInstVal) = S;
5744 #line 2656 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5747 // Handle the short syntax
5748 const PointerType *PFTy = 0;
5749 const FunctionType *Ty = 0;
5750 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
5751 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
5752 // Pull out the types of all of the arguments...
5753 std::vector<const Type*> ParamTypes;
5754 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
5755 for (; I != E; ++I) {
5756 const Type *Ty = I->Val->getType();
5757 if (Ty == Type::VoidTy)
5758 GEN_ERROR("Short call syntax cannot be used with varargs");
5759 ParamTypes.push_back(Ty);
5761 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
5762 PFTy = PointerType::getUnqual(Ty);
5765 delete (yyvsp[(3) - (14)].TypeVal);
5767 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
5769 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
5771 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
5774 ParamAttrsVector Attrs;
5775 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) {
5776 ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs);
5777 Attrs.push_back(PAWI);
5780 // Check the arguments
5782 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
5783 // Make sure no arguments is a good thing!
5784 if (Ty->getNumParams() != 0)
5785 GEN_ERROR("No arguments passed to a function that "
5786 "expects arguments");
5787 } else { // Has arguments?
5788 // Loop through FunctionType's arguments and ensure they are specified
5790 FunctionType::param_iterator I = Ty->param_begin();
5791 FunctionType::param_iterator E = Ty->param_end();
5792 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
5795 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
5796 if (ArgI->Val->getType() != *I)
5797 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
5798 (*I)->getDescription() + "'");
5799 Args.push_back(ArgI->Val);
5800 if (ArgI->Attrs != ParamAttr::None) {
5801 ParamAttrsWithIndex PAWI;
5803 PAWI.attrs = ArgI->Attrs;
5804 Attrs.push_back(PAWI);
5808 if (Ty->isVarArg()) {
5810 for (; ArgI != ArgE; ++ArgI, ++index) {
5811 Args.push_back(ArgI->Val); // push the remaining varargs
5812 if (ArgI->Attrs != ParamAttr::None) {
5813 ParamAttrsWithIndex PAWI;
5815 PAWI.attrs = ArgI->Attrs;
5816 Attrs.push_back(PAWI);
5819 } else if (I != E || ArgI != ArgE)
5820 GEN_ERROR("Invalid number of parameters detected");
5823 const ParamAttrsList *PAL = 0;
5825 PAL = ParamAttrsList::get(Attrs);
5827 // Create the InvokeInst
5828 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
5829 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
5830 II->setParamAttrs(PAL);
5831 (yyval.TermInstVal) = II;
5832 delete (yyvsp[(6) - (14)].ParamList);
5838 #line 2746 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5840 (yyval.TermInstVal) = new UnwindInst();
5846 #line 2750 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5848 (yyval.TermInstVal) = new UnreachableInst();
5854 #line 2757 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5856 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
5857 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
5860 GEN_ERROR("May only switch on a constant pool value");
5862 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
5864 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5869 #line 2768 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5871 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
5872 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
5876 GEN_ERROR("May only switch on a constant pool value");
5878 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
5880 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5885 #line 2781 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5887 // Is this definition named?? if so, assign the name...
5888 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
5890 InsertValue((yyvsp[(2) - (2)].InstVal));
5891 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
5897 #line 2791 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5898 { // Used for PHI nodes
5899 if (!UpRefs.empty())
5900 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
5901 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
5902 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
5904 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
5906 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
5907 delete (yyvsp[(1) - (6)].TypeVal);
5912 #line 2802 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5914 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
5915 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
5917 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
5919 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
5924 #line 2812 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5926 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5927 if (!UpRefs.empty())
5928 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
5929 // Used for call and invoke instructions
5930 (yyval.ParamList) = new ParamList();
5931 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
5932 (yyval.ParamList)->push_back(E);
5933 delete (yyvsp[(1) - (4)].TypeVal);
5939 #line 2823 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5941 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5942 // Labels are only valid in ASMs
5943 (yyval.ParamList) = new ParamList();
5944 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
5945 (yyval.ParamList)->push_back(E);
5951 #line 2831 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5953 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5954 if (!UpRefs.empty())
5955 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
5956 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
5957 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
5958 (yyval.ParamList)->push_back(E);
5959 delete (yyvsp[(3) - (6)].TypeVal);
5965 #line 2841 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5967 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5968 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
5969 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
5970 (yyval.ParamList)->push_back(E);
5976 #line 2848 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5977 { (yyval.ParamList) = new ParamList(); ;}
5981 #line 2851 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5982 { (yyval.ValueList) = new std::vector<Value*>(); ;}
5986 #line 2852 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5988 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
5989 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
5995 #line 2859 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5997 (yyval.BoolVal) = true;
6003 #line 2863 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6005 (yyval.BoolVal) = false;
6011 #line 2868 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6013 if (!UpRefs.empty())
6014 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6015 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
6016 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
6018 "Arithmetic operator requires integer, FP, or packed operands");
6019 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6021 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6023 (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
6024 if ((yyval.InstVal) == 0)
6025 GEN_ERROR("binary operator returned null");
6026 delete (yyvsp[(2) - (5)].TypeVal);
6031 #line 2884 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6033 if (!UpRefs.empty())
6034 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
6035 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
6036 if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
6037 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
6038 GEN_ERROR("Logical operator requires integral operands");
6040 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
6042 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
6044 (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
6045 if ((yyval.InstVal) == 0)
6046 GEN_ERROR("binary operator returned null");
6047 delete (yyvsp[(2) - (5)].TypeVal);
6052 #line 2901 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6054 if (!UpRefs.empty())
6055 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6056 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6057 GEN_ERROR("Vector types not supported by icmp instruction");
6058 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6060 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6062 (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6063 if ((yyval.InstVal) == 0)
6064 GEN_ERROR("icmp operator returned null");
6065 delete (yyvsp[(3) - (6)].TypeVal);
6070 #line 2915 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6072 if (!UpRefs.empty())
6073 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6074 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6075 GEN_ERROR("Vector types not supported by fcmp instruction");
6076 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6078 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6080 (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6081 if ((yyval.InstVal) == 0)
6082 GEN_ERROR("fcmp operator returned null");
6083 delete (yyvsp[(3) - (6)].TypeVal);
6088 #line 2929 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6090 if (!UpRefs.empty())
6091 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6092 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6093 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6094 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6095 GEN_ERROR("invalid cast opcode for cast from '" +
6096 Val->getType()->getDescription() + "' to '" +
6097 DestTy->getDescription() + "'");
6098 (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6099 delete (yyvsp[(4) - (4)].TypeVal);
6104 #line 2941 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6106 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6107 GEN_ERROR("select condition must be boolean");
6108 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6109 GEN_ERROR("select value types should match");
6110 (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6116 #line 2949 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6118 if (!UpRefs.empty())
6119 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6120 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6121 delete (yyvsp[(4) - (4)].TypeVal);
6127 #line 2956 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6129 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6130 GEN_ERROR("Invalid extractelement operands");
6131 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6137 #line 2962 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6139 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6140 GEN_ERROR("Invalid insertelement operands");
6141 (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6147 #line 2968 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6149 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6150 GEN_ERROR("Invalid shufflevector operands");
6151 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6157 #line 2974 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6159 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6160 if (!Ty->isFirstClassType())
6161 GEN_ERROR("PHI node operands must be of first class type");
6162 (yyval.InstVal) = new PHINode(Ty);
6163 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6164 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6165 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6166 GEN_ERROR("All elements of a PHI node must be of the same type");
6167 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6168 (yyvsp[(2) - (2)].PHIList)->pop_front();
6170 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6176 #line 2990 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6179 // Handle the short syntax
6180 const PointerType *PFTy = 0;
6181 const FunctionType *Ty = 0;
6182 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6183 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6184 // Pull out the types of all of the arguments...
6185 std::vector<const Type*> ParamTypes;
6186 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6187 for (; I != E; ++I) {
6188 const Type *Ty = I->Val->getType();
6189 if (Ty == Type::VoidTy)
6190 GEN_ERROR("Short call syntax cannot be used with varargs");
6191 ParamTypes.push_back(Ty);
6193 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6194 PFTy = PointerType::getUnqual(Ty);
6197 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6200 // Check for call to invalid intrinsic to avoid crashing later.
6201 if (Function *theF = dyn_cast<Function>(V)) {
6202 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6203 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6204 !theF->getIntrinsicID(true))
6205 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6206 theF->getName() + "'");
6209 // Set up the ParamAttrs for the function
6210 ParamAttrsVector Attrs;
6211 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) {
6212 ParamAttrsWithIndex PAWI;
6214 PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs);
6215 Attrs.push_back(PAWI);
6217 // Check the arguments
6219 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6220 // Make sure no arguments is a good thing!
6221 if (Ty->getNumParams() != 0)
6222 GEN_ERROR("No arguments passed to a function that "
6223 "expects arguments");
6224 } else { // Has arguments?
6225 // Loop through FunctionType's arguments and ensure they are specified
6226 // correctly. Also, gather any parameter attributes.
6227 FunctionType::param_iterator I = Ty->param_begin();
6228 FunctionType::param_iterator E = Ty->param_end();
6229 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6232 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6233 if (ArgI->Val->getType() != *I)
6234 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6235 (*I)->getDescription() + "'");
6236 Args.push_back(ArgI->Val);
6237 if (ArgI->Attrs != ParamAttr::None) {
6238 ParamAttrsWithIndex PAWI;
6240 PAWI.attrs = ArgI->Attrs;
6241 Attrs.push_back(PAWI);
6244 if (Ty->isVarArg()) {
6246 for (; ArgI != ArgE; ++ArgI, ++index) {
6247 Args.push_back(ArgI->Val); // push the remaining varargs
6248 if (ArgI->Attrs != ParamAttr::None) {
6249 ParamAttrsWithIndex PAWI;
6251 PAWI.attrs = ArgI->Attrs;
6252 Attrs.push_back(PAWI);
6255 } else if (I != E || ArgI != ArgE)
6256 GEN_ERROR("Invalid number of parameters detected");
6259 // Finish off the ParamAttrs and check them
6260 const ParamAttrsList *PAL = 0;
6262 PAL = ParamAttrsList::get(Attrs);
6264 // Create the call node
6265 CallInst *CI = new CallInst(V, Args.begin(), Args.end());
6266 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6267 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6268 CI->setParamAttrs(PAL);
6269 (yyval.InstVal) = CI;
6270 delete (yyvsp[(6) - (8)].ParamList);
6271 delete (yyvsp[(3) - (8)].TypeVal);
6277 #line 3087 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6279 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6285 #line 3092 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6287 (yyval.BoolVal) = true;
6293 #line 3096 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6295 (yyval.BoolVal) = false;
6301 #line 3103 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6303 if (!UpRefs.empty())
6304 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6305 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6306 delete (yyvsp[(2) - (3)].TypeVal);
6312 #line 3110 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6314 if (!UpRefs.empty())
6315 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6316 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6318 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6319 delete (yyvsp[(2) - (6)].TypeVal);
6324 #line 3118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6326 if (!UpRefs.empty())
6327 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6328 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6329 delete (yyvsp[(2) - (3)].TypeVal);
6335 #line 3125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6337 if (!UpRefs.empty())
6338 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6339 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6341 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6342 delete (yyvsp[(2) - (6)].TypeVal);
6347 #line 3133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6349 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6350 GEN_ERROR("Trying to free nonpointer type " +
6351 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6352 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6358 #line 3141 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6360 if (!UpRefs.empty())
6361 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6362 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6363 GEN_ERROR("Can't load from nonpointer type: " +
6364 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6365 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6366 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6367 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6368 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6370 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6371 delete (yyvsp[(3) - (5)].TypeVal);
6376 #line 3155 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6378 if (!UpRefs.empty())
6379 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6380 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6382 GEN_ERROR("Can't store to a nonpointer type: " +
6383 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6384 const Type *ElTy = PT->getElementType();
6385 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6386 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6387 "' into space of type '" + ElTy->getDescription() + "'");
6389 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6391 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6392 delete (yyvsp[(5) - (7)].TypeVal);
6397 #line 3172 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6399 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
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);