diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-31 00:58:22 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-31 00:58:22 +0000 |
commit | 81a0c0b44e582baca8b68754a7fcabfc3aef2e7a (patch) | |
tree | 0b0d24cd0d230447b1d8419bb0360c74955fdda1 | |
parent | 652f7ea955bb433d6b7a4d33685dca9485fd7b8b (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/LangRef.html | 10 | ||||
-rw-r--r-- | include/llvm/Constants.h | 17 | ||||
-rw-r--r-- | include/llvm/DerivedTypes.h | 12 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 168 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.cpp.cvs | 1885 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.h.cvs | 5 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 56 | ||||
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y.cvs | 86 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 88 | ||||
-rw-r--r-- | lib/Bitcode/Writer/BitcodeWriter.cpp | 26 | ||||
-rw-r--r-- | lib/VMCore/Constants.cpp | 216 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 90 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 12 | ||||
-rw-r--r-- | test/Assembler/insertextractvalue.ll | 18 |
14 files changed, 1368 insertions, 1321 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index 25b9e026a2..eba4e5af40 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 '<tt>extractvalue</tt>' instruction is a value of <a href="#t_struct">struct</a> or <a href="#t_array">array</a> 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 '<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction. </p> @@ -2932,7 +2932,7 @@ the index operands. <h5>Example:</h5> <pre> - %result = extractvalue {i32, float} %agg, i32 0 <i>; yields i32</i> + %result = extractvalue {i32, float} %agg, 0 <i>; yields i32</i> </pre> </div> @@ -2947,7 +2947,7 @@ the index operands. <h5>Syntax:</h5> <pre> - <result> = insertvalue <aggregate type> <val>, <ty> <val>, i32 <idx> <i>; yields <n x <ty>></i> + <result> = insertvalue <aggregate type> <val>, <ty> <val>, <idx> <i>; yields <n x <ty>></i> </pre> <h5>Overview:</h5> @@ -2965,7 +2965,7 @@ The first operand of an '<tt>insertvalue</tt>' instruction is a value of <a href="#t_struct">struct</a> or <a href="#t_array">array</a> 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 '<tt><a href="#i_getelementptr">getelementptr</a></tt>' 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 <tt>elt</tt>. <h5>Example:</h5> <pre> - %result = insertvalue {i32, float} %agg, i32 1, i32 0 <i>; yields {i32, float}</i> + %result = insertvalue {i32, float} %agg, 1, 0 <i>; yields {i32, float}</i> </pre> </div> diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 48edac63b8..5d85ee23e7 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<unsigned, 4> &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 d20085ead7..4537400618 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 9a396aa83e..fc06b8cb76 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<unsigned, 4> 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<typename InputIterator> 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<unsigned>(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<typename InputIterator> 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<typename InputIterator> inline ExtractValueInst(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, Instruction *InsertBefore); template<typename InputIterator> 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<typename InputIterator> static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name = "", Instruction *InsertBefore = 0) { - typename std::iterator_traits<InputIterator>::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<typename InputIterator> static ExtractValueInst *Create(Value *Agg, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name, BasicBlock *InsertAtEnd) { - typename std::iterator_traits<InputIterator>::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<InputIterator>:: 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<ExtractValueInst> : VariadicOperandTraits<1> { +struct OperandTraits<ExtractValueInst> : FixedNumOperandTraits<1> { }; template<typename InputIterator> 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<ExtractValueInst>::op_end(this) - Values, - Values, InsertBefore) { + OperandTraits<ExtractValueInst>::op_begin(this), + 1, InsertBefore) { init(Agg, IdxBegin, IdxEnd, Name, typename std::iterator_traits<InputIterator>::iterator_category()); } @@ -1707,17 +1708,12 @@ template<typename InputIterator> 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<PointerType>(Agg->getType()) - ->getAddressSpace()), + : Instruction(checkType(getIndexedType(Agg->getType(), IdxBegin, IdxEnd)), ExtractValue, - OperandTraits<ExtractValueInst>::op_end(this) - Values, - Values, InsertAtEnd) { + OperandTraits<ExtractValueInst>::op_begin(this), + 1, InsertAtEnd) { init(Agg, IdxBegin, IdxEnd, Name, typename std::iterator_traits<InputIterator>::iterator_category()); } @@ -1733,9 +1729,12 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ExtractValueInst, Value) /// value into an aggregate value. /// class InsertValueInst : public Instruction { + SmallVector<unsigned, 4> 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<typename InputIterator> void init(Value *Agg, Value *Val, @@ -1746,14 +1745,15 @@ class InsertValueInst : public Instruction { std::random_access_iterator_tag) { unsigned NumIdx = static_cast<unsigned>(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<typename InputIterator> inline InsertValueInst(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, - unsigned Values, const std::string &Name, Instruction *InsertBefore); template<typename InputIterator> 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<typename InputIterator> static InsertValueInst *Create(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name = "", Instruction *InsertBefore = 0) { - typename std::iterator_traits<InputIterator>::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<typename InputIterator> static InsertValueInst *Create(Value *Agg, Value *Val, InputIterator IdxBegin, InputIterator IdxEnd, const std::string &Name, BasicBlock *InsertAtEnd) { - typename std::iterator_traits<InputIterator>::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<const PointerType*>(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<InsertValueInst> : VariadicOperandTraits<2> { +struct OperandTraits<InsertValueInst> : FixedNumOperandTraits<2> { }; template<typename InputIterator> @@ -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<InsertValueInst>::op_end(this) - Values, - Values, InsertBefore) { + : Instruction(Agg->getType(), InsertValue, + OperandTraits<InsertValueInst>::op_begin(this), + 2, InsertBefore) { init(Agg, Val, IdxBegin, IdxEnd, Name, typename std::iterator_traits<InputIterator>::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<PointerType>(Val->getType()) - ->getAddressSpace()), - InsertValue, - OperandTraits<InsertValueInst>::op_end(this) - Values, - Values, InsertAtEnd) { + : Instruction(Agg->getType(), InsertValue, + OperandTraits<InsertValueInst>::op_begin(this), + 2, InsertAtEnd) { init(Agg, Val, IdxBegin, IdxEnd, Name, typename std::iterator_traits<InputIterator>::iterator_category()); } diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index 78bd21881d..c4dd86be98 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<llvm::Value*> *ValueList; + std::vector<unsigned> *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 |