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,
227 #define ESINT64VAL 258
228 #define EUINT64VAL 259
229 #define ESAPINTVAL 260
230 #define EUAPINTVAL 261
231 #define LOCALVAL_ID 262
232 #define GLOBALVAL_ID 263
240 #define PPC_FP128 271
244 #define GLOBALVAR 275
246 #define STRINGCONSTANT 277
247 #define ATSTRINGCONSTANT 278
248 #define PCTSTRINGCONSTANT 279
249 #define ZEROINITIALIZER 280
261 #define THREAD_LOCAL 292
263 #define DOTDOTDOT 294
269 #define APPENDING 300
270 #define DLLIMPORT 301
271 #define DLLEXPORT 302
272 #define EXTERN_WEAK 303
278 #define ADDRSPACE 309
284 #define SIDEEFFECT 315
287 #define FASTCC_TOK 318
288 #define COLDCC_TOK 319
289 #define X86_STDCALLCC_TOK 320
290 #define X86_FASTCALLCC_TOK 321
291 #define DATALAYOUT 322
297 #define UNREACHABLE 328
340 #define GETELEMENTPTR 371
356 #define EXTRACTELEMENT 387
357 #define INSERTELEMENT 388
358 #define SHUFFLEVECTOR 389
373 #define PROTECTED 404
378 /* Copy the first part of user declarations. */
379 #line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
381 #include "ParserInternals.h"
382 #include "llvm/CallingConv.h"
383 #include "llvm/InlineAsm.h"
384 #include "llvm/Instructions.h"
385 #include "llvm/Module.h"
386 #include "llvm/ValueSymbolTable.h"
387 #include "llvm/AutoUpgrade.h"
388 #include "llvm/Support/GetElementPtrTypeIterator.h"
389 #include "llvm/Support/CommandLine.h"
390 #include "llvm/ADT/SmallVector.h"
391 #include "llvm/ADT/STLExtras.h"
392 #include "llvm/Support/MathExtras.h"
393 #include "llvm/Support/Streams.h"
399 // The following is a gross hack. In order to rid the libAsmParser library of
400 // exceptions, we have to have a way of getting the yyparse function to go into
401 // an error situation. So, whenever we want an error to occur, the GenerateError
402 // function (see bottom of file) sets TriggerError. Then, at the end of each
403 // production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR
404 // (a goto) to put YACC in error state. Furthermore, several calls to
405 // GenerateError are made from inside productions and they must simulate the
406 // previous exception behavior by exiting the production immediately. We have
407 // replaced these with the GEN_ERROR macro which calls GeneratError and then
408 // immediately invokes YYERROR. This would be so much cleaner if it was a
409 // recursive descent parser.
410 static bool TriggerError = false;
411 #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYABORT; } }
412 #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; }
414 int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit
415 int yylex(); // declaration" of xxx warnings.
417 using namespace llvm;
419 static Module *ParserResult;
421 // DEBUG_UPREFS - Define this symbol if you want to enable debugging output
422 // relating to upreferences in the input stream.
424 //#define DEBUG_UPREFS 1
426 #define UR_OUT(X) cerr << X
431 #define YYERROR_VERBOSE 1
433 static GlobalVariable *CurGV;
436 // This contains info used when building the body of a function. It is
437 // destroyed when the function is completed.
439 typedef std::vector<Value *> ValueList; // Numbered defs
442 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers=0);
444 static struct PerModuleInfo {
445 Module *CurrentModule;
446 ValueList Values; // Module level numbered definitions
447 ValueList LateResolveValues;
448 std::vector<PATypeHolder> Types;
449 std::map<ValID, PATypeHolder> LateResolveTypes;
451 /// PlaceHolderInfo - When temporary placeholder objects are created, remember
452 /// how they were referenced and on which line of the input they came from so
453 /// that we can resolve them later and print error messages as appropriate.
454 std::map<Value*, std::pair<ValID, int> > PlaceHolderInfo;
456 // GlobalRefs - This maintains a mapping between <Type, ValID>'s and forward
457 // references to global values. Global values may be referenced before they
458 // are defined, and if so, the temporary object that they represent is held
459 // here. This is used for forward references of GlobalValues.
461 typedef std::map<std::pair<const PointerType *,
462 ValID>, GlobalValue*> GlobalRefsType;
463 GlobalRefsType GlobalRefs;
466 // If we could not resolve some functions at function compilation time
467 // (calls to functions before they are defined), resolve them now... Types
468 // are resolved when the constant pool has been completely parsed.
470 ResolveDefinitions(LateResolveValues);
474 // Check to make sure that all global value forward references have been
477 if (!GlobalRefs.empty()) {
478 std::string UndefinedReferences = "Unresolved global references exist:\n";
480 for (GlobalRefsType::iterator I = GlobalRefs.begin(), E =GlobalRefs.end();
482 UndefinedReferences += " " + I->first.first->getDescription() + " " +
483 I->first.second.getName() + "\n";
485 GenerateError(UndefinedReferences);
489 // Look for intrinsic functions and CallInst that need to be upgraded
490 for (Module::iterator FI = CurrentModule->begin(),
491 FE = CurrentModule->end(); FI != FE; )
492 UpgradeCallsToIntrinsic(FI++); // must be post-increment, as we remove
494 Values.clear(); // Clear out function local definitions
499 // GetForwardRefForGlobal - Check to see if there is a forward reference
500 // for this global. If so, remove it from the GlobalRefs map and return it.
501 // If not, just return null.
502 GlobalValue *GetForwardRefForGlobal(const PointerType *PTy, ValID ID) {
503 // Check to see if there is a forward reference to this global variable...
504 // if there is, eliminate it and patch the reference to use the new def'n.
505 GlobalRefsType::iterator I = GlobalRefs.find(std::make_pair(PTy, ID));
506 GlobalValue *Ret = 0;
507 if (I != GlobalRefs.end()) {
514 bool TypeIsUnresolved(PATypeHolder* PATy) {
515 // If it isn't abstract, its resolved
516 const Type* Ty = PATy->get();
517 if (!Ty->isAbstract())
519 // Traverse the type looking for abstract types. If it isn't abstract then
520 // we don't need to traverse that leg of the type.
521 std::vector<const Type*> WorkList, SeenList;
522 WorkList.push_back(Ty);
523 while (!WorkList.empty()) {
524 const Type* Ty = WorkList.back();
525 SeenList.push_back(Ty);
527 if (const OpaqueType* OpTy = dyn_cast<OpaqueType>(Ty)) {
528 // Check to see if this is an unresolved type
529 std::map<ValID, PATypeHolder>::iterator I = LateResolveTypes.begin();
530 std::map<ValID, PATypeHolder>::iterator E = LateResolveTypes.end();
531 for ( ; I != E; ++I) {
532 if (I->second.get() == OpTy)
535 } else if (const SequentialType* SeqTy = dyn_cast<SequentialType>(Ty)) {
536 const Type* TheTy = SeqTy->getElementType();
537 if (TheTy->isAbstract() && TheTy != Ty) {
538 std::vector<const Type*>::iterator I = SeenList.begin(),
544 WorkList.push_back(TheTy);
546 } else if (const StructType* StrTy = dyn_cast<StructType>(Ty)) {
547 for (unsigned i = 0; i < StrTy->getNumElements(); ++i) {
548 const Type* TheTy = StrTy->getElementType(i);
549 if (TheTy->isAbstract() && TheTy != Ty) {
550 std::vector<const Type*>::iterator I = SeenList.begin(),
556 WorkList.push_back(TheTy);
565 static struct PerFunctionInfo {
566 Function *CurrentFunction; // Pointer to current function being created
568 ValueList Values; // Keep track of #'d definitions
570 ValueList LateResolveValues;
571 bool isDeclare; // Is this function a forward declararation?
572 GlobalValue::LinkageTypes Linkage; // Linkage for forward declaration.
573 GlobalValue::VisibilityTypes Visibility;
575 /// BBForwardRefs - When we see forward references to basic blocks, keep
576 /// track of them here.
577 std::map<ValID, BasicBlock*> BBForwardRefs;
579 inline PerFunctionInfo() {
582 Linkage = GlobalValue::ExternalLinkage;
583 Visibility = GlobalValue::DefaultVisibility;
586 inline void FunctionStart(Function *M) {
591 void FunctionDone() {
592 // Any forward referenced blocks left?
593 if (!BBForwardRefs.empty()) {
594 GenerateError("Undefined reference to label " +
595 BBForwardRefs.begin()->second->getName());
599 // Resolve all forward references now.
600 ResolveDefinitions(LateResolveValues, &CurModule.LateResolveValues);
602 Values.clear(); // Clear out function local definitions
603 BBForwardRefs.clear();
606 Linkage = GlobalValue::ExternalLinkage;
607 Visibility = GlobalValue::DefaultVisibility;
609 } CurFun; // Info for the current function...
611 static bool inFunctionScope() { return CurFun.CurrentFunction != 0; }
614 //===----------------------------------------------------------------------===//
615 // Code to handle definitions of all the types
616 //===----------------------------------------------------------------------===//
618 static void InsertValue(Value *V, ValueList &ValueTab = CurFun.Values) {
619 // Things that have names or are void typed don't get slot numbers
620 if (V->hasName() || (V->getType() == Type::VoidTy))
623 // In the case of function values, we have to allow for the forward reference
624 // of basic blocks, which are included in the numbering. Consequently, we keep
625 // track of the next insertion location with NextValNum. When a BB gets
626 // inserted, it could change the size of the CurFun.Values vector.
627 if (&ValueTab == &CurFun.Values) {
628 if (ValueTab.size() <= CurFun.NextValNum)
629 ValueTab.resize(CurFun.NextValNum+1);
630 ValueTab[CurFun.NextValNum++] = V;
633 // For all other lists, its okay to just tack it on the back of the vector.
634 ValueTab.push_back(V);
637 static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
639 case ValID::LocalID: // Is it a numbered definition?
640 // Module constants occupy the lowest numbered slots...
641 if (D.Num < CurModule.Types.size())
642 return CurModule.Types[D.Num];
644 case ValID::LocalName: // Is it a named definition?
645 if (const Type *N = CurModule.CurrentModule->getTypeByName(D.getName())) {
646 D.destroy(); // Free old strdup'd memory...
651 GenerateError("Internal parser error: Invalid symbol type reference");
655 // If we reached here, we referenced either a symbol that we don't know about
656 // or an id number that hasn't been read yet. We may be referencing something
657 // forward, so just create an entry to be resolved later and get to it...
659 if (DoNotImprovise) return 0; // Do we just want a null to be returned?
662 if (inFunctionScope()) {
663 if (D.Type == ValID::LocalName) {
664 GenerateError("Reference to an undefined type: '" + D.getName() + "'");
667 GenerateError("Reference to an undefined type: #" + utostr(D.Num));
672 std::map<ValID, PATypeHolder>::iterator I =CurModule.LateResolveTypes.find(D);
673 if (I != CurModule.LateResolveTypes.end())
676 Type *Typ = OpaqueType::get();
677 CurModule.LateResolveTypes.insert(std::make_pair(D, Typ));
681 // getExistingVal - Look up the value specified by the provided type and
682 // the provided ValID. If the value exists and has already been defined, return
683 // it. Otherwise return null.
685 static Value *getExistingVal(const Type *Ty, const ValID &D) {
686 if (isa<FunctionType>(Ty)) {
687 GenerateError("Functions are not values and "
688 "must be referenced as pointers");
693 case ValID::LocalID: { // Is it a numbered definition?
694 // Check that the number is within bounds.
695 if (D.Num >= CurFun.Values.size())
697 Value *Result = CurFun.Values[D.Num];
698 if (Ty != Result->getType()) {
699 GenerateError("Numbered value (%" + utostr(D.Num) + ") of type '" +
700 Result->getType()->getDescription() + "' does not match "
701 "expected type, '" + Ty->getDescription() + "'");
706 case ValID::GlobalID: { // Is it a numbered definition?
707 if (D.Num >= CurModule.Values.size())
709 Value *Result = CurModule.Values[D.Num];
710 if (Ty != Result->getType()) {
711 GenerateError("Numbered value (@" + utostr(D.Num) + ") of type '" +
712 Result->getType()->getDescription() + "' does not match "
713 "expected type, '" + Ty->getDescription() + "'");
719 case ValID::LocalName: { // Is it a named definition?
720 if (!inFunctionScope())
722 ValueSymbolTable &SymTab = CurFun.CurrentFunction->getValueSymbolTable();
723 Value *N = SymTab.lookup(D.getName());
726 if (N->getType() != Ty)
729 D.destroy(); // Free old strdup'd memory...
732 case ValID::GlobalName: { // Is it a named definition?
733 ValueSymbolTable &SymTab = CurModule.CurrentModule->getValueSymbolTable();
734 Value *N = SymTab.lookup(D.getName());
737 if (N->getType() != Ty)
740 D.destroy(); // Free old strdup'd memory...
744 // Check to make sure that "Ty" is an integral type, and that our
745 // value will fit into the specified type...
746 case ValID::ConstSIntVal: // Is it a constant pool reference??
747 if (!isa<IntegerType>(Ty) ||
748 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
749 GenerateError("Signed integral constant '" +
750 itostr(D.ConstPool64) + "' is invalid for type '" +
751 Ty->getDescription() + "'");
754 return ConstantInt::get(Ty, D.ConstPool64, true);
756 case ValID::ConstUIntVal: // Is it an unsigned const pool reference?
757 if (isa<IntegerType>(Ty) &&
758 ConstantInt::isValueValidForType(Ty, D.UConstPool64))
759 return ConstantInt::get(Ty, D.UConstPool64);
761 if (!isa<IntegerType>(Ty) ||
762 !ConstantInt::isValueValidForType(Ty, D.ConstPool64)) {
763 GenerateError("Integral constant '" + utostr(D.UConstPool64) +
764 "' is invalid or out of range for type '" +
765 Ty->getDescription() + "'");
768 // This is really a signed reference. Transmogrify.
769 return ConstantInt::get(Ty, D.ConstPool64, true);
771 case ValID::ConstFPVal: // Is it a floating point const pool reference?
772 if (!Ty->isFloatingPoint() ||
773 !ConstantFP::isValueValidForType(Ty, *D.ConstPoolFP)) {
774 GenerateError("FP constant invalid for type");
777 // Lexer has no type info, so builds all float and double FP constants
778 // as double. Fix this here. Long double does not need this.
779 if (&D.ConstPoolFP->getSemantics() == &APFloat::IEEEdouble &&
781 D.ConstPoolFP->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
782 return ConstantFP::get(Ty, *D.ConstPoolFP);
784 case ValID::ConstNullVal: // Is it a null value?
785 if (!isa<PointerType>(Ty)) {
786 GenerateError("Cannot create a a non pointer null");
789 return ConstantPointerNull::get(cast<PointerType>(Ty));
791 case ValID::ConstUndefVal: // Is it an undef value?
792 return UndefValue::get(Ty);
794 case ValID::ConstZeroVal: // Is it a zero value?
795 return Constant::getNullValue(Ty);
797 case ValID::ConstantVal: // Fully resolved constant?
798 if (D.ConstantValue->getType() != Ty) {
799 GenerateError("Constant expression type different from required type");
802 return D.ConstantValue;
804 case ValID::InlineAsmVal: { // Inline asm expression
805 const PointerType *PTy = dyn_cast<PointerType>(Ty);
806 const FunctionType *FTy =
807 PTy ? dyn_cast<FunctionType>(PTy->getElementType()) : 0;
808 if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) {
809 GenerateError("Invalid type for asm constraint string");
812 InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints,
813 D.IAD->HasSideEffects);
814 D.destroy(); // Free InlineAsmDescriptor.
818 assert(0 && "Unhandled case!");
822 assert(0 && "Unhandled case!");
826 // getVal - This function is identical to getExistingVal, except that if a
827 // value is not already defined, it "improvises" by creating a placeholder var
828 // that looks and acts just like the requested variable. When the value is
829 // defined later, all uses of the placeholder variable are replaced with the
832 static Value *getVal(const Type *Ty, const ValID &ID) {
833 if (Ty == Type::LabelTy) {
834 GenerateError("Cannot use a basic block here");
838 // See if the value has already been defined.
839 Value *V = getExistingVal(Ty, ID);
841 if (TriggerError) return 0;
843 if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty)) {
844 GenerateError("Invalid use of a composite type");
848 // If we reached here, we referenced either a symbol that we don't know about
849 // or an id number that hasn't been read yet. We may be referencing something
850 // forward, so just create an entry to be resolved later and get to it...
853 case ValID::GlobalName:
854 case ValID::GlobalID: {
855 const PointerType *PTy = dyn_cast<PointerType>(Ty);
857 GenerateError("Invalid type for reference to global" );
860 const Type* ElTy = PTy->getElementType();
861 if (const FunctionType *FTy = dyn_cast<FunctionType>(ElTy))
862 V = new Function(FTy, GlobalValue::ExternalLinkage);
864 V = new GlobalVariable(ElTy, false, GlobalValue::ExternalLinkage, 0, "",
865 (Module*)0, false, PTy->getAddressSpace());
869 V = new Argument(Ty);
872 // Remember where this forward reference came from. FIXME, shouldn't we try
873 // to recycle these things??
874 CurModule.PlaceHolderInfo.insert(std::make_pair(V, std::make_pair(ID,
877 if (inFunctionScope())
878 InsertValue(V, CurFun.LateResolveValues);
880 InsertValue(V, CurModule.LateResolveValues);
884 /// defineBBVal - This is a definition of a new basic block with the specified
885 /// identifier which must be the same as CurFun.NextValNum, if its numeric.
886 static BasicBlock *defineBBVal(const ValID &ID) {
887 assert(inFunctionScope() && "Can't get basic block at global scope!");
891 // First, see if this was forward referenced
893 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
894 if (BBI != CurFun.BBForwardRefs.end()) {
896 // The forward declaration could have been inserted anywhere in the
897 // function: insert it into the correct place now.
898 CurFun.CurrentFunction->getBasicBlockList().remove(BB);
899 CurFun.CurrentFunction->getBasicBlockList().push_back(BB);
901 // We're about to erase the entry, save the key so we can clean it up.
902 ValID Tmp = BBI->first;
904 // Erase the forward ref from the map as its no longer "forward"
905 CurFun.BBForwardRefs.erase(ID);
907 // The key has been removed from the map but so we don't want to leave
908 // strdup'd memory around so destroy it too.
911 // If its a numbered definition, bump the number and set the BB value.
912 if (ID.Type == ValID::LocalID) {
913 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
921 // We haven't seen this BB before and its first mention is a definition.
922 // Just create it and return it.
923 std::string Name (ID.Type == ValID::LocalName ? ID.getName() : "");
924 BB = new BasicBlock(Name, CurFun.CurrentFunction);
925 if (ID.Type == ValID::LocalID) {
926 assert(ID.Num == CurFun.NextValNum && "Invalid new block number");
930 ID.destroy(); // Free strdup'd memory
934 /// getBBVal - get an existing BB value or create a forward reference for it.
936 static BasicBlock *getBBVal(const ValID &ID) {
937 assert(inFunctionScope() && "Can't get basic block at global scope!");
941 std::map<ValID, BasicBlock*>::iterator BBI = CurFun.BBForwardRefs.find(ID);
942 if (BBI != CurFun.BBForwardRefs.end()) {
944 } if (ID.Type == ValID::LocalName) {
945 std::string Name = ID.getName();
946 Value *N = CurFun.CurrentFunction->getValueSymbolTable().lookup(Name);
948 if (N->getType()->getTypeID() == Type::LabelTyID)
949 BB = cast<BasicBlock>(N);
951 GenerateError("Reference to label '" + Name + "' is actually of type '"+
952 N->getType()->getDescription() + "'");
953 } else if (ID.Type == ValID::LocalID) {
954 if (ID.Num < CurFun.NextValNum && ID.Num < CurFun.Values.size()) {
955 if (CurFun.Values[ID.Num]->getType()->getTypeID() == Type::LabelTyID)
956 BB = cast<BasicBlock>(CurFun.Values[ID.Num]);
958 GenerateError("Reference to label '%" + utostr(ID.Num) +
959 "' is actually of type '"+
960 CurFun.Values[ID.Num]->getType()->getDescription() + "'");
963 GenerateError("Illegal label reference " + ID.getName());
967 // If its already been defined, return it now.
969 ID.destroy(); // Free strdup'd memory.
973 // Otherwise, this block has not been seen before, create it.
975 if (ID.Type == ValID::LocalName)
977 BB = new BasicBlock(Name, CurFun.CurrentFunction);
979 // Insert it in the forward refs map.
980 CurFun.BBForwardRefs[ID] = BB;
986 //===----------------------------------------------------------------------===//
987 // Code to handle forward references in instructions
988 //===----------------------------------------------------------------------===//
990 // This code handles the late binding needed with statements that reference
991 // values not defined yet... for example, a forward branch, or the PHI node for
994 // This keeps a table (CurFun.LateResolveValues) of all such forward references
995 // and back patchs after we are done.
998 // ResolveDefinitions - If we could not resolve some defs at parsing
999 // time (forward branches, phi functions for loops, etc...) resolve the
1003 ResolveDefinitions(ValueList &LateResolvers, ValueList *FutureLateResolvers) {
1004 // Loop over LateResolveDefs fixing up stuff that couldn't be resolved
1005 while (!LateResolvers.empty()) {
1006 Value *V = LateResolvers.back();
1007 LateResolvers.pop_back();
1009 std::map<Value*, std::pair<ValID, int> >::iterator PHI =
1010 CurModule.PlaceHolderInfo.find(V);
1011 assert(PHI != CurModule.PlaceHolderInfo.end() && "Placeholder error!");
1013 ValID &DID = PHI->second.first;
1015 Value *TheRealValue = getExistingVal(V->getType(), DID);
1019 V->replaceAllUsesWith(TheRealValue);
1021 CurModule.PlaceHolderInfo.erase(PHI);
1022 } else if (FutureLateResolvers) {
1023 // Functions have their unresolved items forwarded to the module late
1025 InsertValue(V, *FutureLateResolvers);
1027 if (DID.Type == ValID::LocalName || DID.Type == ValID::GlobalName) {
1028 GenerateError("Reference to an invalid definition: '" +DID.getName()+
1029 "' of type '" + V->getType()->getDescription() + "'",
1030 PHI->second.second);
1033 GenerateError("Reference to an invalid definition: #" +
1034 itostr(DID.Num) + " of type '" +
1035 V->getType()->getDescription() + "'",
1036 PHI->second.second);
1041 LateResolvers.clear();
1044 // ResolveTypeTo - A brand new type was just declared. This means that (if
1045 // name is not null) things referencing Name can be resolved. Otherwise, things
1046 // refering to the number can be resolved. Do this now.
1048 static void ResolveTypeTo(std::string *Name, const Type *ToTy) {
1051 D = ValID::createLocalName(*Name);
1053 D = ValID::createLocalID(CurModule.Types.size());
1055 std::map<ValID, PATypeHolder>::iterator I =
1056 CurModule.LateResolveTypes.find(D);
1057 if (I != CurModule.LateResolveTypes.end()) {
1058 ((DerivedType*)I->second.get())->refineAbstractTypeTo(ToTy);
1059 CurModule.LateResolveTypes.erase(I);
1063 // setValueName - Set the specified value to the name given. The name may be
1064 // null potentially, in which case this is a noop. The string passed in is
1065 // assumed to be a malloc'd string buffer, and is free'd by this function.
1067 static void setValueName(Value *V, std::string *NameStr) {
1068 if (!NameStr) return;
1069 std::string Name(*NameStr); // Copy string
1070 delete NameStr; // Free old string
1072 if (V->getType() == Type::VoidTy) {
1073 GenerateError("Can't assign name '" + Name+"' to value with void type");
1077 assert(inFunctionScope() && "Must be in function scope!");
1078 ValueSymbolTable &ST = CurFun.CurrentFunction->getValueSymbolTable();
1079 if (ST.lookup(Name)) {
1080 GenerateError("Redefinition of value '" + Name + "' of type '" +
1081 V->getType()->getDescription() + "'");
1089 /// ParseGlobalVariable - Handle parsing of a global. If Initializer is null,
1090 /// this is a declaration, otherwise it is a definition.
1091 static GlobalVariable *
1092 ParseGlobalVariable(std::string *NameStr,
1093 GlobalValue::LinkageTypes Linkage,
1094 GlobalValue::VisibilityTypes Visibility,
1095 bool isConstantGlobal, const Type *Ty,
1096 Constant *Initializer, bool IsThreadLocal,
1097 unsigned AddressSpace = 0) {
1098 if (isa<FunctionType>(Ty)) {
1099 GenerateError("Cannot declare global vars of function type");
1103 const PointerType *PTy = PointerType::get(Ty, AddressSpace);
1107 Name = *NameStr; // Copy string
1108 delete NameStr; // Free old string
1111 // See if this global value was forward referenced. If so, recycle the
1114 if (!Name.empty()) {
1115 ID = ValID::createGlobalName(Name);
1117 ID = ValID::createGlobalID(CurModule.Values.size());
1120 if (GlobalValue *FWGV = CurModule.GetForwardRefForGlobal(PTy, ID)) {
1121 // Move the global to the end of the list, from whereever it was
1122 // previously inserted.
1123 GlobalVariable *GV = cast<GlobalVariable>(FWGV);
1124 CurModule.CurrentModule->getGlobalList().remove(GV);
1125 CurModule.CurrentModule->getGlobalList().push_back(GV);
1126 GV->setInitializer(Initializer);
1127 GV->setLinkage(Linkage);
1128 GV->setVisibility(Visibility);
1129 GV->setConstant(isConstantGlobal);
1130 GV->setThreadLocal(IsThreadLocal);
1131 InsertValue(GV, CurModule.Values);
1135 // If this global has a name
1136 if (!Name.empty()) {
1137 // if the global we're parsing has an initializer (is a definition) and
1138 // has external linkage.
1139 if (Initializer && Linkage != GlobalValue::InternalLinkage)
1140 // If there is already a global with external linkage with this name
1141 if (CurModule.CurrentModule->getGlobalVariable(Name, false)) {
1142 // If we allow this GVar to get created, it will be renamed in the
1143 // symbol table because it conflicts with an existing GVar. We can't
1144 // allow redefinition of GVars whose linking indicates that their name
1145 // must stay the same. Issue the error.
1146 GenerateError("Redefinition of global variable named '" + Name +
1147 "' of type '" + Ty->getDescription() + "'");
1152 // Otherwise there is no existing GV to use, create one now.
1153 GlobalVariable *GV =
1154 new GlobalVariable(Ty, isConstantGlobal, Linkage, Initializer, Name,
1155 CurModule.CurrentModule, IsThreadLocal, AddressSpace);
1156 GV->setVisibility(Visibility);
1157 InsertValue(GV, CurModule.Values);
1161 // setTypeName - Set the specified type to the name given. The name may be
1162 // null potentially, in which case this is a noop. The string passed in is
1163 // assumed to be a malloc'd string buffer, and is freed by this function.
1165 // This function returns true if the type has already been defined, but is
1166 // allowed to be redefined in the specified context. If the name is a new name
1167 // for the type plane, it is inserted and false is returned.
1168 static bool setTypeName(const Type *T, std::string *NameStr) {
1169 assert(!inFunctionScope() && "Can't give types function-local names!");
1170 if (NameStr == 0) return false;
1172 std::string Name(*NameStr); // Copy string
1173 delete NameStr; // Free old string
1175 // We don't allow assigning names to void type
1176 if (T == Type::VoidTy) {
1177 GenerateError("Can't assign name '" + Name + "' to the void type");
1181 // Set the type name, checking for conflicts as we do so.
1182 bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T);
1184 if (AlreadyExists) { // Inserting a name that is already defined???
1185 const Type *Existing = CurModule.CurrentModule->getTypeByName(Name);
1186 assert(Existing && "Conflict but no matching type?!");
1188 // There is only one case where this is allowed: when we are refining an
1189 // opaque type. In this case, Existing will be an opaque type.
1190 if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Existing)) {
1191 // We ARE replacing an opaque type!
1192 const_cast<OpaqueType*>(OpTy)->refineAbstractTypeTo(T);
1196 // Otherwise, this is an attempt to redefine a type. That's okay if
1197 // the redefinition is identical to the original. This will be so if
1198 // Existing and T point to the same Type object. In this one case we
1199 // allow the equivalent redefinition.
1200 if (Existing == T) return true; // Yes, it's equal.
1202 // Any other kind of (non-equivalent) redefinition is an error.
1203 GenerateError("Redefinition of type named '" + Name + "' of type '" +
1204 T->getDescription() + "'");
1210 //===----------------------------------------------------------------------===//
1211 // Code for handling upreferences in type names...
1214 // TypeContains - Returns true if Ty directly contains E in it.
1216 static bool TypeContains(const Type *Ty, const Type *E) {
1217 return std::find(Ty->subtype_begin(), Ty->subtype_end(),
1218 E) != Ty->subtype_end();
1222 struct UpRefRecord {
1223 // NestingLevel - The number of nesting levels that need to be popped before
1224 // this type is resolved.
1225 unsigned NestingLevel;
1227 // LastContainedTy - This is the type at the current binding level for the
1228 // type. Every time we reduce the nesting level, this gets updated.
1229 const Type *LastContainedTy;
1231 // UpRefTy - This is the actual opaque type that the upreference is
1232 // represented with.
1233 OpaqueType *UpRefTy;
1235 UpRefRecord(unsigned NL, OpaqueType *URTy)
1236 : NestingLevel(NL), LastContainedTy(URTy), UpRefTy(URTy) {}
1240 // UpRefs - A list of the outstanding upreferences that need to be resolved.
1241 static std::vector<UpRefRecord> UpRefs;
1243 /// HandleUpRefs - Every time we finish a new layer of types, this function is
1244 /// called. It loops through the UpRefs vector, which is a list of the
1245 /// currently active types. For each type, if the up reference is contained in
1246 /// the newly completed type, we decrement the level count. When the level
1247 /// count reaches zero, the upreferenced type is the type that is passed in:
1248 /// thus we can complete the cycle.
1250 static PATypeHolder HandleUpRefs(const Type *ty) {
1251 // If Ty isn't abstract, or if there are no up-references in it, then there is
1252 // nothing to resolve here.
1253 if (!ty->isAbstract() || UpRefs.empty()) return ty;
1255 PATypeHolder Ty(ty);
1256 UR_OUT("Type '" << Ty->getDescription() <<
1257 "' newly formed. Resolving upreferences.\n" <<
1258 UpRefs.size() << " upreferences active!\n");
1260 // If we find any resolvable upreferences (i.e., those whose NestingLevel goes
1261 // to zero), we resolve them all together before we resolve them to Ty. At
1262 // the end of the loop, if there is anything to resolve to Ty, it will be in
1264 OpaqueType *TypeToResolve = 0;
1266 for (unsigned i = 0; i != UpRefs.size(); ++i) {
1267 UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", "
1268 << UpRefs[i].second->getDescription() << ") = "
1269 << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n");
1270 if (TypeContains(Ty, UpRefs[i].LastContainedTy)) {
1271 // Decrement level of upreference
1272 unsigned Level = --UpRefs[i].NestingLevel;
1273 UpRefs[i].LastContainedTy = Ty;
1274 UR_OUT(" Uplevel Ref Level = " << Level << "\n");
1275 if (Level == 0) { // Upreference should be resolved!
1276 if (!TypeToResolve) {
1277 TypeToResolve = UpRefs[i].UpRefTy;
1279 UR_OUT(" * Resolving upreference for "
1280 << UpRefs[i].second->getDescription() << "\n";
1281 std::string OldName = UpRefs[i].UpRefTy->getDescription());
1282 UpRefs[i].UpRefTy->refineAbstractTypeTo(TypeToResolve);
1283 UR_OUT(" * Type '" << OldName << "' refined upreference to: "
1284 << (const void*)Ty << ", " << Ty->getDescription() << "\n");
1286 UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list...
1287 --i; // Do not skip the next element...
1292 if (TypeToResolve) {
1293 UR_OUT(" * Resolving upreference for "
1294 << UpRefs[i].second->getDescription() << "\n";
1295 std::string OldName = TypeToResolve->getDescription());
1296 TypeToResolve->refineAbstractTypeTo(Ty);
1302 //===----------------------------------------------------------------------===//
1303 // RunVMAsmParser - Define an interface to this parser
1304 //===----------------------------------------------------------------------===//
1306 static Module* RunParser(Module * M);
1308 Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
1310 Module *M = RunParser(new Module(LLLgetFilename()));
1317 /* Enabling traces. */
1322 /* Enabling verbose error messages. */
1323 #ifdef YYERROR_VERBOSE
1324 # undef YYERROR_VERBOSE
1325 # define YYERROR_VERBOSE 1
1327 # define YYERROR_VERBOSE 0
1330 /* Enabling the token table. */
1331 #ifndef YYTOKEN_TABLE
1332 # define YYTOKEN_TABLE 0
1335 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1336 typedef union YYSTYPE
1337 #line 951 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
1339 llvm::Module *ModuleVal;
1340 llvm::Function *FunctionVal;
1341 llvm::BasicBlock *BasicBlockVal;
1342 llvm::TerminatorInst *TermInstVal;
1343 llvm::Instruction *InstVal;
1344 llvm::Constant *ConstVal;
1346 const llvm::Type *PrimType;
1347 std::list<llvm::PATypeHolder> *TypeList;
1348 llvm::PATypeHolder *TypeVal;
1349 llvm::Value *ValueVal;
1350 std::vector<llvm::Value*> *ValueList;
1351 llvm::ArgListType *ArgList;
1352 llvm::TypeWithAttrs TypeWithAttrs;
1353 llvm::TypeWithAttrsList *TypeWithAttrsList;
1354 llvm::ParamList *ParamList;
1356 // Represent the RHS of PHI node
1357 std::list<std::pair<llvm::Value*,
1358 llvm::BasicBlock*> > *PHIList;
1359 std::vector<std::pair<llvm::Constant*, llvm::BasicBlock*> > *JumpTable;
1360 std::vector<llvm::Constant*> *ConstVector;
1362 llvm::GlobalValue::LinkageTypes Linkage;
1363 llvm::GlobalValue::VisibilityTypes Visibility;
1364 llvm::ParameterAttributes ParamAttrs;
1365 llvm::APInt *APIntVal;
1370 llvm::APFloat *FPVal;
1373 std::string *StrVal; // This memory must be deleted
1374 llvm::ValID ValIDVal;
1376 llvm::Instruction::BinaryOps BinaryOpVal;
1377 llvm::Instruction::TermOps TermOpVal;
1378 llvm::Instruction::MemoryOps MemOpVal;
1379 llvm::Instruction::CastOps CastOpVal;
1380 llvm::Instruction::OtherOps OtherOpVal;
1381 llvm::ICmpInst::Predicate IPredicate;
1382 llvm::FCmpInst::Predicate FPredicate;
1384 /* Line 193 of yacc.c. */
1385 #line 1386 "llvmAsmParser.tab.c"
1387 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
1388 # define YYSTYPE_IS_DECLARED 1
1389 # define YYSTYPE_IS_TRIVIAL 1
1394 /* Copy the second part of user declarations. */
1397 /* Line 216 of yacc.c. */
1398 #line 1399 "llvmAsmParser.tab.c"
1405 typedef YYTYPE_UINT8 yytype_uint8;
1407 typedef unsigned char yytype_uint8;
1411 typedef YYTYPE_INT8 yytype_int8;
1412 #elif (defined __STDC__ || defined __C99__FUNC__ \
1413 || defined __cplusplus || defined _MSC_VER)
1414 typedef signed char yytype_int8;
1416 typedef short int yytype_int8;
1419 #ifdef YYTYPE_UINT16
1420 typedef YYTYPE_UINT16 yytype_uint16;
1422 typedef unsigned short int yytype_uint16;
1426 typedef YYTYPE_INT16 yytype_int16;
1428 typedef short int yytype_int16;
1432 # ifdef __SIZE_TYPE__
1433 # define YYSIZE_T __SIZE_TYPE__
1434 # elif defined size_t
1435 # define YYSIZE_T size_t
1436 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1437 || defined __cplusplus || defined _MSC_VER)
1438 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
1439 # define YYSIZE_T size_t
1441 # define YYSIZE_T unsigned int
1445 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
1448 # if defined YYENABLE_NLS && YYENABLE_NLS
1450 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
1451 # define YY_(msgid) dgettext ("bison-runtime", msgid)
1455 # define YY_(msgid) msgid
1459 /* Suppress unused-variable warnings by "using" E. */
1460 #if ! defined lint || defined __GNUC__
1461 # define YYUSE(e) ((void) (e))
1463 # define YYUSE(e) /* empty */
1466 /* Identity function, used to suppress warnings about constant conditions. */
1468 # define YYID(n) (n)
1470 #if (defined __STDC__ || defined __C99__FUNC__ \
1471 || defined __cplusplus || defined _MSC_VER)
1484 #if ! defined yyoverflow || YYERROR_VERBOSE
1486 /* The parser invokes alloca or malloc; define the necessary symbols. */
1488 # ifdef YYSTACK_USE_ALLOCA
1489 # if YYSTACK_USE_ALLOCA
1491 # define YYSTACK_ALLOC __builtin_alloca
1492 # elif defined __BUILTIN_VA_ARG_INCR
1493 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
1495 # define YYSTACK_ALLOC __alloca
1496 # elif defined _MSC_VER
1497 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
1498 # define alloca _alloca
1500 # define YYSTACK_ALLOC alloca
1501 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1502 || defined __cplusplus || defined _MSC_VER)
1503 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1505 # define _STDLIB_H 1
1512 # ifdef YYSTACK_ALLOC
1513 /* Pacify GCC's `empty if-body' warning. */
1514 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
1515 # ifndef YYSTACK_ALLOC_MAXIMUM
1516 /* The OS might guarantee only one guard page at the bottom of the stack,
1517 and a page size can be as small as 4096 bytes. So we cannot safely
1518 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
1519 to allow for a few compiler-allocated temporary stack slots. */
1520 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
1523 # define YYSTACK_ALLOC YYMALLOC
1524 # define YYSTACK_FREE YYFREE
1525 # ifndef YYSTACK_ALLOC_MAXIMUM
1526 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
1528 # if (defined __cplusplus && ! defined _STDLIB_H \
1529 && ! ((defined YYMALLOC || defined malloc) \
1530 && (defined YYFREE || defined free)))
1531 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
1533 # define _STDLIB_H 1
1537 # define YYMALLOC malloc
1538 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1539 || defined __cplusplus || defined _MSC_VER)
1540 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
1544 # define YYFREE free
1545 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1546 || defined __cplusplus || defined _MSC_VER)
1547 void free (void *); /* INFRINGES ON USER NAME SPACE */
1551 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1554 #if (! defined yyoverflow \
1555 && (! defined __cplusplus \
1556 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
1558 /* A type that is properly aligned for any stack member. */
1565 /* The size of the maximum gap between one aligned stack and the next. */
1566 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
1568 /* The size of an array large to enough to hold all stacks, each with
1570 # define YYSTACK_BYTES(N) \
1571 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
1572 + YYSTACK_GAP_MAXIMUM)
1574 /* Copy COUNT objects from FROM to TO. The source and destination do
1577 # if defined __GNUC__ && 1 < __GNUC__
1578 # define YYCOPY(To, From, Count) \
1579 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
1581 # define YYCOPY(To, From, Count) \
1585 for (yyi = 0; yyi < (Count); yyi++) \
1586 (To)[yyi] = (From)[yyi]; \
1592 /* Relocate STACK from its old location to the new one. The
1593 local variables YYSIZE and YYSTACKSIZE give the old and new number of
1594 elements in the stack, and YYPTR gives the new location of the
1595 stack. Advance YYPTR to a properly aligned location for the next
1597 # define YYSTACK_RELOCATE(Stack) \
1600 YYSIZE_T yynewbytes; \
1601 YYCOPY (&yyptr->Stack, Stack, yysize); \
1602 Stack = &yyptr->Stack; \
1603 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
1604 yyptr += yynewbytes / sizeof (*yyptr); \
1610 /* YYFINAL -- State number of the termination state. */
1612 /* YYLAST -- Last index in YYTABLE. */
1615 /* YYNTOKENS -- Number of terminals. */
1616 #define YYNTOKENS 164
1617 /* YYNNTS -- Number of nonterminals. */
1619 /* YYNRULES -- Number of rules. */
1620 #define YYNRULES 318
1621 /* YYNRULES -- Number of states. */
1622 #define YYNSTATES 619
1624 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1625 #define YYUNDEFTOK 2
1626 #define YYMAXUTOK 404
1628 #define YYTRANSLATE(YYX) \
1629 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
1631 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1632 static const yytype_uint8 yytranslate[] =
1634 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1638 150, 151, 154, 2, 153, 2, 2, 2, 2, 2,
1639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1640 159, 152, 160, 2, 2, 2, 2, 2, 2, 2,
1641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1643 2, 156, 155, 158, 2, 2, 2, 2, 2, 163,
1644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1646 157, 2, 2, 161, 2, 162, 2, 2, 2, 2,
1647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1653 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, 1, 2, 3, 4,
1660 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1661 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1662 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1663 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
1664 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1665 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
1666 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
1667 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1668 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
1669 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
1670 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
1671 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
1672 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
1673 135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
1674 145, 146, 147, 148, 149
1678 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1680 static const yytype_uint16 yyprhs[] =
1682 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
1683 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
1684 39, 41, 43, 45, 47, 49, 51, 53, 55, 57,
1685 59, 61, 63, 65, 67, 69, 71, 73, 75, 77,
1686 79, 81, 83, 85, 87, 89, 91, 93, 95, 97,
1687 99, 101, 103, 105, 107, 109, 111, 113, 115, 117,
1688 119, 121, 123, 125, 127, 129, 130, 135, 136, 139,
1689 140, 142, 144, 146, 147, 150, 152, 154, 156, 158,
1690 160, 162, 164, 166, 167, 169, 171, 173, 174, 176,
1691 178, 179, 181, 183, 185, 187, 188, 190, 192, 193,
1692 195, 197, 199, 201, 203, 206, 208, 210, 212, 214,
1693 216, 218, 220, 222, 224, 225, 228, 230, 232, 234,
1694 236, 238, 240, 241, 244, 245, 248, 249, 252, 253,
1695 257, 260, 261, 263, 264, 268, 270, 273, 275, 277,
1696 279, 281, 283, 285, 287, 289, 291, 295, 297, 300,
1697 306, 312, 318, 324, 328, 331, 337, 342, 345, 347,
1698 349, 351, 355, 357, 361, 363, 364, 366, 370, 375,
1699 379, 383, 388, 393, 397, 404, 410, 413, 416, 419,
1700 422, 425, 428, 431, 434, 437, 440, 443, 446, 453,
1701 459, 468, 475, 482, 490, 498, 505, 514, 523, 527,
1702 529, 531, 533, 535, 536, 539, 546, 548, 549, 551,
1703 554, 555, 559, 560, 564, 568, 572, 576, 577, 586,
1704 587, 597, 598, 608, 614, 617, 621, 623, 627, 631,
1705 635, 639, 641, 642, 648, 652, 654, 658, 660, 661,
1706 672, 674, 676, 681, 683, 685, 688, 692, 693, 695,
1707 697, 699, 701, 703, 705, 707, 709, 711, 715, 717,
1708 723, 725, 727, 729, 731, 733, 735, 738, 741, 744,
1709 748, 751, 752, 754, 757, 760, 764, 774, 784, 793,
1710 808, 810, 812, 819, 825, 828, 835, 843, 848, 853,
1711 860, 867, 868, 869, 873, 876, 878, 884, 890, 897,
1712 904, 909, 916, 921, 926, 933, 940, 943, 952, 954,
1713 956, 957, 961, 968, 972, 979, 982, 988, 996
1716 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1717 static const yytype_int16 yyrhs[] =
1719 210, 0, -1, 74, -1, 75, -1, 76, -1, 77,
1720 -1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
1721 -1, 86, -1, 87, -1, 88, -1, 83, -1, 84,
1722 -1, 85, -1, 117, -1, 118, -1, 119, -1, 120,
1723 -1, 121, -1, 122, -1, 123, -1, 124, -1, 125,
1724 -1, 126, -1, 127, -1, 128, -1, 91, -1, 92,
1725 -1, 93, -1, 94, -1, 95, -1, 96, -1, 97,
1726 -1, 98, -1, 99, -1, 100, -1, 101, -1, 102,
1727 -1, 103, -1, 104, -1, 105, -1, 106, -1, 107,
1728 -1, 108, -1, 109, -1, 110, -1, 97, -1, 98,
1729 -1, 99, -1, 100, -1, 26, -1, 27, -1, 11,
1730 -1, 12, -1, 13, -1, 16, -1, 15, -1, 14,
1731 -1, 19, -1, 22, -1, 24, -1, 172, -1, -1,
1732 54, 150, 4, 151, -1, -1, 172, 152, -1, -1,
1733 20, -1, 23, -1, 178, -1, -1, 176, 152, -1,
1734 42, -1, 44, -1, 43, -1, 45, -1, 47, -1,
1735 46, -1, 48, -1, 50, -1, -1, 147, -1, 148,
1736 -1, 149, -1, -1, 46, -1, 48, -1, -1, 42,
1737 -1, 43, -1, 44, -1, 47, -1, -1, 44, -1,
1738 42, -1, -1, 62, -1, 63, -1, 64, -1, 65,
1739 -1, 66, -1, 61, 4, -1, 136, -1, 118, -1,
1740 135, -1, 119, -1, 138, -1, 139, -1, 141, -1,
1741 142, -1, 143, -1, -1, 187, 186, -1, 137, -1,
1742 140, -1, 136, -1, 135, -1, 144, -1, 145, -1,
1743 -1, 189, 188, -1, -1, 146, 22, -1, -1, 53,
1744 4, -1, -1, 153, 53, 4, -1, 34, 22, -1,
1745 -1, 193, -1, -1, 153, 196, 195, -1, 193, -1,
1746 53, 4, -1, 11, -1, 12, -1, 13, -1, 16,
1747 -1, 15, -1, 14, -1, 17, -1, 49, -1, 197,
1748 -1, 198, 174, 154, -1, 232, -1, 155, 4, -1,
1749 198, 150, 202, 151, 189, -1, 10, 150, 202, 151,
1750 189, -1, 156, 4, 157, 198, 158, -1, 159, 4,
1751 157, 198, 160, -1, 161, 203, 162, -1, 161, 162,
1752 -1, 159, 161, 203, 162, 160, -1, 159, 161, 162,
1753 160, -1, 198, 187, -1, 198, -1, 10, -1, 199,
1754 -1, 201, 153, 199, -1, 201, -1, 201, 153, 39,
1755 -1, 39, -1, -1, 198, -1, 203, 153, 198, -1,
1756 198, 156, 206, 158, -1, 198, 156, 158, -1, 198,
1757 163, 22, -1, 198, 159, 206, 160, -1, 198, 161,
1758 206, 162, -1, 198, 161, 162, -1, 198, 159, 161,
1759 206, 162, 160, -1, 198, 159, 161, 162, 160, -1,
1760 198, 40, -1, 198, 41, -1, 198, 232, -1, 198,
1761 205, -1, 198, 25, -1, 170, 3, -1, 170, 5,
1762 -1, 170, 4, -1, 170, 6, -1, 11, 26, -1,
1763 11, 27, -1, 171, 9, -1, 167, 150, 204, 38,
1764 198, 151, -1, 116, 150, 204, 243, 151, -1, 130,
1765 150, 204, 153, 204, 153, 204, 151, -1, 165, 150,
1766 204, 153, 204, 151, -1, 166, 150, 204, 153, 204,
1767 151, -1, 89, 168, 150, 204, 153, 204, 151, -1,
1768 90, 169, 150, 204, 153, 204, 151, -1, 132, 150,
1769 204, 153, 204, 151, -1, 133, 150, 204, 153, 204,
1770 153, 204, 151, -1, 134, 150, 204, 153, 204, 153,
1771 204, 151, -1, 206, 153, 204, -1, 204, -1, 32,
1772 -1, 33, -1, 37, -1, -1, 200, 232, -1, 122,
1773 150, 209, 38, 198, 151, -1, 211, -1, -1, 212,
1774 -1, 211, 212, -1, -1, 31, 213, 228, -1, -1,
1775 30, 214, 229, -1, 59, 58, 218, -1, 175, 18,
1776 198, -1, 175, 18, 10, -1, -1, 177, 181, 208,
1777 207, 204, 174, 215, 195, -1, -1, 177, 179, 181,
1778 208, 207, 204, 174, 216, 195, -1, -1, 177, 180,
1779 181, 208, 207, 198, 174, 217, 195, -1, 177, 181,
1780 35, 184, 209, -1, 51, 219, -1, 55, 152, 220,
1781 -1, 22, -1, 52, 152, 22, -1, 67, 152, 22,
1782 -1, 156, 221, 158, -1, 221, 153, 22, -1, 22,
1783 -1, -1, 222, 153, 198, 187, 173, -1, 198, 187,
1784 173, -1, 222, -1, 222, 153, 39, -1, 39, -1,
1785 -1, 185, 200, 176, 150, 223, 151, 189, 194, 191,
1786 190, -1, 28, -1, 161, -1, 183, 181, 224, 225,
1787 -1, 29, -1, 162, -1, 235, 227, -1, 182, 181,
1788 224, -1, -1, 60, -1, 3, -1, 4, -1, 9,
1789 -1, 26, -1, 27, -1, 40, -1, 41, -1, 25,
1790 -1, 159, 206, 160, -1, 205, -1, 58, 230, 22,
1791 153, 22, -1, 7, -1, 8, -1, 172, -1, 176,
1792 -1, 232, -1, 231, -1, 198, 233, -1, 235, 236,
1793 -1, 226, 236, -1, 237, 175, 238, -1, 237, 240,
1794 -1, -1, 21, -1, 68, 234, -1, 68, 10, -1,
1795 69, 17, 233, -1, 69, 11, 233, 153, 17, 233,
1796 153, 17, 233, -1, 70, 170, 233, 153, 17, 233,
1797 156, 239, 158, -1, 70, 170, 233, 153, 17, 233,
1798 156, 158, -1, 71, 185, 200, 233, 150, 242, 151,
1799 189, 38, 17, 233, 72, 17, 233, -1, 72, -1,
1800 73, -1, 239, 170, 231, 153, 17, 233, -1, 170,
1801 231, 153, 17, 233, -1, 175, 245, -1, 198, 156,
1802 233, 153, 233, 158, -1, 241, 153, 156, 233, 153,
1803 233, 158, -1, 198, 187, 233, 187, -1, 17, 187,
1804 233, 187, -1, 242, 153, 198, 187, 233, 187, -1,
1805 242, 153, 17, 187, 233, 187, -1, -1, -1, 243,
1806 153, 234, -1, 57, 56, -1, 56, -1, 165, 198,
1807 233, 153, 233, -1, 166, 198, 233, 153, 233, -1,
1808 89, 168, 198, 233, 153, 233, -1, 90, 169, 198,
1809 233, 153, 233, -1, 167, 234, 38, 198, -1, 130,
1810 234, 153, 234, 153, 234, -1, 131, 234, 153, 198,
1811 -1, 132, 234, 153, 234, -1, 133, 234, 153, 234,
1812 153, 234, -1, 134, 234, 153, 234, 153, 234, -1,
1813 129, 241, -1, 244, 185, 200, 233, 150, 242, 151,
1814 189, -1, 247, -1, 36, -1, -1, 111, 198, 192,
1815 -1, 111, 198, 153, 11, 233, 192, -1, 112, 198,
1816 192, -1, 112, 198, 153, 11, 233, 192, -1, 113,
1817 234, -1, 246, 114, 198, 233, 192, -1, 246, 115,
1818 234, 153, 198, 233, 192, -1, 116, 198, 233, 243,
1822 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1823 static const yytype_uint16 yyrline[] =
1825 0, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111,
1826 1111, 1112, 1112, 1112, 1112, 1112, 1112, 1113, 1113, 1113,
1827 1113, 1113, 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1117,
1828 1117, 1118, 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1125,
1829 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130,
1830 1130, 1131, 1131, 1132, 1133, 1138, 1139, 1139, 1139, 1139,
1831 1139, 1141, 1141, 1141, 1142, 1142, 1144, 1145, 1149, 1153,
1832 1158, 1158, 1160, 1161, 1166, 1172, 1173, 1174, 1175, 1176,
1833 1180, 1181, 1182, 1186, 1187, 1188, 1189, 1193, 1194, 1195,
1834 1199, 1200, 1201, 1202, 1203, 1207, 1208, 1209, 1212, 1213,
1835 1214, 1215, 1216, 1217, 1218, 1225, 1226, 1227, 1228, 1229,
1836 1230, 1231, 1232, 1233, 1236, 1237, 1242, 1243, 1244, 1245,
1837 1246, 1247, 1250, 1251, 1256, 1257, 1264, 1265, 1271, 1272,
1838 1281, 1289, 1290, 1295, 1296, 1297, 1302, 1315, 1315, 1315,
1839 1315, 1315, 1315, 1315, 1318, 1322, 1326, 1333, 1338, 1346,
1840 1376, 1401, 1406, 1416, 1426, 1430, 1440, 1447, 1456, 1463,
1841 1468, 1473, 1480, 1481, 1488, 1495, 1503, 1509, 1521, 1549,
1842 1565, 1592, 1620, 1646, 1666, 1692, 1712, 1724, 1731, 1797,
1843 1807, 1817, 1823, 1833, 1839, 1849, 1854, 1859, 1872, 1884,
1844 1906, 1914, 1920, 1931, 1936, 1941, 1947, 1953, 1962, 1966,
1845 1974, 1974, 1977, 1977, 1980, 1992, 2013, 2018, 2026, 2027,
1846 2031, 2031, 2035, 2035, 2038, 2041, 2065, 2077, 2076, 2088,
1847 2087, 2097, 2096, 2107, 2147, 2150, 2156, 2166, 2170, 2175,
1848 2177, 2182, 2187, 2196, 2206, 2217, 2221, 2230, 2239, 2244,
1849 2378, 2378, 2380, 2389, 2389, 2391, 2396, 2408, 2412, 2417,
1850 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2449, 2474, 2478,
1851 2488, 2492, 2496, 2501, 2508, 2508, 2514, 2523, 2527, 2536,
1852 2545, 2554, 2558, 2565, 2569, 2573, 2578, 2588, 2607, 2616,
1853 2707, 2711, 2718, 2729, 2742, 2752, 2763, 2773, 2784, 2792,
1854 2802, 2809, 2812, 2813, 2820, 2824, 2829, 2845, 2862, 2876,
1855 2890, 2902, 2910, 2917, 2923, 2929, 2935, 2950, 3048, 3053,
1856 3057, 3064, 3071, 3079, 3086, 3094, 3102, 3116, 3133
1860 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1861 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1862 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1863 static const char *const yytname[] =
1865 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "ESAPINTVAL",
1866 "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE",
1867 "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE",
1868 "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT",
1869 "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK",
1870 "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL",
1871 "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO",
1872 "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK",
1873 "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE",
1874 "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "DEPLIBS", "CALL",
1875 "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK",
1876 "FASTCC_TOK", "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK",
1877 "DATALAYOUT", "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE",
1878 "ADD", "SUB", "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM",
1879 "AND", "OR", "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE",
1880 "SLT", "SGT", "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE",
1881 "OLT", "OGT", "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC",
1882 "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT",
1883 "SEXT", "FPTRUNC", "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI",
1884 "FPTOSI", "INTTOPTR", "PTRTOINT", "PHI_TOK", "SELECT", "VAARG",
1885 "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", "SIGNEXT", "ZEROEXT",
1886 "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST",
1887 "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('",
1888 "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'",
1889 "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps",
1890 "IPredicates", "FPredicates", "IntType", "FPType", "LocalName",
1891 "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName",
1892 "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage",
1893 "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage",
1894 "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr",
1895 "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign",
1896 "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes",
1897 "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes",
1898 "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr",
1899 "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "Module",
1900 "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock",
1901 "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH",
1902 "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END",
1903 "Function", "FunctionProto", "OptSideEffect", "ConstValueRef",
1904 "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList",
1905 "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst",
1906 "PHIList", "ParamList", "IndexList", "OptTailCall", "InstVal",
1907 "OptVolatile", "MemoryInst", 0
1912 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
1914 static const yytype_uint16 yytoknum[] =
1916 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1917 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1918 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1919 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
1920 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
1921 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
1922 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
1923 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
1924 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
1925 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
1926 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
1927 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
1928 375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
1929 385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
1930 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
1931 40, 41, 61, 44, 42, 92, 91, 120, 93, 60,
1936 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1937 static const yytype_uint8 yyr1[] =
1939 0, 164, 165, 165, 165, 165, 165, 165, 165, 165,
1940 165, 166, 166, 166, 166, 166, 166, 167, 167, 167,
1941 167, 167, 167, 167, 167, 167, 167, 167, 167, 168,
1942 168, 168, 168, 168, 168, 168, 168, 168, 168, 169,
1943 169, 169, 169, 169, 169, 169, 169, 169, 169, 169,
1944 169, 169, 169, 169, 169, 170, 171, 171, 171, 171,
1945 171, 172, 172, 172, 173, 173, 174, 174, 175, 175,
1946 176, 176, 177, 177, 178, 179, 179, 179, 179, 179,
1947 180, 180, 180, 181, 181, 181, 181, 182, 182, 182,
1948 183, 183, 183, 183, 183, 184, 184, 184, 185, 185,
1949 185, 185, 185, 185, 185, 186, 186, 186, 186, 186,
1950 186, 186, 186, 186, 187, 187, 188, 188, 188, 188,
1951 188, 188, 189, 189, 190, 190, 191, 191, 192, 192,
1952 193, 194, 194, 195, 195, 196, 196, 197, 197, 197,
1953 197, 197, 197, 197, 198, 198, 198, 198, 198, 198,
1954 198, 198, 198, 198, 198, 198, 198, 199, 200, 200,
1955 201, 201, 202, 202, 202, 202, 203, 203, 204, 204,
1956 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
1957 204, 204, 204, 204, 204, 204, 204, 204, 205, 205,
1958 205, 205, 205, 205, 205, 205, 205, 205, 206, 206,
1959 207, 207, 208, 208, 209, 209, 210, 210, 211, 211,
1960 213, 212, 214, 212, 212, 212, 212, 215, 212, 216,
1961 212, 217, 212, 212, 212, 212, 218, 219, 219, 220,
1962 221, 221, 221, 222, 222, 223, 223, 223, 223, 224,
1963 225, 225, 226, 227, 227, 228, 229, 230, 230, 231,
1964 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
1965 232, 232, 232, 232, 233, 233, 234, 235, 235, 236,
1966 237, 237, 237, 238, 238, 238, 238, 238, 238, 238,
1967 238, 238, 239, 239, 240, 241, 241, 242, 242, 242,
1968 242, 242, 243, 243, 244, 244, 245, 245, 245, 245,
1969 245, 245, 245, 245, 245, 245, 245, 245, 245, 246,
1970 246, 247, 247, 247, 247, 247, 247, 247, 247
1973 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1974 static const yytype_uint8 yyr2[] =
1976 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1977 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1978 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1979 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1980 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1981 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1982 1, 1, 1, 1, 1, 0, 4, 0, 2, 0,
1983 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
1984 1, 1, 1, 0, 1, 1, 1, 0, 1, 1,
1985 0, 1, 1, 1, 1, 0, 1, 1, 0, 1,
1986 1, 1, 1, 1, 2, 1, 1, 1, 1, 1,
1987 1, 1, 1, 1, 0, 2, 1, 1, 1, 1,
1988 1, 1, 0, 2, 0, 2, 0, 2, 0, 3,
1989 2, 0, 1, 0, 3, 1, 2, 1, 1, 1,
1990 1, 1, 1, 1, 1, 1, 3, 1, 2, 5,
1991 5, 5, 5, 3, 2, 5, 4, 2, 1, 1,
1992 1, 3, 1, 3, 1, 0, 1, 3, 4, 3,
1993 3, 4, 4, 3, 6, 5, 2, 2, 2, 2,
1994 2, 2, 2, 2, 2, 2, 2, 2, 6, 5,
1995 8, 6, 6, 7, 7, 6, 8, 8, 3, 1,
1996 1, 1, 1, 0, 2, 6, 1, 0, 1, 2,
1997 0, 3, 0, 3, 3, 3, 3, 0, 8, 0,
1998 9, 0, 9, 5, 2, 3, 1, 3, 3, 3,
1999 3, 1, 0, 5, 3, 1, 3, 1, 0, 10,
2000 1, 1, 4, 1, 1, 2, 3, 0, 1, 1,
2001 1, 1, 1, 1, 1, 1, 1, 3, 1, 5,
2002 1, 1, 1, 1, 1, 1, 2, 2, 2, 3,
2003 2, 0, 1, 2, 2, 3, 9, 9, 8, 14,
2004 1, 1, 6, 5, 2, 6, 7, 4, 4, 6,
2005 6, 0, 0, 3, 2, 1, 5, 5, 6, 6,
2006 4, 6, 4, 4, 6, 6, 2, 8, 1, 1,
2007 0, 3, 6, 3, 6, 2, 5, 7, 4
2010 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
2011 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
2012 means the default is an error. */
2013 static const yytype_uint16 yydefact[] =
2015 73, 61, 70, 62, 71, 63, 212, 210, 0, 0,
2016 0, 0, 0, 0, 83, 72, 0, 73, 208, 87,
2017 90, 0, 0, 224, 0, 0, 68, 0, 74, 75,
2018 77, 76, 78, 80, 79, 81, 82, 84, 85, 86,
2019 83, 83, 203, 1, 209, 88, 89, 83, 213, 91,
2020 92, 93, 94, 83, 271, 211, 271, 0, 0, 232,
2021 225, 226, 214, 260, 261, 216, 137, 138, 139, 142,
2022 141, 140, 143, 144, 0, 0, 0, 0, 262, 263,
2023 145, 215, 147, 203, 203, 95, 202, 0, 98, 98,
2024 272, 268, 69, 243, 244, 245, 267, 227, 228, 231,
2025 0, 165, 148, 0, 0, 0, 0, 154, 166, 0,
2026 0, 165, 0, 0, 0, 97, 96, 0, 200, 201,
2027 0, 0, 99, 100, 101, 102, 103, 0, 246, 0,
2028 310, 270, 0, 229, 164, 114, 160, 162, 0, 0,
2029 0, 0, 0, 0, 153, 0, 0, 146, 0, 0,
2030 159, 0, 158, 0, 223, 137, 138, 139, 142, 141,
2031 140, 0, 0, 67, 67, 104, 0, 240, 241, 242,
2032 309, 295, 0, 0, 0, 0, 98, 280, 281, 2,
2033 3, 4, 5, 6, 7, 8, 9, 10, 14, 15,
2034 16, 11, 12, 13, 0, 0, 0, 0, 0, 0,
2035 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
2036 27, 28, 0, 0, 0, 0, 0, 0, 0, 0,
2037 0, 269, 98, 284, 0, 308, 230, 157, 0, 122,
2038 67, 67, 156, 0, 167, 0, 122, 67, 67, 0,
2039 204, 185, 186, 181, 183, 182, 184, 187, 180, 176,
2040 177, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2041 0, 0, 0, 0, 0, 179, 178, 217, 0, 294,
2042 274, 67, 273, 0, 0, 55, 0, 0, 29, 30,
2043 31, 32, 33, 34, 35, 36, 37, 38, 0, 53,
2044 54, 49, 50, 51, 52, 39, 40, 41, 42, 43,
2045 44, 45, 46, 47, 48, 0, 128, 128, 315, 67,
2046 67, 306, 0, 0, 0, 0, 0, 67, 67, 0,
2047 0, 0, 0, 106, 108, 107, 105, 109, 110, 111,
2048 112, 113, 115, 163, 161, 150, 151, 152, 155, 66,
2049 149, 219, 221, 0, 0, 0, 0, 0, 0, 0,
2050 0, 169, 199, 0, 0, 0, 173, 0, 170, 0,
2051 0, 0, 133, 238, 249, 250, 251, 256, 252, 253,
2052 254, 255, 247, 0, 258, 265, 264, 266, 0, 275,
2053 0, 0, 67, 67, 0, 311, 0, 313, 292, 0,
2054 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2055 67, 0, 119, 118, 116, 117, 120, 121, 123, 133,
2056 133, 0, 0, 0, 292, 0, 0, 0, 0, 0,
2057 168, 154, 166, 0, 171, 172, 0, 0, 0, 0,
2058 218, 237, 114, 235, 0, 248, 0, 0, 0, 0,
2059 0, 0, 0, 0, 0, 0, 318, 0, 0, 0,
2060 302, 303, 0, 0, 0, 0, 300, 0, 128, 0,
2061 220, 222, 67, 0, 0, 0, 0, 0, 0, 0,
2062 198, 175, 0, 0, 0, 0, 0, 0, 135, 133,
2063 65, 0, 122, 0, 257, 0, 0, 291, 0, 0,
2064 128, 129, 128, 0, 0, 0, 0, 0, 0, 296,
2065 297, 291, 0, 316, 67, 205, 0, 0, 189, 0,
2066 0, 0, 0, 174, 0, 0, 67, 130, 136, 134,
2067 64, 234, 236, 114, 131, 0, 0, 0, 114, 114,
2068 0, 298, 299, 312, 314, 293, 0, 0, 301, 304,
2069 305, 0, 128, 0, 0, 0, 195, 0, 0, 191,
2070 192, 188, 65, 132, 126, 259, 0, 0, 0, 0,
2071 122, 0, 285, 0, 122, 317, 193, 194, 0, 0,
2072 0, 233, 0, 124, 0, 278, 0, 0, 106, 108,
2073 114, 114, 0, 114, 114, 286, 307, 190, 196, 197,
2074 127, 0, 239, 276, 0, 277, 0, 288, 287, 0,
2075 0, 0, 125, 0, 0, 0, 114, 114, 0, 0,
2076 0, 290, 289, 283, 0, 0, 282, 0, 279
2079 /* YYDEFGOTO[NTERM-NUM]. */
2080 static const yytype_int16 yydefgoto[] =
2082 -1, 262, 263, 264, 288, 305, 161, 162, 78, 521,
2083 112, 12, 79, 14, 15, 40, 41, 42, 47, 53,
2084 117, 127, 332, 227, 408, 335, 592, 573, 385, 478,
2085 554, 430, 479, 80, 163, 136, 153, 137, 138, 109,
2086 352, 374, 353, 120, 87, 154, 16, 17, 18, 20,
2087 19, 362, 409, 410, 62, 23, 60, 100, 433, 434,
2088 128, 169, 54, 95, 55, 48, 436, 375, 82, 377,
2089 272, 56, 91, 92, 221, 577, 131, 311, 530, 446,
2093 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
2095 #define YYPACT_NINF -544
2096 static const yytype_int16 yypact[] =
2098 291, -544, -544, -544, -544, -544, -544, -544, -9, -121,
2099 -14, -80, 72, -50, 19, -544, 110, 423, -544, 113,
2100 13, -37, -33, -544, -16, 121, -544, 1532, -544, -544,
2101 -544, -544, -544, -544, -544, -544, -544, -544, -544, -544,
2102 128, 128, 160, -544, -544, -544, -544, 128, -544, -544,
2103 -544, -544, -544, 128, 133, -544, 3, 183, 189, 192,
2104 -544, -544, -544, -544, -544, 32, -544, -544, -544, -544,
2105 -544, -544, -544, -544, 215, 218, 1, 509, -544, -544,
2106 -544, -18, -544, 190, 190, 184, -544, 260, 219, 219,
2107 -544, -544, 199, -544, -544, -544, -544, -544, -544, -544,
2108 -53, 1055, -544, 86, 102, 748, 32, -544, -18, -108,
2109 118, 1055, 109, 260, 260, -544, -544, 1298, -544, -544,
2110 1572, 267, -544, -544, -544, -544, -544, 1630, -544, -17,
2111 1854, -544, 256, -544, -544, -18, -544, 136, 135, 1648,
2112 1648, 137, -85, 1648, -544, 300, 157, -544, 1572, 1648,
2113 32, 162, -18, 74, -544, 44, 307, 311, 324, 334,
2114 335, 236, 336, 1110, 293, -544, 101, -544, -544, -544,
2115 -544, -544, 292, 1688, 63, 338, 219, -544, -544, -544,
2116 -544, -544, -544, -544, -544, -544, -544, -544, -544, -544,
2117 -544, -544, -544, -544, 392, 1194, 1648, 1648, 1648, 1648,
2118 -544, -544, -544, -544, -544, -544, -544, -544, -544, -544,
2119 -544, -544, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648,
2120 1648, -544, 219, -544, 49, -544, -544, 269, 1377, -544,
2121 -42, -38, -544, 197, -18, 200, -544, 293, -13, 1298,
2122 -544, -544, -544, -544, -544, -544, -544, -544, -544, -544,
2123 -544, 392, 1194, 202, 209, 212, 213, 214, 1417, 1728,
2124 788, 348, 221, 223, 224, -544, -544, -544, 226, -544,
2125 32, 699, -544, 837, 837, -544, 837, 1630, -544, -544,
2126 -544, -544, -544, -544, -544, -544, -544, -544, 1648, -544,
2127 -544, -544, -544, -544, -544, -544, -544, -544, -544, -544,
2128 -544, -544, -544, -544, -544, 1648, -8, -2, -544, 699,
2129 -15, 222, 227, 229, 230, 239, 245, 699, 699, 339,
2130 1630, 1648, 1648, -544, -544, -544, -544, -544, -544, -544,
2131 -544, -544, -544, -544, -544, 120, -544, -544, -544, -544,
2132 120, -544, 109, 340, 249, 250, 1572, 1572, 1572, 1572,
2133 1572, -544, -544, -47, 1010, -4, -544, -75, -544, 1572,
2134 1572, 1572, 248, 1457, -544, -544, -544, -544, -544, -544,
2135 -544, -544, 329, 1572, -544, -544, -544, -544, 262, -544,
2136 263, 837, 699, 699, 23, -544, 31, -544, -544, 837,
2137 246, 1648, 1648, 1648, 1648, 1648, 264, 265, 1648, 837,
2138 699, 266, -544, -544, -544, -544, -544, -544, -544, 248,
2139 248, 1648, 1572, 1572, -544, 273, 274, 275, 276, 1572,
2140 -544, 271, 965, -67, -544, -544, 283, 284, 371, 6,
2141 -544, -544, -18, 285, 288, -544, 398, 16, 427, 431,
2142 301, 297, 299, 837, 452, 837, 305, 310, 837, 312,
2143 -18, -544, 313, 323, 837, 837, -18, 314, 326, 1648,
2144 -544, -544, 34, 328, 343, 154, 1572, 1572, 1572, 1572,
2145 -544, -544, 317, 1572, 1572, 1648, 438, 489, -544, 248,
2146 131, 1475, -544, 344, -544, 837, 837, 1746, 837, 837,
2147 326, -544, 326, 1648, 837, 345, 1648, 1648, 1648, -544,
2148 -544, 1746, 448, -544, 699, -544, 1572, 1572, -544, 351,
2149 354, 353, 356, -544, 360, 361, 79, -544, -544, -544,
2150 -544, -544, -544, -18, -6, 485, 362, 357, 29, -18,
2151 173, -544, -544, -544, -544, -544, 369, 837, -544, -544,
2152 -544, 176, 326, 363, 379, 1572, -544, 1572, 1572, -544,
2153 -544, -544, 131, -544, 481, -544, 521, -1, 558, 558,
2154 -544, 1803, -544, 381, -544, -544, -544, -544, 389, 391,
2155 394, -544, 539, 400, 837, -544, 1249, 2, 397, 399,
2156 -544, -544, 80, 29, -18, -544, 120, -544, -544, -544,
2157 -544, 526, -544, -544, 401, -544, 1249, 269, 269, 538,
2158 558, 558, -544, 540, 403, 837, -544, -544, 837, 542,
2159 488, 269, 269, -544, 837, 546, -544, 837, -544
2162 /* YYPGOTO[NTERM-NUM]. */
2163 static const yytype_int16 yypgoto[] =
2165 -544, 434, 439, 440, 320, 316, -171, -544, 0, 22,
2166 -134, 483, 9, -544, -544, -544, -544, 191, -544, -544,
2167 -544, -149, -544, -403, -544, -230, -544, -544, -284, 52,
2168 -544, -372, -544, -544, -26, 358, -119, -544, 468, 482,
2169 -113, -161, -245, 225, 257, 350, -544, -544, 573, -544,
2170 -544, -544, -544, -544, -544, -544, -544, -544, -544, -544,
2171 502, -544, -544, -544, -544, -544, -544, -543, -64, 14,
2172 -195, -544, 536, -544, -544, -544, -544, -544, 92, 180,
2173 -544, -544, -544, -544
2176 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
2177 positive, shift that token. If negative, reduce the rule which
2178 number is the opposite. If zero, do what YYDEFACT says.
2179 If YYTABLE_NINF, syntax error. */
2180 #define YYTABLE_NINF -208
2181 static const yytype_int16 yytable[] =
2183 11, 81, 265, 308, 276, 104, 340, 164, 166, 13,
2184 275, 167, 110, 275, 355, 357, 110, 11, 312, 313,
2185 314, 315, 316, 387, 90, 319, 13, 277, 476, 480,
2186 267, 24, 93, 594, 443, 237, 110, 460, 461, 110,
2187 476, 110, 445, 21, 25, 143, 110, -55, -55, -55,
2188 -55, 108, 110, 604, 144, 49, 50, 51, 22, 477,
2189 52, 29, 30, 31, 32, 33, 34, 35, 143, 36,
2190 241, 242, 26, 320, 273, 135, 444, 233, 419, 108,
2191 274, 63, 64, -143, 444, 135, 419, 425, 110, 240,
2192 27, 152, 11, 1, 2, 472, 3, 4, 5, 266,
2193 132, 152, 28, 341, 342, 133, 419, 519, 111, 423,
2194 43, 420, 111, 230, 231, 57, 336, 234, 599, 58,
2195 552, 2, 337, 238, 4, 558, 559, 401, 437, 402,
2196 403, 404, 111, 110, 405, 111, -67, 111, 406, 407,
2197 59, 389, 111, 61, 168, 384, -67, 271, 111, 419,
2198 1, 386, -67, 3, 90, 5, 424, 575, 381, 45,
2199 595, 46, 105, 321, 322, 94, 37, 38, 39, 419,
2200 306, 307, 271, 309, 503, 268, 484, 597, 598, -143,
2201 600, 601, 101, -143, 111, 505, 310, 271, 271, 271,
2202 271, 271, 317, 318, 271, 85, 449, 86, 451, 452,
2203 453, 399, 135, 611, 612, 97, 533, 376, 534, 376,
2204 376, 98, 376, 152, 99, 402, 403, 404, 1, 102,
2205 405, 3, 103, 5, 406, 407, 115, 86, 116, 111,
2206 551, 83, 84, 414, 415, 416, 417, 418, 88, 243,
2207 244, 245, 246, 139, 89, 376, 426, 427, 428, 323,
2208 324, 152, 524, 376, 376, 402, 403, 404, 565, 140,
2209 405, 265, 382, 147, 406, 407, 325, 326, 145, 327,
2210 328, 165, 329, 330, 331, 37, 38, 39, 226, 383,
2211 121, 122, 123, 124, 125, 126, 229, 378, 379, 228,
2212 380, -207, 118, 119, 152, 400, 271, 232, 535, 463,
2213 464, 538, 539, 540, 235, 508, 470, 493, 236, -69,
2214 1, 2, 239, 3, 4, 5, -56, 376, 376, 376,
2215 -57, 6, 7, 388, 560, 376, 561, 564, 422, 561,
2216 582, 396, 397, -60, 586, 376, 376, 432, 148, 149,
2217 113, 114, 8, -59, -58, 247, 9, 110, 269, 275,
2218 10, 339, 346, 509, 510, 511, 512, 338, 266, 347,
2219 514, 515, 348, 349, 350, 271, 450, 271, 271, 271,
2220 358, 359, 456, 360, 361, 390, 363, 398, 411, 376,
2221 391, 376, 392, 393, 376, 462, 576, 323, 324, 435,
2222 376, 376, 394, 543, 544, 440, 441, 442, 395, 412,
2223 413, 429, 448, 447, 325, 326, 596, 327, 328, 475,
2224 329, 330, 331, 457, 458, 438, 439, 454, 455, 459,
2225 483, 376, 376, -206, 376, 376, 466, 467, 468, 469,
2226 376, 471, 568, 504, 569, 570, 473, 474, 481, 482,
2227 376, -69, 1, 2, 485, 3, 4, 5, 486, 516,
2228 488, 487, 489, 6, 7, 523, 491, 490, 493, 492,
2229 517, 529, 495, 494, 501, 496, 497, 271, 499, 500,
2230 271, 271, 271, 376, 8, 529, 498, 513, 9, 502,
2231 520, 506, 10, 278, 279, 280, 281, 282, 283, 284,
2232 285, 286, 287, 518, 376, 376, 507, 525, 537, 526,
2233 527, 444, 531, 532, 545, 546, 547, 555, 536, 548,
2234 376, 549, 550, 557, 566, 556, 63, 64, 542, 106,
2235 66, 67, 68, 69, 70, 71, 72, 562, 1, 2,
2236 567, 3, 4, 5, 572, 584, 376, 376, 574, 585,
2237 587, 376, 588, 590, 376, 589, 591, -18, 602, -19,
2238 376, 563, 520, 376, 603, 605, 609, 608, 73, 614,
2239 615, 364, 365, 617, 218, 63, 64, 366, 345, 219,
2240 220, 344, 580, 581, 571, 130, 553, 1, 2, 146,
2241 3, 4, 5, 367, 368, 369, 334, 142, 593, 343,
2242 44, 129, 96, 541, 465, 0, 0, 0, 370, 371,
2243 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2244 0, 0, 0, 0, 606, 607, 372, 0, 0, 610,
2245 0, 0, 613, 0, 0, 0, 0, 0, 616, 0,
2246 0, 618, 179, 180, 181, 182, 183, 184, 185, 186,
2247 187, 188, 189, 190, 191, 192, 193, 251, 252, 0,
2248 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2249 0, 0, 0, 0, 74, 75, 0, 0, 76, 0,
2250 77, 107, 0, 0, 253, 200, 578, 579, 203, 204,
2251 205, 206, 207, 208, 209, 210, 211, 0, 254, 0,
2252 255, 256, 257, 325, 326, 0, 327, 328, 0, 329,
2253 330, 331, 364, 365, 0, 0, 63, 64, 366, 0,
2254 0, 0, 0, 0, 0, 0, 0, 373, 1, 2,
2255 0, 3, 4, 5, 367, 368, 369, 0, 0, 0,
2256 0, 0, 0, 0, 0, 0, 0, 0, 0, 370,
2257 371, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2258 0, 0, 0, 110, 0, 63, 64, 372, 106, 66,
2259 67, 68, 69, 70, 71, 72, 0, 1, 2, 0,
2260 3, 4, 5, 179, 180, 181, 182, 183, 184, 185,
2261 186, 187, 188, 189, 190, 191, 192, 193, 251, 252,
2262 0, 0, 0, 0, 0, 63, 64, 73, 106, 155,
2263 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
2264 3, 4, 5, 0, 0, 253, 200, 201, 202, 203,
2265 204, 205, 206, 207, 208, 209, 210, 211, 0, 254,
2266 0, 255, 256, 257, 0, 0, 0, 73, 0, 0,
2267 364, 365, 0, 0, 63, 64, 366, 0, 0, 111,
2268 0, 0, 0, 0, 0, 0, 1, 2, 373, 3,
2269 4, 5, 367, 368, 369, 0, 0, 0, 0, 0,
2270 0, 0, 0, 0, 0, 0, 0, 370, 371, 0,
2271 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2272 0, 0, 0, 0, 0, 372, 0, 0, 0, 0,
2273 0, 0, 0, 74, 75, 0, 0, 76, 0, 77,
2274 141, 179, 180, 181, 182, 183, 184, 185, 186, 187,
2275 188, 189, 190, 191, 192, 193, 251, 252, 0, 0,
2276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2277 0, 0, 0, 74, 75, 0, 0, 76, 0, 77,
2278 356, 0, 0, 253, 200, 201, 202, 203, 204, 205,
2279 206, 207, 208, 209, 210, 211, 0, 254, 0, 255,
2280 256, 257, 63, 64, 0, 0, 0, 0, 0, 0,
2281 0, 0, 0, 0, 1, 2, 0, 3, 4, 5,
2282 248, 0, 0, 0, 0, 0, 373, 0, 0, 0,
2283 0, 0, 0, 0, 0, 249, 250, 0, 0, 0,
2284 0, 0, 0, 0, 0, 0, 0, 63, 64, 110,
2285 106, 155, 156, 157, 158, 159, 160, 72, 0, 1,
2286 2, 0, 3, 4, 5, 0, 0, 0, 0, 179,
2287 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
2288 190, 191, 192, 193, 251, 252, 0, 0, 0, 73,
2289 0, 0, 63, 64, 0, 106, 66, 67, 68, 69,
2290 70, 71, 72, 0, 1, 2, 0, 3, 4, 5,
2291 0, 253, 200, 201, 202, 203, 204, 205, 206, 207,
2292 208, 209, 210, 211, 134, 254, 0, 255, 256, 257,
2293 0, 0, 0, 0, 73, 0, 0, 0, 0, 0,
2294 0, 0, 0, 0, 0, 111, 0, 63, 64, -67,
2295 0, 258, 0, 0, 259, 0, 260, 0, 261, 1,
2296 2, 0, 3, 4, 5, 248, 0, 0, 0, 0,
2297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2298 249, 250, 0, 0, 0, 0, 0, 0, 0, 0,
2299 0, 0, 0, 0, 110, 74, 75, 0, 0, 76,
2300 0, 77, 421, 0, 0, 0, 0, 0, 0, 0,
2301 0, 0, 0, 0, 179, 180, 181, 182, 183, 184,
2302 185, 186, 187, 188, 189, 190, 191, 192, 193, 251,
2303 252, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2304 74, 75, 0, 0, 76, 0, 77, 0, 0, 0,
2305 289, 290, 0, 0, 0, 0, 253, 200, 201, 202,
2306 203, 204, 205, 206, 207, 208, 209, 210, 211, 0,
2307 254, 0, 255, 256, 257, 0, 0, 0, 0, 0,
2308 0, 0, 364, 365, 0, 0, 0, 0, 366, 0,
2309 111, 0, 0, 0, 0, 0, 258, 0, 0, 259,
2310 0, 260, 0, 261, 367, 368, 369, 0, 0, 0,
2311 0, 0, 0, 0, 0, 0, 0, 0, 0, 370,
2312 371, 291, 292, 293, 294, 295, 296, 297, 298, 299,
2313 300, 301, 302, 303, 304, 63, 64, 372, 150, 66,
2314 67, 68, 69, 70, 71, 72, 0, 1, 2, 0,
2315 3, 4, 5, 179, 180, 181, 182, 183, 184, 185,
2316 186, 187, 188, 189, 190, 191, 192, 193, 251, 252,
2317 0, 0, 0, 0, 0, 0, 0, 73, 0, 0,
2318 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2319 0, 0, 0, 0, 0, 253, 200, 201, 202, 203,
2320 204, 205, 206, 207, 208, 209, 210, 211, 0, 254,
2321 0, 255, 256, 257, 63, 64, 0, 106, 66, 67,
2322 68, 69, 70, 71, 72, 0, 1, 2, 0, 3,
2323 4, 5, 0, 0, 0, 0, 0, 0, 373, 0,
2324 0, 0, 0, 0, 0, 0, 333, 0, 0, 0,
2325 151, 0, 0, 0, 63, 64, 73, 106, 155, 156,
2326 157, 158, 159, 160, 72, 0, 1, 2, 0, 3,
2327 4, 5, 0, 0, 0, 0, 0, 0, 0, 0,
2328 0, 0, 0, 74, 75, 0, 0, 76, 0, 77,
2329 0, 0, 0, 0, 63, 64, 73, 106, 66, 67,
2330 68, 69, 70, 71, 72, 0, 1, 2, 0, 3,
2331 4, 5, 63, 64, 0, 106, 66, 67, 68, 69,
2332 70, 71, 72, 0, 1, 2, 431, 3, 4, 5,
2333 0, 0, 0, 0, 0, 0, 73, 0, 0, 0,
2334 0, 0, 0, 0, 522, 0, 0, 0, 0, 0,
2335 0, 0, 0, 0, 73, 0, 0, 0, 0, 0,
2336 0, 0, 74, 75, 0, 0, 76, 0, 77, 63,
2337 64, 0, 65, 66, 67, 68, 69, 70, 71, 72,
2338 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2339 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2340 0, 0, 74, 75, 0, 351, 76, 0, 77, 63,
2341 64, 73, 106, 155, 156, 157, 158, 159, 160, 72,
2342 0, 1, 2, 0, 3, 4, 5, 0, 0, 0,
2343 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2344 0, 0, 74, 75, 0, 0, 76, 0, 77, 0,
2345 0, 73, 0, 0, 0, 0, 0, 0, 0, 0,
2346 74, 75, 0, 0, 76, 0, 77, 63, 64, 0,
2347 150, 66, 67, 68, 69, 70, 71, 72, 0, 1,
2348 2, 0, 3, 4, 5, 63, 64, 0, 106, 66,
2349 67, 68, 69, 70, 71, 72, 0, 1, 2, 0,
2350 3, 4, 5, 0, 0, 0, 0, 0, 0, 73,
2351 0, 0, 0, 0, 0, 0, 0, 74, 75, 0,
2352 0, 76, 0, 77, 0, 63, 64, 73, 270, 66,
2353 67, 68, 69, 70, 71, 72, 0, 1, 2, 0,
2354 3, 4, 5, 0, 0, 0, 0, 0, 0, 0,
2355 0, 0, 0, 0, 0, 0, 0, 74, 75, 0,
2356 0, 76, 0, 77, 0, 63, 64, 73, 106, 155,
2357 156, 157, 158, 159, 160, 72, 0, 1, 2, 0,
2358 3, 4, 5, 63, 64, 0, 106, 66, 67, 68,
2359 69, 70, 71, 528, 0, 1, 2, 0, 3, 4,
2360 5, 0, 0, 0, 0, 0, 0, 73, 0, 0,
2361 0, 0, 0, 0, 0, 74, 75, 0, 0, 76,
2362 0, 77, 0, 0, 0, 73, 0, 0, 0, 0,
2363 0, 0, 0, 74, 75, 0, 0, 76, 0, 77,
2364 63, 64, 0, 106, 66, 67, 68, 69, 70, 71,
2365 583, 0, 1, 2, 0, 3, 4, 5, 0, 0,
2366 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2367 0, 0, 0, 74, 75, 0, 0, 76, 0, 77,
2368 0, 0, 73, 0, 0, 0, 0, 0, 0, 0,
2369 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2370 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2371 0, 0, 0, 74, 75, 0, 0, 76, 0, 354,
2372 170, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2373 0, 74, 75, 0, 0, 76, 0, 77, 0, 0,
2374 171, 172, 0, 0, 0, 0, 0, 0, 0, 0,
2375 0, 0, 173, 174, 175, 176, 177, 178, 179, 180,
2376 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
2377 191, 192, 193, 194, 195, 0, 0, 0, 0, 0,
2378 0, 0, 0, 0, 0, 0, 0, 0, 74, 75,
2379 0, 0, 76, 0, 77, 196, 197, 198, 0, 0,
2380 199, 200, 201, 202, 203, 204, 205, 206, 207, 208,
2381 209, 210, 211, 212, 213, 214, 215, 216, 217
2384 static const yytype_int16 yycheck[] =
2386 0, 27, 163, 198, 175, 4, 236, 120, 127, 0,
2387 11, 28, 54, 11, 259, 260, 54, 17, 213, 214,
2388 215, 216, 217, 307, 21, 220, 17, 176, 34, 432,
2389 164, 152, 29, 576, 11, 148, 54, 409, 410, 54,
2390 34, 54, 11, 52, 58, 153, 54, 3, 4, 5,
2391 6, 77, 54, 596, 162, 42, 43, 44, 67, 53,
2392 47, 42, 43, 44, 45, 46, 47, 48, 153, 50,
2393 26, 27, 152, 222, 11, 101, 53, 162, 153, 105,
2394 17, 7, 8, 54, 53, 111, 153, 162, 54, 153,
2395 18, 117, 92, 19, 20, 162, 22, 23, 24, 163,
2396 153, 127, 152, 237, 238, 158, 153, 479, 150, 354,
2397 0, 158, 150, 139, 140, 152, 158, 143, 38, 152,
2398 523, 20, 160, 149, 23, 528, 529, 322, 373, 135,
2399 136, 137, 150, 54, 140, 150, 154, 150, 144, 145,
2400 156, 156, 150, 22, 161, 153, 154, 173, 150, 153,
2401 19, 153, 154, 22, 21, 24, 160, 158, 277, 46,
2402 158, 48, 161, 114, 115, 162, 147, 148, 149, 153,
2403 196, 197, 198, 199, 458, 166, 160, 580, 581, 150,
2404 583, 584, 150, 154, 150, 151, 212, 213, 214, 215,
2405 216, 217, 218, 219, 220, 35, 391, 37, 393, 394,
2406 395, 320, 228, 606, 607, 22, 490, 271, 492, 273,
2407 274, 22, 276, 239, 22, 135, 136, 137, 19, 4,
2408 140, 22, 4, 24, 144, 145, 42, 37, 44, 150,
2409 151, 40, 41, 346, 347, 348, 349, 350, 47, 3,
2410 4, 5, 6, 157, 53, 309, 359, 360, 361, 118,
2411 119, 277, 482, 317, 318, 135, 136, 137, 542, 157,
2412 140, 422, 288, 154, 144, 145, 135, 136, 150, 138,
2413 139, 4, 141, 142, 143, 147, 148, 149, 22, 305,
2414 61, 62, 63, 64, 65, 66, 151, 273, 274, 153,
2415 276, 0, 32, 33, 320, 321, 322, 160, 493, 412,
2416 413, 496, 497, 498, 4, 151, 419, 153, 151, 18,
2417 19, 20, 150, 22, 23, 24, 9, 381, 382, 383,
2418 9, 30, 31, 309, 151, 389, 153, 151, 354, 153,
2419 560, 317, 318, 9, 564, 399, 400, 363, 113, 114,
2420 83, 84, 51, 9, 9, 9, 55, 54, 56, 11,
2421 59, 151, 150, 466, 467, 468, 469, 160, 422, 150,
2422 473, 474, 150, 150, 150, 391, 392, 393, 394, 395,
2423 22, 150, 398, 150, 150, 153, 150, 38, 38, 443,
2424 153, 445, 153, 153, 448, 411, 557, 118, 119, 60,
2425 454, 455, 153, 506, 507, 381, 382, 383, 153, 150,
2426 150, 153, 156, 389, 135, 136, 577, 138, 139, 38,
2427 141, 142, 143, 399, 400, 153, 153, 153, 153, 153,
2428 22, 485, 486, 0, 488, 489, 153, 153, 153, 153,
2429 494, 160, 545, 459, 547, 548, 153, 153, 153, 151,
2430 504, 18, 19, 20, 17, 22, 23, 24, 17, 475,
2431 153, 150, 153, 30, 31, 481, 4, 443, 153, 445,
2432 22, 487, 448, 153, 150, 153, 153, 493, 454, 455,
2433 496, 497, 498, 537, 51, 501, 153, 160, 55, 153,
2434 480, 153, 59, 91, 92, 93, 94, 95, 96, 97,
2435 98, 99, 100, 4, 558, 559, 153, 153, 153, 485,
2436 486, 53, 488, 489, 153, 151, 153, 22, 494, 153,
2437 574, 151, 151, 156, 151, 153, 7, 8, 504, 10,
2438 11, 12, 13, 14, 15, 16, 17, 158, 19, 20,
2439 151, 22, 23, 24, 53, 561, 600, 601, 17, 158,
2440 151, 605, 151, 4, 608, 151, 146, 150, 22, 150,
2441 614, 537, 552, 617, 153, 17, 153, 17, 49, 17,
2442 72, 3, 4, 17, 130, 7, 8, 9, 252, 130,
2443 130, 251, 558, 559, 552, 92, 524, 19, 20, 111,
2444 22, 23, 24, 25, 26, 27, 228, 105, 574, 239,
2445 17, 89, 56, 501, 414, -1, -1, -1, 40, 41,
2446 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2447 -1, -1, -1, -1, 600, 601, 58, -1, -1, 605,
2448 -1, -1, 608, -1, -1, -1, -1, -1, 614, -1,
2449 -1, 617, 74, 75, 76, 77, 78, 79, 80, 81,
2450 82, 83, 84, 85, 86, 87, 88, 89, 90, -1,
2451 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2452 -1, -1, -1, -1, 155, 156, -1, -1, 159, -1,
2453 161, 162, -1, -1, 116, 117, 118, 119, 120, 121,
2454 122, 123, 124, 125, 126, 127, 128, -1, 130, -1,
2455 132, 133, 134, 135, 136, -1, 138, 139, -1, 141,
2456 142, 143, 3, 4, -1, -1, 7, 8, 9, -1,
2457 -1, -1, -1, -1, -1, -1, -1, 159, 19, 20,
2458 -1, 22, 23, 24, 25, 26, 27, -1, -1, -1,
2459 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2460 41, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2461 -1, -1, -1, 54, -1, 7, 8, 58, 10, 11,
2462 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2463 22, 23, 24, 74, 75, 76, 77, 78, 79, 80,
2464 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2465 -1, -1, -1, -1, -1, 7, 8, 49, 10, 11,
2466 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2467 22, 23, 24, -1, -1, 116, 117, 118, 119, 120,
2468 121, 122, 123, 124, 125, 126, 127, 128, -1, 130,
2469 -1, 132, 133, 134, -1, -1, -1, 49, -1, -1,
2470 3, 4, -1, -1, 7, 8, 9, -1, -1, 150,
2471 -1, -1, -1, -1, -1, -1, 19, 20, 159, 22,
2472 23, 24, 25, 26, 27, -1, -1, -1, -1, -1,
2473 -1, -1, -1, -1, -1, -1, -1, 40, 41, -1,
2474 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2475 -1, -1, -1, -1, -1, 58, -1, -1, -1, -1,
2476 -1, -1, -1, 155, 156, -1, -1, 159, -1, 161,
2477 162, 74, 75, 76, 77, 78, 79, 80, 81, 82,
2478 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
2479 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2480 -1, -1, -1, 155, 156, -1, -1, 159, -1, 161,
2481 162, -1, -1, 116, 117, 118, 119, 120, 121, 122,
2482 123, 124, 125, 126, 127, 128, -1, 130, -1, 132,
2483 133, 134, 7, 8, -1, -1, -1, -1, -1, -1,
2484 -1, -1, -1, -1, 19, 20, -1, 22, 23, 24,
2485 25, -1, -1, -1, -1, -1, 159, -1, -1, -1,
2486 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
2487 -1, -1, -1, -1, -1, -1, -1, 7, 8, 54,
2488 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2489 20, -1, 22, 23, 24, -1, -1, -1, -1, 74,
2490 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2491 85, 86, 87, 88, 89, 90, -1, -1, -1, 49,
2492 -1, -1, 7, 8, -1, 10, 11, 12, 13, 14,
2493 15, 16, 17, -1, 19, 20, -1, 22, 23, 24,
2494 -1, 116, 117, 118, 119, 120, 121, 122, 123, 124,
2495 125, 126, 127, 128, 39, 130, -1, 132, 133, 134,
2496 -1, -1, -1, -1, 49, -1, -1, -1, -1, -1,
2497 -1, -1, -1, -1, -1, 150, -1, 7, 8, 154,
2498 -1, 156, -1, -1, 159, -1, 161, -1, 163, 19,
2499 20, -1, 22, 23, 24, 25, -1, -1, -1, -1,
2500 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2501 40, 41, -1, -1, -1, -1, -1, -1, -1, -1,
2502 -1, -1, -1, -1, 54, 155, 156, -1, -1, 159,
2503 -1, 161, 162, -1, -1, -1, -1, -1, -1, -1,
2504 -1, -1, -1, -1, 74, 75, 76, 77, 78, 79,
2505 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
2506 90, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2507 155, 156, -1, -1, 159, -1, 161, -1, -1, -1,
2508 26, 27, -1, -1, -1, -1, 116, 117, 118, 119,
2509 120, 121, 122, 123, 124, 125, 126, 127, 128, -1,
2510 130, -1, 132, 133, 134, -1, -1, -1, -1, -1,
2511 -1, -1, 3, 4, -1, -1, -1, -1, 9, -1,
2512 150, -1, -1, -1, -1, -1, 156, -1, -1, 159,
2513 -1, 161, -1, 163, 25, 26, 27, -1, -1, -1,
2514 -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
2515 41, 97, 98, 99, 100, 101, 102, 103, 104, 105,
2516 106, 107, 108, 109, 110, 7, 8, 58, 10, 11,
2517 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2518 22, 23, 24, 74, 75, 76, 77, 78, 79, 80,
2519 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
2520 -1, -1, -1, -1, -1, -1, -1, 49, -1, -1,
2521 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2522 -1, -1, -1, -1, -1, 116, 117, 118, 119, 120,
2523 121, 122, 123, 124, 125, 126, 127, 128, -1, 130,
2524 -1, 132, 133, 134, 7, 8, -1, 10, 11, 12,
2525 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2526 23, 24, -1, -1, -1, -1, -1, -1, 159, -1,
2527 -1, -1, -1, -1, -1, -1, 39, -1, -1, -1,
2528 122, -1, -1, -1, 7, 8, 49, 10, 11, 12,
2529 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2530 23, 24, -1, -1, -1, -1, -1, -1, -1, -1,
2531 -1, -1, -1, 155, 156, -1, -1, 159, -1, 161,
2532 -1, -1, -1, -1, 7, 8, 49, 10, 11, 12,
2533 13, 14, 15, 16, 17, -1, 19, 20, -1, 22,
2534 23, 24, 7, 8, -1, 10, 11, 12, 13, 14,
2535 15, 16, 17, -1, 19, 20, 39, 22, 23, 24,
2536 -1, -1, -1, -1, -1, -1, 49, -1, -1, -1,
2537 -1, -1, -1, -1, 39, -1, -1, -1, -1, -1,
2538 -1, -1, -1, -1, 49, -1, -1, -1, -1, -1,
2539 -1, -1, 155, 156, -1, -1, 159, -1, 161, 7,
2540 8, -1, 10, 11, 12, 13, 14, 15, 16, 17,
2541 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2542 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2543 -1, -1, 155, 156, -1, 158, 159, -1, 161, 7,
2544 8, 49, 10, 11, 12, 13, 14, 15, 16, 17,
2545 -1, 19, 20, -1, 22, 23, 24, -1, -1, -1,
2546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2547 -1, -1, 155, 156, -1, -1, 159, -1, 161, -1,
2548 -1, 49, -1, -1, -1, -1, -1, -1, -1, -1,
2549 155, 156, -1, -1, 159, -1, 161, 7, 8, -1,
2550 10, 11, 12, 13, 14, 15, 16, 17, -1, 19,
2551 20, -1, 22, 23, 24, 7, 8, -1, 10, 11,
2552 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2553 22, 23, 24, -1, -1, -1, -1, -1, -1, 49,
2554 -1, -1, -1, -1, -1, -1, -1, 155, 156, -1,
2555 -1, 159, -1, 161, -1, 7, 8, 49, 10, 11,
2556 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2557 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
2558 -1, -1, -1, -1, -1, -1, -1, 155, 156, -1,
2559 -1, 159, -1, 161, -1, 7, 8, 49, 10, 11,
2560 12, 13, 14, 15, 16, 17, -1, 19, 20, -1,
2561 22, 23, 24, 7, 8, -1, 10, 11, 12, 13,
2562 14, 15, 16, 17, -1, 19, 20, -1, 22, 23,
2563 24, -1, -1, -1, -1, -1, -1, 49, -1, -1,
2564 -1, -1, -1, -1, -1, 155, 156, -1, -1, 159,
2565 -1, 161, -1, -1, -1, 49, -1, -1, -1, -1,
2566 -1, -1, -1, 155, 156, -1, -1, 159, -1, 161,
2567 7, 8, -1, 10, 11, 12, 13, 14, 15, 16,
2568 17, -1, 19, 20, -1, 22, 23, 24, -1, -1,
2569 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2570 -1, -1, -1, 155, 156, -1, -1, 159, -1, 161,
2571 -1, -1, 49, -1, -1, -1, -1, -1, -1, -1,
2572 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2573 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2574 -1, -1, -1, 155, 156, -1, -1, 159, -1, 161,
2575 36, -1, -1, -1, -1, -1, -1, -1, -1, -1,
2576 -1, 155, 156, -1, -1, 159, -1, 161, -1, -1,
2577 56, 57, -1, -1, -1, -1, -1, -1, -1, -1,
2578 -1, -1, 68, 69, 70, 71, 72, 73, 74, 75,
2579 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
2580 86, 87, 88, 89, 90, -1, -1, -1, -1, -1,
2581 -1, -1, -1, -1, -1, -1, -1, -1, 155, 156,
2582 -1, -1, 159, -1, 161, 111, 112, 113, -1, -1,
2583 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
2584 126, 127, 128, 129, 130, 131, 132, 133, 134
2587 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
2588 symbol of state STATE-NUM. */
2589 static const yytype_uint8 yystos[] =
2591 0, 19, 20, 22, 23, 24, 30, 31, 51, 55,
2592 59, 172, 175, 176, 177, 178, 210, 211, 212, 214,
2593 213, 52, 67, 219, 152, 58, 152, 18, 152, 42,
2594 43, 44, 45, 46, 47, 48, 50, 147, 148, 149,
2595 179, 180, 181, 0, 212, 46, 48, 182, 229, 42,
2596 43, 44, 47, 183, 226, 228, 235, 152, 152, 156,
2597 220, 22, 218, 7, 8, 10, 11, 12, 13, 14,
2598 15, 16, 17, 49, 155, 156, 159, 161, 172, 176,
2599 197, 198, 232, 181, 181, 35, 37, 208, 181, 181,
2600 21, 236, 237, 29, 162, 227, 236, 22, 22, 22,
2601 221, 150, 4, 4, 4, 161, 10, 162, 198, 203,
2602 54, 150, 174, 208, 208, 42, 44, 184, 32, 33,
2603 207, 61, 62, 63, 64, 65, 66, 185, 224, 224,
2604 175, 240, 153, 158, 39, 198, 199, 201, 202, 157,
2605 157, 162, 203, 153, 162, 150, 202, 154, 207, 207,
2606 10, 122, 198, 200, 209, 11, 12, 13, 14, 15,
2607 16, 170, 171, 198, 204, 4, 200, 28, 161, 225,
2608 36, 56, 57, 68, 69, 70, 71, 72, 73, 74,
2609 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
2610 85, 86, 87, 88, 89, 90, 111, 112, 113, 116,
2611 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
2612 127, 128, 129, 130, 131, 132, 133, 134, 165, 166,
2613 167, 238, 244, 245, 246, 247, 22, 187, 153, 151,
2614 198, 198, 160, 162, 198, 4, 151, 204, 198, 150,
2615 232, 26, 27, 3, 4, 5, 6, 9, 25, 40,
2616 41, 89, 90, 116, 130, 132, 133, 134, 156, 159,
2617 161, 163, 165, 166, 167, 205, 232, 174, 176, 56,
2618 10, 198, 234, 11, 17, 11, 170, 185, 91, 92,
2619 93, 94, 95, 96, 97, 98, 99, 100, 168, 26,
2620 27, 97, 98, 99, 100, 101, 102, 103, 104, 105,
2621 106, 107, 108, 109, 110, 169, 198, 198, 234, 198,
2622 198, 241, 234, 234, 234, 234, 234, 198, 198, 234,
2623 185, 114, 115, 118, 119, 135, 136, 138, 139, 141,
2624 142, 143, 186, 39, 199, 189, 158, 160, 160, 151,
2625 189, 174, 174, 209, 168, 169, 150, 150, 150, 150,
2626 150, 158, 204, 206, 161, 206, 162, 206, 22, 150,
2627 150, 150, 215, 150, 3, 4, 9, 25, 26, 27,
2628 40, 41, 58, 159, 205, 231, 232, 233, 233, 233,
2629 233, 200, 198, 198, 153, 192, 153, 192, 233, 156,
2630 153, 153, 153, 153, 153, 153, 233, 233, 38, 200,
2631 198, 234, 135, 136, 137, 140, 144, 145, 188, 216,
2632 217, 38, 150, 150, 204, 204, 204, 204, 204, 153,
2633 158, 162, 198, 206, 160, 162, 204, 204, 204, 153,
2634 195, 39, 198, 222, 223, 60, 230, 206, 153, 153,
2635 233, 233, 233, 11, 53, 11, 243, 233, 156, 234,
2636 198, 234, 234, 234, 153, 153, 198, 233, 233, 153,
2637 195, 195, 198, 204, 204, 243, 153, 153, 153, 153,
2638 204, 160, 162, 153, 153, 38, 34, 53, 193, 196,
2639 187, 153, 151, 22, 160, 17, 17, 150, 153, 153,
2640 233, 4, 233, 153, 153, 233, 153, 153, 153, 233,
2641 233, 150, 153, 192, 198, 151, 153, 153, 151, 204,
2642 204, 204, 204, 160, 204, 204, 198, 22, 4, 195,
2643 172, 173, 39, 198, 189, 153, 233, 233, 17, 198,
2644 242, 233, 233, 192, 192, 234, 233, 153, 234, 234,
2645 234, 242, 233, 204, 204, 153, 151, 153, 153, 151,
2646 151, 151, 187, 193, 194, 22, 153, 156, 187, 187,
2647 151, 153, 158, 233, 151, 192, 151, 151, 204, 204,
2648 204, 173, 53, 191, 17, 158, 170, 239, 118, 119,
2649 233, 233, 189, 17, 198, 158, 189, 151, 151, 151,
2650 4, 146, 190, 233, 231, 158, 170, 187, 187, 38,
2651 187, 187, 22, 153, 231, 17, 233, 233, 17, 153,
2652 233, 187, 187, 233, 17, 72, 233, 17, 233
2655 #define yyerrok (yyerrstatus = 0)
2656 #define yyclearin (yychar = YYEMPTY)
2657 #define YYEMPTY (-2)
2660 #define YYACCEPT goto yyacceptlab
2661 #define YYABORT goto yyabortlab
2662 #define YYERROR goto yyerrorlab
2665 /* Like YYERROR except do call yyerror. This remains here temporarily
2666 to ease the transition to the new meaning of YYERROR, for GCC.
2667 Once GCC version 2 has supplanted version 1, this can go. */
2669 #define YYFAIL goto yyerrlab
2671 #define YYRECOVERING() (!!yyerrstatus)
2673 #define YYBACKUP(Token, Value) \
2675 if (yychar == YYEMPTY && yylen == 1) \
2679 yytoken = YYTRANSLATE (yychar); \
2685 yyerror (YY_("syntax error: cannot back up")); \
2692 #define YYERRCODE 256
2695 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
2696 If N is 0, then set CURRENT to the empty location which ends
2697 the previous symbol: RHS[0] (always defined). */
2699 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
2700 #ifndef YYLLOC_DEFAULT
2701 # define YYLLOC_DEFAULT(Current, Rhs, N) \
2705 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
2706 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
2707 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
2708 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
2712 (Current).first_line = (Current).last_line = \
2713 YYRHSLOC (Rhs, 0).last_line; \
2714 (Current).first_column = (Current).last_column = \
2715 YYRHSLOC (Rhs, 0).last_column; \
2721 /* YY_LOCATION_PRINT -- Print the location on the stream.
2722 This macro was not mandated originally: define only if we know
2723 we won't break user code: when these are the locations we know. */
2725 #ifndef YY_LOCATION_PRINT
2726 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2727 # define YY_LOCATION_PRINT(File, Loc) \
2728 fprintf (File, "%d.%d-%d.%d", \
2729 (Loc).first_line, (Loc).first_column, \
2730 (Loc).last_line, (Loc).last_column)
2732 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
2737 /* YYLEX -- calling `yylex' with the right arguments. */
2740 # define YYLEX yylex (YYLEX_PARAM)
2742 # define YYLEX yylex ()
2745 /* Enable debugging if requested. */
2749 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
2750 # define YYFPRINTF fprintf
2753 # define YYDPRINTF(Args) \
2759 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2763 YYFPRINTF (stderr, "%s ", Title); \
2764 yy_symbol_print (stderr, \
2766 YYFPRINTF (stderr, "\n"); \
2771 /*--------------------------------.
2772 | Print this symbol on YYOUTPUT. |
2773 `--------------------------------*/
2776 #if (defined __STDC__ || defined __C99__FUNC__ \
2777 || defined __cplusplus || defined _MSC_VER)
2779 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2782 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2785 YYSTYPE const * const yyvaluep;
2791 if (yytype < YYNTOKENS)
2792 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2804 /*--------------------------------.
2805 | Print this symbol on YYOUTPUT. |
2806 `--------------------------------*/
2808 #if (defined __STDC__ || defined __C99__FUNC__ \
2809 || defined __cplusplus || defined _MSC_VER)
2811 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2814 yy_symbol_print (yyoutput, yytype, yyvaluep)
2817 YYSTYPE const * const yyvaluep;
2820 if (yytype < YYNTOKENS)
2821 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2823 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2825 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2826 YYFPRINTF (yyoutput, ")");
2829 /*------------------------------------------------------------------.
2830 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
2832 `------------------------------------------------------------------*/
2834 #if (defined __STDC__ || defined __C99__FUNC__ \
2835 || defined __cplusplus || defined _MSC_VER)
2837 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
2840 yy_stack_print (bottom, top)
2841 yytype_int16 *bottom;
2845 YYFPRINTF (stderr, "Stack now");
2846 for (; bottom <= top; ++bottom)
2847 YYFPRINTF (stderr, " %d", *bottom);
2848 YYFPRINTF (stderr, "\n");
2851 # define YY_STACK_PRINT(Bottom, Top) \
2854 yy_stack_print ((Bottom), (Top)); \
2858 /*------------------------------------------------.
2859 | Report that the YYRULE is going to be reduced. |
2860 `------------------------------------------------*/
2862 #if (defined __STDC__ || defined __C99__FUNC__ \
2863 || defined __cplusplus || defined _MSC_VER)
2865 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
2868 yy_reduce_print (yyvsp, yyrule)
2873 int yynrhs = yyr2[yyrule];
2875 unsigned long int yylno = yyrline[yyrule];
2876 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2878 /* The symbols being reduced. */
2879 for (yyi = 0; yyi < yynrhs; yyi++)
2881 fprintf (stderr, " $%d = ", yyi + 1);
2882 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2883 &(yyvsp[(yyi + 1) - (yynrhs)])
2885 fprintf (stderr, "\n");
2889 # define YY_REDUCE_PRINT(Rule) \
2892 yy_reduce_print (yyvsp, Rule); \
2895 /* Nonzero means print parse trace. It is left uninitialized so that
2896 multiple parsers can coexist. */
2898 #else /* !YYDEBUG */
2899 # define YYDPRINTF(Args)
2900 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
2901 # define YY_STACK_PRINT(Bottom, Top)
2902 # define YY_REDUCE_PRINT(Rule)
2903 #endif /* !YYDEBUG */
2906 /* YYINITDEPTH -- initial size of the parser's stacks. */
2908 # define YYINITDEPTH 200
2911 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
2912 if the built-in stack extension method is used).
2914 Do not make this value too large; the results are undefined if
2915 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
2916 evaluated with infinite-precision integer arithmetic. */
2919 # define YYMAXDEPTH 10000
2927 # if defined __GLIBC__ && defined _STRING_H
2928 # define yystrlen strlen
2930 /* Return the length of YYSTR. */
2931 #if (defined __STDC__ || defined __C99__FUNC__ \
2932 || defined __cplusplus || defined _MSC_VER)
2934 yystrlen (const char *yystr)
2942 for (yylen = 0; yystr[yylen]; yylen++)
2950 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
2951 # define yystpcpy stpcpy
2953 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
2955 #if (defined __STDC__ || defined __C99__FUNC__ \
2956 || defined __cplusplus || defined _MSC_VER)
2958 yystpcpy (char *yydest, const char *yysrc)
2961 yystpcpy (yydest, yysrc)
2967 const char *yys = yysrc;
2969 while ((*yyd++ = *yys++) != '\0')
2978 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2979 quotes and backslashes, so that it's suitable for yyerror. The
2980 heuristic is that double-quoting is unnecessary unless the string
2981 contains an apostrophe, a comma, or backslash (other than
2982 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2983 null, do not copy; instead, return the length of what the result
2986 yytnamerr (char *yyres, const char *yystr)
2991 char const *yyp = yystr;
2998 goto do_not_strip_quotes;
3002 goto do_not_strip_quotes;
3015 do_not_strip_quotes: ;
3019 return yystrlen (yystr);
3021 return yystpcpy (yyres, yystr) - yyres;
3025 /* Copy into YYRESULT an error message about the unexpected token
3026 YYCHAR while in state YYSTATE. Return the number of bytes copied,
3027 including the terminating null byte. If YYRESULT is null, do not
3028 copy anything; just return the number of bytes that would be
3029 copied. As a special case, return 0 if an ordinary "syntax error"
3030 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
3031 size calculation. */
3033 yysyntax_error (char *yyresult, int yystate, int yychar)
3035 int yyn = yypact[yystate];
3037 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
3041 int yytype = YYTRANSLATE (yychar);
3042 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
3043 YYSIZE_T yysize = yysize0;
3045 int yysize_overflow = 0;
3046 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
3047 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
3051 /* This is so xgettext sees the translatable formats that are
3052 constructed on the fly. */
3053 YY_("syntax error, unexpected %s");
3054 YY_("syntax error, unexpected %s, expecting %s");
3055 YY_("syntax error, unexpected %s, expecting %s or %s");
3056 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
3057 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
3061 static char const yyunexpected[] = "syntax error, unexpected %s";
3062 static char const yyexpecting[] = ", expecting %s";
3063 static char const yyor[] = " or %s";
3064 char yyformat[sizeof yyunexpected
3065 + sizeof yyexpecting - 1
3066 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
3067 * (sizeof yyor - 1))];
3068 char const *yyprefix = yyexpecting;
3070 /* Start YYX at -YYN if negative to avoid negative indexes in
3072 int yyxbegin = yyn < 0 ? -yyn : 0;
3074 /* Stay within bounds of both yycheck and yytname. */
3075 int yychecklim = YYLAST - yyn + 1;
3076 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
3079 yyarg[0] = yytname[yytype];
3080 yyfmt = yystpcpy (yyformat, yyunexpected);
3082 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
3083 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
3085 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
3089 yyformat[sizeof yyunexpected - 1] = '\0';
3092 yyarg[yycount++] = yytname[yyx];
3093 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
3094 yysize_overflow |= (yysize1 < yysize);
3096 yyfmt = yystpcpy (yyfmt, yyprefix);
3100 yyf = YY_(yyformat);
3101 yysize1 = yysize + yystrlen (yyf);
3102 yysize_overflow |= (yysize1 < yysize);
3105 if (yysize_overflow)
3106 return YYSIZE_MAXIMUM;
3110 /* Avoid sprintf, as that infringes on the user's name space.
3111 Don't have undefined behavior even if the translation
3112 produced a string with the wrong number of "%s"s. */
3113 char *yyp = yyresult;
3115 while ((*yyp = *yyf) != '\0')
3117 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
3119 yyp += yytnamerr (yyp, yyarg[yyi++]);
3132 #endif /* YYERROR_VERBOSE */
3135 /*-----------------------------------------------.
3136 | Release the memory associated to this symbol. |
3137 `-----------------------------------------------*/
3140 #if (defined __STDC__ || defined __C99__FUNC__ \
3141 || defined __cplusplus || defined _MSC_VER)
3143 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
3146 yydestruct (yymsg, yytype, yyvaluep)
3156 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
3167 /* Prevent warnings from -Wmissing-prototypes. */
3169 #ifdef YYPARSE_PARAM
3170 #if defined __STDC__ || defined __cplusplus
3171 int yyparse (void *YYPARSE_PARAM);
3175 #else /* ! YYPARSE_PARAM */
3176 #if defined __STDC__ || defined __cplusplus
3181 #endif /* ! YYPARSE_PARAM */
3185 /* The look-ahead symbol. */
3188 /* The semantic value of the look-ahead symbol. */
3191 /* Number of syntax errors so far. */
3200 #ifdef YYPARSE_PARAM
3201 #if (defined __STDC__ || defined __C99__FUNC__ \
3202 || defined __cplusplus || defined _MSC_VER)
3204 yyparse (void *YYPARSE_PARAM)
3207 yyparse (YYPARSE_PARAM)
3208 void *YYPARSE_PARAM;
3210 #else /* ! YYPARSE_PARAM */
3211 #if (defined __STDC__ || defined __C99__FUNC__ \
3212 || defined __cplusplus || defined _MSC_VER)
3226 /* Number of tokens to shift before error messages enabled. */
3228 /* Look-ahead token as an internal (translated) token number. */
3231 /* Buffer for error messages, and its allocated size. */
3233 char *yymsg = yymsgbuf;
3234 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
3237 /* Three stacks and their tools:
3238 `yyss': related to states,
3239 `yyvs': related to semantic values,
3240 `yyls': related to locations.
3242 Refer to the stacks thru separate pointers, to allow yyoverflow
3243 to reallocate them elsewhere. */
3245 /* The state stack. */
3246 yytype_int16 yyssa[YYINITDEPTH];
3247 yytype_int16 *yyss = yyssa;
3248 yytype_int16 *yyssp;
3250 /* The semantic value stack. */
3251 YYSTYPE yyvsa[YYINITDEPTH];
3252 YYSTYPE *yyvs = yyvsa;
3257 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
3259 YYSIZE_T yystacksize = YYINITDEPTH;
3261 /* The variables used to return semantic value and location from the
3266 /* The number of symbols on the RHS of the reduced rule.
3267 Keep to zero when no symbol should be popped. */
3270 YYDPRINTF ((stderr, "Starting parse\n"));
3275 yychar = YYEMPTY; /* Cause a token to be read. */
3277 /* Initialize stack pointers.
3278 Waste one element of value and location stack
3279 so that they stay on the same level as the state stack.
3280 The wasted elements are never initialized. */
3287 /*------------------------------------------------------------.
3288 | yynewstate -- Push a new state, which is found in yystate. |
3289 `------------------------------------------------------------*/
3291 /* In all cases, when you get here, the value and location stacks
3292 have just been pushed. So pushing a state here evens the stacks. */
3298 if (yyss + yystacksize - 1 <= yyssp)
3300 /* Get the current used size of the three stacks, in elements. */
3301 YYSIZE_T yysize = yyssp - yyss + 1;
3305 /* Give user a chance to reallocate the stack. Use copies of
3306 these so that the &'s don't force the real ones into
3308 YYSTYPE *yyvs1 = yyvs;
3309 yytype_int16 *yyss1 = yyss;
3312 /* Each stack pointer address is followed by the size of the
3313 data in use in that stack, in bytes. This used to be a
3314 conditional around just the two extra args, but that might
3315 be undefined if yyoverflow is a macro. */
3316 yyoverflow (YY_("memory exhausted"),
3317 &yyss1, yysize * sizeof (*yyssp),
3318 &yyvs1, yysize * sizeof (*yyvsp),
3325 #else /* no yyoverflow */
3326 # ifndef YYSTACK_RELOCATE
3327 goto yyexhaustedlab;
3329 /* Extend the stack our own way. */
3330 if (YYMAXDEPTH <= yystacksize)
3331 goto yyexhaustedlab;
3333 if (YYMAXDEPTH < yystacksize)
3334 yystacksize = YYMAXDEPTH;
3337 yytype_int16 *yyss1 = yyss;
3338 union yyalloc *yyptr =
3339 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
3341 goto yyexhaustedlab;
3342 YYSTACK_RELOCATE (yyss);
3343 YYSTACK_RELOCATE (yyvs);
3345 # undef YYSTACK_RELOCATE
3347 YYSTACK_FREE (yyss1);
3350 #endif /* no yyoverflow */
3352 yyssp = yyss + yysize - 1;
3353 yyvsp = yyvs + yysize - 1;
3356 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
3357 (unsigned long int) yystacksize));
3359 if (yyss + yystacksize - 1 <= yyssp)
3363 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
3372 /* Do appropriate processing given the current state. Read a
3373 look-ahead token if we need one and don't already have one. */
3375 /* First try to decide what to do without reference to look-ahead token. */
3376 yyn = yypact[yystate];
3377 if (yyn == YYPACT_NINF)
3380 /* Not known => get a look-ahead token if don't already have one. */
3382 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
3383 if (yychar == YYEMPTY)
3385 YYDPRINTF ((stderr, "Reading a token: "));
3389 if (yychar <= YYEOF)
3391 yychar = yytoken = YYEOF;
3392 YYDPRINTF ((stderr, "Now at end of input.\n"));
3396 yytoken = YYTRANSLATE (yychar);
3397 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
3400 /* If the proper action on seeing token YYTOKEN is to reduce or to
3401 detect an error, take that action. */
3403 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
3408 if (yyn == 0 || yyn == YYTABLE_NINF)
3417 /* Count tokens shifted since error; after three, turn off error
3422 /* Shift the look-ahead token. */
3423 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3425 /* Discard the shifted token unless it is eof. */
3426 if (yychar != YYEOF)
3435 /*-----------------------------------------------------------.
3436 | yydefault -- do the default action for the current state. |
3437 `-----------------------------------------------------------*/
3439 yyn = yydefact[yystate];
3445 /*-----------------------------.
3446 | yyreduce -- Do a reduction. |
3447 `-----------------------------*/
3449 /* yyn is the number of a rule to reduce with. */
3452 /* If YYLEN is nonzero, implement the default value of the action:
3455 Otherwise, the following line sets YYVAL to garbage.
3456 This behavior is undocumented and Bison
3457 users should not rely upon it. Assigning to YYVAL
3458 unconditionally makes the parser a bit smaller, and it avoids a
3459 GCC warning that YYVAL may be used uninitialized. */
3460 yyval = yyvsp[1-yylen];
3463 YY_REDUCE_PRINT (yyn);
3467 #line 1117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3468 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
3472 #line 1117 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3473 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
3477 #line 1118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3478 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
3482 #line 1118 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3483 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
3487 #line 1119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3488 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
3492 #line 1119 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3493 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
3497 #line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3498 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
3502 #line 1120 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3503 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
3507 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3508 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
3512 #line 1121 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3513 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
3517 #line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3518 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
3522 #line 1125 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3523 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
3527 #line 1126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3528 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
3532 #line 1126 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3533 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
3537 #line 1127 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3538 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
3542 #line 1127 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3543 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
3547 #line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3548 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
3552 #line 1128 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3553 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
3557 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3558 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
3562 #line 1129 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3563 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
3567 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3568 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
3572 #line 1130 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3573 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
3577 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3578 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
3582 #line 1131 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3583 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
3587 #line 1132 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3588 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
3592 #line 1133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3593 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
3597 #line 1142 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3598 { (yyval.StrVal) = 0; ;}
3602 #line 1144 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3603 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
3607 #line 1145 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3608 { (yyval.UIntVal)=0; ;}
3612 #line 1149 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3614 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3620 #line 1153 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3628 #line 1161 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3636 #line 1166 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3638 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
3644 #line 1172 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3645 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3649 #line 1173 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3650 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3654 #line 1174 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3655 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3659 #line 1175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3660 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
3664 #line 1176 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3665 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3669 #line 1180 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3670 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3674 #line 1181 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3675 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3679 #line 1182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3680 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3684 #line 1186 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3685 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3689 #line 1187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3690 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
3694 #line 1188 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3695 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
3699 #line 1189 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3700 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
3704 #line 1193 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3705 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3709 #line 1194 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3710 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
3714 #line 1195 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3715 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
3719 #line 1199 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3720 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3724 #line 1200 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3725 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3729 #line 1201 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3730 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
3734 #line 1202 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3735 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3739 #line 1203 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3740 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
3744 #line 1207 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3745 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
3749 #line 1208 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3750 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
3754 #line 1209 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3755 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
3759 #line 1212 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3760 { (yyval.UIntVal) = CallingConv::C; ;}
3764 #line 1213 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3765 { (yyval.UIntVal) = CallingConv::C; ;}
3769 #line 1214 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3770 { (yyval.UIntVal) = CallingConv::Fast; ;}
3774 #line 1215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3775 { (yyval.UIntVal) = CallingConv::Cold; ;}
3779 #line 1216 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3780 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
3784 #line 1217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3785 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
3789 #line 1218 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3791 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
3792 GEN_ERROR("Calling conv too large");
3793 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3799 #line 1225 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3800 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3804 #line 1226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3805 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3809 #line 1227 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3810 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3814 #line 1228 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3815 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3819 #line 1229 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3820 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
3824 #line 1230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3825 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
3829 #line 1231 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3830 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
3834 #line 1232 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3835 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
3839 #line 1233 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3840 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
3844 #line 1236 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3845 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3849 #line 1237 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3851 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3856 #line 1242 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3857 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
3861 #line 1243 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3862 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
3866 #line 1244 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3867 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
3871 #line 1245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3872 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
3876 #line 1246 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3877 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
3881 #line 1247 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3882 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
3886 #line 1250 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3887 { (yyval.ParamAttrs) = ParamAttr::None; ;}
3891 #line 1251 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3893 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
3898 #line 1256 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3899 { (yyval.StrVal) = 0; ;}
3903 #line 1257 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3905 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3910 #line 1264 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3911 { (yyval.UIntVal) = 0; ;}
3915 #line 1265 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3917 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
3918 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3919 GEN_ERROR("Alignment must be a power of two");
3925 #line 1271 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3926 { (yyval.UIntVal) = 0; ;}
3930 #line 1272 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3932 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
3933 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
3934 GEN_ERROR("Alignment must be a power of two");
3940 #line 1281 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3942 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
3943 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
3944 GEN_ERROR("Invalid character in section name");
3945 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
3951 #line 1289 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3952 { (yyval.StrVal) = 0; ;}
3956 #line 1290 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3957 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
3961 #line 1295 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3966 #line 1296 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3971 #line 1297 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3973 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
3974 delete (yyvsp[(1) - (1)].StrVal);
3980 #line 1302 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3982 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
3983 GEN_ERROR("Alignment must be a power of two");
3984 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
3990 #line 1318 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
3992 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
3998 #line 1322 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4000 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
4006 #line 1326 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4008 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
4009 GEN_ERROR("Cannot form a pointer to a basic block");
4010 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal))));
4011 delete (yyvsp[(1) - (3)].TypeVal);
4017 #line 1333 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4018 { // Named types are also simple types...
4019 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
4021 (yyval.TypeVal) = new PATypeHolder(tmp);
4026 #line 1338 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4027 { // Type UpReference
4028 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
4029 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
4030 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
4031 (yyval.TypeVal) = new PATypeHolder(OT);
4032 UR_OUT("New Upreference!\n");
4038 #line 1346 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4040 // Allow but ignore attributes on function types; this permits auto-upgrade.
4041 // FIXME: remove in LLVM 3.0.
4042 const Type* RetTy = *(yyvsp[(1) - (5)].TypeVal);
4043 if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy ||
4044 isa<OpaqueType>(RetTy)))
4045 GEN_ERROR("LLVM Functions cannot return aggregates");
4047 std::vector<const Type*> Params;
4048 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4049 for (; I != E; ++I ) {
4050 const Type *Ty = I->Ty->get();
4051 Params.push_back(Ty);
4054 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4055 if (isVarArg) Params.pop_back();
4057 for (unsigned i = 0; i != Params.size(); ++i)
4058 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4059 GEN_ERROR("Function arguments must be value types!");
4063 FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg);
4064 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4065 delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle
4066 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4072 #line 1376 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4074 // Allow but ignore attributes on function types; this permits auto-upgrade.
4075 // FIXME: remove in LLVM 3.0.
4076 std::vector<const Type*> Params;
4077 TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end();
4078 for ( ; I != E; ++I ) {
4079 const Type* Ty = I->Ty->get();
4080 Params.push_back(Ty);
4083 bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
4084 if (isVarArg) Params.pop_back();
4086 for (unsigned i = 0; i != Params.size(); ++i)
4087 if (!(Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])))
4088 GEN_ERROR("Function arguments must be value types!");
4092 FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg);
4093 delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list
4094 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT));
4100 #line 1401 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4101 { // Sized array type?
4102 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4103 delete (yyvsp[(4) - (5)].TypeVal);
4109 #line 1406 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4111 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
4112 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
4113 GEN_ERROR("Unsigned result not equal to signed result");
4114 if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger())
4115 GEN_ERROR("Element type of a VectorType must be primitive");
4116 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
4117 delete (yyvsp[(4) - (5)].TypeVal);
4123 #line 1416 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4124 { // Structure type?
4125 std::vector<const Type*> Elements;
4126 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
4127 E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I)
4128 Elements.push_back(*I);
4130 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements)));
4131 delete (yyvsp[(2) - (3)].TypeList);
4137 #line 1426 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4138 { // Empty structure type?
4139 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
4145 #line 1430 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4147 std::vector<const Type*> Elements;
4148 for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
4149 E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I)
4150 Elements.push_back(*I);
4152 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true)));
4153 delete (yyvsp[(3) - (5)].TypeList);
4159 #line 1440 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4160 { // Empty structure type?
4161 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
4167 #line 1447 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4169 // Allow but ignore attributes on function types; this permits auto-upgrade.
4170 // FIXME: remove in LLVM 3.0.
4171 (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal);
4172 (yyval.TypeWithAttrs).Attrs = ParamAttr::None;
4177 #line 1456 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4179 if (!UpRefs.empty())
4180 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
4181 if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType())
4182 GEN_ERROR("LLVM functions cannot return aggregate types");
4183 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
4188 #line 1463 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4190 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
4195 #line 1468 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4197 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4198 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
4204 #line 1473 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4206 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
4212 #line 1481 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4214 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
4215 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4216 TWA.Ty = new PATypeHolder(Type::VoidTy);
4217 (yyval.TypeWithAttrsList)->push_back(TWA);
4223 #line 1488 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4225 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
4226 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
4227 TWA.Ty = new PATypeHolder(Type::VoidTy);
4228 (yyval.TypeWithAttrsList)->push_back(TWA);
4234 #line 1495 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4236 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
4242 #line 1503 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4244 (yyval.TypeList) = new std::list<PATypeHolder>();
4245 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
4246 delete (yyvsp[(1) - (1)].TypeVal);
4252 #line 1509 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4254 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
4255 delete (yyvsp[(3) - (3)].TypeVal);
4261 #line 1521 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4262 { // Nonempty unsized arr
4263 if (!UpRefs.empty())
4264 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4265 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal)->get());
4267 GEN_ERROR("Cannot make array constant with type: '" +
4268 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4269 const Type *ETy = ATy->getElementType();
4270 int NumElements = ATy->getNumElements();
4272 // Verify that we have the correct size...
4273 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4274 GEN_ERROR("Type mismatch: constant sized array initialized with " +
4275 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4276 itostr(NumElements) + "");
4278 // Verify all elements are correct type!
4279 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4280 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4281 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4282 ETy->getDescription() +"' as required!\nIt is of type '"+
4283 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4286 (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector));
4287 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4293 #line 1549 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4295 if (!UpRefs.empty())
4296 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4297 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4299 GEN_ERROR("Cannot make array constant with type: '" +
4300 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4302 int NumElements = ATy->getNumElements();
4303 if (NumElements != -1 && NumElements != 0)
4304 GEN_ERROR("Type mismatch: constant sized array initialized with 0"
4305 " arguments, but has size of " + itostr(NumElements) +"");
4306 (yyval.ConstVal) = ConstantArray::get(ATy, std::vector<Constant*>());
4307 delete (yyvsp[(1) - (3)].TypeVal);
4313 #line 1565 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4315 if (!UpRefs.empty())
4316 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4317 const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal)->get());
4319 GEN_ERROR("Cannot make array constant with type: '" +
4320 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4322 int NumElements = ATy->getNumElements();
4323 const Type *ETy = ATy->getElementType();
4324 if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length()))
4325 GEN_ERROR("Can't build string constant of size " +
4326 itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) +
4327 " when array has size " + itostr(NumElements) + "");
4328 std::vector<Constant*> Vals;
4329 if (ETy == Type::Int8Ty) {
4330 for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i)
4331 Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i]));
4333 delete (yyvsp[(3) - (3)].StrVal);
4334 GEN_ERROR("Cannot build string arrays of non byte sized elements");
4336 delete (yyvsp[(3) - (3)].StrVal);
4337 (yyval.ConstVal) = ConstantArray::get(ATy, Vals);
4338 delete (yyvsp[(1) - (3)].TypeVal);
4344 #line 1592 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4345 { // Nonempty unsized arr
4346 if (!UpRefs.empty())
4347 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
4348 const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal)->get());
4350 GEN_ERROR("Cannot make packed constant with type: '" +
4351 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4352 const Type *ETy = PTy->getElementType();
4353 int NumElements = PTy->getNumElements();
4355 // Verify that we have the correct size...
4356 if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size())
4357 GEN_ERROR("Type mismatch: constant sized packed initialized with " +
4358 utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " +
4359 itostr(NumElements) + "");
4361 // Verify all elements are correct type!
4362 for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) {
4363 if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType())
4364 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
4365 ETy->getDescription() +"' as required!\nIt is of type '"+
4366 (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'.");
4369 (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector));
4370 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4376 #line 1620 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4378 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
4380 GEN_ERROR("Cannot make struct constant with type: '" +
4381 (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'");
4383 if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes())
4384 GEN_ERROR("Illegal number of initializers for structure type");
4386 // Check to ensure that constants are compatible with the type initializer!
4387 for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i)
4388 if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i))
4389 GEN_ERROR("Expected type '" +
4390 STy->getElementType(i)->getDescription() +
4391 "' for element #" + utostr(i) +
4392 " of structure initializer");
4394 // Check to ensure that Type is not packed
4395 if (STy->isPacked())
4396 GEN_ERROR("Unpacked Initializer to vector type '" +
4397 STy->getDescription() + "'");
4399 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector));
4400 delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector);
4406 #line 1646 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4408 if (!UpRefs.empty())
4409 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
4410 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal)->get());
4412 GEN_ERROR("Cannot make struct constant with type: '" +
4413 (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'");
4415 if (STy->getNumContainedTypes() != 0)
4416 GEN_ERROR("Illegal number of initializers for structure type");
4418 // Check to ensure that Type is not packed
4419 if (STy->isPacked())
4420 GEN_ERROR("Unpacked Initializer to vector type '" +
4421 STy->getDescription() + "'");
4423 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4424 delete (yyvsp[(1) - (3)].TypeVal);
4430 #line 1666 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4432 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
4434 GEN_ERROR("Cannot make struct constant with type: '" +
4435 (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'");
4437 if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes())
4438 GEN_ERROR("Illegal number of initializers for structure type");
4440 // Check to ensure that constants are compatible with the type initializer!
4441 for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i)
4442 if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i))
4443 GEN_ERROR("Expected type '" +
4444 STy->getElementType(i)->getDescription() +
4445 "' for element #" + utostr(i) +
4446 " of structure initializer");
4448 // Check to ensure that Type is packed
4449 if (!STy->isPacked())
4450 GEN_ERROR("Vector initializer to non-vector type '" +
4451 STy->getDescription() + "'");
4453 (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector));
4454 delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector);
4460 #line 1692 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4462 if (!UpRefs.empty())
4463 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
4464 const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal)->get());
4466 GEN_ERROR("Cannot make struct constant with type: '" +
4467 (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'");
4469 if (STy->getNumContainedTypes() != 0)
4470 GEN_ERROR("Illegal number of initializers for structure type");
4472 // Check to ensure that Type is packed
4473 if (!STy->isPacked())
4474 GEN_ERROR("Vector initializer to non-vector type '" +
4475 STy->getDescription() + "'");
4477 (yyval.ConstVal) = ConstantStruct::get(STy, std::vector<Constant*>());
4478 delete (yyvsp[(1) - (5)].TypeVal);
4484 #line 1712 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4486 if (!UpRefs.empty())
4487 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4488 const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4490 GEN_ERROR("Cannot make null pointer constant with type: '" +
4491 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'");
4493 (yyval.ConstVal) = ConstantPointerNull::get(PTy);
4494 delete (yyvsp[(1) - (2)].TypeVal);
4500 #line 1724 "/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 (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get());
4505 delete (yyvsp[(1) - (2)].TypeVal);
4511 #line 1731 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4513 if (!UpRefs.empty())
4514 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4515 const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal)->get());
4517 GEN_ERROR("Global const reference must be a pointer type");
4519 // ConstExprs can exist in the body of a function, thus creating
4520 // GlobalValues whenever they refer to a variable. Because we are in
4521 // the context of a function, getExistingVal will search the functions
4522 // symbol table instead of the module symbol table for the global symbol,
4523 // which throws things all off. To get around this, we just tell
4524 // getExistingVal that we are at global scope here.
4526 Function *SavedCurFn = CurFun.CurrentFunction;
4527 CurFun.CurrentFunction = 0;
4529 Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal));
4532 CurFun.CurrentFunction = SavedCurFn;
4534 // If this is an initializer for a constant pointer, which is referencing a
4535 // (currently) undefined variable, create a stub now that shall be replaced
4536 // in the future with the right type of variable.
4539 assert(isa<PointerType>(Ty) && "Globals may only be used as pointers!");
4540 const PointerType *PT = cast<PointerType>(Ty);
4542 // First check to see if the forward references value is already created!
4543 PerModuleInfo::GlobalRefsType::iterator I =
4544 CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)));
4546 if (I != CurModule.GlobalRefs.end()) {
4547 V = I->second; // Placeholder already exists, use it...
4548 (yyvsp[(2) - (2)].ValIDVal).destroy();
4551 if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName)
4552 Name = (yyvsp[(2) - (2)].ValIDVal).getName();
4553 else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID)
4554 GEN_ERROR("Invalid reference to global");
4556 // Create the forward referenced global.
4558 if (const FunctionType *FTy =
4559 dyn_cast<FunctionType>(PT->getElementType())) {
4560 GV = new Function(FTy, GlobalValue::ExternalWeakLinkage, Name,
4561 CurModule.CurrentModule);
4563 GV = new GlobalVariable(PT->getElementType(), false,
4564 GlobalValue::ExternalWeakLinkage, 0,
4565 Name, CurModule.CurrentModule);
4568 // Keep track of the fact that we have a forward ref to recycle it
4569 CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV));
4574 (yyval.ConstVal) = cast<GlobalValue>(V);
4575 delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle
4581 #line 1797 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4583 if (!UpRefs.empty())
4584 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4585 if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType())
4586 GEN_ERROR("Mismatched types for constant expression: " +
4587 (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription());
4588 (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal);
4589 delete (yyvsp[(1) - (2)].TypeVal);
4595 #line 1807 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4597 if (!UpRefs.empty())
4598 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
4599 const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get();
4600 if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
4601 GEN_ERROR("Cannot create a null initialized value of this type");
4602 (yyval.ConstVal) = Constant::getNullValue(Ty);
4603 delete (yyvsp[(1) - (2)].TypeVal);
4609 #line 1817 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4610 { // integral constants
4611 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
4612 GEN_ERROR("Constant value doesn't fit in type");
4613 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true);
4619 #line 1823 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4620 { // arbitrary precision integer constants
4621 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4622 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4623 GEN_ERROR("Constant value does not fit in type");
4625 (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth);
4626 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4627 delete (yyvsp[(2) - (2)].APIntVal);
4633 #line 1833 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4634 { // integral constants
4635 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
4636 GEN_ERROR("Constant value doesn't fit in type");
4637 (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false);
4643 #line 1839 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4644 { // arbitrary precision integer constants
4645 uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
4646 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
4647 GEN_ERROR("Constant value does not fit in type");
4649 (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth);
4650 (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal));
4651 delete (yyvsp[(2) - (2)].APIntVal);
4657 #line 1849 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4658 { // Boolean constants
4659 assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4660 (yyval.ConstVal) = ConstantInt::getTrue();
4666 #line 1854 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4667 { // Boolean constants
4668 assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
4669 (yyval.ConstVal) = ConstantInt::getFalse();
4675 #line 1859 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4676 { // Floating point constants
4677 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
4678 GEN_ERROR("Floating point constant invalid for type");
4679 // Lexer has no type info, so builds all float and double FP constants
4680 // as double. Fix this here. Long double is done right.
4681 if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy)
4682 (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven);
4683 (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal));
4684 delete (yyvsp[(2) - (2)].FPVal);
4690 #line 1872 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4692 if (!UpRefs.empty())
4693 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
4694 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4695 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4696 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4697 GEN_ERROR("invalid cast opcode for cast from '" +
4698 Val->getType()->getDescription() + "' to '" +
4699 DestTy->getDescription() + "'");
4700 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4701 delete (yyvsp[(5) - (6)].TypeVal);
4706 #line 1884 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4708 if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
4709 GEN_ERROR("GetElementPtr requires a pointer operand");
4712 GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(),
4715 GEN_ERROR("Index list invalid for constant getelementptr");
4717 SmallVector<Constant*, 8> IdxVec;
4718 for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i)
4719 if (Constant *C = dyn_cast<Constant>((*(yyvsp[(4) - (5)].ValueList))[i]))
4720 IdxVec.push_back(C);
4722 GEN_ERROR("Indices to constant getelementptr must be constants");
4724 delete (yyvsp[(4) - (5)].ValueList);
4726 (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size());
4732 #line 1906 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4734 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
4735 GEN_ERROR("Select condition must be of boolean type");
4736 if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType())
4737 GEN_ERROR("Select operand types must match");
4738 (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4744 #line 1914 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4746 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4747 GEN_ERROR("Binary operator types must match");
4749 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4754 #line 1920 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4756 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
4757 GEN_ERROR("Logical operator types must match");
4758 if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) {
4759 if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType()) ||
4760 !cast<VectorType>((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger())
4761 GEN_ERROR("Logical operator requires integral operands");
4763 (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4769 #line 1931 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4771 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4772 GEN_ERROR("icmp operand types must match");
4773 (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4778 #line 1936 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4780 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
4781 GEN_ERROR("fcmp operand types must match");
4782 (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal));
4787 #line 1941 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4789 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
4790 GEN_ERROR("Invalid extractelement operands");
4791 (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal));
4797 #line 1947 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4799 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4800 GEN_ERROR("Invalid insertelement operands");
4801 (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4807 #line 1953 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4809 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
4810 GEN_ERROR("Invalid shufflevector operands");
4811 (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal));
4817 #line 1962 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4819 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
4825 #line 1966 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4827 (yyval.ConstVector) = new std::vector<Constant*>();
4828 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
4834 #line 1974 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4835 { (yyval.BoolVal) = false; ;}
4839 #line 1974 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4840 { (yyval.BoolVal) = true; ;}
4844 #line 1977 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4845 { (yyval.BoolVal) = true; ;}
4849 #line 1977 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4850 { (yyval.BoolVal) = false; ;}
4854 #line 1980 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4856 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
4857 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
4859 GlobalValue* Aliasee = dyn_cast<GlobalValue>(V);
4861 GEN_ERROR("Aliases can be created only to global values");
4863 (yyval.ConstVal) = Aliasee;
4865 delete (yyvsp[(1) - (2)].TypeVal);
4870 #line 1992 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4872 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
4873 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
4874 if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy))
4875 GEN_ERROR("invalid cast opcode for cast from '" +
4876 Val->getType()->getDescription() + "' to '" +
4877 DestTy->getDescription() + "'");
4879 (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy);
4881 delete (yyvsp[(5) - (6)].TypeVal);
4886 #line 2013 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4888 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
4889 CurModule.ModuleDone();
4895 #line 2018 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4897 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
4898 CurModule.ModuleDone();
4904 #line 2031 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4905 { CurFun.isDeclare = false; ;}
4909 #line 2031 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4911 CurFun.FunctionDone();
4917 #line 2035 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4918 { CurFun.isDeclare = true; ;}
4922 #line 2035 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4929 #line 2038 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4936 #line 2041 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4938 if (!UpRefs.empty())
4939 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
4940 // Eagerly resolve types. This is not an optimization, this is a
4941 // requirement that is due to the fact that we could have this:
4943 // %list = type { %list * }
4944 // %list = type { %list * } ; repeated type decl
4946 // If types are not resolved eagerly, then the two types will not be
4947 // determined to be the same type!
4949 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal));
4951 if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4953 // If this is a named type that is not a redefinition, add it to the slot
4955 CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal));
4958 delete (yyvsp[(3) - (3)].TypeVal);
4964 #line 2065 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4966 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
4968 if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) {
4970 // If this is a named type that is not a redefinition, add it to the slot
4972 CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType));
4979 #line 2077 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4981 /* "Externally Visible" Linkage */
4982 if ((yyvsp[(5) - (6)].ConstVal) == 0)
4983 GEN_ERROR("Global value initializer is not a constant");
4984 CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage,
4985 (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));
4991 #line 2084 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
4998 #line 2088 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5000 if ((yyvsp[(6) - (7)].ConstVal) == 0)
5001 GEN_ERROR("Global value initializer is not a constant");
5002 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));
5008 #line 2093 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5015 #line 2097 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5017 if (!UpRefs.empty())
5018 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
5019 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));
5021 delete (yyvsp[(6) - (7)].TypeVal);
5026 #line 2103 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5034 #line 2107 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5037 if ((yyvsp[(1) - (5)].StrVal)) {
5038 Name = *(yyvsp[(1) - (5)].StrVal);
5039 delete (yyvsp[(1) - (5)].StrVal);
5042 GEN_ERROR("Alias name cannot be empty");
5044 Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal);
5046 GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name);
5048 GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee,
5049 CurModule.CurrentModule);
5050 GA->setVisibility((yyvsp[(2) - (5)].Visibility));
5051 InsertValue(GA, CurModule.Values);
5054 // If there was a forward reference of this alias, resolve it now.
5058 ID = ValID::createGlobalName(Name);
5060 ID = ValID::createGlobalID(CurModule.Values.size()-1);
5062 if (GlobalValue *FWGV =
5063 CurModule.GetForwardRefForGlobal(GA->getType(), ID)) {
5064 // Replace uses of the fwdref with the actual alias.
5065 FWGV->replaceAllUsesWith(GA);
5066 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(FWGV))
5067 GV->eraseFromParent();
5069 cast<Function>(FWGV)->eraseFromParent();
5078 #line 2147 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5085 #line 2150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5092 #line 2156 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5094 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
5095 if (AsmSoFar.empty())
5096 CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal));
5098 CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal));
5099 delete (yyvsp[(1) - (1)].StrVal);
5105 #line 2166 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5107 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
5108 delete (yyvsp[(3) - (3)].StrVal);
5113 #line 2170 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5115 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
5116 delete (yyvsp[(3) - (3)].StrVal);
5121 #line 2177 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5123 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
5124 delete (yyvsp[(3) - (3)].StrVal);
5130 #line 2182 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5132 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
5133 delete (yyvsp[(1) - (1)].StrVal);
5139 #line 2187 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5146 #line 2196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5148 if (!UpRefs.empty())
5149 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
5150 if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy)
5151 GEN_ERROR("void typed arguments are invalid");
5152 ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal);
5153 (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList);
5154 (yyvsp[(1) - (5)].ArgList)->push_back(E);
5160 #line 2206 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5162 if (!UpRefs.empty())
5163 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
5164 if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy)
5165 GEN_ERROR("void typed arguments are invalid");
5166 ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal);
5167 (yyval.ArgList) = new ArgListType;
5168 (yyval.ArgList)->push_back(E);
5174 #line 2217 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5176 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
5182 #line 2221 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5184 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
5185 struct ArgListEntry E;
5186 E.Ty = new PATypeHolder(Type::VoidTy);
5188 E.Attrs = ParamAttr::None;
5189 (yyval.ArgList)->push_back(E);
5195 #line 2230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5197 (yyval.ArgList) = new ArgListType;
5198 struct ArgListEntry E;
5199 E.Ty = new PATypeHolder(Type::VoidTy);
5201 E.Attrs = ParamAttr::None;
5202 (yyval.ArgList)->push_back(E);
5208 #line 2239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5210 (yyval.ArgList) = 0;
5216 #line 2245 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5218 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
5219 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
5221 // Check the function result for abstractness if this is a define. We should
5222 // have no abstract types at this point
5223 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal)))
5224 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
5226 std::vector<const Type*> ParamTypeList;
5227 ParamAttrsVector Attrs;
5228 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) {
5229 ParamAttrsWithIndex PAWI;
5231 PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs);
5232 Attrs.push_back(PAWI);
5234 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
5236 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
5237 const Type* Ty = I->Ty->get();
5238 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
5239 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
5240 ParamTypeList.push_back(Ty);
5241 if (Ty != Type::VoidTy)
5242 if (I->Attrs != ParamAttr::None) {
5243 ParamAttrsWithIndex PAWI;
5245 PAWI.attrs = I->Attrs;
5246 Attrs.push_back(PAWI);
5251 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
5252 if (isVarArg) ParamTypeList.pop_back();
5254 const ParamAttrsList *PAL = 0;
5256 PAL = ParamAttrsList::get(Attrs);
5258 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
5259 const PointerType *PFT = PointerType::getUnqual(FT);
5260 delete (yyvsp[(2) - (10)].TypeVal);
5263 if (!FunctionName.empty()) {
5264 ID = ValID::createGlobalName((char*)FunctionName.c_str());
5266 ID = ValID::createGlobalID(CurModule.Values.size());
5270 // See if this function was forward referenced. If so, recycle the object.
5271 if (GlobalValue *FWRef = CurModule.GetForwardRefForGlobal(PFT, ID)) {
5272 // Move the function to the end of the list, from whereever it was
5273 // previously inserted.
5274 Fn = cast<Function>(FWRef);
5275 assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
5276 CurModule.CurrentModule->getFunctionList().remove(Fn);
5277 CurModule.CurrentModule->getFunctionList().push_back(Fn);
5278 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
5279 (Fn = CurModule.CurrentModule->getFunction(FunctionName))) {
5280 if (Fn->getFunctionType() != FT ) {
5281 // The existing function doesn't have the same type. This is an overload
5283 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5284 } else if (Fn->getParamAttrs() != PAL) {
5285 // The existing function doesn't have the same parameter attributes.
5286 // This is an overload error.
5287 GEN_ERROR("Overload of function '" + FunctionName + "' not permitted.");
5288 } else if (!CurFun.isDeclare && !Fn->isDeclaration()) {
5289 // Neither the existing or the current function is a declaration and they
5290 // have the same name and same type. Clearly this is a redefinition.
5291 GEN_ERROR("Redefinition of function '" + FunctionName + "'");
5292 } else if (Fn->isDeclaration()) {
5293 // Make sure to strip off any argument names so we can't get conflicts.
5294 for (Function::arg_iterator AI = Fn->arg_begin(), AE = Fn->arg_end();
5298 } else { // Not already defined?
5299 Fn = new Function(FT, GlobalValue::ExternalWeakLinkage, FunctionName,
5300 CurModule.CurrentModule);
5301 InsertValue(Fn, CurModule.Values);
5304 CurFun.FunctionStart(Fn);
5306 if (CurFun.isDeclare) {
5307 // If we have declaration, always overwrite linkage. This will allow us to
5308 // correctly handle cases, when pointer to function is passed as argument to
5309 // another function.
5310 Fn->setLinkage(CurFun.Linkage);
5311 Fn->setVisibility(CurFun.Visibility);
5313 Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal));
5314 Fn->setParamAttrs(PAL);
5315 Fn->setAlignment((yyvsp[(9) - (10)].UIntVal));
5316 if ((yyvsp[(8) - (10)].StrVal)) {
5317 Fn->setSection(*(yyvsp[(8) - (10)].StrVal));
5318 delete (yyvsp[(8) - (10)].StrVal);
5320 if ((yyvsp[(10) - (10)].StrVal)) {
5321 Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str());
5322 delete (yyvsp[(10) - (10)].StrVal);
5325 // Add all of the arguments we parsed to the function...
5326 if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty...
5327 if (isVarArg) { // Nuke the last entry
5328 assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 &&
5329 "Not a varargs marker!");
5330 delete (yyvsp[(5) - (10)].ArgList)->back().Ty;
5331 (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry
5333 Function::arg_iterator ArgIt = Fn->arg_begin();
5334 Function::arg_iterator ArgEnd = Fn->arg_end();
5336 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin();
5337 I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) {
5338 delete I->Ty; // Delete the typeholder...
5339 setValueName(ArgIt, I->Name); // Insert arg into symtab...
5345 delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list
5352 #line 2380 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5354 (yyval.FunctionVal) = CurFun.CurrentFunction;
5356 // Make sure that we keep track of the linkage type even if there was a
5357 // previous "declare".
5358 (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage));
5359 (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility));
5364 #line 2391 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5366 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5372 #line 2396 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5374 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
5375 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
5376 (yyval.FunctionVal) = CurFun.CurrentFunction;
5377 CurFun.FunctionDone();
5383 #line 2408 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5385 (yyval.BoolVal) = false;
5391 #line 2412 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5393 (yyval.BoolVal) = true;
5399 #line 2417 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5400 { // A reference to a direct constant
5401 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
5407 #line 2421 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5409 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
5415 #line 2425 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5416 { // Perhaps it's an FP constant?
5417 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
5423 #line 2429 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5425 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
5431 #line 2433 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5433 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
5439 #line 2437 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5441 (yyval.ValIDVal) = ValID::createNull();
5447 #line 2441 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5449 (yyval.ValIDVal) = ValID::createUndef();
5455 #line 2445 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5456 { // A vector zero constant.
5457 (yyval.ValIDVal) = ValID::createZeroInit();
5463 #line 2449 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5464 { // Nonempty unsized packed vector
5465 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
5466 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
5468 VectorType* pt = VectorType::get(ETy, NumElements);
5469 PATypeHolder* PTy = new PATypeHolder(
5477 // Verify all elements are correct type!
5478 for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) {
5479 if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType())
5480 GEN_ERROR("Element #" + utostr(i) + " is not of type '" +
5481 ETy->getDescription() +"' as required!\nIt is of type '" +
5482 (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'.");
5485 (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector)));
5486 delete PTy; delete (yyvsp[(2) - (3)].ConstVector);
5492 #line 2474 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5494 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
5500 #line 2478 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5502 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
5503 delete (yyvsp[(3) - (5)].StrVal);
5504 delete (yyvsp[(5) - (5)].StrVal);
5510 #line 2488 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5511 { // Is it an integer reference...?
5512 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
5518 #line 2492 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5520 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
5526 #line 2496 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5527 { // Is it a named reference...?
5528 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
5529 delete (yyvsp[(1) - (1)].StrVal);
5535 #line 2501 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5536 { // Is it a named reference...?
5537 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
5538 delete (yyvsp[(1) - (1)].StrVal);
5544 #line 2514 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5546 if (!UpRefs.empty())
5547 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
5548 (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal));
5549 delete (yyvsp[(1) - (2)].TypeVal);
5555 #line 2523 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5557 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5563 #line 2527 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5564 { // Do not allow functions with 0 basic blocks
5565 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
5571 #line 2536 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5573 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
5575 InsertValue((yyvsp[(3) - (3)].TermInstVal));
5576 (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal));
5577 (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal);
5583 #line 2545 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5585 if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
5586 if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
5587 if (CI2->getParent() == 0)
5588 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2);
5589 (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal));
5590 (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal);
5596 #line 2554 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5597 { // Empty space between instruction lists
5598 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum));
5604 #line 2558 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5605 { // Labelled (named) basic block
5606 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)));
5607 delete (yyvsp[(1) - (1)].StrVal);
5614 #line 2565 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5615 { // Return with a result...
5616 (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal));
5622 #line 2569 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5623 { // Return with no result...
5624 (yyval.TermInstVal) = new ReturnInst();
5630 #line 2573 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5631 { // Unconditional Branch...
5632 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
5634 (yyval.TermInstVal) = new BranchInst(tmpBB);
5639 #line 2578 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5641 assert(cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
5642 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5644 BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal));
5646 Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal));
5648 (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal);
5653 #line 2588 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5655 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
5657 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal));
5659 SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size());
5660 (yyval.TermInstVal) = S;
5662 std::vector<std::pair<Constant*,BasicBlock*> >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(),
5663 E = (yyvsp[(8) - (9)].JumpTable)->end();
5664 for (; I != E; ++I) {
5665 if (ConstantInt *CI = dyn_cast<ConstantInt>(I->first))
5666 S->addCase(CI, I->second);
5668 GEN_ERROR("Switch case is constant, but not a simple integer");
5670 delete (yyvsp[(8) - (9)].JumpTable);
5676 #line 2607 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5678 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
5680 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal));
5682 SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0);
5683 (yyval.TermInstVal) = S;
5689 #line 2617 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5692 // Handle the short syntax
5693 const PointerType *PFTy = 0;
5694 const FunctionType *Ty = 0;
5695 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (14)].TypeVal)->get())) ||
5696 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
5697 // Pull out the types of all of the arguments...
5698 std::vector<const Type*> ParamTypes;
5699 ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end();
5700 for (; I != E; ++I) {
5701 const Type *Ty = I->Val->getType();
5702 if (Ty == Type::VoidTy)
5703 GEN_ERROR("Short call syntax cannot be used with varargs");
5704 ParamTypes.push_back(Ty);
5706 Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false);
5707 PFTy = PointerType::getUnqual(Ty);
5710 delete (yyvsp[(3) - (14)].TypeVal);
5712 Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling...
5714 BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal));
5716 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
5719 ParamAttrsVector Attrs;
5720 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) {
5721 ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs);
5722 Attrs.push_back(PAWI);
5725 // Check the arguments
5727 if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments?
5728 // Make sure no arguments is a good thing!
5729 if (Ty->getNumParams() != 0)
5730 GEN_ERROR("No arguments passed to a function that "
5731 "expects arguments");
5732 } else { // Has arguments?
5733 // Loop through FunctionType's arguments and ensure they are specified
5735 FunctionType::param_iterator I = Ty->param_begin();
5736 FunctionType::param_iterator E = Ty->param_end();
5737 ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end();
5740 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
5741 if (ArgI->Val->getType() != *I)
5742 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
5743 (*I)->getDescription() + "'");
5744 Args.push_back(ArgI->Val);
5745 if (ArgI->Attrs != ParamAttr::None) {
5746 ParamAttrsWithIndex PAWI;
5748 PAWI.attrs = ArgI->Attrs;
5749 Attrs.push_back(PAWI);
5753 if (Ty->isVarArg()) {
5755 for (; ArgI != ArgE; ++ArgI, ++index) {
5756 Args.push_back(ArgI->Val); // push the remaining varargs
5757 if (ArgI->Attrs != ParamAttr::None) {
5758 ParamAttrsWithIndex PAWI;
5760 PAWI.attrs = ArgI->Attrs;
5761 Attrs.push_back(PAWI);
5764 } else if (I != E || ArgI != ArgE)
5765 GEN_ERROR("Invalid number of parameters detected");
5768 const ParamAttrsList *PAL = 0;
5770 PAL = ParamAttrsList::get(Attrs);
5772 // Create the InvokeInst
5773 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
5774 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
5775 II->setParamAttrs(PAL);
5776 (yyval.TermInstVal) = II;
5777 delete (yyvsp[(6) - (14)].ParamList);
5783 #line 2707 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5785 (yyval.TermInstVal) = new UnwindInst();
5791 #line 2711 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5793 (yyval.TermInstVal) = new UnreachableInst();
5799 #line 2718 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5801 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
5802 Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
5805 GEN_ERROR("May only switch on a constant pool value");
5807 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal));
5809 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5814 #line 2729 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5816 (yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
5817 Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
5821 GEN_ERROR("May only switch on a constant pool value");
5823 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal));
5825 (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB));
5830 #line 2742 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5832 // Is this definition named?? if so, assign the name...
5833 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
5835 InsertValue((yyvsp[(2) - (2)].InstVal));
5836 (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal);
5842 #line 2752 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5843 { // Used for PHI nodes
5844 if (!UpRefs.empty())
5845 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
5846 (yyval.PHIList) = new std::list<std::pair<Value*, BasicBlock*> >();
5847 Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal));
5849 BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal));
5851 (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
5852 delete (yyvsp[(1) - (6)].TypeVal);
5857 #line 2763 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5859 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
5860 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
5862 BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal));
5864 (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB));
5869 #line 2773 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5871 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5872 if (!UpRefs.empty())
5873 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
5874 // Used for call and invoke instructions
5875 (yyval.ParamList) = new ParamList();
5876 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal));
5877 (yyval.ParamList)->push_back(E);
5878 delete (yyvsp[(1) - (4)].TypeVal);
5884 #line 2784 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5886 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5887 // Labels are only valid in ASMs
5888 (yyval.ParamList) = new ParamList();
5889 ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal));
5890 (yyval.ParamList)->push_back(E);
5896 #line 2792 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5898 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5899 if (!UpRefs.empty())
5900 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
5901 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
5902 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal));
5903 (yyval.ParamList)->push_back(E);
5904 delete (yyvsp[(3) - (6)].TypeVal);
5910 #line 2802 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5912 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
5913 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
5914 ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal));
5915 (yyval.ParamList)->push_back(E);
5921 #line 2809 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5922 { (yyval.ParamList) = new ParamList(); ;}
5926 #line 2812 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5927 { (yyval.ValueList) = new std::vector<Value*>(); ;}
5931 #line 2813 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5933 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
5934 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
5940 #line 2820 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5942 (yyval.BoolVal) = true;
5948 #line 2824 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5950 (yyval.BoolVal) = false;
5956 #line 2829 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5958 if (!UpRefs.empty())
5959 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
5960 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() &&
5961 !isa<VectorType>((*(yyvsp[(2) - (5)].TypeVal)).get()))
5963 "Arithmetic operator requires integer, FP, or packed operands");
5964 Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
5966 Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
5968 (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2);
5969 if ((yyval.InstVal) == 0)
5970 GEN_ERROR("binary operator returned null");
5971 delete (yyvsp[(2) - (5)].TypeVal);
5976 #line 2845 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5978 if (!UpRefs.empty())
5979 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
5980 if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) {
5981 if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa<VectorType>((yyvsp[(2) - (5)].TypeVal)->get()) ||
5982 !cast<VectorType>((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger())
5983 GEN_ERROR("Logical operator requires integral operands");
5985 Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal));
5987 Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal));
5989 (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2);
5990 if ((yyval.InstVal) == 0)
5991 GEN_ERROR("binary operator returned null");
5992 delete (yyvsp[(2) - (5)].TypeVal);
5997 #line 2862 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
5999 if (!UpRefs.empty())
6000 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6001 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6002 GEN_ERROR("Vector types not supported by icmp instruction");
6003 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6005 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6007 (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2);
6008 if ((yyval.InstVal) == 0)
6009 GEN_ERROR("icmp operator returned null");
6010 delete (yyvsp[(3) - (6)].TypeVal);
6015 #line 2876 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6017 if (!UpRefs.empty())
6018 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
6019 if (isa<VectorType>((*(yyvsp[(3) - (6)].TypeVal)).get()))
6020 GEN_ERROR("Vector types not supported by fcmp instruction");
6021 Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal));
6023 Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal));
6025 (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2);
6026 if ((yyval.InstVal) == 0)
6027 GEN_ERROR("fcmp operator returned null");
6028 delete (yyvsp[(3) - (6)].TypeVal);
6033 #line 2890 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6035 if (!UpRefs.empty())
6036 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6037 Value* Val = (yyvsp[(2) - (4)].ValueVal);
6038 const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get();
6039 if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy))
6040 GEN_ERROR("invalid cast opcode for cast from '" +
6041 Val->getType()->getDescription() + "' to '" +
6042 DestTy->getDescription() + "'");
6043 (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy);
6044 delete (yyvsp[(4) - (4)].TypeVal);
6049 #line 2902 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6051 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
6052 GEN_ERROR("select condition must be boolean");
6053 if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType())
6054 GEN_ERROR("select value types should match");
6055 (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6061 #line 2910 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6063 if (!UpRefs.empty())
6064 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
6065 (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal));
6066 delete (yyvsp[(4) - (4)].TypeVal);
6072 #line 2917 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6074 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
6075 GEN_ERROR("Invalid extractelement operands");
6076 (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal));
6082 #line 2923 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6084 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6085 GEN_ERROR("Invalid insertelement operands");
6086 (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6092 #line 2929 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6094 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
6095 GEN_ERROR("Invalid shufflevector operands");
6096 (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal));
6102 #line 2935 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6104 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
6105 if (!Ty->isFirstClassType())
6106 GEN_ERROR("PHI node operands must be of first class type");
6107 (yyval.InstVal) = new PHINode(Ty);
6108 ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size());
6109 while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) {
6110 if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty)
6111 GEN_ERROR("All elements of a PHI node must be of the same type");
6112 cast<PHINode>((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second);
6113 (yyvsp[(2) - (2)].PHIList)->pop_front();
6115 delete (yyvsp[(2) - (2)].PHIList); // Free the list...
6121 #line 2951 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6124 // Handle the short syntax
6125 const PointerType *PFTy = 0;
6126 const FunctionType *Ty = 0;
6127 if (!(PFTy = dyn_cast<PointerType>((yyvsp[(3) - (8)].TypeVal)->get())) ||
6128 !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
6129 // Pull out the types of all of the arguments...
6130 std::vector<const Type*> ParamTypes;
6131 ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end();
6132 for (; I != E; ++I) {
6133 const Type *Ty = I->Val->getType();
6134 if (Ty == Type::VoidTy)
6135 GEN_ERROR("Short call syntax cannot be used with varargs");
6136 ParamTypes.push_back(Ty);
6138 Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false);
6139 PFTy = PointerType::getUnqual(Ty);
6142 Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling...
6145 // Check for call to invalid intrinsic to avoid crashing later.
6146 if (Function *theF = dyn_cast<Function>(V)) {
6147 if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) &&
6148 (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) &&
6149 !theF->getIntrinsicID(true))
6150 GEN_ERROR("Call to invalid LLVM intrinsic function '" +
6151 theF->getName() + "'");
6154 // Set up the ParamAttrs for the function
6155 ParamAttrsVector Attrs;
6156 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) {
6157 ParamAttrsWithIndex PAWI;
6159 PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs);
6160 Attrs.push_back(PAWI);
6162 // Check the arguments
6164 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
6165 // Make sure no arguments is a good thing!
6166 if (Ty->getNumParams() != 0)
6167 GEN_ERROR("No arguments passed to a function that "
6168 "expects arguments");
6169 } else { // Has arguments?
6170 // Loop through FunctionType's arguments and ensure they are specified
6171 // correctly. Also, gather any parameter attributes.
6172 FunctionType::param_iterator I = Ty->param_begin();
6173 FunctionType::param_iterator E = Ty->param_end();
6174 ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end();
6177 for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) {
6178 if (ArgI->Val->getType() != *I)
6179 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
6180 (*I)->getDescription() + "'");
6181 Args.push_back(ArgI->Val);
6182 if (ArgI->Attrs != ParamAttr::None) {
6183 ParamAttrsWithIndex PAWI;
6185 PAWI.attrs = ArgI->Attrs;
6186 Attrs.push_back(PAWI);
6189 if (Ty->isVarArg()) {
6191 for (; ArgI != ArgE; ++ArgI, ++index) {
6192 Args.push_back(ArgI->Val); // push the remaining varargs
6193 if (ArgI->Attrs != ParamAttr::None) {
6194 ParamAttrsWithIndex PAWI;
6196 PAWI.attrs = ArgI->Attrs;
6197 Attrs.push_back(PAWI);
6200 } else if (I != E || ArgI != ArgE)
6201 GEN_ERROR("Invalid number of parameters detected");
6204 // Finish off the ParamAttrs and check them
6205 const ParamAttrsList *PAL = 0;
6207 PAL = ParamAttrsList::get(Attrs);
6209 // Create the call node
6210 CallInst *CI = new CallInst(V, Args.begin(), Args.end());
6211 CI->setTailCall((yyvsp[(1) - (8)].BoolVal));
6212 CI->setCallingConv((yyvsp[(2) - (8)].UIntVal));
6213 CI->setParamAttrs(PAL);
6214 (yyval.InstVal) = CI;
6215 delete (yyvsp[(6) - (8)].ParamList);
6216 delete (yyvsp[(3) - (8)].TypeVal);
6222 #line 3048 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6224 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
6230 #line 3053 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6232 (yyval.BoolVal) = true;
6238 #line 3057 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6240 (yyval.BoolVal) = false;
6246 #line 3064 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6248 if (!UpRefs.empty())
6249 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6250 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6251 delete (yyvsp[(2) - (3)].TypeVal);
6257 #line 3071 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6259 if (!UpRefs.empty())
6260 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6261 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6263 (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6264 delete (yyvsp[(2) - (6)].TypeVal);
6269 #line 3079 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6271 if (!UpRefs.empty())
6272 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
6273 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal));
6274 delete (yyvsp[(2) - (3)].TypeVal);
6280 #line 3086 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6282 if (!UpRefs.empty())
6283 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
6284 Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal));
6286 (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal));
6287 delete (yyvsp[(2) - (6)].TypeVal);
6292 #line 3094 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6294 if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
6295 GEN_ERROR("Trying to free nonpointer type " +
6296 (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + "");
6297 (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal));
6303 #line 3102 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6305 if (!UpRefs.empty())
6306 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6307 if (!isa<PointerType>((yyvsp[(3) - (5)].TypeVal)->get()))
6308 GEN_ERROR("Can't load from nonpointer type: " +
6309 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6310 if (!cast<PointerType>((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType())
6311 GEN_ERROR("Can't load from pointer of non-first-class type: " +
6312 (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
6313 Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal));
6315 (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal));
6316 delete (yyvsp[(3) - (5)].TypeVal);
6321 #line 3116 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6323 if (!UpRefs.empty())
6324 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6325 const PointerType *PT = dyn_cast<PointerType>((yyvsp[(5) - (7)].TypeVal)->get());
6327 GEN_ERROR("Can't store to a nonpointer type: " +
6328 (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
6329 const Type *ElTy = PT->getElementType();
6330 if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType())
6331 GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() +
6332 "' into space of type '" + ElTy->getDescription() + "'");
6334 Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal));
6336 (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal));
6337 delete (yyvsp[(5) - (7)].TypeVal);
6342 #line 3133 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6344 if (!UpRefs.empty())
6345 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
6346 if (!isa<PointerType>((yyvsp[(2) - (4)].TypeVal)->get()))
6347 GEN_ERROR("getelementptr insn requires pointer operand");
6349 if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true))
6350 GEN_ERROR("Invalid getelementptr indices for type '" +
6351 (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'");
6352 Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal));
6354 (yyval.InstVal) = new GetElementPtrInst(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end());
6355 delete (yyvsp[(2) - (4)].TypeVal);
6356 delete (yyvsp[(4) - (4)].ValueList);
6361 /* Line 1267 of yacc.c. */
6362 #line 6363 "llvmAsmParser.tab.c"
6365 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
6369 YY_STACK_PRINT (yyss, yyssp);
6374 /* Now `shift' the result of the reduction. Determine what state
6375 that goes to, based on the state we popped back to and the rule
6376 number reduced by. */
6380 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
6381 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
6382 yystate = yytable[yystate];
6384 yystate = yydefgoto[yyn - YYNTOKENS];
6389 /*------------------------------------.
6390 | yyerrlab -- here on detecting error |
6391 `------------------------------------*/
6393 /* If not already recovering from an error, report this error. */
6397 #if ! YYERROR_VERBOSE
6398 yyerror (YY_("syntax error"));
6401 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
6402 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
6404 YYSIZE_T yyalloc = 2 * yysize;
6405 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
6406 yyalloc = YYSTACK_ALLOC_MAXIMUM;
6407 if (yymsg != yymsgbuf)
6408 YYSTACK_FREE (yymsg);
6409 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
6411 yymsg_alloc = yyalloc;
6415 yymsg_alloc = sizeof yymsgbuf;
6419 if (0 < yysize && yysize <= yymsg_alloc)
6421 (void) yysyntax_error (yymsg, yystate, yychar);
6426 yyerror (YY_("syntax error"));
6428 goto yyexhaustedlab;
6436 if (yyerrstatus == 3)
6438 /* If just tried and failed to reuse look-ahead token after an
6439 error, discard it. */
6441 if (yychar <= YYEOF)
6443 /* Return failure if at end of input. */
6444 if (yychar == YYEOF)
6449 yydestruct ("Error: discarding",
6455 /* Else will try to reuse look-ahead token after shifting the error
6460 /*---------------------------------------------------.
6461 | yyerrorlab -- error raised explicitly by YYERROR. |
6462 `---------------------------------------------------*/
6465 /* Pacify compilers like GCC when the user code never invokes
6466 YYERROR and the label yyerrorlab therefore never appears in user
6468 if (/*CONSTCOND*/ 0)
6471 /* Do not reclaim the symbols of the rule which action triggered
6475 YY_STACK_PRINT (yyss, yyssp);
6480 /*-------------------------------------------------------------.
6481 | yyerrlab1 -- common code for both syntax error and YYERROR. |
6482 `-------------------------------------------------------------*/
6484 yyerrstatus = 3; /* Each real token shifted decrements this. */
6488 yyn = yypact[yystate];
6489 if (yyn != YYPACT_NINF)
6492 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
6500 /* Pop the current state because it cannot handle the error token. */
6505 yydestruct ("Error: popping",
6506 yystos[yystate], yyvsp);
6509 YY_STACK_PRINT (yyss, yyssp);
6518 /* Shift the error token. */
6519 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
6525 /*-------------------------------------.
6526 | yyacceptlab -- YYACCEPT comes here. |
6527 `-------------------------------------*/
6532 /*-----------------------------------.
6533 | yyabortlab -- YYABORT comes here. |
6534 `-----------------------------------*/
6540 /*-------------------------------------------------.
6541 | yyexhaustedlab -- memory exhaustion comes here. |
6542 `-------------------------------------------------*/
6544 yyerror (YY_("memory exhausted"));
6550 if (yychar != YYEOF && yychar != YYEMPTY)
6551 yydestruct ("Cleanup: discarding lookahead",
6553 /* Do not reclaim the symbols of the rule which action triggered
6554 this YYABORT or YYACCEPT. */
6556 YY_STACK_PRINT (yyss, yyssp);
6557 while (yyssp != yyss)
6559 yydestruct ("Cleanup: popping",
6560 yystos[*yyssp], yyvsp);
6565 YYSTACK_FREE (yyss);
6568 if (yymsg != yymsgbuf)
6569 YYSTACK_FREE (yymsg);
6571 /* Make sure YYID is used. */
6572 return YYID (yyresult);
6576 #line 3150 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y"
6579 // common code from the two 'RunVMAsmParser' functions
6580 static Module* RunParser(Module * M) {
6581 CurModule.CurrentModule = M;
6582 // Check to make sure the parser succeeded
6585 delete ParserResult;
6589 // Emit an error if there are any unresolved types left.
6590 if (!CurModule.LateResolveTypes.empty()) {
6591 const ValID &DID = CurModule.LateResolveTypes.begin()->first;
6592 if (DID.Type == ValID::LocalName) {
6593 GenerateError("Undefined type remains at eof: '"+DID.getName() + "'");
6595 GenerateError("Undefined type remains at eof: #" + itostr(DID.Num));
6598 delete ParserResult;
6602 // Emit an error if there are any unresolved values left.
6603 if (!CurModule.LateResolveValues.empty()) {
6604 Value *V = CurModule.LateResolveValues.back();
6605 std::map<Value*, std::pair<ValID, int> >::iterator I =
6606 CurModule.PlaceHolderInfo.find(V);
6608 if (I != CurModule.PlaceHolderInfo.end()) {
6609 ValID &DID = I->second.first;
6610 if (DID.Type == ValID::LocalName) {
6611 GenerateError("Undefined value remains at eof: "+DID.getName() + "'");
6613 GenerateError("Undefined value remains at eof: #" + itostr(DID.Num));
6616 delete ParserResult;
6621 // Check to make sure that parsing produced a result
6625 // Reset ParserResult variable while saving its value for the result.
6626 Module *Result = ParserResult;
6632 void llvm::GenerateError(const std::string &message, int LineNo) {
6633 if (LineNo == -1) LineNo = LLLgetLineNo();
6634 // TODO: column number in exception
6636 TheParseError->setError(LLLgetFilename(), message, LineNo);
6640 int yyerror(const char *ErrorMsg) {
6641 std::string where = LLLgetFilename() + ":" + utostr(LLLgetLineNo()) + ": ";
6642 std::string errMsg = where + "error: " + std::string(ErrorMsg);
6643 if (yychar != YYEMPTY && yychar != 0) {
6644 errMsg += " while reading token: '";
6645 errMsg += std::string(LLLgetTokenStart(),
6646 LLLgetTokenStart()+LLLgetTokenLength()) + "'";
6648 GenerateError(errMsg);