From ac5c3382feeb2dd03c55b713f4aee6a4acee5884 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Sat, 31 May 2008 00:58:22 +0000 Subject: [PATCH] IR, bitcode reader, bitcode writer, and asmparser changes to insertvalue and extractvalue to use constant indices instead of Value* indices. And begin updating LangRef.html. There's definately more to come here, but I'm checking this basic support in now to make it available to people who are interested. llvm-svn: 51806 --- docs/LangRef.html | 10 +- include/llvm/Constants.h | 17 +- include/llvm/DerivedTypes.h | 12 +- include/llvm/Instructions.h | 168 +-- lib/AsmParser/llvmAsmParser.cpp.cvs | 1999 +++++++++++++------------- lib/AsmParser/llvmAsmParser.h.cvs | 5 +- lib/AsmParser/llvmAsmParser.y | 56 +- lib/AsmParser/llvmAsmParser.y.cvs | 86 +- lib/Bitcode/Reader/BitcodeReader.cpp | 84 +- lib/Bitcode/Writer/BitcodeWriter.cpp | 26 +- lib/VMCore/Constants.cpp | 216 ++- lib/VMCore/Instructions.cpp | 90 +- lib/VMCore/Type.cpp | 12 +- test/Assembler/insertextractvalue.ll | 20 +- 14 files changed, 1424 insertions(+), 1377 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 25b9e026a26..eba4e5af40d 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2918,7 +2918,7 @@ or array element from an aggregate value. The first operand of an 'extractvalue' instruction is a value of struct or array type. The operands are constant indices to specify which value to extract -in the same manner as indices in a +in a similar manner as indices in a 'getelementptr' instruction.

@@ -2932,7 +2932,7 @@ the index operands.
Example:
-  %result = extractvalue {i32, float} %agg, i32 0    ; yields i32
+  %result = extractvalue {i32, float} %agg, 0    ; yields i32
 
@@ -2947,7 +2947,7 @@ the index operands.
Syntax:
-  <result> = insertvalue <aggregate type> <val>, <ty> <val>, i32 <idx>    ; yields <n x <ty>>
+  <result> = insertvalue <aggregate type> <val>, <ty> <val>, <idx>    ; yields <n x <ty>>
 
Overview:
@@ -2965,7 +2965,7 @@ The first operand of an 'insertvalue' instruction is a value of struct or array type. The second operand is a first-class value to insert. The following operands are constant indices -indicating the position at which to insert the value in the same manner as +indicating the position at which to insert the value in a similar manner as indices in a 'getelementptr' instruction. The value to insert must have the same type as the value identified @@ -2982,7 +2982,7 @@ specified by the indices is that of elt.
Example:
-  %result = insertvalue {i32, float} %agg, i32 1, i32 0    ; yields {i32, float}
+  %result = insertvalue {i32, float} %agg, 1, 0    ; yields {i32, float}
 
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 48edac63b87..5d85ee23e7c 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -25,6 +25,7 @@ #include "llvm/OperandTraits.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APFloat.h" +#include "llvm/ADT/SmallVector.h" namespace llvm { @@ -576,10 +577,10 @@ protected: static Constant *getShuffleVectorTy(const Type *Ty, Constant *V1, Constant *V2, Constant *Mask); static Constant *getExtractValueTy(const Type *Ty, Constant *Agg, - Constant * const *Idxs, unsigned NumIdxs); + const unsigned *Idxs, unsigned NumIdxs); static Constant *getInsertValueTy(const Type *Ty, Constant *Agg, Constant *Val, - Constant * const *Idxs, unsigned NumIdxs); + const unsigned *Idxs, unsigned NumIdxs); public: // Static methods to construct a ConstantExpr of different kinds. Note that @@ -656,6 +657,10 @@ public: /// @brief Return true if this is a compare constant expression bool isCompare() const; + /// @brief Return true if this is an insertvalue or extractvalue expression, + /// and the getIndices() method may be used. + bool hasIndices() const; + /// Select constant expr /// static Constant *getSelect(Constant *C, Constant *V1, Constant *V2) { @@ -712,9 +717,9 @@ public: static Constant *getInsertElement(Constant *Vec, Constant *Elt,Constant *Idx); static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask); static Constant *getExtractValue(Constant *Agg, - Constant* const *IdxList, unsigned NumIdx); + const unsigned *IdxList, unsigned NumIdx); static Constant *getInsertValue(Constant *Agg, Constant *Val, - Constant* const *IdxList, unsigned NumIdx); + const unsigned *IdxList, unsigned NumIdx); /// Floating point negation must be implemented with f(x) = -0.0 - x. This /// method returns the negative zero constant for floating point or vector @@ -732,6 +737,10 @@ public: /// not an ICMP or FCMP constant expression. unsigned getPredicate() const; + /// getIndices - Assert that this is an insertvalue or exactvalue + /// expression and return the list of indices. + const SmallVector &getIndices() const; + /// getOpcodeName - Return a string representation for an opcode. const char *getOpcodeName() const; diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index d20085ead75..4537400618b 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -197,7 +197,9 @@ public: /// the element. /// virtual const Type *getTypeAtIndex(const Value *V) const = 0; + virtual const Type *getTypeAtIndex(unsigned Idx) const = 0; virtual bool indexValid(const Value *V) const = 0; + virtual bool indexValid(unsigned Idx) const = 0; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const CompositeType *) { return true; } @@ -245,8 +247,10 @@ public: /// getTypeAtIndex - Given an index value into the type, return the type of /// the element. For a structure type, this must be a constant value... /// - virtual const Type *getTypeAtIndex(const Value *V) const ; + virtual const Type *getTypeAtIndex(const Value *V) const; + virtual const Type *getTypeAtIndex(unsigned Idx) const; virtual bool indexValid(const Value *V) const; + virtual bool indexValid(unsigned Idx) const; // Implement the AbstractTypeUser interface. virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy); @@ -288,6 +292,9 @@ public: inline const Type *getElementType() const { return ContainedTys[0]; } virtual bool indexValid(const Value *V) const; + virtual bool indexValid(unsigned Idx) const { + return true; + } /// getTypeAtIndex - Given an index value into the type, return the type of /// the element. For sequential types, there is only one subtype... @@ -295,6 +302,9 @@ public: virtual const Type *getTypeAtIndex(const Value *) const { return ContainedTys[0]; } + virtual const Type *getTypeAtIndex(unsigned Idx) const { + return ContainedTys[0]; + } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const SequentialType *) { return true; } diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 9a396aa83ef..fc06b8cb762 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -22,6 +22,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/ParameterAttributes.h" #include "llvm/BasicBlock.h" +#include "llvm/ADT/SmallVector.h" namespace llvm { @@ -1518,9 +1519,11 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorInst, Value) /// element value from an aggregate value. /// class ExtractValueInst : public Instruction { + SmallVector Indices; + ExtractValueInst(const ExtractValueInst &EVI); - void init(Value *Agg, Value* const *Idx, unsigned NumIdx); - void init(Value *Agg, Value *Idx); + void init(Value *Agg, const unsigned *Idx, unsigned NumIdx); + void init(Value *Agg, unsigned Idx); template void init(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, @@ -1530,14 +1533,15 @@ class ExtractValueInst : public Instruction { std::random_access_iterator_tag) { unsigned NumIdx = static_cast(std::distance(IdxBegin, IdxEnd)); - if (NumIdx > 0) { - // This requires that the iterator points to contiguous memory. - init(Agg, &*IdxBegin, NumIdx); // FIXME: for the general case - // we have to build an array here - } - else { - init(Agg, 0, NumIdx); - } + // There's no fundamental reason why we require at least one index + // (other than weirdness with &*IdxBegin being invalid; see + // getelementptr's init routine for example). But there's no + // present need to support it. + assert(NumIdx > 0 && "ExtractValueInst must have at least one index"); + + // This requires that the iterator points to contiguous memory. + init(Agg, &*IdxBegin, NumIdx); // FIXME: for the general case + // we have to build an array here setName(Name); } @@ -1549,7 +1553,7 @@ class ExtractValueInst : public Instruction { /// pointer type. /// static const Type *getIndexedType(const Type *Agg, - Value* const *Idx, unsigned NumIdx); + const unsigned *Idx, unsigned NumIdx); template static const Type *getIndexedType(const Type *Ptr, @@ -1563,9 +1567,9 @@ class ExtractValueInst : public Instruction { if (NumIdx > 0) // This requires that the iterator points to contiguous memory. - return getIndexedType(Ptr, (Value *const *)&*IdxBegin, NumIdx); + return getIndexedType(Ptr, (const unsigned *)&*IdxBegin, NumIdx); else - return getIndexedType(Ptr, (Value *const*)0, NumIdx); + return getIndexedType(Ptr, (const unsigned *)0, NumIdx); } /// Constructors - Create a extractvalue instruction with a base aggregate @@ -1575,55 +1579,53 @@ class ExtractValueInst : public Instruction { template inline ExtractValueInst(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, Instruction *InsertBefore); template inline ExtractValueInst(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, BasicBlock *InsertAtEnd); /// Constructors - These two constructors are convenience methods because one /// and two index extractvalue instructions are so common. - ExtractValueInst(Value *Agg, Value *Idx, const std::string &Name = "", + ExtractValueInst(Value *Agg, unsigned Idx, const std::string &Name = "", Instruction *InsertBefore = 0); - ExtractValueInst(Value *Agg, Value *Idx, + ExtractValueInst(Value *Agg, unsigned Idx, const std::string &Name, BasicBlock *InsertAtEnd); public: + // allocate space for exactly two operands + void *operator new(size_t s) { + return User::operator new(s, 1); + } + template static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name = "", Instruction *InsertBefore = 0) { - typename std::iterator_traits::difference_type Values = - 1 + std::distance(IdxBegin, IdxEnd); - return new(Values) - ExtractValueInst(Agg, IdxBegin, IdxEnd, Values, Name, InsertBefore); + return new + ExtractValueInst(Agg, IdxBegin, IdxEnd, Name, InsertBefore); } template static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name, BasicBlock *InsertAtEnd) { - typename std::iterator_traits::difference_type Values = - 1 + std::distance(IdxBegin, IdxEnd); - return new(Values) - ExtractValueInst(Agg, IdxBegin, IdxEnd, Values, Name, InsertAtEnd); + return new ExtractValueInst(Agg, IdxBegin, IdxEnd, Name, InsertAtEnd); } /// Constructors - These two creators are convenience methods because one /// index extractvalue instructions are much more common than those with /// more than one. - static ExtractValueInst *Create(Value *Agg, Value *Idx, + static ExtractValueInst *Create(Value *Agg, unsigned Idx, const std::string &Name = "", Instruction *InsertBefore = 0) { - return new(2) ExtractValueInst(Agg, Idx, Name, InsertBefore); + return new ExtractValueInst(Agg, Idx, Name, InsertBefore); } - static ExtractValueInst *Create(Value *Agg, Value *Idx, + static ExtractValueInst *Create(Value *Agg, unsigned Idx, const std::string &Name, BasicBlock *InsertAtEnd) { - return new(2) ExtractValueInst(Agg, Idx, Name, InsertAtEnd); + return new ExtractValueInst(Agg, Idx, Name, InsertAtEnd); } virtual ExtractValueInst *clone() const; @@ -1650,7 +1652,7 @@ public: typename std::iterator_traits:: iterator_category()); } - static const Type *getIndexedType(const Type *Ptr, Value *Idx); + static const Type *getIndexedType(const Type *Ptr, unsigned Idx); inline op_iterator idx_begin() { return op_begin()+1; } inline const_op_iterator idx_begin() const { return op_begin()+1; } @@ -1686,20 +1688,19 @@ public: }; template <> -struct OperandTraits : VariadicOperandTraits<1> { +struct OperandTraits : FixedNumOperandTraits<1> { }; template ExtractValueInst::ExtractValueInst(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, Instruction *InsertBefore) : Instruction(checkType(getIndexedType(Agg->getType(), IdxBegin, IdxEnd)), ExtractValue, - OperandTraits::op_end(this) - Values, - Values, InsertBefore) { + OperandTraits::op_begin(this), + 1, InsertBefore) { init(Agg, IdxBegin, IdxEnd, Name, typename std::iterator_traits::iterator_category()); } @@ -1707,17 +1708,12 @@ template ExtractValueInst::ExtractValueInst(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, BasicBlock *InsertAtEnd) - : Instruction(PointerType::get(checkType( - getIndexedType(Agg->getType(), - IdxBegin, IdxEnd)), - cast(Agg->getType()) - ->getAddressSpace()), + : Instruction(checkType(getIndexedType(Agg->getType(), IdxBegin, IdxEnd)), ExtractValue, - OperandTraits::op_end(this) - Values, - Values, InsertAtEnd) { + OperandTraits::op_begin(this), + 1, InsertAtEnd) { init(Agg, IdxBegin, IdxEnd, Name, typename std::iterator_traits::iterator_category()); } @@ -1733,9 +1729,12 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueInst, Value) /// value into an aggregate value. /// class InsertValueInst : public Instruction { + SmallVector Indices; + + void *operator new(size_t, unsigned); // Do not implement InsertValueInst(const InsertValueInst &IVI); - void init(Value *Agg, Value *Val, Value* const *Idx, unsigned NumIdx); - void init(Value *Agg, Value *Val, Value *Idx); + void init(Value *Agg, Value *Val, const unsigned *Idx, unsigned NumIdx); + void init(Value *Agg, Value *Val, unsigned Idx); template void init(Value *Agg, Value *Val, @@ -1746,14 +1745,15 @@ class InsertValueInst : public Instruction { std::random_access_iterator_tag) { unsigned NumIdx = static_cast(std::distance(IdxBegin, IdxEnd)); - if (NumIdx > 0) { - // This requires that the iterator points to contiguous memory. - init(Agg, Val, &*IdxBegin, NumIdx); // FIXME: for the general case - // we have to build an array here - } - else { - init(Agg, Val, 0, NumIdx); - } + // There's no fundamental reason why we require at least one index + // (other than weirdness with &*IdxBegin being invalid; see + // getelementptr's init routine for example). But there's no + // present need to support it. + assert(NumIdx > 0 && "InsertValueInst must have at least one index"); + + // This requires that the iterator points to contiguous memory. + init(Agg, Val, &*IdxBegin, NumIdx); // FIXME: for the general case + // we have to build an array here setName(Name); } @@ -1765,56 +1765,55 @@ class InsertValueInst : public Instruction { template inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, Instruction *InsertBefore); template inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, BasicBlock *InsertAtEnd); /// Constructors - These two constructors are convenience methods because one /// and two index insertvalue instructions are so common. InsertValueInst(Value *Agg, Value *Val, - Value *Idx, const std::string &Name = "", + unsigned Idx, const std::string &Name = "", Instruction *InsertBefore = 0); - InsertValueInst(Value *Agg, Value *Val, Value *Idx, + InsertValueInst(Value *Agg, Value *Val, unsigned Idx, const std::string &Name, BasicBlock *InsertAtEnd); public: + // allocate space for exactly two operands + void *operator new(size_t s) { + return User::operator new(s, 2); + } + template static InsertValueInst *Create(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name = "", Instruction *InsertBefore = 0) { - typename std::iterator_traits::difference_type Values = - 1 + std::distance(IdxBegin, IdxEnd); - return new(Values) - InsertValueInst(Agg, Val, IdxBegin, IdxEnd, Values, Name, InsertBefore); + return new InsertValueInst(Agg, Val, IdxBegin, IdxEnd, + Name, InsertBefore); } template static InsertValueInst *Create(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name, BasicBlock *InsertAtEnd) { - typename std::iterator_traits::difference_type Values = - 1 + std::distance(IdxBegin, IdxEnd); - return new(Values) - InsertValueInst(Agg, Val, IdxBegin, IdxEnd, Values, Name, InsertAtEnd); + return new InsertValueInst(Agg, Val, IdxBegin, IdxEnd, + Name, InsertAtEnd); } /// Constructors - These two creators are convenience methods because one /// index insertvalue instructions are much more common than those with /// more than one. - static InsertValueInst *Create(Value *Agg, Value *Val, Value *Idx, + static InsertValueInst *Create(Value *Agg, Value *Val, unsigned Idx, const std::string &Name = "", Instruction *InsertBefore = 0) { - return new(3) InsertValueInst(Agg, Val, Idx, Name, InsertBefore); + return new InsertValueInst(Agg, Val, Idx, Name, InsertBefore); } - static InsertValueInst *Create(Value *Agg, Value *Val, Value *Idx, + static InsertValueInst *Create(Value *Agg, Value *Val, unsigned Idx, const std::string &Name, BasicBlock *InsertAtEnd) { - return new(3) InsertValueInst(Agg, Val, Idx, Name, InsertAtEnd); + return new InsertValueInst(Agg, Val, Idx, Name, InsertAtEnd); } virtual InsertValueInst *clone() const; @@ -1827,10 +1826,10 @@ public: return reinterpret_cast(Instruction::getType()); } - inline op_iterator idx_begin() { return op_begin()+1; } - inline const_op_iterator idx_begin() const { return op_begin()+1; } - inline op_iterator idx_end() { return op_end(); } - inline const_op_iterator idx_end() const { return op_end(); } + inline unsigned *idx_begin() { return Indices.begin(); } + inline const unsigned *idx_begin() const { return Indices.begin(); } + inline unsigned *idx_end() { return Indices.end(); } + inline const unsigned *idx_end() const { return Indices.end(); } Value *getAggregateOperand() { return getOperand(0); @@ -1871,7 +1870,7 @@ public: }; template <> -struct OperandTraits : VariadicOperandTraits<2> { +struct OperandTraits : FixedNumOperandTraits<2> { }; template @@ -1879,15 +1878,11 @@ InsertValueInst::InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, Instruction *InsertBefore) - : Instruction(checkType(ExtractValueInst::getIndexedType( - Agg->getType(), - IdxBegin, IdxEnd)), - InsertValue, - OperandTraits::op_end(this) - Values, - Values, InsertBefore) { + : Instruction(Agg->getType(), InsertValue, + OperandTraits::op_begin(this), + 2, InsertBefore) { init(Agg, Val, IdxBegin, IdxEnd, Name, typename std::iterator_traits::iterator_category()); } @@ -1896,18 +1891,11 @@ InsertValueInst::InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, BasicBlock *InsertAtEnd) - : Instruction(PointerType::get(checkType( - ExtractValueInst::getIndexedType( - Val->getType(), - IdxBegin, IdxEnd)), - cast(Val->getType()) - ->getAddressSpace()), - InsertValue, - OperandTraits::op_end(this) - Values, - Values, InsertAtEnd) { + : Instruction(Agg->getType(), InsertValue, + OperandTraits::op_begin(this), + 2, InsertAtEnd) { init(Agg, Val, IdxBegin, IdxEnd, Name, typename std::iterator_traits::iterator_category()); } diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index 78bd21881dd..c4dd86be980 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -1109,6 +1109,10 @@ ParseGlobalVariable(std::string *NameStr, GenerateError("Cannot declare global vars of function type"); return 0; } + if (Ty == Type::LabelTy) { + GenerateError("Cannot declare global vars of label type"); + return 0; + } const PointerType *PTy = PointerType::get(Ty, AddressSpace); @@ -1344,7 +1348,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) { #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 949 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1358,6 +1362,7 @@ typedef union YYSTYPE llvm::PATypeHolder *TypeVal; llvm::Value *ValueVal; std::vector *ValueList; + std::vector *ConstantList; llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; @@ -1392,7 +1397,7 @@ typedef union YYSTYPE llvm::FCmpInst::Predicate FPredicate; } /* Line 193 of yacc.c. */ -#line 1396 "llvmAsmParser.tab.c" +#line 1401 "llvmAsmParser.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -1405,7 +1410,7 @@ typedef union YYSTYPE /* Line 216 of yacc.c. */ -#line 1409 "llvmAsmParser.tab.c" +#line 1414 "llvmAsmParser.tab.c" #ifdef short # undef short @@ -1620,16 +1625,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 44 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2144 +#define YYLAST 2191 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 170 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 85 +#define YYNNTS 86 /* YYNRULES -- Number of rules. */ -#define YYNRULES 331 +#define YYNRULES 333 /* YYNRULES -- Number of states. */ -#define YYNSTATES 679 +#define YYNSTATES 683 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -1720,10 +1725,10 @@ static const yytype_uint16 yyprhs[] = 766, 768, 770, 773, 775, 779, 782, 785, 789, 792, 793, 795, 798, 801, 805, 815, 825, 834, 849, 851, 853, 860, 866, 869, 876, 884, 889, 894, 901, 908, - 909, 910, 914, 917, 919, 925, 931, 938, 945, 952, - 959, 964, 971, 976, 981, 988, 995, 998, 1007, 1009, - 1011, 1012, 1016, 1023, 1027, 1034, 1037, 1043, 1051, 1057, - 1062, 1067 + 909, 910, 914, 917, 921, 924, 926, 932, 938, 945, + 952, 959, 966, 971, 978, 983, 988, 995, 1002, 1005, + 1014, 1016, 1018, 1019, 1023, 1030, 1034, 1041, 1044, 1050, + 1058, 1064, 1069, 1074 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -1783,8 +1788,8 @@ static const yytype_int16 yyrhs[] = -1, 93, 175, 156, 210, 159, 210, 157, -1, 135, 156, 210, 159, 210, 157, -1, 136, 156, 210, 159, 210, 159, 210, 157, -1, 137, 156, 210, 159, 210, - 159, 210, 157, -1, 139, 156, 210, 250, 157, -1, - 140, 156, 210, 159, 210, 250, 157, -1, 212, 159, + 159, 210, 157, -1, 139, 156, 210, 251, 157, -1, + 140, 156, 210, 159, 210, 251, 157, -1, 212, 159, 210, -1, 210, -1, 32, -1, 33, -1, 37, -1, -1, 206, 238, -1, 125, 156, 215, 38, 204, 157, -1, 217, -1, -1, 218, -1, 217, 218, -1, -1, @@ -1815,67 +1820,68 @@ static const yytype_int16 yyrhs[] = 239, 162, 164, -1, 72, 191, 206, 239, 156, 249, 157, 195, 38, 17, 239, 73, 17, 239, -1, 73, -1, 74, -1, 246, 176, 237, 159, 17, 239, -1, - 176, 237, 159, 17, 239, -1, 181, 252, -1, 204, + 176, 237, 159, 17, 239, -1, 181, 253, -1, 204, 162, 239, 159, 239, 164, -1, 248, 159, 162, 239, 159, 239, 164, -1, 204, 193, 239, 193, -1, 17, 193, 239, 193, -1, 249, 159, 204, 193, 239, 193, -1, 249, 159, 17, 193, 239, 193, -1, -1, -1, - 250, 159, 240, -1, 58, 57, -1, 57, -1, 171, - 204, 239, 159, 239, -1, 172, 204, 239, 159, 239, - -1, 90, 174, 204, 239, 159, 239, -1, 91, 175, - 204, 239, 159, 239, -1, 92, 174, 204, 239, 159, - 239, -1, 93, 175, 204, 239, 159, 239, -1, 173, - 240, 38, 204, -1, 133, 240, 159, 240, 159, 240, - -1, 134, 240, 159, 204, -1, 135, 240, 159, 240, - -1, 136, 240, 159, 240, 159, 240, -1, 137, 240, - 159, 240, 159, 240, -1, 132, 248, -1, 251, 191, - 206, 239, 156, 249, 157, 195, -1, 254, -1, 36, - -1, -1, 114, 204, 198, -1, 114, 204, 159, 11, - 239, 198, -1, 115, 204, 198, -1, 115, 204, 159, - 11, 239, 198, -1, 116, 240, -1, 253, 117, 204, - 239, 198, -1, 253, 118, 240, 159, 204, 239, 198, - -1, 138, 204, 239, 159, 4, -1, 119, 204, 239, - 250, -1, 139, 204, 239, 250, -1, 140, 204, 239, - 159, 204, 239, 250, -1 + 250, 159, 240, -1, 159, 4, -1, 251, 159, 4, + -1, 58, 57, -1, 57, -1, 171, 204, 239, 159, + 239, -1, 172, 204, 239, 159, 239, -1, 90, 174, + 204, 239, 159, 239, -1, 91, 175, 204, 239, 159, + 239, -1, 92, 174, 204, 239, 159, 239, -1, 93, + 175, 204, 239, 159, 239, -1, 173, 240, 38, 204, + -1, 133, 240, 159, 240, 159, 240, -1, 134, 240, + 159, 204, -1, 135, 240, 159, 240, -1, 136, 240, + 159, 240, 159, 240, -1, 137, 240, 159, 240, 159, + 240, -1, 132, 248, -1, 252, 191, 206, 239, 156, + 249, 157, 195, -1, 255, -1, 36, -1, -1, 114, + 204, 198, -1, 114, 204, 159, 11, 239, 198, -1, + 115, 204, 198, -1, 115, 204, 159, 11, 239, 198, + -1, 116, 240, -1, 254, 117, 204, 239, 198, -1, + 254, 118, 240, 159, 204, 239, 198, -1, 138, 204, + 239, 159, 4, -1, 119, 204, 239, 250, -1, 139, + 204, 239, 251, -1, 140, 204, 239, 159, 204, 239, + 251, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, - 1112, 1113, 1113, 1113, 1113, 1113, 1113, 1114, 1114, 1114, - 1114, 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1115, 1118, - 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1126, - 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, - 1131, 1132, 1132, 1133, 1134, 1139, 1140, 1140, 1140, 1140, - 1140, 1142, 1142, 1142, 1143, 1143, 1145, 1146, 1150, 1154, - 1159, 1159, 1161, 1162, 1167, 1173, 1174, 1175, 1176, 1177, - 1178, 1182, 1183, 1184, 1188, 1189, 1190, 1191, 1195, 1196, - 1197, 1201, 1202, 1203, 1204, 1205, 1209, 1210, 1211, 1214, - 1215, 1216, 1217, 1218, 1219, 1220, 1227, 1228, 1229, 1230, - 1231, 1232, 1233, 1234, 1235, 1236, 1240, 1241, 1246, 1247, - 1248, 1249, 1250, 1251, 1254, 1255, 1260, 1261, 1268, 1269, - 1275, 1276, 1285, 1293, 1294, 1299, 1300, 1301, 1306, 1319, - 1319, 1319, 1319, 1319, 1319, 1319, 1322, 1326, 1330, 1337, - 1342, 1350, 1379, 1404, 1409, 1419, 1429, 1433, 1443, 1450, - 1459, 1466, 1471, 1476, 1483, 1484, 1491, 1498, 1506, 1512, - 1524, 1552, 1568, 1595, 1623, 1649, 1669, 1695, 1715, 1727, - 1734, 1800, 1810, 1820, 1826, 1836, 1842, 1852, 1857, 1862, - 1875, 1887, 1908, 1916, 1922, 1933, 1938, 1943, 1948, 1953, - 1959, 1965, 1971, 1992, 2016, 2020, 2028, 2028, 2031, 2031, - 2034, 2046, 2067, 2072, 2080, 2081, 2085, 2085, 2089, 2089, - 2092, 2095, 2119, 2131, 2130, 2142, 2141, 2151, 2150, 2161, - 2201, 2204, 2210, 2220, 2224, 2229, 2231, 2236, 2241, 2250, - 2260, 2271, 2275, 2284, 2293, 2298, 2427, 2427, 2429, 2438, - 2438, 2440, 2445, 2457, 2461, 2466, 2470, 2474, 2478, 2482, - 2486, 2490, 2494, 2498, 2523, 2527, 2537, 2541, 2545, 2550, - 2557, 2557, 2563, 2572, 2577, 2582, 2586, 2595, 2604, 2613, - 2617, 2625, 2632, 2636, 2641, 2651, 2670, 2679, 2765, 2769, - 2776, 2787, 2800, 2810, 2821, 2831, 2842, 2850, 2860, 2867, - 2870, 2871, 2878, 2882, 2887, 2903, 2920, 2934, 2948, 2962, - 2976, 2988, 2996, 3003, 3009, 3015, 3021, 3036, 3126, 3131, - 3135, 3142, 3149, 3157, 3164, 3172, 3180, 3194, 3211, 3219, - 3234, 3249 + 0, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, + 1118, 1119, 1119, 1119, 1119, 1119, 1119, 1120, 1120, 1120, + 1120, 1120, 1120, 1121, 1121, 1121, 1121, 1121, 1121, 1124, + 1124, 1125, 1125, 1126, 1126, 1127, 1127, 1128, 1128, 1132, + 1132, 1133, 1133, 1134, 1134, 1135, 1135, 1136, 1136, 1137, + 1137, 1138, 1138, 1139, 1140, 1145, 1146, 1146, 1146, 1146, + 1146, 1148, 1148, 1148, 1149, 1149, 1151, 1152, 1156, 1160, + 1165, 1165, 1167, 1168, 1173, 1179, 1180, 1181, 1182, 1183, + 1184, 1188, 1189, 1190, 1194, 1195, 1196, 1197, 1201, 1202, + 1203, 1207, 1208, 1209, 1210, 1211, 1215, 1216, 1217, 1220, + 1221, 1222, 1223, 1224, 1225, 1226, 1233, 1234, 1235, 1236, + 1237, 1238, 1239, 1240, 1241, 1242, 1246, 1247, 1252, 1253, + 1254, 1255, 1256, 1257, 1260, 1261, 1266, 1267, 1274, 1275, + 1281, 1282, 1291, 1299, 1300, 1305, 1306, 1307, 1312, 1325, + 1325, 1325, 1325, 1325, 1325, 1325, 1328, 1332, 1336, 1343, + 1348, 1356, 1385, 1410, 1415, 1425, 1435, 1439, 1449, 1456, + 1465, 1472, 1477, 1482, 1489, 1490, 1497, 1504, 1512, 1518, + 1530, 1558, 1574, 1601, 1629, 1655, 1675, 1701, 1721, 1733, + 1740, 1806, 1816, 1826, 1832, 1842, 1848, 1858, 1864, 1870, + 1883, 1895, 1916, 1924, 1930, 1941, 1946, 1951, 1956, 1961, + 1967, 1973, 1979, 1987, 1998, 2002, 2010, 2010, 2013, 2013, + 2016, 2028, 2049, 2054, 2062, 2063, 2067, 2067, 2071, 2071, + 2074, 2077, 2101, 2113, 2112, 2124, 2123, 2133, 2132, 2143, + 2183, 2186, 2192, 2202, 2206, 2211, 2213, 2218, 2223, 2232, + 2242, 2253, 2257, 2266, 2275, 2280, 2409, 2409, 2411, 2420, + 2420, 2422, 2427, 2439, 2443, 2448, 2452, 2456, 2460, 2464, + 2468, 2472, 2476, 2480, 2508, 2512, 2522, 2526, 2530, 2535, + 2542, 2542, 2548, 2557, 2562, 2567, 2571, 2580, 2589, 2598, + 2602, 2610, 2617, 2621, 2626, 2637, 2656, 2665, 2751, 2755, + 2762, 2773, 2786, 2796, 2807, 2817, 2828, 2836, 2846, 2853, + 2856, 2857, 2865, 2871, 2880, 2884, 2889, 2905, 2922, 2936, + 2950, 2964, 2978, 2990, 2998, 3005, 3011, 3017, 3023, 3038, + 3128, 3133, 3137, 3144, 3151, 3161, 3168, 3178, 3186, 3200, + 3217, 3225, 3240, 3255 }; #endif @@ -1926,8 +1932,9 @@ static const char *const yytname[] = "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", "ReturnedVal", "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", - "JumpTable", "Inst", "PHIList", "ParamList", "IndexList", "OptTailCall", - "InstVal", "OptVolatile", "MemoryInst", 0 + "JumpTable", "Inst", "PHIList", "ParamList", "IndexList", + "ConstantIndexList", "OptTailCall", "InstVal", "OptVolatile", + "MemoryInst", 0 }; #endif @@ -1989,10 +1996,10 @@ static const yytype_uint8 yyr1[] = 239, 239, 240, 241, 241, 242, 242, 243, 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, 246, 247, 248, 248, 249, 249, 249, 249, 249, - 250, 250, 251, 251, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 253, - 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, - 254, 254 + 250, 250, 251, 251, 252, 252, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 254, 254, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -2028,10 +2035,10 @@ static const yytype_uint8 yyr2[] = 1, 1, 2, 1, 3, 2, 2, 3, 2, 0, 1, 2, 2, 3, 9, 9, 8, 14, 1, 1, 6, 5, 2, 6, 7, 4, 4, 6, 6, 0, - 0, 3, 2, 1, 5, 5, 6, 6, 6, 6, - 4, 6, 4, 4, 6, 6, 2, 8, 1, 1, - 0, 3, 6, 3, 6, 2, 5, 7, 5, 4, - 4, 7 + 0, 3, 2, 3, 2, 1, 5, 5, 6, 6, + 6, 6, 4, 6, 4, 4, 6, 6, 2, 8, + 1, 1, 0, 3, 6, 3, 6, 2, 5, 7, + 5, 4, 4, 7 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -2052,26 +2059,26 @@ static const yytype_uint16 yydefact[] = 237, 0, 167, 150, 0, 0, 0, 0, 156, 168, 0, 0, 167, 0, 0, 0, 98, 97, 0, 206, 207, 0, 0, 100, 101, 102, 103, 104, 0, 252, - 0, 320, 278, 0, 235, 166, 116, 162, 164, 0, + 0, 322, 278, 0, 235, 166, 116, 162, 164, 0, 0, 0, 0, 0, 0, 155, 0, 0, 148, 0, 0, 161, 0, 160, 0, 229, 139, 140, 141, 144, 143, 142, 0, 0, 67, 67, 105, 0, 246, 247, - 248, 319, 303, 0, 0, 0, 0, 99, 288, 289, + 248, 321, 305, 0, 0, 0, 0, 99, 288, 289, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 277, 99, 292, - 0, 318, 236, 159, 0, 124, 67, 67, 158, 0, + 0, 320, 236, 159, 0, 124, 67, 67, 158, 0, 169, 0, 124, 67, 67, 0, 210, 187, 188, 183, 185, 184, 186, 189, 182, 178, 179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 181, 180, 223, 0, 302, + 0, 0, 0, 0, 0, 181, 180, 223, 0, 304, 282, 67, 273, 281, 0, 0, 55, 0, 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, 53, 54, 49, 50, 51, 52, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, 130, - 130, 325, 67, 67, 316, 0, 0, 0, 0, 0, + 130, 327, 67, 67, 318, 0, 0, 0, 0, 0, 67, 67, 67, 67, 67, 0, 0, 0, 0, 0, 107, 109, 108, 106, 110, 111, 112, 113, 114, 117, 165, 163, 152, 153, 154, 157, 66, 151, 225, 227, @@ -2079,137 +2086,139 @@ static const yytype_uint16 yydefact[] = 0, 0, 171, 205, 0, 0, 0, 175, 0, 172, 0, 0, 0, 135, 244, 255, 256, 257, 262, 258, 259, 260, 261, 253, 0, 264, 271, 270, 272, 0, - 0, 283, 0, 0, 67, 67, 67, 67, 0, 321, - 0, 323, 300, 0, 0, 0, 0, 0, 0, 0, - 0, 300, 0, 0, 0, 0, 0, 67, 0, 115, + 0, 283, 0, 0, 67, 67, 67, 67, 0, 323, + 0, 325, 300, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 67, 0, 115, 121, 120, 118, 119, 122, 123, 125, 135, 135, 0, - 0, 0, 0, 0, 300, 0, 0, 0, 0, 300, + 0, 0, 0, 0, 300, 0, 0, 0, 0, 0, 0, 0, 170, 156, 168, 0, 173, 174, 0, 0, 0, 0, 224, 243, 116, 241, 0, 254, 0, 0, 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 329, 0, 0, 0, 312, 313, 0, 0, 0, - 330, 0, 0, 0, 310, 0, 130, 0, 226, 228, - 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 204, 177, 0, 0, 0, 0, 0, 0, - 137, 135, 65, 0, 124, 0, 263, 0, 0, 299, - 0, 0, 0, 0, 130, 131, 130, 0, 0, 0, - 0, 0, 0, 328, 67, 304, 305, 299, 0, 326, - 67, 211, 0, 0, 0, 0, 191, 0, 0, 0, - 0, 202, 300, 176, 0, 0, 67, 132, 138, 136, - 64, 240, 242, 116, 133, 0, 0, 0, 116, 116, - 0, 306, 307, 308, 309, 322, 324, 301, 0, 0, - 311, 314, 315, 300, 0, 130, 0, 0, 0, 0, - 0, 199, 0, 0, 0, 193, 194, 190, 65, 134, - 128, 265, 0, 0, 0, 0, 124, 0, 293, 0, - 331, 124, 327, 195, 196, 197, 198, 0, 0, 0, - 203, 239, 0, 126, 0, 286, 0, 0, 107, 109, - 116, 116, 0, 116, 116, 294, 317, 192, 200, 201, - 129, 0, 245, 284, 0, 285, 0, 296, 295, 0, - 0, 0, 127, 0, 0, 0, 116, 116, 0, 0, - 0, 298, 297, 291, 0, 0, 290, 0, 287 + 0, 331, 0, 0, 0, 314, 315, 0, 0, 0, + 0, 332, 0, 0, 0, 312, 0, 130, 0, 226, + 228, 67, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 204, 177, 0, 0, 0, 0, 0, + 0, 137, 135, 65, 0, 124, 0, 263, 0, 0, + 299, 0, 0, 0, 0, 130, 131, 130, 0, 0, + 0, 0, 0, 0, 330, 302, 0, 67, 306, 307, + 299, 0, 328, 67, 211, 0, 0, 0, 0, 191, + 0, 0, 0, 0, 202, 0, 176, 0, 0, 67, + 132, 138, 136, 64, 240, 242, 116, 133, 0, 0, + 0, 116, 116, 0, 308, 309, 310, 311, 324, 326, + 301, 0, 0, 313, 316, 317, 303, 0, 0, 130, + 0, 0, 0, 0, 0, 199, 0, 0, 0, 193, + 194, 190, 65, 134, 128, 265, 0, 0, 0, 0, + 124, 0, 293, 0, 333, 124, 329, 195, 196, 197, + 198, 0, 0, 0, 203, 239, 0, 126, 0, 286, + 0, 0, 107, 109, 116, 116, 0, 116, 116, 294, + 319, 192, 200, 201, 129, 0, 245, 284, 0, 285, + 0, 296, 295, 0, 0, 0, 127, 0, 0, 0, + 116, 116, 0, 0, 0, 298, 297, 291, 0, 0, + 290, 0, 287 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 272, 273, 274, 299, 316, 162, 163, 79, 571, + -1, 272, 273, 274, 299, 316, 162, 163, 79, 574, 113, 12, 80, 14, 15, 41, 42, 43, 48, 54, - 118, 128, 349, 233, 436, 352, 652, 633, 409, 520, - 610, 462, 521, 81, 164, 137, 154, 138, 139, 110, + 118, 128, 349, 233, 436, 352, 656, 637, 409, 521, + 614, 462, 522, 81, 164, 137, 154, 138, 139, 110, 373, 395, 374, 121, 88, 155, 16, 17, 18, 20, 19, 383, 437, 438, 63, 23, 61, 101, 465, 466, 129, 170, 55, 96, 56, 49, 468, 396, 83, 398, - 282, 283, 57, 92, 93, 227, 637, 132, 324, 580, - 481, 228, 229, 230, 231 + 282, 283, 57, 92, 93, 227, 641, 132, 324, 583, + 481, 491, 228, 229, 230, 231 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -578 +#define YYPACT_NINF -611 static const yytype_int16 yypact[] = { - 348, -578, -578, -578, -578, -578, -578, -578, 42, -145, - -8, -70, 59, -15, -2, -578, 154, 1288, -578, 155, - 317, 4, 24, -578, -4, 157, -578, 1678, -578, -578, - -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, - -578, 133, 133, 203, -578, -578, -578, -578, 133, -578, - -578, -578, -578, -578, 133, 183, -578, -5, 191, 194, - 204, -578, -578, -578, -578, -578, 73, -578, -578, -578, - -578, -578, -578, -578, -578, 235, 238, 11, 244, -578, - -578, -578, 87, -578, 212, 212, 261, -578, 100, 321, - 321, -578, -578, 250, -578, -578, -578, -578, -578, -578, - -578, -47, 50, -578, 102, 107, 787, 73, -578, 87, - -81, 141, 50, 129, 100, 100, -578, -578, 1362, -578, - -578, 1722, 303, -578, -578, -578, -578, -578, 1780, -578, - -17, 2004, -578, 302, -578, -578, 87, -578, 173, 189, - 1840, 1840, 181, -61, 1840, -578, 346, 200, -578, 1722, - 1840, 73, 195, 87, 294, -578, 79, 360, 365, 371, - 372, 385, 272, 388, 1425, 343, -578, 30, -578, -578, - -578, -578, -578, 344, 1858, 220, 391, 321, -578, -578, - -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, - -578, -578, -578, -578, -578, 668, 443, 668, 443, 1840, - 1840, 1840, 1840, -578, -578, -578, -578, -578, -578, -578, - -578, -578, -578, -578, -578, 1840, 1840, 1840, 1840, 1840, - 1840, 1840, 1840, 1840, 1840, 1840, 1840, -578, 321, -578, - 53, -578, -578, 178, 1560, -578, -20, -27, -578, 241, - 87, 253, -578, 343, 16, 1362, -578, -578, -578, -578, - -578, -578, -578, -578, -578, -578, -578, 668, 443, 668, - 443, 258, 264, 268, 275, 278, 280, 281, 1601, 1887, - 1046, 395, 282, 284, 287, -578, -578, -578, 288, -578, - 73, 996, -578, 266, 1140, 1140, -578, 1140, 1780, -578, - -578, -578, -578, -578, -578, -578, -578, -578, -578, 1840, - -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, - -578, -578, -578, -578, -578, -578, 1840, 1840, 1840, 68, - 85, -578, 996, -25, 271, 286, 289, 290, 291, 299, - 996, 996, 996, 996, 996, 408, 1780, 1840, 1840, 455, - -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, - -578, -578, 188, -578, -578, -578, -578, 188, -578, 129, - 409, 304, 305, 306, 308, 1722, 1722, 1722, 1722, 1722, - 1722, 1722, -578, -578, 89, 1087, -58, -578, -48, -578, - 1722, 1722, 1722, 313, 1619, -578, -578, -578, -578, -578, - -578, -578, -578, 412, 1722, -578, -578, -578, -578, 1840, - 315, -578, 316, 1140, 996, 996, 996, 996, 27, -578, - 37, -578, -578, 1140, 322, 1840, 1840, 1840, 1840, 1840, - 319, -578, 324, 326, 327, 1840, 1140, 996, 329, -578, - -578, -578, -578, -578, -578, -578, -578, 313, 313, 1840, - 1722, 1722, 1722, 1722, -578, 330, 331, 333, 335, -578, - 336, 1722, -578, 332, 1274, -40, -578, -578, 337, 341, - 463, 21, -578, -578, 87, 345, 349, -578, 480, 22, - -578, 488, 490, 352, 350, 351, 353, 354, 1140, 513, - 1140, 359, 361, 1140, 364, 87, -578, 366, 373, 515, - 359, 1840, 1140, 1140, 87, 368, 375, 1840, -578, -578, - -1, 376, 377, 380, 381, 147, 1722, 1722, 1722, 1722, - 176, 1722, -578, -578, 392, 1722, 1722, 1840, 519, 538, - -578, 313, 274, 1660, -578, 398, -578, 1140, 1140, 1905, - 1140, 1140, 1140, 1140, 375, -578, 375, 1840, 1140, 400, - 1840, 1840, 1840, -578, 996, -578, -578, 1905, 506, -578, - 996, -578, 1722, 1722, 1722, 1722, -578, 402, 405, 406, - 407, -578, -578, -578, 410, 413, 49, -578, -578, -578, - -578, -578, -578, 87, -16, 547, 414, 419, 90, 87, - 206, -578, -578, -578, -578, -578, -578, -578, 411, 1140, - -578, -578, -578, -578, 269, 375, 415, 417, 425, 427, - 1722, -578, 1722, 1722, 276, -578, -578, -578, 274, -578, - 517, -578, 568, 1, 849, 849, -578, 1946, -578, 422, - 359, -578, -578, -578, -578, -578, -578, 430, 431, 432, - -578, -578, 586, 444, 1140, -578, 621, 3, 442, 447, - -578, -578, 18, 90, 87, -578, 188, -578, -578, -578, - -578, 577, -578, -578, 441, -578, 621, 178, 178, 587, - 849, 849, -578, 588, 448, 1140, -578, -578, 1140, 589, - 539, 178, 178, -578, 1140, 594, -578, 1140, -578 + 645, -611, -611, -611, -611, -611, -611, -611, -11, -112, + 3, -74, 83, -41, 26, -611, 111, 692, -611, -17, + 199, -19, 54, -611, 21, 124, -611, 1670, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, 17, 17, 72, -611, -611, -611, -611, 17, -611, + -611, -611, -611, -611, 17, 137, -611, -5, 196, 204, + 215, -611, -611, -611, -611, -611, 65, -611, -611, -611, + -611, -611, -611, -611, -611, 262, 265, 2, 322, -611, + -611, -611, -40, -611, 240, 240, 219, -611, 319, 193, + 193, -611, -611, 257, -611, -611, -611, -611, -611, -611, + -611, 52, 1252, -611, 120, 131, 671, 65, -611, -40, + -101, 132, 1252, 139, 319, 319, -611, -611, 1359, -611, + -611, 1711, 299, -611, -611, -611, -611, -611, 1772, -611, + -16, 2051, -611, 287, -611, -611, -40, -611, 154, 160, + 1831, 1831, 159, -77, 1831, -611, 316, 183, -611, 1711, + 1831, 65, 175, -40, 278, -611, 248, 334, 338, 356, + 357, 358, 244, 359, 1310, 314, -611, 36, -611, -611, + -611, -611, -611, 313, 1872, 34, 360, 193, -611, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, 324, 522, 324, 522, 1831, + 1831, 1831, 1831, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, 1831, 1831, 1831, 1831, 1831, + 1831, 1831, 1831, 1831, 1831, 1831, 1831, -611, 193, -611, + 236, -611, -611, 174, 1548, -611, -12, -23, -611, 208, + -40, 218, -611, 314, -22, 1359, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, -611, 324, 522, 324, + 522, 220, 221, 222, 224, 227, 229, 230, 1589, 1890, + 931, 366, 241, 251, 252, -611, -611, -611, 253, -611, + 65, 881, -611, 237, 1025, 1025, -611, 1025, 1772, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, 1831, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -611, -611, -611, -611, 1831, 1831, 1831, -6, + 8, -611, 881, -7, 239, 269, 272, 277, 279, 280, + 881, 881, 881, 881, 881, 372, 1772, 1831, 1831, 433, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + -611, -611, -47, -611, -611, -611, -611, -47, -611, 139, + 403, 286, 288, 289, 290, 1711, 1711, 1711, 1711, 1711, + 1711, 1711, -611, -611, 58, 972, -54, -611, 46, -611, + 1711, 1711, 1711, 291, 1611, -611, -611, -611, -611, -611, + -611, -611, -611, 386, 1711, -611, -611, -611, -611, 1831, + 292, -611, 293, 1025, 881, 881, 881, 881, 24, -611, + 25, -611, -611, 1025, 294, 1831, 1831, 1831, 1831, 1831, + 296, 303, 304, 305, 306, 1831, 1025, 881, 309, -611, + -611, -611, -611, -611, -611, -611, -611, 291, 291, 1831, + 1711, 1711, 1711, 1711, -611, 310, 311, 312, 315, 303, + 320, 1711, -611, 307, 1159, 56, -611, -611, 321, 323, + 415, 10, -611, -611, -40, 326, 331, -611, 459, -53, + -611, 474, 477, 339, 337, 340, 341, 342, 1025, 493, + 1025, 343, 344, 1025, 346, -40, -611, 347, 348, 504, + 505, 351, 1831, 1025, 1025, -40, 355, 354, 1831, -611, + -611, 45, 362, 363, 367, 368, -69, 1711, 1711, 1711, + 1711, 121, 1711, -611, -611, 352, 1711, 1711, 1831, 492, + 521, -611, 291, 123, 1652, -611, 369, -611, 1025, 1025, + 1934, 1025, 1025, 1025, 1025, 354, -611, 354, 1831, 1025, + 370, 1831, 1831, 1831, -611, -611, 531, 881, -611, -611, + 1934, 482, -611, 881, -611, 1711, 1711, 1711, 1711, -611, + 378, 381, 382, 387, -611, 303, -611, 393, 398, 53, + -611, -611, -611, -611, -611, -611, -40, -14, 534, 399, + 395, 6, -40, 125, -611, -611, -611, -611, -611, -611, + -611, 396, 1025, -611, -611, -611, -611, 303, 167, 354, + 402, 404, 405, 406, 1711, -611, 1711, 1711, 191, -611, + -611, -611, 123, -611, 510, -611, 550, -4, 734, 734, + -611, 1952, -611, 407, 351, -611, -611, -611, -611, -611, + -611, 411, 412, 417, -611, -611, 568, 423, 1025, -611, + 1455, -3, 420, 421, -611, -611, -20, 6, -40, -611, + -47, -611, -611, -611, -611, 556, -611, -611, 422, -611, + 1455, 174, 174, 563, 734, 734, -611, 566, 425, 1025, + -611, -611, 1025, 569, 512, 174, 174, -611, 1025, 570, + -611, 1025, -611 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -578, 482, 484, 485, -163, -161, -174, -578, 0, 12, - -97, 525, 10, -578, -578, -578, -578, 267, -578, -578, - -578, -138, -578, -457, -578, -239, -578, -578, -311, 45, - -578, -412, -578, -578, -26, 387, -122, -578, 510, 521, - 86, -159, -237, 222, 257, 383, -578, -578, 612, -578, - -578, -578, -578, -578, -578, -578, -578, -578, -578, -578, - 541, -578, -578, -578, -578, -578, -578, -577, -51, 246, - -197, -578, -578, 575, -578, -578, -578, -578, -578, 88, - -413, -578, -578, -578, -578 + -611, 457, 458, 463, -176, -171, -174, -611, 0, -15, + -146, 503, 11, -611, -611, -611, -611, 12, -611, -611, + -611, -143, -611, -441, -611, -238, -611, -611, -310, 22, + -611, -412, -611, -611, -26, 364, -123, -611, 488, 495, + 35, -161, -256, 242, 276, 361, -611, -611, 585, -611, + -611, -611, -611, -611, -611, -611, -611, -611, -611, -611, + 513, -611, -611, -611, -611, -611, -611, -610, -99, 127, + -179, -611, -611, 547, -611, -611, -611, -611, -611, 59, + 164, -440, -611, -611, -611, -611 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -2219,440 +2228,450 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -214 static const yytype_int16 yytable[] = { - 11, 82, 287, 357, 321, 275, 167, 522, 490, 411, - 13, 168, 286, 24, 286, 105, 91, 11, 518, 325, - 326, 327, 328, 329, 94, 498, 499, 13, 111, 335, - 111, 505, 376, 378, 317, 111, 510, 318, 478, 288, - 29, 30, 31, 32, 33, 34, 35, 36, 480, 37, - 2, 25, 109, 4, 111, 518, 659, 64, 65, 654, - 107, 67, 68, 69, 70, 71, 72, 73, 277, 1, - 2, 111, 3, 4, 5, 519, 136, 27, 144, 664, - 109, 479, -55, -55, -55, -55, 136, 145, 26, 135, - 336, 479, 153, 11, 361, 21, 363, 362, 144, 364, - 74, 451, 153, 246, 111, 247, 248, 239, 456, 569, - 22, 451, 133, 276, 236, 237, 608, 134, 240, 451, - 457, 614, 615, 111, 244, 430, 431, 432, 514, 112, - 433, 112, 119, 120, 434, 435, 112, 413, 455, 354, - 111, 428, 111, 28, 353, -145, 358, 359, 281, 604, - 169, 38, 39, 40, 44, 112, 551, 469, 60, 430, - 431, 432, 58, 95, 433, 635, 403, 655, 434, 435, - 337, 338, 112, 319, 320, 281, 322, 278, 106, 62, - 620, 451, 59, 657, 658, 549, 660, 661, 526, 323, + 11, 82, 287, 275, 357, 167, 105, 286, 286, 511, + 411, 13, 168, 376, 378, 111, 91, 11, 663, 277, + 519, 317, 321, 523, 94, 499, 500, 318, 13, 46, + 658, 47, 111, 111, 288, 478, 480, 325, 326, 327, + 328, 329, 21, 111, 519, 284, 24, 335, 111, 111, + 668, 285, 109, 84, 85, 246, 2, 22, 144, 4, + 89, -145, 25, 111, 520, 276, 90, 145, 29, 30, + 31, 32, 33, 34, 35, 36, 136, 37, 479, 479, + 109, 361, 144, 363, 26, 336, 136, 362, 559, 364, + 538, 239, 153, 11, 430, 431, 432, 358, 359, 433, + 111, 27, 153, 434, 435, 451, 451, 86, 111, 87, + 572, 44, 456, 527, 236, 237, 112, 28, 240, 455, + -67, 430, 431, 432, 244, 608, 433, 430, 431, 432, + 434, 435, 433, 112, 112, 612, 434, 435, 469, 58, + 618, 619, 1, 354, 112, 3, 62, 5, 281, 112, + 112, 169, 353, 408, -67, 413, 165, 624, 91, 428, + 639, 659, -145, 95, 112, 403, -145, 410, -67, 106, + 38, 39, 40, 319, 320, 281, 322, 339, 278, 38, + 39, 40, 397, 60, 243, 397, 397, 552, 397, 323, 281, 281, 281, 281, 281, 330, 331, 332, 333, 334, - 281, 46, 470, 47, 91, 112, 607, 165, 136, 671, - 672, 75, 76, 98, 426, 77, 99, 78, 484, 153, - 486, 487, 488, 585, 112, 586, 100, 408, -67, 102, - 397, 284, 339, 397, 397, 243, 397, 285, 86, 103, - 87, 112, 104, 112, 410, -67, -145, -67, 451, 87, - -145, 64, 65, 452, 107, 67, 68, 69, 70, 71, - 72, 73, 153, 1, 2, 140, 3, 4, 5, 1, - 141, 397, 3, 404, 5, 249, 250, 251, 252, 397, - 397, 397, 397, 397, 622, 574, 38, 39, 40, 148, - 405, 406, 407, 1, 74, 275, 3, 146, 5, 340, - 341, 64, 65, 116, 556, 117, 537, 166, 84, 85, - 153, 427, 281, 1, 2, 89, 3, 4, 5, 342, - 343, 90, 344, 345, 232, 346, 347, 348, 339, 430, - 431, 432, 234, 561, 433, 537, 149, 150, 434, 435, - 587, 114, 115, 590, 591, 592, 235, 238, -213, 454, - 241, 245, 397, 397, 397, 397, 397, 242, 464, 50, - 51, 52, 397, 616, 53, 617, -69, 1, 2, -56, - 3, 4, 5, 281, -57, 397, 397, 642, 6, 7, - -60, -59, 646, 122, 123, 124, 125, 126, 127, 281, - 485, 281, 281, 281, -58, 340, 341, 253, 111, 494, - 8, 279, 286, 276, 9, 75, 76, 355, 10, 77, - 356, 78, 108, 500, 365, 342, 343, 379, 344, 345, - 366, 346, 347, 348, 367, 399, 621, 397, 617, 397, - 414, 368, 397, 630, 369, 537, 370, 371, 380, 636, - 381, 397, 397, 382, 384, 415, 425, 439, 416, 417, - 418, 444, 445, 446, 447, 448, 449, 450, 419, 429, - 440, 441, 442, 656, 443, 544, 458, 459, 460, 300, - 301, 550, 461, 467, 471, 472, 397, 397, 489, 397, - 397, 397, 397, 491, 483, 492, 493, 397, 497, 506, - 507, 566, 508, 397, 509, 511, 515, 573, 513, 397, - 516, 517, 525, 579, 523, 527, 524, 528, 529, 530, - 531, 281, 532, 533, 281, 281, 281, 535, 537, 543, - 538, 579, 570, 540, 547, 541, 501, 502, 503, 504, - 400, 401, 542, 402, 548, 552, 553, 512, 397, 554, - 555, 567, 568, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 575, 563, 589, - 479, 600, 601, 397, 397, 602, 603, 605, 412, 611, - 606, 632, 623, 612, 624, 618, 420, 421, 422, 423, - 424, 613, 625, 397, 626, 634, 645, 647, 648, 649, - 650, 644, 557, 558, 559, 560, 651, 562, -18, 662, - 663, 564, 565, -19, 665, 668, 674, 669, 570, 397, - 397, 677, 675, 224, 397, 225, 226, 397, 131, 609, - 631, 351, 147, 397, 385, 386, 397, 143, 360, 45, - 387, 130, 97, 0, 0, 594, 0, 0, 596, 597, - 598, 599, 0, 0, 0, 0, 388, 389, 390, 473, - 474, 475, 476, 477, 0, 0, 0, 0, 0, 482, + 281, 112, 554, 661, 662, 451, 664, 665, 136, 112, + 611, 133, 59, 426, 457, 451, 134, 451, 98, 153, + 470, 102, 452, 397, 515, 588, 99, 589, 339, 675, + 676, 397, 397, 397, 397, 397, 484, 100, 486, 487, + 488, 50, 51, 52, 340, 341, 53, 249, 250, 251, + 252, -55, -55, -55, -55, 122, 123, 124, 125, 126, + 127, 116, 153, 117, 342, 343, 103, 344, 345, 104, + 346, 347, 348, 404, 247, 248, 1, 87, 564, 3, + 546, 5, 620, 140, 621, 64, 65, 577, 146, 626, + 405, 406, 407, 275, 141, 340, 341, 1, 2, 148, + 3, 4, 5, 166, 397, 397, 397, 397, 397, 232, + 153, 427, 281, 234, 397, 342, 343, 235, 344, 345, + 241, 346, 347, 348, 625, 238, 621, 397, 397, 64, + 65, 245, 107, 67, 68, 69, 70, 71, 72, 73, + 242, 1, 2, -56, 3, 4, 5, -57, 634, 454, + 546, 119, 120, 337, 338, 276, 149, 150, 464, 590, + 114, 115, 593, 594, 595, -60, -59, -58, 253, 111, + 279, 286, 74, 281, 355, 356, 365, 366, 367, 397, + 368, 397, 646, 369, 397, 370, 371, 650, 379, 281, + 485, 281, 281, 281, 397, 397, 399, 380, 414, 495, + 444, 445, 446, 447, 448, 449, 450, 381, 382, 384, + 425, 400, 401, 501, 402, 458, 459, 460, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 415, 397, + 397, 416, 397, 397, 397, 397, 417, 429, 418, 419, + 397, 439, 440, 640, 441, 442, 443, 467, 397, 412, + 461, 471, 472, 518, 397, 489, 483, 420, 421, 422, + 423, 424, 490, 492, 493, 494, 547, 660, 498, 507, + 508, 509, 553, 514, 510, 502, 503, 504, 505, 512, + 516, 526, 517, 75, 76, 524, 513, 77, 525, 78, + 108, 528, 569, 397, 529, 530, 531, 536, 576, 532, + 533, 534, 538, 539, 582, 541, 542, 543, 544, 545, + 546, 550, 281, 551, 570, 281, 281, 281, 566, 397, + 397, 555, 556, 573, 582, 571, 557, 558, 578, 592, + 473, 474, 475, 476, 477, 596, 479, 604, 605, 397, + 482, 606, 560, 561, 562, 563, 607, 565, 300, 301, + 609, 567, 568, 496, 497, 610, 615, 617, 616, 627, + 622, 628, 629, 630, 636, 397, 397, 638, 651, 652, + 397, 649, 654, 397, 653, 655, -18, -19, 666, 397, + 669, 667, 397, 672, 673, 679, 678, 681, 224, 225, + 600, 601, 602, 603, 226, 648, 131, 635, 351, 613, + 147, 143, 45, 130, 97, 535, 360, 537, 506, 598, + 540, 0, 573, 0, 0, 0, 0, 0, 0, 0, + 548, 549, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 0, 0, 0, 631, + 0, 632, 633, 0, 0, -213, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 579, 580, 0, 584, 585, + 586, 587, 0, -69, 1, 2, 591, 3, 4, 5, + 0, 0, 0, 0, 597, 6, 7, 0, 64, 65, + 599, 107, 67, 68, 69, 70, 71, 72, 73, 0, + 1, 2, -212, 3, 4, 5, 0, 8, 0, 0, + 0, 9, 0, 0, 0, 10, 0, 0, 0, 0, + -69, 1, 2, 0, 3, 4, 5, 0, 0, 623, + 0, 74, 6, 7, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 385, 386, 0, + 0, 64, 65, 387, 8, 644, 645, 0, 9, 0, + 0, 0, 10, 1, 2, 0, 3, 4, 5, 388, + 389, 390, 0, 0, 0, 657, 0, 0, 0, 0, + 0, 0, 0, 0, 391, 392, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 339, 0, + 0, 670, 671, 393, 0, 0, 674, 0, 0, 677, + 0, 0, 0, 0, 0, 680, 0, 0, 682, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 257, 258, 259, 260, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 142, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 261, 203, 642, 643, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 0, 262, 0, 263, + 264, 265, 0, 266, 267, 342, 343, 0, 344, 345, + 0, 346, 347, 348, 385, 386, 0, 0, 64, 65, + 387, 0, 0, 0, 0, 0, 0, 0, 0, 394, + 1, 2, 0, 3, 4, 5, 388, 389, 390, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 391, 392, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 495, 496, 0, 0, 0, 0, 0, 0, - 393, 0, 0, 0, 0, 0, 627, 0, 628, 629, - 0, 0, 0, 0, 0, 0, 180, 181, 182, 183, + 0, 0, 0, 0, 0, 0, 111, 0, 64, 65, + 393, 107, 156, 157, 158, 159, 160, 161, 73, 0, + 1, 2, 0, 3, 4, 5, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 257, 258, 259, 260, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 534, 0, 536, 0, 0, 539, - 0, 0, 0, 0, 0, 0, 0, 0, 545, 546, + 194, 257, 258, 259, 260, 0, 0, 0, 0, 64, + 65, 74, 107, 156, 157, 158, 159, 160, 161, 73, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 261, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 0, 262, 0, 263, 264, 265, 0, - 266, 267, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 0, 576, 577, 0, 581, 582, 583, 584, - 0, 0, 0, 0, 588, 0, 394, 0, 0, 0, - 593, 0, 0, 0, 64, 65, 595, 107, 67, 68, - 69, 70, 71, 72, 73, 0, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 619, 0, 74, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 385, 386, 0, 0, 64, 65, 387, 0, - 640, 641, 0, 0, 0, 0, 0, 0, 1, 2, - 0, 3, 4, 5, 388, 389, 390, 0, 0, 0, - 653, 0, 0, 0, 0, 0, 0, 0, 0, 391, - 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 0, 0, 666, 667, 393, 0, - 0, 670, 0, 0, 673, 0, 0, 0, 0, 0, - 676, 0, 0, 678, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 257, - 258, 259, 260, 0, 0, 0, 0, 0, 75, 76, - 0, 0, 77, 0, 78, 142, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 261, 203, - 638, 639, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 0, 262, 0, 263, 264, 265, 0, 266, 267, - 342, 343, 0, 344, 345, 0, 346, 347, 348, 385, - 386, 0, 0, 64, 65, 387, 0, 0, 0, 0, - 0, 0, 0, 0, 394, 1, 2, 0, 3, 4, - 5, 388, 389, 390, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 391, 392, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 111, 0, 64, 65, 393, 107, 156, 157, 158, - 159, 160, 161, 73, 0, 1, 2, 0, 3, 4, - 5, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 257, 258, 259, 260, - 0, 0, 0, 0, 64, 65, 74, 107, 156, 157, - 158, 159, 160, 161, 73, 0, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 261, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 0, 262, - 0, 263, 264, 265, 0, 266, 267, 74, 0, 0, - 0, 0, 0, 385, 386, 0, 0, 64, 65, 387, - 0, 0, 112, 0, 0, 0, 0, 0, 0, 1, - 2, 394, 3, 4, 5, 388, 389, 390, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 393, - 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, - 0, 77, 0, 78, 377, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 257, 258, 259, 260, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 75, 76, - 0, 0, 77, 0, 78, 453, 0, 0, 0, 261, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 0, 262, 0, 263, 264, 265, 0, 266, - 267, 64, 65, 0, 0, 0, 0, 0, -212, 0, - 0, 0, 0, 1, 2, 0, 3, 4, 5, 254, - 0, 0, 0, 0, 0, 394, -69, 1, 2, 0, - 3, 4, 5, 0, 255, 256, 0, 0, 6, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 0, 0, 0, 9, 0, 0, 0, 10, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 257, 258, 259, 260, 0, 64, - 65, 0, 151, 67, 68, 69, 70, 71, 72, 73, - 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 0, 0, 0, 261, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 0, 262, 0, 263, - 264, 265, 74, 266, 267, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 112, 0, 64, 65, -67, 0, 268, 0, 0, 269, - 0, 270, 0, 271, 1, 2, 0, 3, 4, 5, - 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 255, 256, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 111, 0, 0, 0, 0, 0, 0, 152, 0, 0, + 266, 267, 74, 0, 0, 0, 0, 0, 385, 386, + 0, 0, 64, 65, 387, 0, 0, 112, 0, 0, + 0, 0, 0, 0, 1, 2, 394, 3, 4, 5, + 388, 389, 390, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 377, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 257, 258, 259, 260, 0, - 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 261, 203, 204, 205, 206, 207, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 453, 0, 0, 0, 261, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 0, 262, 0, - 263, 264, 265, 0, 266, 267, 0, 64, 65, 0, - 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, - 2, 112, 3, 4, 5, 0, 0, 268, 0, 0, - 269, 0, 270, 0, 271, 0, 0, 0, 0, 350, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, - 74, 107, 156, 157, 158, 159, 160, 161, 73, 0, - 1, 2, 0, 3, 4, 5, 64, 65, 0, 107, + 263, 264, 265, 0, 266, 267, 64, 65, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, + 0, 3, 4, 5, 254, 0, 0, 0, 0, 0, + 394, 0, 0, 0, 0, 0, 0, 0, 0, 255, + 256, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 111, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 257, + 258, 259, 260, 0, 0, 0, 0, 0, 0, 64, + 65, 0, 107, 67, 68, 69, 70, 71, 72, 73, + 0, 1, 2, 0, 3, 4, 5, 0, 261, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 135, 262, 0, 263, 264, 265, 0, 266, 267, + 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 112, 0, 64, 65, -67, + 0, 268, 0, 0, 269, 0, 270, 0, 271, 1, + 2, 0, 3, 4, 5, 254, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 255, 256, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 111, 64, 65, 0, 151, 67, 68, 69, 70, 71, 72, 73, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 74, 0, 0, 0, 0, 0, 0, 463, 0, - 0, 0, 0, 0, 0, 0, 0, 64, 65, 74, - 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, - 2, 0, 3, 4, 5, 64, 65, 0, 66, 67, - 68, 69, 70, 71, 72, 73, 0, 1, 2, 572, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, - 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 74, 64, - 65, 0, 107, 156, 157, 158, 159, 160, 161, 73, + 0, 3, 4, 5, 0, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 257, 258, 259, 260, 0, 0, 0, 0, 0, 74, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 261, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 0, 262, 0, 263, 264, 265, 0, 266, + 267, 0, 0, 0, 0, 0, 0, 0, 385, 386, + 0, 0, 0, 0, 387, 0, 112, 0, 0, 0, + 0, 0, 268, 0, 0, 269, 0, 270, 0, 271, + 388, 389, 390, 0, 152, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 391, 392, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, + 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 257, 258, 259, 260, 0, + 0, 0, 0, 0, 0, 64, 65, 0, 107, 67, + 68, 69, 70, 71, 72, 73, 0, 1, 2, 0, + 3, 4, 5, 0, 261, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 350, 262, 0, + 263, 264, 265, 0, 266, 267, 64, 65, 74, 107, + 156, 157, 158, 159, 160, 161, 73, 0, 1, 2, + 0, 3, 4, 5, 0, 0, 0, 0, 64, 65, + 394, 107, 67, 68, 69, 70, 71, 72, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 74, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 463, 0, 0, 0, 0, 0, 0, 0, 0, 64, + 65, 74, 107, 67, 68, 69, 70, 71, 72, 73, + 0, 1, 2, 0, 3, 4, 5, 64, 65, 0, + 66, 67, 68, 69, 70, 71, 72, 73, 0, 1, + 2, 575, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 0, 74, 0, 0, 0, 0, 0, 0, 75, + 76, 0, 0, 77, 0, 78, 0, 0, 64, 65, + 74, 107, 156, 157, 158, 159, 160, 161, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 75, 76, 0, 372, 77, 0, 78, 0, 0, 0, + 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 64, + 65, 0, 151, 67, 68, 69, 70, 71, 72, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 75, 76, 0, 372, 77, 0, 78, 0, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, - 75, 76, 0, 0, 77, 0, 78, 64, 65, 0, - 151, 67, 68, 69, 70, 71, 72, 73, 0, 1, + 0, 75, 76, 0, 0, 77, 0, 78, 64, 65, + 0, 107, 67, 68, 69, 70, 71, 72, 73, 0, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 64, + 65, 74, 280, 67, 68, 69, 70, 71, 72, 73, + 0, 1, 2, 0, 3, 4, 5, 64, 65, 0, + 107, 156, 157, 158, 159, 160, 161, 73, 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, 0, + 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 74, 64, 65, 0, 107, 67, 68, 69, 70, 71, + 72, 581, 0, 1, 2, 0, 3, 4, 5, 64, + 65, 0, 107, 67, 68, 69, 70, 71, 72, 647, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 74, 0, 0, 0, 0, 0, + 0, 0, 75, 76, 0, 0, 77, 0, 78, 0, + 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, - 74, 0, 0, 0, 0, 0, 0, 0, 0, 75, - 76, 0, 0, 77, 0, 78, 0, 64, 65, 0, - 107, 67, 68, 69, 70, 71, 72, 73, 0, 1, - 2, 0, 3, 4, 5, 64, 65, 0, 280, 67, - 68, 69, 70, 71, 72, 73, 0, 1, 2, 0, - 3, 4, 5, 75, 76, 0, 0, 77, 0, 78, - 74, 0, 0, 0, 64, 65, 0, 107, 156, 157, - 158, 159, 160, 161, 73, 0, 1, 2, 74, 3, - 4, 5, 64, 65, 0, 107, 67, 68, 69, 70, - 71, 72, 578, 0, 1, 2, 0, 3, 4, 5, - 0, 0, 0, 0, 0, 0, 0, 74, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, - 0, 0, 0, 64, 65, 74, 107, 67, 68, 69, - 70, 71, 72, 643, 0, 1, 2, 0, 3, 4, - 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 74, 0, 0, 0, - 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, - 76, 0, 0, 77, 0, 78, 0, 0, 0, 0, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 171, 0, 0, 0, 0, 0, 0, 0, 75, 76, - 0, 0, 77, 0, 375, 0, 0, 0, 0, 0, - 0, 172, 173, 0, 0, 0, 75, 76, 0, 0, - 77, 0, 78, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 75, 76, 0, - 0, 77, 0, 78, 0, 0, 0, 0, 199, 200, - 201, 0, 0, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223 + 0, 75, 76, 0, 0, 77, 0, 375, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 171, 0, 0, + 0, 0, 0, 0, 0, 75, 76, 0, 0, 77, + 0, 78, 0, 0, 0, 0, 0, 0, 172, 173, + 0, 0, 0, 75, 76, 0, 0, 77, 0, 78, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 199, 200, 201, 0, 0, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223 }; static const yytype_int16 yycheck[] = { - 0, 27, 176, 242, 201, 164, 128, 464, 421, 320, - 0, 28, 11, 158, 11, 4, 21, 17, 34, 216, - 217, 218, 219, 220, 29, 437, 438, 17, 55, 226, - 55, 444, 269, 270, 197, 55, 449, 198, 11, 177, - 42, 43, 44, 45, 46, 47, 48, 49, 11, 51, - 20, 59, 78, 23, 55, 34, 38, 7, 8, 636, - 10, 11, 12, 13, 14, 15, 16, 17, 165, 19, - 20, 55, 22, 23, 24, 54, 102, 18, 159, 656, - 106, 54, 3, 4, 5, 6, 112, 168, 158, 39, - 228, 54, 118, 93, 257, 53, 259, 258, 159, 260, - 50, 159, 128, 154, 55, 26, 27, 168, 166, 521, - 68, 159, 159, 164, 140, 141, 573, 164, 144, 159, - 168, 578, 579, 55, 150, 141, 142, 143, 168, 156, - 146, 156, 32, 33, 150, 151, 156, 162, 375, 166, - 55, 338, 55, 158, 164, 55, 243, 244, 174, 562, - 167, 153, 154, 155, 0, 156, 157, 394, 162, 141, - 142, 143, 158, 168, 146, 164, 288, 164, 150, 151, - 117, 118, 156, 199, 200, 201, 202, 167, 167, 22, - 593, 159, 158, 640, 641, 496, 643, 644, 166, 215, + 0, 27, 176, 164, 242, 128, 4, 11, 11, 449, + 320, 0, 28, 269, 270, 55, 21, 17, 38, 165, + 34, 197, 201, 464, 29, 437, 438, 198, 17, 46, + 640, 48, 55, 55, 177, 11, 11, 216, 217, 218, + 219, 220, 53, 55, 34, 11, 158, 226, 55, 55, + 660, 17, 78, 41, 42, 154, 20, 68, 159, 23, + 48, 55, 59, 55, 54, 164, 54, 168, 42, 43, + 44, 45, 46, 47, 48, 49, 102, 51, 54, 54, + 106, 257, 159, 259, 158, 228, 112, 258, 157, 260, + 159, 168, 118, 93, 141, 142, 143, 243, 244, 146, + 55, 18, 128, 150, 151, 159, 159, 35, 55, 37, + 522, 0, 166, 166, 140, 141, 156, 158, 144, 375, + 160, 141, 142, 143, 150, 565, 146, 141, 142, 143, + 150, 151, 146, 156, 156, 576, 150, 151, 394, 158, + 581, 582, 19, 166, 156, 22, 22, 24, 174, 156, + 156, 167, 164, 159, 160, 162, 121, 597, 21, 338, + 164, 164, 156, 168, 156, 288, 160, 159, 160, 167, + 153, 154, 155, 199, 200, 201, 202, 54, 167, 153, + 154, 155, 281, 162, 149, 284, 285, 497, 287, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 46, 399, 48, 21, 156, 157, 121, 234, 666, - 667, 161, 162, 22, 336, 165, 22, 167, 415, 245, - 417, 418, 419, 534, 156, 536, 22, 159, 160, 156, - 281, 11, 54, 284, 285, 149, 287, 17, 35, 4, - 37, 156, 4, 156, 159, 160, 156, 160, 159, 37, - 160, 7, 8, 164, 10, 11, 12, 13, 14, 15, - 16, 17, 288, 19, 20, 163, 22, 23, 24, 19, - 163, 322, 22, 299, 24, 3, 4, 5, 6, 330, - 331, 332, 333, 334, 595, 524, 153, 154, 155, 160, - 316, 317, 318, 19, 50, 454, 22, 156, 24, 121, - 122, 7, 8, 42, 157, 44, 159, 4, 41, 42, - 336, 337, 338, 19, 20, 48, 22, 23, 24, 141, - 142, 54, 144, 145, 22, 147, 148, 149, 54, 141, - 142, 143, 159, 157, 146, 159, 114, 115, 150, 151, - 537, 84, 85, 540, 541, 542, 157, 166, 0, 375, - 4, 156, 403, 404, 405, 406, 407, 157, 384, 42, - 43, 44, 413, 157, 47, 159, 18, 19, 20, 9, - 22, 23, 24, 399, 9, 426, 427, 616, 30, 31, - 9, 9, 621, 62, 63, 64, 65, 66, 67, 415, - 416, 417, 418, 419, 9, 121, 122, 9, 55, 425, - 52, 57, 11, 454, 56, 161, 162, 166, 60, 165, - 157, 167, 168, 439, 156, 141, 142, 22, 144, 145, - 156, 147, 148, 149, 156, 159, 157, 478, 159, 480, - 159, 156, 483, 157, 156, 159, 156, 156, 156, 613, - 156, 492, 493, 156, 156, 159, 38, 38, 159, 159, - 159, 365, 366, 367, 368, 369, 370, 371, 159, 4, - 156, 156, 156, 637, 156, 491, 380, 381, 382, 26, - 27, 497, 159, 61, 159, 159, 527, 528, 159, 530, - 531, 532, 533, 159, 162, 159, 159, 538, 159, 159, - 159, 517, 159, 544, 159, 159, 159, 523, 166, 550, - 159, 38, 22, 529, 159, 17, 157, 17, 156, 159, - 159, 537, 159, 159, 540, 541, 542, 4, 159, 4, - 159, 547, 522, 159, 156, 159, 440, 441, 442, 443, - 284, 285, 159, 287, 159, 159, 159, 451, 589, 159, - 159, 22, 4, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 159, 166, 159, - 54, 159, 157, 614, 615, 159, 159, 157, 322, 22, - 157, 54, 157, 159, 157, 164, 330, 331, 332, 333, - 334, 162, 157, 634, 157, 17, 164, 157, 157, 157, - 4, 617, 506, 507, 508, 509, 152, 511, 156, 22, - 159, 515, 516, 156, 17, 17, 17, 159, 608, 660, - 661, 17, 73, 131, 665, 131, 131, 668, 93, 574, - 608, 234, 112, 674, 3, 4, 677, 106, 245, 17, - 9, 90, 57, -1, -1, 547, -1, -1, 552, 553, - 554, 555, -1, -1, -1, -1, 25, 26, 27, 403, - 404, 405, 406, 407, -1, -1, -1, -1, -1, 413, - -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 426, 427, -1, -1, -1, -1, -1, -1, - 59, -1, -1, -1, -1, -1, 600, -1, 602, 603, - -1, -1, -1, -1, -1, -1, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 478, -1, 480, -1, -1, 483, - -1, -1, -1, -1, -1, -1, -1, -1, 492, 493, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, -1, 133, -1, 135, 136, 137, -1, - 139, 140, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, -1, 527, 528, -1, 530, 531, 532, 533, - -1, -1, -1, -1, 538, -1, 165, -1, -1, -1, - 544, -1, -1, -1, 7, 8, 550, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 589, -1, 50, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 3, 4, -1, -1, 7, 8, 9, -1, - 614, 615, -1, -1, -1, -1, -1, -1, 19, 20, - -1, 22, 23, 24, 25, 26, 27, -1, -1, -1, - 634, -1, -1, -1, -1, -1, -1, -1, -1, 40, - 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 54, -1, -1, 660, 661, 59, -1, - -1, 665, -1, -1, 668, -1, -1, -1, -1, -1, - 674, -1, -1, 677, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, -1, -1, -1, -1, -1, 161, 162, - -1, -1, 165, -1, 167, 168, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, -1, 133, -1, 135, 136, 137, -1, 139, 140, - 141, 142, -1, 144, 145, -1, 147, 148, 149, 3, - 4, -1, -1, 7, 8, 9, -1, -1, -1, -1, - -1, -1, -1, -1, 165, 19, 20, -1, 22, 23, - 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 55, -1, 7, 8, 59, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - -1, -1, -1, -1, 7, 8, 50, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, -1, -1, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, -1, 133, - -1, 135, 136, 137, -1, 139, 140, 50, -1, -1, - -1, -1, -1, 3, 4, -1, -1, 7, 8, 9, - -1, -1, 156, -1, -1, -1, -1, -1, -1, 19, - 20, 165, 22, 23, 24, 25, 26, 27, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - -1, -1, -1, -1, -1, -1, -1, 161, 162, -1, - -1, 165, -1, 167, 168, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 161, 162, - -1, -1, 165, -1, 167, 168, -1, -1, -1, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, -1, 133, -1, 135, 136, 137, -1, 139, - 140, 7, 8, -1, -1, -1, -1, -1, 0, -1, - -1, -1, -1, 19, 20, -1, 22, 23, 24, 25, - -1, -1, -1, -1, -1, 165, 18, 19, 20, -1, - 22, 23, 24, -1, 40, 41, -1, -1, 30, 31, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 52, -1, -1, -1, 56, -1, -1, -1, 60, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, -1, 7, - 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - -1, -1, -1, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, -1, 133, -1, 135, - 136, 137, 50, 139, 140, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 156, -1, 7, 8, 160, -1, 162, -1, -1, 165, - -1, 167, -1, 169, 19, 20, -1, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 55, -1, -1, -1, -1, -1, -1, 125, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, - -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, -1, 133, -1, - 135, 136, 137, -1, 139, 140, -1, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, 156, 22, 23, 24, -1, -1, 162, -1, -1, - 165, -1, 167, -1, 169, -1, -1, -1, -1, 39, - -1, -1, -1, -1, -1, -1, -1, -1, 7, 8, - 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, 50, -1, -1, -1, -1, -1, -1, 39, -1, - -1, -1, -1, -1, -1, -1, -1, 7, 8, 50, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, 39, - 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, - 50, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 161, 162, -1, -1, 165, -1, 167, 50, 7, - 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 161, 162, -1, 164, 165, -1, 167, -1, - -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, - 161, 162, -1, -1, 165, -1, 167, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 161, 162, -1, -1, 165, -1, 167, -1, -1, - 50, -1, -1, -1, -1, -1, -1, -1, -1, 161, - 162, -1, -1, 165, -1, 167, -1, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 161, 162, -1, -1, 165, -1, 167, - 50, -1, -1, -1, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, 50, 22, - 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, -1, -1, -1, -1, -1, -1, 50, -1, -1, - -1, 161, 162, -1, -1, 165, -1, 167, -1, -1, - -1, -1, -1, 7, 8, 50, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 50, -1, -1, -1, - -1, 161, 162, -1, -1, 165, -1, 167, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 161, - 162, -1, -1, 165, -1, 167, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 36, -1, -1, -1, -1, -1, -1, -1, 161, 162, - -1, -1, 165, -1, 167, -1, -1, -1, -1, -1, - -1, 57, 58, -1, -1, -1, 161, 162, -1, -1, - 165, -1, 167, 69, 70, 71, 72, 73, 74, 75, + 226, 156, 157, 644, 645, 159, 647, 648, 234, 156, + 157, 159, 158, 336, 168, 159, 164, 159, 22, 245, + 399, 156, 164, 322, 168, 535, 22, 537, 54, 670, + 671, 330, 331, 332, 333, 334, 415, 22, 417, 418, + 419, 42, 43, 44, 121, 122, 47, 3, 4, 5, + 6, 3, 4, 5, 6, 62, 63, 64, 65, 66, + 67, 42, 288, 44, 141, 142, 4, 144, 145, 4, + 147, 148, 149, 299, 26, 27, 19, 37, 157, 22, + 159, 24, 157, 163, 159, 7, 8, 525, 156, 599, + 316, 317, 318, 454, 163, 121, 122, 19, 20, 160, + 22, 23, 24, 4, 403, 404, 405, 406, 407, 22, + 336, 337, 338, 159, 413, 141, 142, 157, 144, 145, + 4, 147, 148, 149, 157, 166, 159, 426, 427, 7, + 8, 156, 10, 11, 12, 13, 14, 15, 16, 17, + 157, 19, 20, 9, 22, 23, 24, 9, 157, 375, + 159, 32, 33, 117, 118, 454, 114, 115, 384, 538, + 84, 85, 541, 542, 543, 9, 9, 9, 9, 55, + 57, 11, 50, 399, 166, 157, 156, 156, 156, 478, + 156, 480, 620, 156, 483, 156, 156, 625, 22, 415, + 416, 417, 418, 419, 493, 494, 159, 156, 159, 425, + 365, 366, 367, 368, 369, 370, 371, 156, 156, 156, + 38, 284, 285, 439, 287, 380, 381, 382, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 159, 528, + 529, 159, 531, 532, 533, 534, 159, 4, 159, 159, + 539, 38, 156, 617, 156, 156, 156, 61, 547, 322, + 159, 159, 159, 38, 553, 159, 162, 330, 331, 332, + 333, 334, 159, 159, 159, 159, 492, 641, 159, 159, + 159, 159, 498, 166, 159, 440, 441, 442, 443, 159, + 159, 22, 159, 161, 162, 159, 451, 165, 157, 167, + 168, 17, 518, 592, 17, 156, 159, 4, 524, 159, + 159, 159, 159, 159, 530, 159, 159, 159, 4, 4, + 159, 156, 538, 159, 22, 541, 542, 543, 166, 618, + 619, 159, 159, 523, 550, 4, 159, 159, 159, 159, + 403, 404, 405, 406, 407, 4, 54, 159, 157, 638, + 413, 159, 507, 508, 509, 510, 159, 512, 26, 27, + 157, 516, 517, 426, 427, 157, 22, 162, 159, 157, + 164, 157, 157, 157, 54, 664, 665, 17, 157, 157, + 669, 164, 4, 672, 157, 152, 156, 156, 22, 678, + 17, 159, 681, 17, 159, 73, 17, 17, 131, 131, + 555, 556, 557, 558, 131, 621, 93, 612, 234, 577, + 112, 106, 17, 90, 57, 478, 245, 480, 444, 550, + 483, -1, 612, -1, -1, -1, -1, -1, -1, -1, + 493, 494, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, -1, -1, -1, 604, + -1, 606, 607, -1, -1, 0, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 528, 529, -1, 531, 532, + 533, 534, -1, 18, 19, 20, 539, 22, 23, 24, + -1, -1, -1, -1, 547, 30, 31, -1, 7, 8, + 553, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, 0, 22, 23, 24, -1, 52, -1, -1, + -1, 56, -1, -1, -1, 60, -1, -1, -1, -1, + 18, 19, 20, -1, 22, 23, 24, -1, -1, 592, + -1, 50, 30, 31, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, -1, + -1, 7, 8, 9, 52, 618, 619, -1, 56, -1, + -1, -1, 60, 19, 20, -1, 22, 23, 24, 25, + 26, 27, -1, -1, -1, 638, -1, -1, -1, -1, + -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 54, -1, + -1, 664, 665, 59, -1, -1, 669, -1, -1, 672, + -1, -1, -1, -1, -1, 678, -1, -1, 681, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 161, 162, -1, - -1, 165, -1, 167, -1, -1, -1, -1, 114, 115, - 116, -1, -1, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140 + -1, -1, 161, 162, -1, -1, 165, -1, 167, 168, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, -1, 133, -1, 135, + 136, 137, -1, 139, 140, 141, 142, -1, 144, 145, + -1, 147, 148, 149, 3, 4, -1, -1, 7, 8, + 9, -1, -1, -1, -1, -1, -1, -1, -1, 165, + 19, 20, -1, 22, 23, 24, 25, 26, 27, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, -1, 7, 8, + 59, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, -1, -1, -1, -1, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, -1, 133, -1, 135, 136, 137, -1, + 139, 140, 50, -1, -1, -1, -1, -1, 3, 4, + -1, -1, 7, 8, 9, -1, -1, 156, -1, -1, + -1, -1, -1, -1, 19, 20, 165, 22, 23, 24, + 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, + -1, -1, 161, 162, -1, -1, 165, -1, 167, 168, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, + 168, -1, -1, -1, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, -1, 133, -1, + 135, 136, 137, -1, 139, 140, 7, 8, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 19, 20, + -1, 22, 23, 24, 25, -1, -1, -1, -1, -1, + 165, -1, -1, -1, -1, -1, -1, -1, -1, 40, + 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, -1, -1, -1, -1, -1, -1, 7, + 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 39, 133, -1, 135, 136, 137, -1, 139, 140, + -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 156, -1, 7, 8, 160, + -1, 162, -1, -1, 165, -1, 167, -1, 169, 19, + 20, -1, 22, 23, 24, 25, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 55, 7, 8, -1, 10, + 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, + -1, 22, 23, 24, -1, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, -1, -1, -1, -1, -1, 50, + -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, -1, 133, -1, 135, 136, 137, -1, 139, + 140, -1, -1, -1, -1, -1, -1, -1, 3, 4, + -1, -1, -1, -1, 9, -1, 156, -1, -1, -1, + -1, -1, 162, -1, -1, 165, -1, 167, -1, 169, + 25, 26, 27, -1, 125, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, + 161, 162, -1, -1, 165, -1, 167, -1, -1, -1, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, -1, + -1, -1, -1, -1, -1, 7, 8, -1, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 39, 133, -1, + 135, 136, 137, -1, 139, 140, 7, 8, 50, 10, + 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, + -1, 22, 23, 24, -1, -1, -1, -1, 7, 8, + 165, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, 50, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 39, -1, -1, -1, -1, -1, -1, -1, -1, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, 7, 8, -1, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, 39, 22, 23, 24, -1, -1, -1, -1, -1, + -1, -1, 50, -1, -1, -1, -1, -1, -1, 161, + 162, -1, -1, 165, -1, 167, -1, -1, 7, 8, + 50, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 161, 162, -1, 164, 165, -1, 167, -1, -1, -1, + -1, 50, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 161, 162, -1, -1, 165, -1, 167, 7, + 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, + -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, + -1, 161, 162, -1, -1, 165, -1, 167, 7, 8, + -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 161, 162, -1, -1, 165, -1, 167, 7, + 8, 50, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, 7, 8, -1, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, -1, -1, -1, -1, -1, + -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, + 50, 7, 8, -1, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, 7, + 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, 50, -1, -1, -1, -1, -1, + -1, -1, 161, 162, -1, -1, 165, -1, 167, -1, + -1, -1, 50, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 161, 162, -1, -1, 165, -1, 167, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, + -1, -1, -1, -1, -1, 161, 162, -1, -1, 165, + -1, 167, -1, -1, -1, -1, -1, -1, 57, 58, + -1, -1, -1, 161, 162, -1, -1, 165, -1, 167, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 114, 115, 116, -1, -1, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -2681,8 +2700,8 @@ static const yytype_uint8 yystos[] = 85, 86, 87, 88, 89, 90, 91, 92, 93, 114, 115, 116, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 171, 172, 173, 245, 251, 252, - 253, 254, 22, 193, 159, 157, 204, 204, 166, 168, + 137, 138, 139, 140, 171, 172, 173, 245, 252, 253, + 254, 255, 22, 193, 159, 157, 204, 204, 166, 168, 204, 4, 157, 210, 204, 156, 238, 26, 27, 3, 4, 5, 6, 9, 25, 40, 41, 90, 91, 92, 93, 119, 133, 135, 136, 137, 139, 140, 162, 165, @@ -2708,25 +2727,26 @@ static const yytype_uint8 yystos[] = 210, 159, 201, 39, 204, 228, 229, 61, 236, 212, 240, 159, 159, 239, 239, 239, 239, 239, 11, 54, 11, 250, 239, 162, 240, 204, 240, 240, 240, 159, - 250, 159, 159, 159, 204, 239, 239, 159, 201, 201, - 204, 210, 210, 210, 210, 250, 159, 159, 159, 159, - 250, 159, 210, 166, 168, 159, 159, 38, 34, 54, - 199, 202, 193, 159, 157, 22, 166, 17, 17, 156, - 159, 159, 159, 159, 239, 4, 239, 159, 159, 239, - 159, 159, 159, 4, 204, 239, 239, 156, 159, 198, - 204, 157, 159, 159, 159, 159, 157, 210, 210, 210, - 210, 157, 210, 166, 210, 210, 204, 22, 4, 201, - 178, 179, 39, 204, 195, 159, 239, 239, 17, 204, - 249, 239, 239, 239, 239, 198, 198, 240, 239, 159, - 240, 240, 240, 239, 249, 239, 210, 210, 210, 210, - 159, 157, 159, 159, 250, 157, 157, 157, 193, 199, - 200, 22, 159, 162, 193, 193, 157, 159, 164, 239, - 250, 157, 198, 157, 157, 157, 157, 210, 210, 210, - 157, 179, 54, 197, 17, 164, 176, 246, 121, 122, - 239, 239, 195, 17, 204, 164, 195, 157, 157, 157, - 4, 152, 196, 239, 237, 164, 176, 193, 193, 38, - 193, 193, 22, 159, 237, 17, 239, 239, 17, 159, - 239, 193, 193, 239, 17, 73, 239, 17, 239 + 159, 251, 159, 159, 159, 204, 239, 239, 159, 201, + 201, 204, 210, 210, 210, 210, 250, 159, 159, 159, + 159, 251, 159, 210, 166, 168, 159, 159, 38, 34, + 54, 199, 202, 193, 159, 157, 22, 166, 17, 17, + 156, 159, 159, 159, 159, 239, 4, 239, 159, 159, + 239, 159, 159, 159, 4, 4, 159, 204, 239, 239, + 156, 159, 198, 204, 157, 159, 159, 159, 159, 157, + 210, 210, 210, 210, 157, 210, 166, 210, 210, 204, + 22, 4, 201, 178, 179, 39, 204, 195, 159, 239, + 239, 17, 204, 249, 239, 239, 239, 239, 198, 198, + 240, 239, 159, 240, 240, 240, 4, 239, 249, 239, + 210, 210, 210, 210, 159, 157, 159, 159, 251, 157, + 157, 157, 193, 199, 200, 22, 159, 162, 193, 193, + 157, 159, 164, 239, 251, 157, 198, 157, 157, 157, + 157, 210, 210, 210, 157, 179, 54, 197, 17, 164, + 176, 246, 121, 122, 239, 239, 195, 17, 204, 164, + 195, 157, 157, 157, 4, 152, 196, 239, 237, 164, + 176, 193, 193, 38, 193, 193, 22, 159, 237, 17, + 239, 239, 17, 159, 239, 193, 193, 239, 17, 73, + 239, 17, 239 }; #define yyerrok (yyerrstatus = 0) @@ -3541,152 +3561,152 @@ yyreduce: switch (yyn) { case 29: -#line 1118 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} break; case 30: -#line 1118 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} break; case 31: -#line 1119 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} break; case 32: -#line 1119 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1125 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} break; case 33: -#line 1120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} break; case 34: -#line 1120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} break; case 35: -#line 1121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} break; case 36: -#line 1121 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} break; case 37: -#line 1122 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} break; case 38: -#line 1122 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} break; case 39: -#line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} break; case 40: -#line 1126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} break; case 41: -#line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} break; case 42: -#line 1127 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} break; case 43: -#line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} break; case 44: -#line 1128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} break; case 45: -#line 1129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} break; case 46: -#line 1129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} break; case 47: -#line 1130 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1136 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} break; case 48: -#line 1130 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1136 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} break; case 49: -#line 1131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} break; case 50: -#line 1131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} break; case 51: -#line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} break; case 52: -#line 1132 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} break; case 53: -#line 1133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} break; case 54: -#line 1134 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1140 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} break; case 65: -#line 1143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 66: -#line 1145 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} break; case 67: -#line 1146 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1152 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal)=0; ;} break; case 68: -#line 1150 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3694,7 +3714,7 @@ yyreduce: break; case 69: -#line 1154 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3702,7 +3722,7 @@ yyreduce: break; case 73: -#line 1162 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1168 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -3710,7 +3730,7 @@ yyreduce: break; case 74: -#line 1167 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1173 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR @@ -3718,157 +3738,157 @@ yyreduce: break; case 75: -#line 1173 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1179 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 76: -#line 1174 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1180 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 77: -#line 1175 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1181 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 78: -#line 1176 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 79: -#line 1177 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} break; case 80: -#line 1178 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1184 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::CommonLinkage; ;} break; case 81: -#line 1182 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1188 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} break; case 82: -#line 1183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} break; case 83: -#line 1184 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1190 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 84: -#line 1188 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 85: -#line 1189 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} break; case 86: -#line 1190 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} break; case 87: -#line 1191 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} break; case 88: -#line 1195 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 89: -#line 1196 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 90: -#line 1197 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 91: #line 1201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; - case 92: + case 89: #line 1202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 90: +#line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 91: +#line 1207 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 92: +#line 1208 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 93: -#line 1203 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 94: -#line 1204 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 95: -#line 1205 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 96: -#line 1209 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 97: #line 1210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; - case 98: + case 95: #line 1211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 96: +#line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 97: +#line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 98: +#line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 99: -#line 1214 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 100: -#line 1215 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1221 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 101: -#line 1216 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1222 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 102: -#line 1217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 103: -#line 1218 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} break; case 104: -#line 1219 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} break; case 105: -#line 1220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1226 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); @@ -3878,129 +3898,129 @@ yyreduce: break; case 106: -#line 1227 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1233 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 107: -#line 1228 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 108: -#line 1229 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 109: -#line 1230 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 110: -#line 1231 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::InReg; ;} break; case 111: -#line 1232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1238 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} break; case 112: -#line 1233 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1239 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} break; case 113: -#line 1234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} break; case 114: -#line 1235 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1241 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::Nest; ;} break; case 115: -#line 1236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1242 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;} break; case 116: -#line 1240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 117: -#line 1241 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 118: -#line 1246 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} break; case 119: -#line 1247 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} break; case 120: -#line 1248 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} break; case 121: -#line 1249 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::SExt; ;} break; case 122: -#line 1250 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1256 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} break; case 123: -#line 1251 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} break; case 124: -#line 1254 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = ParamAttr::None; ;} break; case 125: -#line 1255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1261 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); ;} break; case 126: -#line 1260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 127: -#line 1261 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1267 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); ;} break; case 128: -#line 1268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 129: -#line 1269 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4010,12 +4030,12 @@ yyreduce: break; case 130: -#line 1275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 131: -#line 1276 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1282 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -4025,7 +4045,7 @@ yyreduce: break; case 132: -#line 1285 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1291 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') @@ -4036,27 +4056,27 @@ yyreduce: break; case 133: -#line 1293 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1299 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 134: -#line 1294 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} break; case 135: -#line 1299 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1305 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 136: -#line 1300 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1306 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 137: -#line 1301 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1307 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -4065,7 +4085,7 @@ yyreduce: break; case 138: -#line 1306 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1312 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); @@ -4075,7 +4095,7 @@ yyreduce: break; case 146: -#line 1322 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1328 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -4083,7 +4103,7 @@ yyreduce: break; case 147: -#line 1326 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1332 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR @@ -4091,7 +4111,7 @@ yyreduce: break; case 148: -#line 1330 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1336 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -4102,7 +4122,7 @@ yyreduce: break; case 149: -#line 1337 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1343 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR @@ -4111,7 +4131,7 @@ yyreduce: break; case 150: -#line 1342 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1348 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -4123,7 +4143,7 @@ yyreduce: break; case 151: -#line 1350 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1356 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4156,7 +4176,7 @@ yyreduce: break; case 152: -#line 1379 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1385 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4184,16 +4204,16 @@ yyreduce: break; case 153: -#line 1404 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1410 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (yyvsp[(2) - (5)].UInt64Val)))); delete (yyvsp[(4) - (5)].TypeVal); CHECK_FOR_ERROR ;} break; case 154: -#line 1409 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1415 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) @@ -4207,7 +4227,7 @@ yyreduce: break; case 155: -#line 1419 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1425 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), @@ -4221,7 +4241,7 @@ yyreduce: break; case 156: -#line 1429 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1435 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -4229,7 +4249,7 @@ yyreduce: break; case 157: -#line 1433 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), @@ -4243,7 +4263,7 @@ yyreduce: break; case 158: -#line 1443 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1449 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR @@ -4251,7 +4271,7 @@ yyreduce: break; case 159: -#line 1450 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1456 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. @@ -4261,7 +4281,7 @@ yyreduce: break; case 160: -#line 1459 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1465 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); @@ -4272,14 +4292,14 @@ yyreduce: break; case 161: -#line 1466 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); ;} break; case 162: -#line 1471 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1477 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); @@ -4288,7 +4308,7 @@ yyreduce: break; case 163: -#line 1476 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1482 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR @@ -4296,7 +4316,7 @@ yyreduce: break; case 165: -#line 1484 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1490 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4307,7 +4327,7 @@ yyreduce: break; case 166: -#line 1491 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1497 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -4318,7 +4338,7 @@ yyreduce: break; case 167: -#line 1498 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1504 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR @@ -4326,7 +4346,7 @@ yyreduce: break; case 168: -#line 1506 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1512 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); @@ -4336,7 +4356,7 @@ yyreduce: break; case 169: -#line 1512 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1518 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); @@ -4345,7 +4365,7 @@ yyreduce: break; case 170: -#line 1524 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1530 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4377,7 +4397,7 @@ yyreduce: break; case 171: -#line 1552 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1558 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4397,7 +4417,7 @@ yyreduce: break; case 172: -#line 1568 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1574 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4428,7 +4448,7 @@ yyreduce: break; case 173: -#line 1595 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1601 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); @@ -4460,7 +4480,7 @@ yyreduce: break; case 174: -#line 1623 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1629 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) @@ -4490,7 +4510,7 @@ yyreduce: break; case 175: -#line 1649 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1655 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); @@ -4514,7 +4534,7 @@ yyreduce: break; case 176: -#line 1669 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1675 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) @@ -4544,7 +4564,7 @@ yyreduce: break; case 177: -#line 1695 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1701 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); @@ -4568,7 +4588,7 @@ yyreduce: break; case 178: -#line 1715 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1721 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4584,7 +4604,7 @@ yyreduce: break; case 179: -#line 1727 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1733 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4595,7 +4615,7 @@ yyreduce: break; case 180: -#line 1734 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1740 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4665,7 +4685,7 @@ yyreduce: break; case 181: -#line 1800 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1806 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4679,7 +4699,7 @@ yyreduce: break; case 182: -#line 1810 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1816 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -4693,7 +4713,7 @@ yyreduce: break; case 183: -#line 1820 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1826 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4703,7 +4723,7 @@ yyreduce: break; case 184: -#line 1826 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1832 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4717,7 +4737,7 @@ yyreduce: break; case 185: -#line 1836 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1842 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); @@ -4727,7 +4747,7 @@ yyreduce: break; case 186: -#line 1842 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1848 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { @@ -4741,25 +4761,27 @@ yyreduce: break; case 187: -#line 1852 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1858 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) + GEN_ERROR("Constant true must have type i1"); (yyval.ConstVal) = ConstantInt::getTrue(); CHECK_FOR_ERROR ;} break; case 188: -#line 1857 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1864 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + if (cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() != 1) + GEN_ERROR("Constant false must have type i1"); (yyval.ConstVal) = ConstantInt::getFalse(); CHECK_FOR_ERROR ;} break; case 189: -#line 1862 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1870 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); @@ -4774,7 +4796,7 @@ yyreduce: break; case 190: -#line 1875 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1883 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); @@ -4790,7 +4812,7 @@ yyreduce: break; case 191: -#line 1887 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1895 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -4815,7 +4837,7 @@ yyreduce: break; case 192: -#line 1908 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1916 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -4827,7 +4849,7 @@ yyreduce: break; case 193: -#line 1916 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); @@ -4837,7 +4859,7 @@ yyreduce: break; case 194: -#line 1922 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1930 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); @@ -4852,7 +4874,7 @@ yyreduce: break; case 195: -#line 1933 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1941 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); @@ -4861,7 +4883,7 @@ yyreduce: break; case 196: -#line 1938 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1946 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); @@ -4870,7 +4892,7 @@ yyreduce: break; case 197: -#line 1943 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1951 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vicmp operand types must match"); @@ -4879,7 +4901,7 @@ yyreduce: break; case 198: -#line 1948 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1956 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("vfcmp operand types must match"); @@ -4888,7 +4910,7 @@ yyreduce: break; case 199: -#line 1953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1961 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); @@ -4898,7 +4920,7 @@ yyreduce: break; case 200: -#line 1959 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1967 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); @@ -4908,7 +4930,7 @@ yyreduce: break; case 201: -#line 1965 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1973 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -4918,57 +4940,31 @@ yyreduce: break; case 202: -#line 1971 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1979 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()) && !isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); - const Type *IdxTy = - ExtractValueInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end()); - if (!IdxTy) - GEN_ERROR("Index list invalid for constant extractvalue"); - - SmallVector IdxVec; - for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant extractvalue must be constants"); - - delete (yyvsp[(4) - (5)].ValueList); - - (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); + (yyval.ConstVal) = ConstantExpr::getExtractValue((yyvsp[(3) - (5)].ConstVal), &(*(yyvsp[(4) - (5)].ConstantList))[0], (yyvsp[(4) - (5)].ConstantList)->size()); + delete (yyvsp[(4) - (5)].ConstantList); CHECK_FOR_ERROR ;} break; case 203: -#line 1992 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(3) - (7)].ConstVal)->getType()) && !isa((yyvsp[(3) - (7)].ConstVal)->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); - const Type *IdxTy = - ExtractValueInst::getIndexedType((yyvsp[(3) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ValueList)->begin(), (yyvsp[(6) - (7)].ValueList)->end()); - if (IdxTy != (yyvsp[(5) - (7)].ConstVal)->getType()) - GEN_ERROR("Index list invalid for constant insertvalue"); - - SmallVector IdxVec; - for (unsigned i = 0, e = (yyvsp[(6) - (7)].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[(6) - (7)].ValueList))[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant insertvalue must be constants"); - - delete (yyvsp[(6) - (7)].ValueList); - - (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &IdxVec[0], IdxVec.size()); + (yyval.ConstVal) = ConstantExpr::getInsertValue((yyvsp[(3) - (7)].ConstVal), (yyvsp[(5) - (7)].ConstVal), &(*(yyvsp[(6) - (7)].ConstantList))[0], (yyvsp[(6) - (7)].ConstantList)->size()); + delete (yyvsp[(6) - (7)].ConstantList); CHECK_FOR_ERROR ;} break; case 204: -#line 2016 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1998 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR @@ -4976,7 +4972,7 @@ yyreduce: break; case 205: -#line 2020 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2002 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); @@ -4985,27 +4981,27 @@ yyreduce: break; case 206: -#line 2028 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 207: -#line 2028 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2010 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 208: -#line 2031 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2013 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 209: -#line 2031 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2013 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 210: -#line 2034 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2016 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); @@ -5021,7 +5017,7 @@ yyreduce: break; case 211: -#line 2046 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2028 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = (yyvsp[(3) - (6)].ConstVal); const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); @@ -5037,7 +5033,7 @@ yyreduce: break; case 212: -#line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2049 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5046,7 +5042,7 @@ yyreduce: break; case 213: -#line 2072 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2054 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -5055,12 +5051,12 @@ yyreduce: break; case 216: -#line 2085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ;} break; case 217: -#line 2085 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR @@ -5068,26 +5064,26 @@ yyreduce: break; case 218: -#line 2089 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 219: -#line 2089 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2071 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 220: -#line 2092 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2074 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 221: -#line 2095 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2077 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); @@ -5115,7 +5111,7 @@ yyreduce: break; case 222: -#line 2119 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2101 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); @@ -5130,7 +5126,7 @@ yyreduce: break; case 223: -#line 2131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2113 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if ((yyvsp[(5) - (6)].ConstVal) == 0) @@ -5142,14 +5138,14 @@ yyreduce: break; case 224: -#line 2138 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2120 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 225: -#line 2142 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2124 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -5159,14 +5155,14 @@ yyreduce: break; case 226: -#line 2147 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2129 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ;} break; case 227: -#line 2151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); @@ -5177,7 +5173,7 @@ yyreduce: break; case 228: -#line 2157 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2139 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -5185,7 +5181,7 @@ yyreduce: break; case 229: -#line 2161 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2143 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if ((yyvsp[(1) - (5)].StrVal)) { @@ -5229,21 +5225,21 @@ yyreduce: break; case 230: -#line 2201 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2183 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 231: -#line 2204 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2186 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 232: -#line 2210 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2192 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -5256,7 +5252,7 @@ yyreduce: break; case 233: -#line 2220 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2202 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5264,7 +5260,7 @@ yyreduce: break; case 234: -#line 2224 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2206 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5272,7 +5268,7 @@ yyreduce: break; case 236: -#line 2231 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2213 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); delete (yyvsp[(3) - (3)].StrVal); @@ -5281,7 +5277,7 @@ yyreduce: break; case 237: -#line 2236 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2218 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5290,19 +5286,19 @@ yyreduce: break; case 238: -#line 2241 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2223 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 239: -#line 2250 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2232 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) - GEN_ERROR("void typed arguments are invalid"); + if (!(*(yyvsp[(3) - (5)].TypeVal))->isFirstClassType()) + GEN_ERROR("Argument types must be first-class"); ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); (yyvsp[(1) - (5)].ArgList)->push_back(E); @@ -5311,12 +5307,12 @@ yyreduce: break; case 240: -#line 2260 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2242 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) - GEN_ERROR("void typed arguments are invalid"); + if (!(*(yyvsp[(1) - (3)].TypeVal))->isFirstClassType()) + GEN_ERROR("Argument types must be first-class"); ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); (yyval.ArgList) = new ArgListType; (yyval.ArgList)->push_back(E); @@ -5325,7 +5321,7 @@ yyreduce: break; case 241: -#line 2271 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2253 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); CHECK_FOR_ERROR @@ -5333,7 +5329,7 @@ yyreduce: break; case 242: -#line 2275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2257 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; @@ -5346,7 +5342,7 @@ yyreduce: break; case 243: -#line 2284 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2266 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new ArgListType; struct ArgListEntry E; @@ -5359,7 +5355,7 @@ yyreduce: break; case 244: -#line 2293 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2275 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -5367,7 +5363,7 @@ yyreduce: break; case 245: -#line 2299 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2281 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! @@ -5498,7 +5494,7 @@ yyreduce: break; case 248: -#line 2429 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2411 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -5510,7 +5506,7 @@ yyreduce: break; case 251: -#line 2440 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2422 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5518,7 +5514,7 @@ yyreduce: break; case 252: -#line 2445 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2427 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); @@ -5529,7 +5525,7 @@ yyreduce: break; case 253: -#line 2457 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2439 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -5537,7 +5533,7 @@ yyreduce: break; case 254: -#line 2461 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2443 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -5545,7 +5541,7 @@ yyreduce: break; case 255: -#line 2466 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2448 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR @@ -5553,7 +5549,7 @@ yyreduce: break; case 256: -#line 2470 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2452 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR @@ -5561,7 +5557,7 @@ yyreduce: break; case 257: -#line 2474 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2456 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR @@ -5569,7 +5565,7 @@ yyreduce: break; case 258: -#line 2478 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2460 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR @@ -5577,7 +5573,7 @@ yyreduce: break; case 259: -#line 2482 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2464 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR @@ -5585,7 +5581,7 @@ yyreduce: break; case 260: -#line 2486 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2468 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -5593,7 +5589,7 @@ yyreduce: break; case 261: -#line 2490 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2472 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -5601,7 +5597,7 @@ yyreduce: break; case 262: -#line 2494 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2476 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -5609,10 +5605,13 @@ yyreduce: break; case 263: -#line 2498 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2480 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); + + if (!ETy->isInteger() && !ETy->isFloatingPoint()) + GEN_ERROR("Invalid vector element type: " + ETy->getDescription()); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -5638,7 +5637,7 @@ yyreduce: break; case 264: -#line 2523 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2508 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR @@ -5646,7 +5645,7 @@ yyreduce: break; case 265: -#line 2527 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2512 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); delete (yyvsp[(3) - (5)].StrVal); @@ -5656,7 +5655,7 @@ yyreduce: break; case 266: -#line 2537 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2522 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5664,7 +5663,7 @@ yyreduce: break; case 267: -#line 2541 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2526 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); CHECK_FOR_ERROR @@ -5672,7 +5671,7 @@ yyreduce: break; case 268: -#line 2545 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2530 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5681,7 +5680,7 @@ yyreduce: break; case 269: -#line 2550 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2535 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); delete (yyvsp[(1) - (1)].StrVal); @@ -5690,7 +5689,7 @@ yyreduce: break; case 272: -#line 2563 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2548 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); @@ -5701,7 +5700,7 @@ yyreduce: break; case 273: -#line 2572 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2557 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); @@ -5710,7 +5709,7 @@ yyreduce: break; case 274: -#line 2577 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2562 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR @@ -5718,7 +5717,7 @@ yyreduce: break; case 275: -#line 2582 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2567 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5726,7 +5725,7 @@ yyreduce: break; case 276: -#line 2586 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2571 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR @@ -5734,7 +5733,7 @@ yyreduce: break; case 277: -#line 2595 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2580 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); CHECK_FOR_ERROR @@ -5746,7 +5745,7 @@ yyreduce: break; case 278: -#line 2604 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2589 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -5759,7 +5758,7 @@ yyreduce: break; case 279: -#line 2613 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2598 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR @@ -5767,7 +5766,7 @@ yyreduce: break; case 280: -#line 2617 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2602 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); delete (yyvsp[(1) - (1)].StrVal); @@ -5777,7 +5776,7 @@ yyreduce: break; case 281: -#line 2625 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2610 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... ValueList &VL = *(yyvsp[(2) - (2)].ValueList); assert(!VL.empty() && "Invalid ret operands!"); @@ -5788,7 +5787,7 @@ yyreduce: break; case 282: -#line 2632 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2617 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = ReturnInst::Create(); CHECK_FOR_ERROR @@ -5796,7 +5795,7 @@ yyreduce: break; case 283: -#line 2636 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2621 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR @@ -5805,9 +5804,10 @@ yyreduce: break; case 284: -#line 2641 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2626 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { - assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + if (cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() != 1) + GEN_ERROR("Branch condition must have type i1"); BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); CHECK_FOR_ERROR BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); @@ -5819,7 +5819,7 @@ yyreduce: break; case 285: -#line 2651 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2637 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR @@ -5842,7 +5842,7 @@ yyreduce: break; case 286: -#line 2670 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2656 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR @@ -5855,7 +5855,7 @@ yyreduce: break; case 287: -#line 2680 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2666 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -5944,7 +5944,7 @@ yyreduce: break; case 288: -#line 2765 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2751 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -5952,7 +5952,7 @@ yyreduce: break; case 289: -#line 2769 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2755 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -5960,7 +5960,7 @@ yyreduce: break; case 290: -#line 2776 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2762 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); @@ -5975,7 +5975,7 @@ yyreduce: break; case 291: -#line 2787 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2773 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); @@ -5991,7 +5991,7 @@ yyreduce: break; case 292: -#line 2800 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2786 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); @@ -6003,7 +6003,7 @@ yyreduce: break; case 293: -#line 2810 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2796 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); @@ -6018,7 +6018,7 @@ yyreduce: break; case 294: -#line 2821 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2807 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); @@ -6030,7 +6030,7 @@ yyreduce: break; case 295: -#line 2831 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2817 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6045,7 +6045,7 @@ yyreduce: break; case 296: -#line 2842 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2828 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs @@ -6057,7 +6057,7 @@ yyreduce: break; case 297: -#line 2850 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2836 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) @@ -6071,7 +6071,7 @@ yyreduce: break; case 298: -#line 2860 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2846 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); @@ -6082,17 +6082,17 @@ yyreduce: break; case 299: -#line 2867 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2853 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ParamList) = new ParamList(); ;} break; case 300: -#line 2870 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2856 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); ;} break; case 301: -#line 2871 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2857 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); @@ -6101,23 +6101,44 @@ yyreduce: break; case 302: -#line 2878 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2865 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstantList) = new std::vector(); + if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) + GEN_ERROR("Index " + utostr((yyvsp[(2) - (2)].UInt64Val)) + " is not valid for insertvalue or extractvalue."); + (yyval.ConstantList)->push_back((yyvsp[(2) - (2)].UInt64Val)); + ;} + break; + + case 303: +#line 2871 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstantList) = (yyvsp[(1) - (3)].ConstantList); + if ((unsigned)(yyvsp[(3) - (3)].UInt64Val) != (yyvsp[(3) - (3)].UInt64Val)) + GEN_ERROR("Index " + utostr((yyvsp[(3) - (3)].UInt64Val)) + " is not valid for insertvalue or extractvalue."); + (yyval.ConstantList)->push_back((yyvsp[(3) - (3)].UInt64Val)); + CHECK_FOR_ERROR + ;} + break; + + case 304: +#line 2880 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 303: -#line 2882 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 305: +#line 2884 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 304: -#line 2887 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 306: +#line 2889 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6136,8 +6157,8 @@ yyreduce: ;} break; - case 305: -#line 2903 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 307: +#line 2905 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); @@ -6157,8 +6178,8 @@ yyreduce: ;} break; - case 306: -#line 2920 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 308: +#line 2922 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6175,8 +6196,8 @@ yyreduce: ;} break; - case 307: -#line 2934 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 309: +#line 2936 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6193,8 +6214,8 @@ yyreduce: ;} break; - case 308: -#line 2948 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 310: +#line 2950 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6211,8 +6232,8 @@ yyreduce: ;} break; - case 309: -#line 2962 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 311: +#line 2964 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); @@ -6229,8 +6250,8 @@ yyreduce: ;} break; - case 310: -#line 2976 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 312: +#line 2978 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6245,8 +6266,8 @@ yyreduce: ;} break; - case 311: -#line 2988 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 313: +#line 2990 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -6257,8 +6278,8 @@ yyreduce: ;} break; - case 312: -#line 2996 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 314: +#line 2998 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); @@ -6268,8 +6289,8 @@ yyreduce: ;} break; - case 313: -#line 3003 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 315: +#line 3005 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); @@ -6278,8 +6299,8 @@ yyreduce: ;} break; - case 314: -#line 3009 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 316: +#line 3011 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); @@ -6288,8 +6309,8 @@ yyreduce: ;} break; - case 315: -#line 3015 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 317: +#line 3017 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); @@ -6298,8 +6319,8 @@ yyreduce: ;} break; - case 316: -#line 3021 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 318: +#line 3023 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -6317,8 +6338,8 @@ yyreduce: ;} break; - case 317: -#line 3037 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 319: +#line 3039 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -6410,32 +6431,32 @@ yyreduce: ;} break; - case 318: -#line 3126 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 320: +#line 3128 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR ;} break; - case 319: -#line 3131 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 321: +#line 3133 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR ;} break; - case 320: -#line 3135 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 322: +#line 3137 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR ;} break; - case 321: -#line 3142 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 323: +#line 3144 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6445,11 +6466,13 @@ yyreduce: ;} break; - case 322: -#line 3149 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 324: +#line 3151 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); + if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty) + GEN_ERROR("Malloc array size is not a 32-bit integer!"); Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); @@ -6457,8 +6480,8 @@ yyreduce: ;} break; - case 323: -#line 3157 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 325: +#line 3161 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); @@ -6468,11 +6491,13 @@ yyreduce: ;} break; - case 324: -#line 3164 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 326: +#line 3168 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); + if ((yyvsp[(4) - (6)].PrimType) != Type::Int32Ty) + GEN_ERROR("Alloca array size is not a 32-bit integer!"); Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); @@ -6480,8 +6505,8 @@ yyreduce: ;} break; - case 325: -#line 3172 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 327: +#line 3178 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -6491,8 +6516,8 @@ yyreduce: ;} break; - case 326: -#line 3180 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 328: +#line 3186 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); @@ -6509,8 +6534,8 @@ yyreduce: ;} break; - case 327: -#line 3194 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 329: +#line 3200 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); @@ -6530,8 +6555,8 @@ yyreduce: ;} break; - case 328: -#line 3211 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 330: +#line 3217 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal)); if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val))) @@ -6542,8 +6567,8 @@ yyreduce: ;} break; - case 329: -#line 3219 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 331: +#line 3225 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); @@ -6561,49 +6586,49 @@ yyreduce: ;} break; - case 330: -#line 3234 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 332: +#line 3240 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); if (!isa((yyvsp[(2) - (4)].TypeVal)->get()) && !isa((yyvsp[(2) - (4)].TypeVal)->get())) GEN_ERROR("extractvalue insn requires an aggregate operand"); - if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end())) + if (!ExtractValueInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end())) GEN_ERROR("Invalid extractvalue indices for type '" + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'"); Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end()); + (yyval.InstVal) = ExtractValueInst::Create(tmpVal, (yyvsp[(4) - (4)].ConstantList)->begin(), (yyvsp[(4) - (4)].ConstantList)->end()); delete (yyvsp[(2) - (4)].TypeVal); - delete (yyvsp[(4) - (4)].ValueList); + delete (yyvsp[(4) - (4)].ConstantList); ;} break; - case 331: -#line 3249 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" + case 333: +#line 3255 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()); if (!isa((yyvsp[(2) - (7)].TypeVal)->get()) && !isa((yyvsp[(2) - (7)].TypeVal)->get())) GEN_ERROR("extractvalue insn requires an aggregate operand"); - if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ValueList)->begin(), (yyvsp[(7) - (7)].ValueList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get()) + if (ExtractValueInst::getIndexedType(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()) != (yyvsp[(5) - (7)].TypeVal)->get()) GEN_ERROR("Invalid insertvalue indices for type '" + (*(yyvsp[(2) - (7)].TypeVal))->getDescription()+ "'"); Value* aggVal = getVal(*(yyvsp[(2) - (7)].TypeVal), (yyvsp[(3) - (7)].ValIDVal)); Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal)); CHECK_FOR_ERROR - (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ValueList)->begin(), (yyvsp[(7) - (7)].ValueList)->end()); + (yyval.InstVal) = InsertValueInst::Create(aggVal, tmpVal, (yyvsp[(7) - (7)].ConstantList)->begin(), (yyvsp[(7) - (7)].ConstantList)->end()); delete (yyvsp[(2) - (7)].TypeVal); delete (yyvsp[(5) - (7)].TypeVal); - delete (yyvsp[(7) - (7)].ValueList); + delete (yyvsp[(7) - (7)].ConstantList); ;} break; /* Line 1267 of yacc.c. */ -#line 6607 "llvmAsmParser.tab.c" +#line 6632 "llvmAsmParser.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -6817,7 +6842,7 @@ yyreturn: } -#line 3268 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3274 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions diff --git a/lib/AsmParser/llvmAsmParser.h.cvs b/lib/AsmParser/llvmAsmParser.h.cvs index 9e696f08f86..0eb12c41485 100644 --- a/lib/AsmParser/llvmAsmParser.h.cvs +++ b/lib/AsmParser/llvmAsmParser.h.cvs @@ -354,7 +354,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 949 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" +#line 953 "/Users/gohman/LLVM/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -368,6 +368,7 @@ typedef union YYSTYPE llvm::PATypeHolder *TypeVal; llvm::Value *ValueVal; std::vector *ValueList; + std::vector *ConstantList; llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; @@ -402,7 +403,7 @@ typedef union YYSTYPE llvm::FCmpInst::Predicate FPredicate; } /* Line 1529 of yacc.c. */ -#line 406 "llvmAsmParser.tab.h" +#line 407 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 8f9c4529fe3..fd1fe41a1ef 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -963,6 +963,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) { llvm::PATypeHolder *TypeVal; llvm::Value *ValueVal; std::vector *ValueList; + std::vector *ConstantList; llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; @@ -1008,6 +1009,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) { %type PHIList %type ParamList // For call param lists & GEP indices %type IndexList // For GEP indices +%type ConstantIndexList // For insertvalue/extractvalue indices %type TypeListI %type ArgTypeList ArgTypeListI %type ArgType @@ -1974,46 +1976,20 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { $$ = ConstantExpr::getShuffleVector($3, $5, $7); CHECK_FOR_ERROR } - | EXTRACTVALUE '(' ConstVal IndexList ')' { + | EXTRACTVALUE '(' ConstVal ConstantIndexList ')' { if (!isa($3->getType()) && !isa($3->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); - const Type *IdxTy = - ExtractValueInst::getIndexedType($3->getType(), $4->begin(), $4->end()); - if (!IdxTy) - GEN_ERROR("Index list invalid for constant extractvalue"); - - SmallVector IdxVec; - for (unsigned i = 0, e = $4->size(); i != e; ++i) - if (Constant *C = dyn_cast((*$4)[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant extractvalue must be constants"); - + $$ = ConstantExpr::getExtractValue($3, &(*$4)[0], $4->size()); delete $4; - - $$ = ConstantExpr::getExtractValue($3, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR } - | INSERTVALUE '(' ConstVal ',' ConstVal IndexList ')' { + | INSERTVALUE '(' ConstVal ',' ConstVal ConstantIndexList ')' { if (!isa($3->getType()) && !isa($3->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); - const Type *IdxTy = - ExtractValueInst::getIndexedType($3->getType(), $6->begin(), $6->end()); - if (IdxTy != $5->getType()) - GEN_ERROR("Index list invalid for constant insertvalue"); - - SmallVector IdxVec; - for (unsigned i = 0, e = $6->size(); i != e; ++i) - if (Constant *C = dyn_cast((*$6)[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant insertvalue must be constants"); - + $$ = ConstantExpr::getInsertValue($3, $5, &(*$6)[0], $6->size()); delete $6; - - $$ = ConstantExpr::getInsertValue($3, $5, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR }; @@ -2885,6 +2861,22 @@ IndexList // Used for gep instructions and constant expressions } ; +ConstantIndexList // Used for insertvalue and extractvalue instructions + : ',' EUINT64VAL { + $$ = new std::vector(); + if ((unsigned)$2 != $2) + GEN_ERROR("Index " + utostr($2) + " is not valid for insertvalue or extractvalue."); + $$->push_back($2); + } + | ConstantIndexList ',' EUINT64VAL { + $$ = $1; + if ((unsigned)$3 != $3) + GEN_ERROR("Index " + utostr($3) + " is not valid for insertvalue or extractvalue."); + $$->push_back($3); + CHECK_FOR_ERROR + } + ; + OptTailCall : TAIL CALL { $$ = true; CHECK_FOR_ERROR @@ -3245,7 +3237,7 @@ MemoryInst : MALLOC Types OptCAlign { delete $2; delete $4; } - | EXTRACTVALUE Types ValueRef IndexList { + | EXTRACTVALUE Types ValueRef ConstantIndexList { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); if (!isa($2->get()) && !isa($2->get())) @@ -3260,7 +3252,7 @@ MemoryInst : MALLOC Types OptCAlign { delete $2; delete $4; } - | INSERTVALUE Types ValueRef ',' Types ValueRef IndexList { + | INSERTVALUE Types ValueRef ',' Types ValueRef ConstantIndexList { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); if (!isa($2->get()) && !isa($2->get())) diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs index 66e656915ec..fd1fe41a1ef 100644 --- a/lib/AsmParser/llvmAsmParser.y.cvs +++ b/lib/AsmParser/llvmAsmParser.y.cvs @@ -731,6 +731,10 @@ ParseGlobalVariable(std::string *NameStr, GenerateError("Cannot declare global vars of function type"); return 0; } + if (Ty == Type::LabelTy) { + GenerateError("Cannot declare global vars of label type"); + return 0; + } const PointerType *PTy = PointerType::get(Ty, AddressSpace); @@ -959,6 +963,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) { llvm::PATypeHolder *TypeVal; llvm::Value *ValueVal; std::vector *ValueList; + std::vector *ConstantList; llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; @@ -1004,6 +1009,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) { %type PHIList %type ParamList // For call param lists & GEP indices %type IndexList // For GEP indices +%type ConstantIndexList // For insertvalue/extractvalue indices %type TypeListI %type ArgTypeList ArgTypeListI %type ArgType @@ -1402,7 +1408,7 @@ Types } | '[' EUINT64VAL 'x' Types ']' { // Sized array type? - $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2))); + $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, $2))); delete $4; CHECK_FOR_ERROR } @@ -1850,12 +1856,14 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr CHECK_FOR_ERROR } | INTTYPE TRUETOK { // Boolean constants - assert(cast($1)->getBitWidth() == 1 && "Not Bool?"); + if (cast($1)->getBitWidth() != 1) + GEN_ERROR("Constant true must have type i1"); $$ = ConstantInt::getTrue(); CHECK_FOR_ERROR } | INTTYPE FALSETOK { // Boolean constants - assert(cast($1)->getBitWidth() == 1 && "Not Bool?"); + if (cast($1)->getBitWidth() != 1) + GEN_ERROR("Constant false must have type i1"); $$ = ConstantInt::getFalse(); CHECK_FOR_ERROR } @@ -1968,46 +1976,20 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { $$ = ConstantExpr::getShuffleVector($3, $5, $7); CHECK_FOR_ERROR } - | EXTRACTVALUE '(' ConstVal IndexList ')' { + | EXTRACTVALUE '(' ConstVal ConstantIndexList ')' { if (!isa($3->getType()) && !isa($3->getType())) GEN_ERROR("ExtractValue requires an aggregate operand"); - const Type *IdxTy = - ExtractValueInst::getIndexedType($3->getType(), $4->begin(), $4->end()); - if (!IdxTy) - GEN_ERROR("Index list invalid for constant extractvalue"); - - SmallVector IdxVec; - for (unsigned i = 0, e = $4->size(); i != e; ++i) - if (Constant *C = dyn_cast((*$4)[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant extractvalue must be constants"); - + $$ = ConstantExpr::getExtractValue($3, &(*$4)[0], $4->size()); delete $4; - - $$ = ConstantExpr::getExtractValue($3, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR } - | INSERTVALUE '(' ConstVal ',' ConstVal IndexList ')' { + | INSERTVALUE '(' ConstVal ',' ConstVal ConstantIndexList ')' { if (!isa($3->getType()) && !isa($3->getType())) GEN_ERROR("InsertValue requires an aggregate operand"); - const Type *IdxTy = - ExtractValueInst::getIndexedType($3->getType(), $6->begin(), $6->end()); - if (IdxTy != $5->getType()) - GEN_ERROR("Index list invalid for constant insertvalue"); - - SmallVector IdxVec; - for (unsigned i = 0, e = $6->size(); i != e; ++i) - if (Constant *C = dyn_cast((*$6)[i])) - IdxVec.push_back(C); - else - GEN_ERROR("Indices to constant insertvalue must be constants"); - + $$ = ConstantExpr::getInsertValue($3, $5, &(*$6)[0], $6->size()); delete $6; - - $$ = ConstantExpr::getInsertValue($3, $5, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR }; @@ -2250,8 +2232,8 @@ LibList : LibList ',' STRINGCONSTANT { ArgListH : ArgListH ',' Types OptParamAttrs OptLocalName { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); - if (*$3 == Type::VoidTy) - GEN_ERROR("void typed arguments are invalid"); + if (!(*$3)->isFirstClassType()) + GEN_ERROR("Argument types must be first-class"); ArgListEntry E; E.Attrs = $4; E.Ty = $3; E.Name = $5; $$ = $1; $1->push_back(E); @@ -2260,8 +2242,8 @@ ArgListH : ArgListH ',' Types OptParamAttrs OptLocalName { | Types OptParamAttrs OptLocalName { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription()); - if (*$1 == Type::VoidTy) - GEN_ERROR("void typed arguments are invalid"); + if (!(*$1)->isFirstClassType()) + GEN_ERROR("Argument types must be first-class"); ArgListEntry E; E.Attrs = $2; E.Ty = $1; E.Name = $3; $$ = new ArgListType; $$->push_back(E); @@ -2498,6 +2480,9 @@ ConstValueRef : ESINT64VAL { // A reference to a direct constant | '<' ConstVector '>' { // Nonempty unsized packed vector const Type *ETy = (*$2)[0]->getType(); int NumElements = $2->size(); + + if (!ETy->isInteger() && !ETy->isFloatingPoint()) + GEN_ERROR("Invalid vector element type: " + ETy->getDescription()); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -2639,7 +2624,8 @@ BBTerminatorInst : $$ = BranchInst::Create(tmpBB); } // Conditional Branch... | BR INTTYPE ValueRef ',' LABEL ValueRef ',' LABEL ValueRef { - assert(cast($2)->getBitWidth() == 1 && "Not Bool?"); + if (cast($2)->getBitWidth() != 1) + GEN_ERROR("Branch condition must have type i1"); BasicBlock* tmpBBA = getBBVal($6); CHECK_FOR_ERROR BasicBlock* tmpBBB = getBBVal($9); @@ -2875,6 +2861,22 @@ IndexList // Used for gep instructions and constant expressions } ; +ConstantIndexList // Used for insertvalue and extractvalue instructions + : ',' EUINT64VAL { + $$ = new std::vector(); + if ((unsigned)$2 != $2) + GEN_ERROR("Index " + utostr($2) + " is not valid for insertvalue or extractvalue."); + $$->push_back($2); + } + | ConstantIndexList ',' EUINT64VAL { + $$ = $1; + if ((unsigned)$3 != $3) + GEN_ERROR("Index " + utostr($3) + " is not valid for insertvalue or extractvalue."); + $$->push_back($3); + CHECK_FOR_ERROR + } + ; + OptTailCall : TAIL CALL { $$ = true; CHECK_FOR_ERROR @@ -3149,6 +3151,8 @@ MemoryInst : MALLOC Types OptCAlign { | MALLOC Types ',' INTTYPE ValueRef OptCAlign { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); + if ($4 != Type::Int32Ty) + GEN_ERROR("Malloc array size is not a 32-bit integer!"); Value* tmpVal = getVal($4, $5); CHECK_FOR_ERROR $$ = new MallocInst(*$2, tmpVal, $6); @@ -3164,6 +3168,8 @@ MemoryInst : MALLOC Types OptCAlign { | ALLOCA Types ',' INTTYPE ValueRef OptCAlign { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); + if ($4 != Type::Int32Ty) + GEN_ERROR("Alloca array size is not a 32-bit integer!"); Value* tmpVal = getVal($4, $5); CHECK_FOR_ERROR $$ = new AllocaInst(*$2, tmpVal, $6); @@ -3231,7 +3237,7 @@ MemoryInst : MALLOC Types OptCAlign { delete $2; delete $4; } - | EXTRACTVALUE Types ValueRef IndexList { + | EXTRACTVALUE Types ValueRef ConstantIndexList { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); if (!isa($2->get()) && !isa($2->get())) @@ -3246,7 +3252,7 @@ MemoryInst : MALLOC Types OptCAlign { delete $2; delete $4; } - | INSERTVALUE Types ValueRef ',' Types ValueRef IndexList { + | INSERTVALUE Types ValueRef ',' Types ValueRef ConstantIndexList { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); if (!isa($2->get()) && !isa($2->get())) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 818b47c2709..60767bdbe5e 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -770,27 +770,45 @@ bool BitcodeReader::ParseConstants() { V = ConstantExpr::getGetElementPtr(Elts[0], &Elts[1], Elts.size()-1); break; } - case bitc::CST_CODE_CE_EXTRACTVAL: { // CE_EXTRACTVAL: [n x operands] - if (Record.size() & 1) return Error("Invalid CE_EXTRACTVAL record"); - SmallVector Elts; - for (unsigned i = 0, e = Record.size(); i != e; i += 2) { - const Type *ElTy = getTypeByID(Record[i]); - if (!ElTy) return Error("Invalid CE_EXTRACTVAL record"); - Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy)); + case bitc::CST_CODE_CE_EXTRACTVAL: { + // CE_EXTRACTVAL: [opty, opval, n x indices] + const Type *AggTy = getTypeByID(Record[0]); + if (!AggTy || !AggTy->isAggregateType()) + return Error("Invalid CE_INSERTVAL record"); + Constant *Agg = ValueList.getConstantFwdRef(Record[1], AggTy); + SmallVector Indices; + for (unsigned i = 2, e = Record.size(); i != e; ++i) { + uint64_t Index = Record[i]; + if ((unsigned)Index != Index) + return Error("Invalid CE_EXTRACTVAL record"); + Indices.push_back((unsigned)Index); } - V = ConstantExpr::getExtractValue(Elts[0], &Elts[1], Elts.size()-1); + if (!ExtractValueInst::getIndexedType(AggTy, + Indices.begin(), Indices.end())) + return Error("Invalid CE_EXTRACTVAL record"); + V = ConstantExpr::getExtractValue(Agg, &Indices[0], Indices.size()); break; } - case bitc::CST_CODE_CE_INSERTVAL: { // CE_INSERTVAL: [n x operands] - if (Record.size() & 1) return Error("Invalid CE_INSERTVAL record"); - SmallVector Elts; - for (unsigned i = 0, e = Record.size(); i != e; i += 2) { - const Type *ElTy = getTypeByID(Record[i]); - if (!ElTy) return Error("Invalid CE_INSERTVAL record"); - Elts.push_back(ValueList.getConstantFwdRef(Record[i+1], ElTy)); + case bitc::CST_CODE_CE_INSERTVAL: { + // CE_INSERTVAL: [opty, opval, opty, opval, n x indices] + const Type *AggTy = getTypeByID(Record[0]); + if (!AggTy || !AggTy->isAggregateType()) + return Error("Invalid CE_INSERTVAL record"); + Constant *Agg = ValueList.getConstantFwdRef(Record[1], AggTy); + const Type *ValTy = getTypeByID(Record[2]); + Constant *Val = ValueList.getConstantFwdRef(Record[2], ValTy); + SmallVector Indices; + for (unsigned i = 4, e = Record.size(); i != e; ++i) { + uint64_t Index = Record[i]; + if ((unsigned)Index != Index) + return Error("Invalid CE_INSERTVAL record"); + Indices.push_back((unsigned)Index); } - V = ConstantExpr::getInsertValue(Elts[0], Elts[1], - &Elts[2], Elts.size()-1); + if (ExtractValueInst::getIndexedType(AggTy, + Indices.begin(), + Indices.end()) != ValTy) + return Error("Invalid CE_INSERTVAL record"); + V = ConstantExpr::getInsertValue(Agg, Val, &Indices[0], Indices.size()); break; } case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#] @@ -1324,18 +1342,20 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { break; } - case bitc::FUNC_CODE_INST_EXTRACTVAL: { // EXTRACTVAL: [n x operands] + case bitc::FUNC_CODE_INST_EXTRACTVAL: { + // EXTRACTVAL: [opty, opval, n x indices] unsigned OpNum = 0; Value *Agg; if (getValueTypePair(Record, OpNum, NextValueNo, Agg)) return Error("Invalid EXTRACTVAL record"); - SmallVector EXTRACTVALIdx; - while (OpNum != Record.size()) { - Value *Op; - if (getValueTypePair(Record, OpNum, NextValueNo, Op)) - return Error("Invalid EXTRACTVAL record"); - EXTRACTVALIdx.push_back(Op); + SmallVector EXTRACTVALIdx; + for (unsigned RecSize = Record.size(); + OpNum != RecSize; ++OpNum) { + uint64_t Index = Record[OpNum]; + if ((unsigned)Index != Index) + return Error("Invalid EXTRACTVAL index"); + EXTRACTVALIdx.push_back((unsigned)Index); } I = ExtractValueInst::Create(Agg, @@ -1343,7 +1363,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { break; } - case bitc::FUNC_CODE_INST_INSERTVAL: { // INSERTVAL: [n x operands] + case bitc::FUNC_CODE_INST_INSERTVAL: { + // INSERTVAL: [opty, opval, opty, opval, n x indices] unsigned OpNum = 0; Value *Agg; if (getValueTypePair(Record, OpNum, NextValueNo, Agg)) @@ -1352,12 +1373,13 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { if (getValueTypePair(Record, OpNum, NextValueNo, Val)) return Error("Invalid INSERTVAL record"); - SmallVector INSERTVALIdx; - while (OpNum != Record.size()) { - Value *Op; - if (getValueTypePair(Record, OpNum, NextValueNo, Op)) - return Error("Invalid INSERTVAL record"); - INSERTVALIdx.push_back(Op); + SmallVector INSERTVALIdx; + for (unsigned RecSize = Record.size(); + OpNum != RecSize; ++OpNum) { + uint64_t Index = Record[OpNum]; + if ((unsigned)Index != Index) + return Error("Invalid INSERTVAL index"); + INSERTVALIdx.push_back((unsigned)Index); } I = InsertValueInst::Create(Agg, Val, diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index cb5963cb8e9..376cc056392 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -610,20 +610,26 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal, Record.push_back(VE.getValueID(C->getOperand(i))); } break; - case Instruction::ExtractValue: + case Instruction::ExtractValue: { Code = bitc::CST_CODE_CE_EXTRACTVAL; - for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) { - Record.push_back(VE.getTypeID(C->getOperand(i)->getType())); - Record.push_back(VE.getValueID(C->getOperand(i))); - } + Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); + Record.push_back(VE.getValueID(C->getOperand(0))); + const SmallVector &Indices = CE->getIndices(); + for (unsigned i = 0, e = Indices.size(); i != e; ++i) + Record.push_back(Indices[i]); break; - case Instruction::InsertValue: + } + case Instruction::InsertValue: { Code = bitc::CST_CODE_CE_INSERTVAL; - for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) { - Record.push_back(VE.getTypeID(C->getOperand(i)->getType())); - Record.push_back(VE.getValueID(C->getOperand(i))); - } + Record.push_back(VE.getTypeID(C->getOperand(0)->getType())); + Record.push_back(VE.getValueID(C->getOperand(0))); + Record.push_back(VE.getTypeID(C->getOperand(1)->getType())); + Record.push_back(VE.getValueID(C->getOperand(1))); + const SmallVector &Indices = CE->getIndices(); + for (unsigned i = 0, e = Indices.size(); i != e; ++i) + Record.push_back(Indices[i]); break; + } case Instruction::Select: Code = bitc::CST_CODE_CE_SELECT; Record.push_back(VE.getValueID(C->getOperand(0))); diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 5753f1fb3df..e15e68a73d5 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -537,15 +537,23 @@ public: /// Constants.cpp, and is used behind the scenes to implement /// extractvalue constant exprs. class VISIBILITY_HIDDEN ExtractValueConstantExpr : public ConstantExpr { - ExtractValueConstantExpr(Constant *Agg, const std::vector &IdxList, - const Type *DestTy); + void *operator new(size_t, unsigned); // DO NOT IMPLEMENT public: - static ExtractValueConstantExpr *Create(Constant *Agg, - const std::vector &IdxList, - const Type *DestTy) { - return - new(IdxList.size() + 1) ExtractValueConstantExpr(Agg, IdxList, DestTy); + // allocate space for exactly one operand + void *operator new(size_t s) { + return User::operator new(s, 1); } + ExtractValueConstantExpr(Constant *Agg, + const SmallVector &IdxList, + const Type *DestTy) + : ConstantExpr(DestTy, Instruction::ExtractValue, &Op<0>(), 1), + Indices(IdxList) { + Op<0>() = Agg; + } + + /// Indicies - These identify which value to extract. + const SmallVector Indices; + /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); }; @@ -554,17 +562,24 @@ public: /// Constants.cpp, and is used behind the scenes to implement /// insertvalue constant exprs. class VISIBILITY_HIDDEN InsertValueConstantExpr : public ConstantExpr { - InsertValueConstantExpr(Constant *Agg, Constant *Val, - const std::vector &IdxList, - const Type *DestTy); + void *operator new(size_t, unsigned); // DO NOT IMPLEMENT public: - static InsertValueConstantExpr *Create(Constant *Agg, Constant *Val, - const std::vector &IdxList, - const Type *DestTy) { - return - new(IdxList.size() + 2) InsertValueConstantExpr(Agg, Val, - IdxList, DestTy); + // allocate space for exactly one operand + void *operator new(size_t s) { + return User::operator new(s, 2); } + InsertValueConstantExpr(Constant *Agg, Constant *Val, + const SmallVector &IdxList, + const Type *DestTy) + : ConstantExpr(DestTy, Instruction::InsertValue, &Op<0>(), 2), + Indices(IdxList) { + Op<0>() = Agg; + Op<1>() = Val; + } + + /// Indicies - These identify the position for the insertion. + const SmallVector Indices; + /// Transparently provide more efficient getOperand methods. DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value); }; @@ -639,45 +654,15 @@ struct OperandTraits : FixedNumOperandTraits<3> { DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ShuffleVectorConstantExpr, Value) template <> -struct OperandTraits : VariadicOperandTraits<1> { +struct OperandTraits : FixedNumOperandTraits<1> { }; - -ExtractValueConstantExpr::ExtractValueConstantExpr - (Constant *Agg, - const std::vector &IdxList, - const Type *DestTy) - : ConstantExpr(DestTy, Instruction::ExtractValue, - OperandTraits::op_end(this) - - (IdxList.size()+1), - IdxList.size()+1) { - OperandList[0] = Agg; - for (unsigned i = 0, E = IdxList.size(); i != E; ++i) - OperandList[i+1] = IdxList[i]; -} - DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueConstantExpr, Value) template <> -struct OperandTraits : VariadicOperandTraits<2> { +struct OperandTraits : FixedNumOperandTraits<2> { }; - -InsertValueConstantExpr::InsertValueConstantExpr - (Constant *Agg, Constant *Val, - const std::vector &IdxList, - const Type *DestTy) - : ConstantExpr(DestTy, Instruction::InsertValue, - OperandTraits::op_end(this) - - (IdxList.size()+2), - IdxList.size()+2) { - OperandList[0] = Agg; - OperandList[1] = Val; - for (unsigned i = 0, E = IdxList.size(); i != E; ++i) - OperandList[i+2] = IdxList[i]; -} - DEFINE_TRANSPARENT_OPERAND_ACCESSORS(InsertValueConstantExpr, Value) - template <> struct OperandTraits : VariadicOperandTraits<1> { }; @@ -718,6 +703,21 @@ bool ConstantExpr::isCompare() const { return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp; } +bool ConstantExpr::hasIndices() const { + return getOpcode() == Instruction::ExtractValue || + getOpcode() == Instruction::InsertValue; +} + +const SmallVector &ConstantExpr::getIndices() const { + if (const ExtractValueConstantExpr *EVCE = + dyn_cast(this)) + return EVCE->Indices; + if (const InsertValueConstantExpr *IVCE = + dyn_cast(this)) + return IVCE->Indices; + assert(0 && "ConstantExpr does not have indices!"); +} + /// ConstantExpr::get* - Return some common constants without having to /// specify the full Instruction::OPCODE identifier. /// @@ -829,29 +829,17 @@ ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const { Op2 = (OpNo == 2) ? Op : getOperand(2); return ConstantExpr::getShuffleVector(Op0, Op1, Op2); case Instruction::InsertValue: { - SmallVector Ops; - Ops.resize(getNumOperands()-2); - for (unsigned i = 2, e = getNumOperands(); i != e; ++i) - Ops[i-2] = getOperand(i); - if (OpNo == 0) - return ConstantExpr::getInsertValue(Op, getOperand(1), - &Ops[0], Ops.size()); - if (OpNo == 1) - return ConstantExpr::getInsertValue(getOperand(0), Op, - &Ops[0], Ops.size()); - Ops[OpNo-2] = Op; - return ConstantExpr::getInsertValue(getOperand(0), getOperand(1), - &Ops[0], Ops.size()); + const SmallVector Indices = getIndices(); + Op0 = (OpNo == 0) ? Op : getOperand(0); + Op1 = (OpNo == 1) ? Op : getOperand(1); + return ConstantExpr::getInsertValue(Op0, Op1, + &Indices[0], Indices.size()); } case Instruction::ExtractValue: { - SmallVector Ops; - Ops.resize(getNumOperands()-1); - for (unsigned i = 1, e = getNumOperands(); i != e; ++i) - Ops[i-1] = getOperand(i); - if (OpNo == 0) - return ConstantExpr::getExtractValue(Op, &Ops[0], Ops.size()); - Ops[OpNo-1] = Op; - return ConstantExpr::getExtractValue(getOperand(0), &Ops[0], Ops.size()); + assert(OpNo == 0 && "ExtractaValue has only one operand!"); + const SmallVector Indices = getIndices(); + return + ConstantExpr::getExtractValue(Op, &Indices[0], Indices.size()); } case Instruction::GetElementPtr: { SmallVector Ops; @@ -908,10 +896,16 @@ getWithOperands(const std::vector &Ops) const { return ConstantExpr::getExtractElement(Ops[0], Ops[1]); case Instruction::ShuffleVector: return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); - case Instruction::InsertValue: - return ConstantExpr::getInsertValue(Ops[0], Ops[1], &Ops[2], Ops.size()-2); - case Instruction::ExtractValue: - return ConstantExpr::getExtractValue(Ops[0], &Ops[1], Ops.size()-1); + case Instruction::InsertValue: { + const SmallVector Indices = getIndices(); + return ConstantExpr::getInsertValue(Ops[0], Ops[1], + &Indices[0], Indices.size()); + } + case Instruction::ExtractValue: { + const SmallVector Indices = getIndices(); + return ConstantExpr::getExtractValue(Ops[0], + &Indices[0], Indices.size()); + } case Instruction::GetElementPtr: return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], Ops.size()-1); case Instruction::ICmp: @@ -1624,21 +1618,30 @@ void UndefValue::destroyConstant() { namespace { struct ExprMapKeyType { - explicit ExprMapKeyType(unsigned opc, std::vector ops, - unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { } + typedef SmallVector IndexList; + + ExprMapKeyType(unsigned opc, + const std::vector &ops, + unsigned short pred = 0, + const IndexList &inds = IndexList()) + : opcode(opc), predicate(pred), operands(ops), indices(inds) {} uint16_t opcode; uint16_t predicate; std::vector operands; + IndexList indices; bool operator==(const ExprMapKeyType& that) const { return this->opcode == that.opcode && this->predicate == that.predicate && this->operands == that.operands; + this->indices == that.indices; } bool operator<(const ExprMapKeyType & that) const { return this->opcode < that.opcode || (this->opcode == that.opcode && this->predicate < that.predicate) || (this->opcode == that.opcode && this->predicate == that.predicate && - this->operands < that.operands); + this->operands < that.operands) || + (this->opcode == that.opcode && this->predicate == that.predicate && + this->operands == that.operands && this->indices < that.indices); } bool operator!=(const ExprMapKeyType& that) const { @@ -1669,15 +1672,11 @@ namespace llvm { if (V.opcode == Instruction::ShuffleVector) return new ShuffleVectorConstantExpr(V.operands[0], V.operands[1], V.operands[2]); - if (V.opcode == Instruction::InsertValue) { - std::vector IdxList(V.operands.begin()+2, V.operands.end()); - return InsertValueConstantExpr::Create(V.operands[0], V.operands[1], - IdxList, Ty); - } - if (V.opcode == Instruction::ExtractValue) { - std::vector IdxList(V.operands.begin()+1, V.operands.end()); - return ExtractValueConstantExpr::Create(V.operands[0], IdxList, Ty); - } + if (V.opcode == Instruction::InsertValue) + return new InsertValueConstantExpr(V.operands[0], V.operands[1], + V.indices, Ty); + if (V.opcode == Instruction::ExtractValue) + return new ExtractValueConstantExpr(V.operands[0], V.indices, Ty); if (V.opcode == Instruction::GetElementPtr) { std::vector IdxList(V.operands.begin()+1, V.operands.end()); return GetElementPtrConstantExpr::Create(V.operands[0], IdxList, Ty); @@ -1756,7 +1755,9 @@ static ExprMapKeyType getValType(ConstantExpr *CE) { for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) Operands.push_back(cast(CE->getOperand(i))); return ExprMapKeyType(CE->getOpcode(), Operands, - CE->isCompare() ? CE->getPredicate() : 0); + CE->isCompare() ? CE->getPredicate() : 0, + CE->hasIndices() ? + CE->getIndices() : SmallVector()); } static ManagedStaticgetType(), Idxs, Idxs+NumIdx) == Val->getType() && "insertvalue indices invalid!"); assert(Agg->getType() == ReqTy && "insertvalue type invalid!"); - if (Constant *FC = ConstantFoldInsertValue(Agg, Val, Idxs, NumIdx)) - return FC; // Fold a few common cases... - assert(Agg->getType()->isFirstClassType() && "Non-first-class type for constant InsertValue expression"); // Look up the constant in the table first to ensure uniqueness std::vector ArgVec; - ArgVec.reserve(NumIdx+2); ArgVec.push_back(Agg); ArgVec.push_back(Val); - for (unsigned i = 0; i != NumIdx; ++i) - ArgVec.push_back(cast(Idxs[i])); - const ExprMapKeyType Key(Instruction::InsertValue, ArgVec); + SmallVector Indices(Idxs, Idxs + NumIdx); + const ExprMapKeyType Key(Instruction::InsertValue, ArgVec, 0, Indices); return ExprConstants->getOrCreate(ReqTy, Key); } Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val, - Constant* const *IdxList, unsigned NumIdx) { + const unsigned *IdxList, unsigned NumIdx) { assert(Agg->getType()->isFirstClassType() && "Tried to create insertelement operation on non-first-class type!"); @@ -2334,28 +2330,22 @@ Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val, } Constant *ConstantExpr::getExtractValueTy(const Type *ReqTy, Constant *Agg, - Constant *const *Idxs, unsigned NumIdx) { + const unsigned *Idxs, unsigned NumIdx) { assert(ExtractValueInst::getIndexedType(Agg->getType(), Idxs, Idxs+NumIdx) == ReqTy && "extractvalue indices invalid!"); - - if (Constant *FC = ConstantFoldExtractValue(Agg, Idxs, NumIdx)) - return FC; // Fold a few common cases... - assert(Agg->getType()->isFirstClassType() && "Non-first-class type for constant extractvalue expression"); // Look up the constant in the table first to ensure uniqueness std::vector ArgVec; - ArgVec.reserve(NumIdx+1); ArgVec.push_back(Agg); - for (unsigned i = 0; i != NumIdx; ++i) - ArgVec.push_back(cast(Idxs[i])); - const ExprMapKeyType Key(Instruction::ExtractValue, ArgVec); + SmallVector Indices; + const ExprMapKeyType Key(Instruction::ExtractValue, ArgVec, 0, Indices); return ExprConstants->getOrCreate(ReqTy, Key); } Constant *ConstantExpr::getExtractValue(Constant *Agg, - Constant* const *IdxList, unsigned NumIdx) { + const unsigned *IdxList, unsigned NumIdx) { assert(Agg->getType()->isFirstClassType() && "Tried to create extractelement operation on non-first-class type!"); @@ -2591,31 +2581,19 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV, Replacement = ConstantExpr::getGetElementPtr(Pointer, &Indices[0], Indices.size()); } else if (getOpcode() == Instruction::ExtractValue) { - SmallVector Indices; Constant *Agg = getOperand(0); - Indices.reserve(getNumOperands()-1); if (Agg == From) Agg = To; - for (unsigned i = 1, e = getNumOperands(); i != e; ++i) { - Constant *Val = getOperand(i); - if (Val == From) Val = To; - Indices.push_back(Val); - } + const SmallVector &Indices = getIndices(); Replacement = ConstantExpr::getExtractValue(Agg, &Indices[0], Indices.size()); } else if (getOpcode() == Instruction::InsertValue) { - SmallVector Indices; Constant *Agg = getOperand(0); Constant *Val = getOperand(1); - Indices.reserve(getNumOperands()-2); if (Agg == From) Agg = To; if (Val == From) Val = To; - for (unsigned i = 2, e = getNumOperands(); i != e; ++i) { - Constant *Val = getOperand(i); - if (Val == From) Val = To; - Indices.push_back(Val); - } + const SmallVector &Indices = getIndices(); Replacement = ConstantExpr::getInsertValue(Agg, Val, &Indices[0], Indices.size()); } else if (isCast()) { diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 6ba0abc01f4..e9b7979f40a 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -1058,7 +1058,22 @@ const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, if (NumIdx == 0) return Agg; - return ExtractValueInst::getIndexedType(Agg, Idxs+1, Idxs+NumIdx); + unsigned CurIdx = 1; + for (; CurIdx != NumIdx; ++CurIdx) { + const CompositeType *CT = dyn_cast(Agg); + if (!CT || isa(CT)) return 0; + Value *Index = Idxs[CurIdx]; + if (!CT->indexValid(Index)) return 0; + Agg = CT->getTypeAtIndex(Index); + + // If the new type forwards to another type, then it is in the middle + // of being refined to another type (and hence, may have dropped all + // references to what it was using before). So, use the new forwarded + // type. + if (const Type *Ty = Agg->getForwardedType()) + Agg = Ty; + } + return CurIdx == NumIdx ? Agg : 0; } const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) { @@ -1335,64 +1350,51 @@ int ShuffleVectorInst::getMaskValue(unsigned i) const { // InsertValueInst Class //===----------------------------------------------------------------------===// -void InsertValueInst::init(Value *Agg, Value *Val, Value* const *Idx, unsigned NumIdx) { - assert(NumOperands == 1+NumIdx && "NumOperands not initialized?"); - Use *OL = OperandList; - OL[0] = Agg; - OL[1] = Val; +void InsertValueInst::init(Value *Agg, Value *Val, + const unsigned *Idx, unsigned NumIdx) { + assert(NumOperands == 2 && "NumOperands not initialized?"); + Op<0>() = Agg; + Op<1>() = Val; - for (unsigned i = 0; i != NumIdx; ++i) - OL[i+2] = Idx[i]; + Indices.insert(Indices.end(), Idx, Idx + NumIdx); } -void InsertValueInst::init(Value *Agg, Value *Val, Value *Idx) { - assert(NumOperands == 3 && "NumOperands not initialized?"); - Use *OL = OperandList; - OL[0] = Agg; - OL[1] = Val; - OL[2] = Idx; +void InsertValueInst::init(Value *Agg, Value *Val, unsigned Idx) { + assert(NumOperands == 2 && "NumOperands not initialized?"); + Op<0>() = Agg; + Op<1>() = Val; + + Indices.push_back(Idx); } InsertValueInst::InsertValueInst(const InsertValueInst &IVI) : Instruction(IVI.getType(), InsertValue, - OperandTraits::op_end(this) - - IVI.getNumOperands(), - IVI.getNumOperands()) { - Use *OL = OperandList; - Use *IVIOL = IVI.OperandList; - for (unsigned i = 0, E = NumOperands; i != E; ++i) - OL[i] = IVIOL[i]; + OperandTraits::op_begin(this), 2), + Indices(IVI.Indices) { } //===----------------------------------------------------------------------===// // ExtractValueInst Class //===----------------------------------------------------------------------===// -void ExtractValueInst::init(Value *Agg, Value* const *Idx, unsigned NumIdx) { - assert(NumOperands == 1+NumIdx && "NumOperands not initialized?"); - Use *OL = OperandList; - OL[0] = Agg; +void ExtractValueInst::init(Value *Agg, const unsigned *Idx, unsigned NumIdx) { + assert(NumOperands == 1 && "NumOperands not initialized?"); + Op<0>() = Agg; - for (unsigned i = 0; i != NumIdx; ++i) - OL[i+1] = Idx[i]; + Indices.insert(Indices.end(), Idx, Idx + NumIdx); } -void ExtractValueInst::init(Value *Agg, Value *Idx) { - assert(NumOperands == 2 && "NumOperands not initialized?"); - Use *OL = OperandList; - OL[0] = Agg; - OL[1] = Idx; +void ExtractValueInst::init(Value *Agg, unsigned Idx) { + assert(NumOperands == 1 && "NumOperands not initialized?"); + Op<0>() = Agg; + + Indices.push_back(Idx); } ExtractValueInst::ExtractValueInst(const ExtractValueInst &EVI) : Instruction(reinterpret_cast(EVI.getType()), ExtractValue, - OperandTraits::op_end(this) - - EVI.getNumOperands(), - EVI.getNumOperands()) { - Use *OL = OperandList; - Use *EVIOL = EVI.OperandList; - for (unsigned i = 0, E = NumOperands; i != E; ++i) - OL[i] = EVIOL[i]; + OperandTraits::op_begin(this), 1), + Indices(EVI.Indices) { } // getIndexedType - Returns the type of the element that would be extracted @@ -1402,13 +1404,13 @@ ExtractValueInst::ExtractValueInst(const ExtractValueInst &EVI) // pointer type. // const Type* ExtractValueInst::getIndexedType(const Type *Agg, - Value* const *Idxs, + const unsigned *Idxs, unsigned NumIdx) { unsigned CurIdx = 0; for (; CurIdx != NumIdx; ++CurIdx) { const CompositeType *CT = dyn_cast(Agg); - if (!CT || isa(CT)) return 0; - Value *Index = Idxs[CurIdx]; + if (!CT || isa(CT) || isa(CT)) return 0; + unsigned Index = Idxs[CurIdx]; if (!CT->indexValid(Index)) return 0; Agg = CT->getTypeAtIndex(Index); @@ -2869,10 +2871,10 @@ VICmpInst* VICmpInst::clone() const { } ExtractValueInst *ExtractValueInst::clone() const { - return new(getNumOperands()) ExtractValueInst(*this); + return new ExtractValueInst(*this); } InsertValueInst *InsertValueInst::clone() const { - return new(getNumOperands()) InsertValueInst(*this); + return new InsertValueInst(*this); } diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index d7fe2d1cfbe..c9805ea856a 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -396,16 +396,24 @@ bool StructType::indexValid(const Value *V) const { // Structure indexes require 32-bit integer constants. if (V->getType() == Type::Int32Ty) if (const ConstantInt *CU = dyn_cast(V)) - return CU->getZExtValue() < NumContainedTys; + return indexValid(CU->getZExtValue()); return false; } +bool StructType::indexValid(unsigned V) const { + return V < NumContainedTys; +} + // getTypeAtIndex - Given an index value into the type, return the type of the // element. For a structure type, this must be a constant value... // const Type *StructType::getTypeAtIndex(const Value *V) const { - assert(indexValid(V) && "Invalid structure index!"); unsigned Idx = (unsigned)cast(V)->getZExtValue(); + return getTypeAtIndex(Idx); +} + +const Type *StructType::getTypeAtIndex(unsigned Idx) const { + assert(indexValid(Idx) && "Invalid structure index!"); return ContainedTys[Idx]; } diff --git a/test/Assembler/insertextractvalue.ll b/test/Assembler/insertextractvalue.ll index ae03f45bcef..bdd0932a1db 100644 --- a/test/Assembler/insertextractvalue.ll +++ b/test/Assembler/insertextractvalue.ll @@ -1,13 +1,13 @@ ; RUN: llvm-as < %s -;define float @foo({{i32},{float, double}}* %p) { - ;%t = load {{i32},{float, double}}* %p - ;%s = extractvalue {{i32},{float, double}} %t, i32 1, i32 0 - ;%r = insertvalue {{i32},{float, double}} %t, double 2.0, i32 1, i32 1 - ;store {{i32},{float, double}} %r, {{i32},{float, double}}* %p - ;ret float %s -;} -define float @bar({{i32},{float, double}}* %p) { - store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, i32 1, i32 1), {{i32},{float, double}}* %p - ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, i32 1, i32 0) +define float @foo({{i32},{float, double}}* %p) { + %t = load {{i32},{float, double}}* %p + %s = extractvalue {{i32},{float, double}} %t, 1, 0 + %r = insertvalue {{i32},{float, double}} %t, double 2.0, 1, 1 + store {{i32},{float, double}} %r, {{i32},{float, double}}* %p + ret float %s +} +define float @bar({{i32},{float, double}}* %p) { + store {{i32},{float, double}} insertvalue ({{i32},{float, double}}{{i32}{i32 4},{float, double}{float 4.0, double 5.0}}, double 20.0, 1, 1), {{i32},{float, double}}* %p + ret float extractvalue ({{i32},{float, double}}{{i32}{i32 3},{float, double}{float 7.0, double 9.0}}, 1, 0) }