llvm.org GIT mirror llvm / 58d7491
Reimplement the parameter attributes support, phase #1. hilights: 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48289 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
34 changed file(s) with 1352 addition(s) and 1662 deletion(s). Raw diff Collapse all Expand all
2626 namespace llvm {
2727
2828 class FunctionType;
29 class ParamAttrsList;
3029
3130 // Traits for intrusive list of instructions...
3231 template<> struct ilist_traits
6867 BasicBlockListType BasicBlocks; ///< The basic blocks
6968 mutable ArgumentListType ArgumentList; ///< The formal arguments
7069 ValueSymbolTable *SymTab; ///< Symbol table of args/instructions
71 const ParamAttrsList *ParamAttrs; ///< Parameter attributes
70 PAListPtr ParamAttrs; ///< Parameter attributes
7271
7372 // The Calling Convention is stored in Value::SubclassData.
7473 /*unsigned CallingConvention;*/
144143 SubclassData = (SubclassData & 1) | (CC << 1);
145144 }
146145
147 /// Obtains a constant pointer to the ParamAttrsList object which holds the
148 /// parameter attributes information, if any.
149 /// @returns 0 if no parameter attributes have been set.
150 /// @brief Get the parameter attributes.
151 const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
152
153 /// Sets the parameter attributes for this Function. To construct a
154 /// ParamAttrsList, see ParameterAttributes.h
155 /// @brief Set the parameter attributes.
156 void setParamAttrs(const ParamAttrsList *attrs);
146 /// getParamAttrs - Return the parameter attributes for this function.
147 const PAListPtr &getParamAttrs() const { return ParamAttrs; }
148
149 /// setParamAttrs - Set the parameter attributes for this Function.
150 void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; }
157151
158152 /// hasCollector/getCollector/setCollector/clearCollector - The name of the
159153 /// garbage collection algorithm to use during code generation.
2929 class VectorType;
3030 class ConstantRange;
3131 class APInt;
32 class ParamAttrsList;
3332
3433 //===----------------------------------------------------------------------===//
3534 // AllocationInst Class
850849 ///
851850
852851 class CallInst : public Instruction {
853 const ParamAttrsList *ParamAttrs; ///< parameter attributes for call
852 PAListPtr ParamAttrs; ///< parameter attributes for call
854853 CallInst(const CallInst &CI);
855854 void init(Value *Func, Value* const *Params, unsigned NumParams);
856855 void init(Value *Func, Value *Actual1, Value *Actual2);
926925 SubclassData = (SubclassData & 1) | (CC << 1);
927926 }
928927
929 /// Obtains a pointer to the ParamAttrsList object which holds the
930 /// parameter attributes information, if any.
931 /// @returns 0 if no attributes have been set.
932 /// @brief Get the parameter attributes.
933 const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
934
935 /// Sets the parameter attributes for this CallInst. To construct a
936 /// ParamAttrsList, see ParameterAttributes.h
937 /// @brief Set the parameter attributes.
938 void setParamAttrs(const ParamAttrsList *attrs);
928 /// getParamAttrs - Return the PAListPtr for the parameter attributes of this
929 /// call.
930 const PAListPtr &getParamAttrs() const { return ParamAttrs; }
931
932 /// setParamAttrs - Sets the parameter attributes for this CallInst.
933 void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
939934
940935 /// @brief Determine whether the call or the callee has the given attribute.
941936 bool paramHasAttr(uint16_t i, unsigned attr) const;
16771672 /// calling convention of the call.
16781673 ///
16791674 class InvokeInst : public TerminatorInst {
1680 const ParamAttrsList *ParamAttrs;
1675 PAListPtr ParamAttrs;
16811676 InvokeInst(const InvokeInst &BI);
16821677 void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
16831678 Value* const *Args, unsigned NumArgs);
17441739 SubclassData = CC;
17451740 }
17461741
1747 /// Obtains a pointer to the ParamAttrsList object which holds the
1748 /// parameter attributes information, if any.
1749 /// @returns 0 if no attributes have been set.
1750 /// @brief Get the parameter attributes.
1751 const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
1752
1753 /// Sets the parameter attributes for this InvokeInst. To construct a
1754 /// ParamAttrsList, see ParameterAttributes.h
1755 /// @brief Set the parameter attributes.
1756 void setParamAttrs(const ParamAttrsList *attrs);
1742 /// getParamAttrs - Return the parameter attribute list for this invoke.
1743 ///
1744 const PAListPtr &getParamAttrs() const { return ParamAttrs; }
1745
1746 /// setParamAttrs - Set the parameter attribute list for this invoke.
1747 ///
1748 void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
17571749
17581750 /// @brief Determine whether the call or the callee has the given attribute.
17591751 bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
2121 class FunctionType;
2222 class Function;
2323 class Module;
24 class ParamAttrsList;
24 class PAListPtr;
2525
2626 /// Intrinsic Namespace - This namespace contains an enum with a value for
2727 /// every intrinsic/builtin function known by LLVM. These enum values are
4848
4949 /// Intrinsic::getParamAttrs(ID) - Return the attributes for an intrinsic.
5050 ///
51 const ParamAttrsList *getParamAttrs(ID id);
51 PAListPtr getParamAttrs(ID id);
5252
5353 /// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
5454 /// declaration for an intrinsic, and return it.
+0
-226
include/llvm/ParamAttrsList.h less more
None //===-- llvm/ParamAttrsList.h - List and Vector of ParamAttrs ---*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains classes used to represent the parameter attributes
10 // associated with functions and their calls.
11 //
12 // The implementation of ParamAttrsList is in VMCore/ParameterAttributes.cpp.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_PARAM_ATTRS_LIST_H
17 #define LLVM_PARAM_ATTRS_LIST_H
18
19 #include "llvm/ParameterAttributes.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/FoldingSet.h"
22
23 namespace llvm {
24
25 /// @brief A vector of attribute/index pairs.
26 typedef SmallVector ParamAttrsVector;
27
28 /// This class represents a list of attribute/index pairs for parameter
29 /// attributes. Each entry in the list contains the index of a function
30 /// parameter and the associated ParameterAttributes. If a parameter's index is
31 /// not present in the list, then no attributes are set for that parameter. The
32 /// list may also be empty, but this does not occur in practice. An item in
33 /// the list with an index of 0 refers to the function as a whole or its result.
34 /// To construct a ParamAttrsList, you must first fill a ParamAttrsVector with
35 /// the attribute/index pairs you wish to set. The list of attributes can be
36 /// turned into a string of mnemonics suitable for LLVM Assembly output.
37 /// Various accessors are provided to obtain information about the attributes.
38 /// Note that objects of this class are "uniqued". The \p get method can return
39 /// the pointer of an existing and identical instance. Consequently, reference
40 /// counting is necessary in order to determine when the last reference to a
41 /// ParamAttrsList of a given shape is dropped. Users of this class should use
42 /// the addRef and dropRef methods to add/drop references. When the reference
43 /// count goes to zero, the ParamAttrsList object is deleted.
44 /// This class is used by Function, CallInst and InvokeInst to represent their
45 /// sets of parameter attributes.
46 /// @brief A List of ParameterAttributes.
47 class ParamAttrsList : public FoldingSetNode {
48 /// @name Construction
49 /// @{
50 private:
51 // ParamAttrsList is uniqued, these should not be publicly available
52 void operator=(const ParamAttrsList &); // Do not implement
53 ParamAttrsList(const ParamAttrsList &); // Do not implement
54 ~ParamAttrsList(); // Private implementation
55
56 /// Only the \p get method can invoke this when it wants to create a
57 /// new instance.
58 /// @brief Construct an ParamAttrsList from a ParamAttrsVector
59 explicit ParamAttrsList(const ParamAttrsVector &attrVec);
60
61 public:
62 /// This method ensures the uniqueness of ParamAttrsList instances. The
63 /// argument is a vector of attribute/index pairs as represented by the
64 /// ParamAttrsWithIndex structure. The index values must be in strictly
65 /// increasing order and ParamAttr::None is not allowed. The vector is
66 /// used to construct the ParamAttrsList instance. If an instance with
67 /// identical vector pairs exists, it will be returned instead of creating
68 /// a new instance.
69 /// @brief Get a ParamAttrsList instance.
70 static const ParamAttrsList *get(const ParamAttrsVector &attrVec);
71
72 /// Returns the ParamAttrsList obtained by modifying PAL using the supplied
73 /// list of attribute/index pairs. Any existing attributes for the given
74 /// index are replaced by the given attributes. If there were no attributes
75 /// then the new ones are inserted. Attributes can be deleted by replacing
76 /// them with ParamAttr::None. Index values must be strictly increasing.
77 /// @brief Get a new ParamAttrsList instance by modifying an existing one.
78 static const ParamAttrsList *getModified(const ParamAttrsList *PAL,
79 const ParamAttrsVector &modVec);
80
81 /// @brief Add the specified attributes to those in PAL at index idx.
82 static const ParamAttrsList *includeAttrs(const ParamAttrsList *PAL,
83 uint16_t idx,
84 ParameterAttributes attrs);
85
86 /// @brief Remove the specified attributes from those in PAL at index idx.
87 static const ParamAttrsList *excludeAttrs(const ParamAttrsList *PAL,
88 uint16_t idx,
89 ParameterAttributes attrs);
90
91 /// @}
92 /// @name Accessors
93 /// @{
94 public:
95 /// The parameter attributes for the \p indexth parameter are returned.
96 /// The 0th parameter refers to the return type of the function. Note that
97 /// the \p param_index is an index into the function's parameters, not an
98 /// index into this class's list of attributes. The result of getParamIndex
99 /// is always suitable input to this function.
100 /// @returns The all the ParameterAttributes for the \p indexth parameter
101 /// as a uint16_t of enumeration values OR'd together.
102 /// @brief Get the attributes for a parameter
103 ParameterAttributes getParamAttrs(uint16_t param_index) const;
104
105 /// This checks to see if the \p ith function parameter has the parameter
106 /// attribute given by \p attr set.
107 /// @returns true if the parameter attribute is set
108 /// @brief Determine if a ParameterAttributes is set
109 bool paramHasAttr(uint16_t i, ParameterAttributes attr) const {
110 return getParamAttrs(i) & attr;
111 }
112
113 /// This extracts the alignment for the \p ith function parameter.
114 /// @returns 0 if unknown, else the alignment in bytes
115 /// @brief Extract the Alignment
116 uint16_t getParamAlignment(uint16_t i) const {
117 return (getParamAttrs(i) & ParamAttr::Alignment) >> 16;
118 }
119
120 /// This returns whether the given attribute is set for at least one
121 /// parameter or for the return value.
122 /// @returns true if the parameter attribute is set somewhere
123 /// @brief Determine if a ParameterAttributes is set somewhere
124 bool hasAttrSomewhere(ParameterAttributes attr) const;
125
126 /// The set of ParameterAttributes set in Attributes is converted to a
127 /// string of equivalent mnemonics. This is, presumably, for writing out
128 /// the mnemonics for the assembly writer.
129 /// @brief Convert parameter attribute bits to text
130 static std::string getParamAttrsText(ParameterAttributes Attributes);
131
132 /// The \p Indexth parameter attribute is converted to string.
133 /// @brief Get the text for the parmeter attributes for one parameter.
134 std::string getParamAttrsTextByIndex(uint16_t Index) const {
135 return getParamAttrsText(getParamAttrs(Index));
136 }
137
138 /// @brief Comparison operator for ParamAttrsList
139 bool operator < (const ParamAttrsList& that) const {
140 if (this->attrs.size() < that.attrs.size())
141 return true;
142 if (this->attrs.size() > that.attrs.size())
143 return false;
144 for (unsigned i = 0; i < attrs.size(); ++i) {
145 if (attrs[i].index < that.attrs[i].index)
146 return true;
147 if (attrs[i].index > that.attrs[i].index)
148 return false;
149 if (attrs[i].attrs < that.attrs[i].attrs)
150 return true;
151 if (attrs[i].attrs > that.attrs[i].attrs)
152 return false;
153 }
154 return false;
155 }
156
157 /// Returns the parameter index of a particular parameter attribute in this
158 /// list of attributes. Note that the attr_index is an index into this
159 /// class's list of attributes, not the index of a parameter. The result
160 /// is the index of the parameter. Clients generally should not use this
161 /// method. It is used internally by LLVM.
162 /// @brief Get a parameter index
163 uint16_t getParamIndex(unsigned attr_index) const {
164 return attrs[attr_index].index;
165 }
166
167 ParameterAttributes getParamAttrsAtIndex(unsigned attr_index) const {
168 return attrs[attr_index].attrs;
169 }
170
171 /// Determines how many parameter attributes are set in this ParamAttrsList.
172 /// This says nothing about how many parameters the function has. It also
173 /// says nothing about the highest parameter index that has attributes.
174 /// Clients generally should not use this method. It is used internally by
175 /// LLVM.
176 /// @returns the number of parameter attributes in this ParamAttrsList.
177 /// @brief Return the number of parameter attributes this type has.
178 unsigned size() const { return attrs.size(); }
179
180 /// @brief Return the number of references to this ParamAttrsList.
181 unsigned numRefs() const { return refCount; }
182
183 /// @}
184 /// @name Mutators
185 /// @{
186 public:
187 /// Classes retaining references to ParamAttrsList objects should call this
188 /// method to increment the reference count. This ensures that the
189 /// ParamAttrsList object will not disappear until the class drops it.
190 /// @brief Add a reference to this instance.
191 void addRef() const { refCount++; }
192
193 /// Classes retaining references to ParamAttrsList objects should call this
194 /// method to decrement the reference count and possibly delete the
195 /// ParamAttrsList object. This ensures that ParamAttrsList objects are
196 /// cleaned up only when the last reference to them is dropped.
197 /// @brief Drop a reference to this instance.
198 void dropRef() const {
199 assert(refCount != 0 && "dropRef without addRef");
200 if (--refCount == 0)
201 delete this;
202 }
203
204 /// @}
205 /// @name Implementation Details
206 /// @{
207 public:
208 void Profile(FoldingSetNodeID &ID) const {
209 Profile(ID, attrs);
210 }
211 static void Profile(FoldingSetNodeID &ID, const ParamAttrsVector &Attrs);
212 void dump() const;
213
214 /// @}
215 /// @name Data
216 /// @{
217 private:
218 ParamAttrsVector attrs; ///< The list of attributes
219 mutable unsigned refCount; ///< The number of references to this object
220 /// @}
221 };
222
223 } // End llvm namespace
224
225 #endif
1414 #ifndef LLVM_PARAMETER_ATTRIBUTES_H
1515 #define LLVM_PARAMETER_ATTRIBUTES_H
1616
17 #include "llvm/Support/DataTypes.h"
18 #include <cassert>
17 #include <string>
1918
2019 namespace llvm {
2120 class Type;
2221
22 /// ParameterAttributes - A bitset of attributes for a parameter.
23 typedef unsigned ParameterAttributes;
24
2325 namespace ParamAttr {
2426
2527 /// Function parameters and results can have attributes to indicate how they
2729 /// lists the attributes that can be associated with parameters or function
2830 /// results.
2931 /// @brief Function parameter attributes.
30
31 /// @brief A more friendly way to reference the attributes.
32 typedef uint32_t Attributes;
32 typedef ParameterAttributes Attributes;
3333
3434 const Attributes None = 0; ///< No attributes have been set
3535 const Attributes ZExt = 1<<0; ///< Zero extended before/after call
6363 };
6464
6565 /// @brief Which attributes cannot be applied to a type.
66 Attributes typeIncompatible (const Type *Ty);
66 Attributes typeIncompatible(const Type *Ty);
6767
6868 /// This turns an int alignment (a power of 2, normally) into the
6969 /// form used internally in ParameterAttributes.
70 ParamAttr::Attributes inline constructAlignmentFromInt(uint32_t i) {
70 ParamAttr::Attributes inline constructAlignmentFromInt(unsigned i) {
7171 return (i << 16);
7272 }
7373
74 /// The set of ParameterAttributes set in Attributes is converted to a
75 /// string of equivalent mnemonics. This is, presumably, for writing out
76 /// the mnemonics for the assembly writer.
77 /// @brief Convert parameter attribute bits to text
78 std::string getAsString(ParameterAttributes Attrs);
7479 } // end namespace ParamAttr
7580
76 /// @brief A more friendly way to reference the attributes.
77 typedef ParamAttr::Attributes ParameterAttributes;
7881
7982 /// This is just a pair of values to associate a set of parameter attributes
8083 /// with a parameter index.
81 /// @brief ParameterAttributes with a parameter index.
8284 struct ParamAttrsWithIndex {
83 ParameterAttributes attrs; ///< The attributes that are set, or'd together
84 uint16_t index; ///< Index of the parameter for which the attributes apply
85
86 static ParamAttrsWithIndex get(uint16_t idx, ParameterAttributes attrs) {
85 ParameterAttributes Attrs; ///< The attributes that are set, or'd together.
86 unsigned Index; ///< Index of the parameter for which the attributes apply.
87
88 static ParamAttrsWithIndex get(unsigned Idx, ParameterAttributes Attrs) {
8789 ParamAttrsWithIndex P;
88 P.index = idx;
89 P.attrs = attrs;
90 P.Index = Idx;
91 P.Attrs = Attrs;
9092 return P;
9193 }
9294 };
95
96 //===----------------------------------------------------------------------===//
97 // PAListPtr Smart Pointer
98 //===----------------------------------------------------------------------===//
99
100 class ParamAttributeListImpl;
101
102 /// PAListPtr - This class manages the ref count for the opaque
103 /// ParamAttributeListImpl object and provides accessors for it.
104 class PAListPtr {
105 /// PAList - The parameter attributes that we are managing. This can be null
106 /// to represent the empty parameter attributes list.
107 ParamAttributeListImpl *PAList;
108 public:
109 PAListPtr() : PAList(0) {}
110 PAListPtr(const PAListPtr &P);
111 const PAListPtr &operator=(const PAListPtr &RHS);
112 ~PAListPtr();
113
114 //===--------------------------------------------------------------------===//
115 // Parameter Attribute List Construction and Mutation
116 //===--------------------------------------------------------------------===//
117
118 /// get - Return a ParamAttrs list with the specified parameter in it.
119 static PAListPtr get(const ParamAttrsWithIndex *Attr, unsigned NumAttrs);
120
121 /// get - Return a ParamAttr list with the parameters specified by the
122 /// consequtive random access iterator range.
123 template
124 static PAListPtr get(const Iter &I, const Iter &E) {
125 if (I == E) return PAListPtr(); // Empty list.
126 return get(&*I, E-I);
127 }
128
129 /// addAttr - Add the specified attribute at the specified index to this
130 /// attribute list. Since parameter attribute lists are immutable, this
131 /// returns the new list.
132 PAListPtr addAttr(unsigned Idx, ParameterAttributes Attrs) const;
133
134 /// removeAttr - Remove the specified attribute at the specified index from
135 /// this attribute list. Since parameter attribute lists are immutable, this
136 /// returns the new list.
137 PAListPtr removeAttr(unsigned Idx, ParameterAttributes Attrs) const;
138
139 //===--------------------------------------------------------------------===//
140 // Parameter Attribute List Accessors
141 //===--------------------------------------------------------------------===//
142
143 /// getParamAttrs - The parameter attributes for the specified parameter are
144 /// returned. Parameters for the result are denoted with Idx = 0.
145 ParameterAttributes getParamAttrs(unsigned Idx) const;
146
147 /// paramHasAttr - Return true if the specified parameter index has the
148 /// specified attribute set.
149 bool paramHasAttr(unsigned Idx, ParameterAttributes Attr) const {
150 return getParamAttrs(Idx) & Attr;
151 }
152
153 /// getParamAlignment - Return the alignment for the specified function
154 /// parameter.
155 unsigned getParamAlignment(unsigned Idx) const {
156 return (getParamAttrs(Idx) & ParamAttr::Alignment) >> 16;
157 }
158
159 /// hasAttrSomewhere - Return true if the specified attribute is set for at
160 /// least one parameter or for the return value.
161 bool hasAttrSomewhere(ParameterAttributes Attr) const;
162
163 /// operator< - Provide an ordering for parameter attribute lists.
164 bool operator==(const PAListPtr &RHS) const { return PAList == RHS.PAList; }
165 bool operator!=(const PAListPtr &RHS) const { return PAList != RHS.PAList; }
166
167 void dump() const;
168
169 //===--------------------------------------------------------------------===//
170 // Parameter Attribute List Introspection
171 //===--------------------------------------------------------------------===//
172
173 /// getRawPointer - Return a raw pointer that uniquely identifies this
174 /// parameter attribute list.
175 void *getRawPointer() const {
176 return PAList;
177 }
178
179 // Parameter attributes are stored as a dense set of slots, where there is one
180 // slot for each argument that has an attribute. This allows walking over the
181 // dense set instead of walking the sparse list of attributes.
182
183 /// isEmpty - Return true if no parameters have an attribute.
184 ///
185 bool isEmpty() const {
186 return PAList == 0;
187 }
188
189 /// getNumSlots - Return the number of slots used in this attribute list.
190 /// This is the number of arguments that have an attribute set on them
191 /// (including the function itself).
192 unsigned getNumSlots() const;
193
194 /// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
195 /// holds a parameter number plus a set of attributes.
196 const ParamAttrsWithIndex &getSlot(unsigned Slot) const;
197
198 private:
199 explicit PAListPtr(ParamAttributeListImpl *L);
200 };
93201
94202 } // End llvm namespace
95203
2727
2828 class CallInst;
2929 class InvokeInst;
30 class ParamAttrsList;
3130
3231 class CallSite {
3332 Instruction *I;
6160
6261 /// getParamAttrs/setParamAttrs - get or set the parameter attributes of
6362 /// the call.
64 const ParamAttrsList *getParamAttrs() const;
65 void setParamAttrs(const ParamAttrsList *PAL);
63 const PAListPtr &getParamAttrs() const;
64 void setParamAttrs(const PAListPtr &PAL);
6665
6766 /// paramHasAttr - whether the call or the callee has the given attribute.
6867 bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
379379
380380
381381 /* Copy the first part of user declarations. */
382 #line 14 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
382 #line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
383383
384384 #include "ParserInternals.h"
385385 #include "llvm/CallingConv.h"
394394 #include "llvm/ADT/STLExtras.h"
395395 #include "llvm/Support/MathExtras.h"
396396 #include "llvm/Support/Streams.h"
397 #include "llvm/ParamAttrsList.h"
398397 #include
399398 #include
400399 #include
13371336
13381337 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
13391338 typedef union YYSTYPE
1340 #line 951 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
1339 #line 950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
13411340 {
13421341 llvm::Module *ModuleVal;
13431342 llvm::Function *FunctionVal;
13841383 llvm::ICmpInst::Predicate IPredicate;
13851384 llvm::FCmpInst::Predicate FPredicate;
13861385 }
1387 /* Line 187 of yacc.c. */
1388 #line 1390 "llvmAsmParser.tab.c"
1386 /* Line 193 of yacc.c. */
1387 #line 1389 "llvmAsmParser.tab.c"
13891388 YYSTYPE;
13901389 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
13911390 # define YYSTYPE_IS_DECLARED 1
13981397
13991398
14001399 /* Line 216 of yacc.c. */
1401 #line 1403 "llvmAsmParser.tab.c"
1400 #line 1402 "llvmAsmParser.tab.c"
14021401
14031402 #ifdef short
14041403 # undef short
14481447 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
14491448
14501449 #ifndef YY_
1451 # if YYENABLE_NLS
1450 # if defined YYENABLE_NLS && YYENABLE_NLS
14521451 # if ENABLE_NLS
14531452 # include /* INFRINGES ON USER NAME SPACE */
14541453 # define YY_(msgid) dgettext ("bison-runtime", msgid)
18281827 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
18291828 static const yytype_uint16 yyrline[] =
18301829 {
1831 0, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113,
1832 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1115, 1115, 1115,
1833 1115, 1115, 1115, 1116, 1116, 1116, 1116, 1116, 1116, 1119,
1834 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1127,
1835 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, 1131, 1132,
1836 1132, 1133, 1133, 1134, 1135, 1140, 1141, 1141, 1141, 1141,
1837 1141, 1143, 1143, 1143, 1144, 1144, 1146, 1147, 1151, 1155,
1838 1160, 1160, 1162, 1163, 1168, 1174, 1175, 1176, 1177, 1178,
1839 1182, 1183, 1184, 1188, 1189, 1190, 1191, 1195, 1196, 1197,
1840 1201, 1202, 1203, 1204, 1205, 1209, 1210, 1211, 1214, 1215,
1841 1216, 1217, 1218, 1219, 1220, 1227, 1228, 1229, 1230, 1231,
1842 1232, 1233, 1234, 1235, 1236, 1240, 1241, 1246, 1247, 1248,
1843 1249, 1250, 1251, 1254, 1255, 1260, 1261, 1268, 1269, 1275,
1844 1276, 1285, 1293, 1294, 1299, 1300, 1301, 1306, 1319, 1319,
1845 1319, 1319, 1319, 1319, 1319, 1322, 1326, 1330, 1337, 1342,
1846 1350, 1380, 1405, 1410, 1420, 1430, 1434, 1444, 1451, 1460,
1847 1467, 1472, 1477, 1484, 1485, 1492, 1499, 1507, 1513, 1525,
1848 1553, 1569, 1596, 1624, 1650, 1670, 1696, 1716, 1728, 1735,
1849 1801, 1811, 1821, 1827, 1837, 1843, 1853, 1858, 1863, 1876,
1850 1888, 1910, 1918, 1924, 1935, 1940, 1945, 1951, 1957, 1966,
1851 1970, 1978, 1978, 1981, 1981, 1984, 1996, 2017, 2022, 2030,
1852 2031, 2035, 2035, 2039, 2039, 2042, 2045, 2069, 2081, 2080,
1853 2092, 2091, 2101, 2100, 2111, 2151, 2154, 2160, 2170, 2174,
1854 2179, 2181, 2186, 2191, 2200, 2210, 2221, 2225, 2234, 2243,
1855 2248, 2382, 2382, 2384, 2393, 2393, 2395, 2400, 2412, 2416,
1856 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2449, 2453, 2478,
1857 2482, 2492, 2496, 2500, 2505, 2512, 2512, 2518, 2527, 2532,
1858 2537, 2541, 2550, 2559, 2568, 2572, 2576, 2581, 2588, 2595,
1859 2599, 2604, 2614, 2633, 2642, 2733, 2737, 2744, 2755, 2768,
1860 2778, 2789, 2799, 2810, 2818, 2828, 2835, 2838, 2839, 2846,
1861 2850, 2855, 2871, 2888, 2902, 2916, 2928, 2936, 2943, 2949,
1862 2955, 2961, 2976, 3074, 3079, 3083, 3090, 3097, 3105, 3112,
1863 3120, 3128, 3142, 3159, 3167
1830 0, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112,
1831 1112, 1113, 1113, 1113, 1113, 1113, 1113, 1114, 1114, 1114,
1832 1114, 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1115, 1118,
1833 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1126,
1834 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131,
1835 1131, 1132, 1132, 1133, 1134, 1139, 1140, 1140, 1140, 1140,
1836 1140, 1142, 1142, 1142, 1143, 1143, 1145, 1146, 1150, 1154,
1837 1159, 1159, 1161, 1162, 1167, 1173, 1174, 1175, 1176, 1177,
1838 1181, 1182, 1183, 1187, 1188, 1189, 1190, 1194, 1195, 1196,
1839 1200, 1201, 1202, 1203, 1204, 1208, 1209, 1210, 1213, 1214,
1840 1215, 1216, 1217, 1218, 1219, 1226, 1227, 1228, 1229, 1230,
1841 1231, 1232, 1233, 1234, 1235, 1239, 1240, 1245, 1246, 1247,
1842 1248, 1249, 1250, 1253, 1254, 1259, 1260, 1267, 1268, 1274,
1843 1275, 1284, 1292, 1293, 1298, 1299, 1300, 1305, 1318, 1318,
1844 1318, 1318, 1318, 1318, 1318, 1321, 1325, 1329, 1336, 1341,
1845 1349, 1379, 1404, 1409, 1419, 1429, 1433, 1443, 1450, 1459,
1846 1466, 1471, 1476, 1483, 1484, 1491, 1498, 1506, 1512, 1524,
1847 1552, 1568, 1595, 1623, 1649, 1669, 1695, 1715, 1727, 1734,
1848 1800, 1810, 1820, 1826, 1836, 1842, 1852, 1857, 1862, 1875,
1849 1887, 1909, 1917, 1923, 1934, 1939, 1944, 1950, 1956, 1965,
1850 1969, 1977, 1977, 1980, 1980, 1983, 1995, 2016, 2021, 2029,
1851 2030, 2034, 2034, 2038, 2038, 2041, 2044, 2068, 2080, 2079,
1852 2091, 2090, 2100, 2099, 2110, 2150, 2153, 2159, 2169, 2173,
1853 2178, 2180, 2185, 2190, 2199, 2209, 2220, 2224, 2233, 2242,
1854 2247, 2373, 2373, 2375, 2384, 2384, 2386, 2391, 2403, 2407,
1855 2412, 2416, 2420, 2424, 2428, 2432, 2436, 2440, 2444, 2469,
1856 2473, 2483, 2487, 2491, 2496, 2503, 2503, 2509, 2518, 2523,
1857 2528, 2532, 2541, 2550, 2559, 2563, 2567, 2572, 2579, 2586,
1858 2590, 2595, 2605, 2624, 2633, 2714, 2718, 2725, 2736, 2749,
1859 2759, 2770, 2780, 2791, 2799, 2809, 2816, 2819, 2820, 2827,
1860 2831, 2836, 2852, 2869, 2883, 2897, 2909, 2917, 2924, 2930,
1861 2936, 2942, 2957, 3043, 3048, 3052, 3059, 3066, 3074, 3081,
1862 3089, 3097, 3111, 3128, 3136
18641863 };
18651864 #endif
18661865
27452744 we won't break user code: when these are the locations we know. */
27462745
27472746 #ifndef YY_LOCATION_PRINT
2748 # if YYLTYPE_IS_TRIVIAL
2747 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
27492748 # define YY_LOCATION_PRINT(File, Loc) \
27502749 fprintf (File, "%d.%d-%d.%d", \
27512750 (Loc).first_line, (Loc).first_column, \
34863485 switch (yyn)
34873486 {
34883487 case 29:
3489 #line 1119 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3488 #line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
34903489 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
34913490 break;
34923491
34933492 case 30:
3494 #line 1119 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3493 #line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
34953494 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
34963495 break;
34973496
34983497 case 31:
3499 #line 1120 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3498 #line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35003499 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
35013500 break;
35023501
35033502 case 32:
3504 #line 1120 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3503 #line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35053504 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
35063505 break;
35073506
35083507 case 33:
3509 #line 1121 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3508 #line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35103509 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
35113510 break;
35123511
35133512 case 34:
3514 #line 1121 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3513 #line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35153514 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
35163515 break;
35173516
35183517 case 35:
3519 #line 1122 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3518 #line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35203519 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
35213520 break;
35223521
35233522 case 36:
3524 #line 1122 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3523 #line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35253524 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
35263525 break;
35273526
35283527 case 37:
3529 #line 1123 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3528 #line 1122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35303529 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
35313530 break;
35323531
35333532 case 38:
3534 #line 1123 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3533 #line 1122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35353534 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
35363535 break;
35373536
35383537 case 39:
3539 #line 1127 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3538 #line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35403539 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
35413540 break;
35423541
35433542 case 40:
3544 #line 1127 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3543 #line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35453544 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
35463545 break;
35473546
35483547 case 41:
3549 #line 1128 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3548 #line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35503549 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
35513550 break;
35523551
35533552 case 42:
3554 #line 1128 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3553 #line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35553554 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
35563555 break;
35573556
35583557 case 43:
3559 #line 1129 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3558 #line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35603559 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
35613560 break;
35623561
35633562 case 44:
3564 #line 1129 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3563 #line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35653564 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
35663565 break;
35673566
35683567 case 45:
3569 #line 1130 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3568 #line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35703569 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
35713570 break;
35723571
35733572 case 46:
3574 #line 1130 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3573 #line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35753574 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
35763575 break;
35773576
35783577 case 47:
3579 #line 1131 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3578 #line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35803579 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
35813580 break;
35823581
35833582 case 48:
3584 #line 1131 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3583 #line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35853584 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
35863585 break;
35873586
35883587 case 49:
3589 #line 1132 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3588 #line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35903589 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
35913590 break;
35923591
35933592 case 50:
3594 #line 1132 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3593 #line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
35953594 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
35963595 break;
35973596
35983597 case 51:
3599 #line 1133 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3598 #line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36003599 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
36013600 break;
36023601
36033602 case 52:
3604 #line 1133 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3603 #line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36053604 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
36063605 break;
36073606
36083607 case 53:
3609 #line 1134 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3608 #line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36103609 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
36113610 break;
36123611
36133612 case 54:
3614 #line 1135 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3613 #line 1134 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36153614 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
36163615 break;
36173616
36183617 case 65:
3619 #line 1144 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3618 #line 1143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36203619 { (yyval.StrVal) = 0; ;}
36213620 break;
36223621
36233622 case 66:
3624 #line 1146 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3623 #line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36253624 { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
36263625 break;
36273626
36283627 case 67:
3629 #line 1147 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3628 #line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36303629 { (yyval.UIntVal)=0; ;}
36313630 break;
36323631
36333632 case 68:
3634 #line 1151 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3633 #line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36353634 {
36363635 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
36373636 CHECK_FOR_ERROR
36393638 break;
36403639
36413640 case 69:
3642 #line 1155 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3641 #line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36433642 {
36443643 (yyval.StrVal) = 0;
36453644 CHECK_FOR_ERROR
36473646 break;
36483647
36493648 case 73:
3650 #line 1163 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3649 #line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36513650 {
36523651 (yyval.StrVal) = 0;
36533652 CHECK_FOR_ERROR
36553654 break;
36563655
36573656 case 74:
3658 #line 1168 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3657 #line 1167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36593658 {
36603659 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
36613660 CHECK_FOR_ERROR
36633662 break;
36643663
36653664 case 75:
3666 #line 1174 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3665 #line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36673666 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
36683667 break;
36693668
36703669 case 76:
3671 #line 1175 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3670 #line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36723671 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
36733672 break;
36743673
36753674 case 77:
3676 #line 1176 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3675 #line 1175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36773676 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
36783677 break;
36793678
36803679 case 78:
3681 #line 1177 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3680 #line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36823681 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
36833682 break;
36843683
36853684 case 79:
3686 #line 1178 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3685 #line 1177 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36873686 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
36883687 break;
36893688
36903689 case 80:
3691 #line 1182 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3690 #line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36923691 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
36933692 break;
36943693
36953694 case 81:
3696 #line 1183 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3695 #line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
36973696 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
36983697 break;
36993698
37003699 case 82:
3701 #line 1184 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3700 #line 1183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37023701 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37033702 break;
37043703
37053704 case 83:
3706 #line 1188 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3705 #line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37073706 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
37083707 break;
37093708
37103709 case 84:
3711 #line 1189 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3710 #line 1188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37123711 { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
37133712 break;
37143713
37153714 case 85:
3716 #line 1190 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3715 #line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37173716 { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
37183717 break;
37193718
37203719 case 86:
3721 #line 1191 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3720 #line 1190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37223721 { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
37233722 break;
37243723
37253724 case 87:
3726 #line 1195 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3725 #line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37273726 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37283727 break;
37293728
37303729 case 88:
3731 #line 1196 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3730 #line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37323731 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
37333732 break;
37343733
37353734 case 89:
3736 #line 1197 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3735 #line 1196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37373736 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
37383737 break;
37393738
37403739 case 90:
3741 #line 1201 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3740 #line 1200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37423741 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37433742 break;
37443743
37453744 case 91:
3746 #line 1202 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3745 #line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37473746 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
37483747 break;
37493748
37503749 case 92:
3751 #line 1203 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3750 #line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37523751 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
37533752 break;
37543753
37553754 case 93:
3756 #line 1204 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3755 #line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37573756 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
37583757 break;
37593758
37603759 case 94:
3761 #line 1205 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3760 #line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37623761 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
37633762 break;
37643763
37653764 case 95:
3766 #line 1209 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3765 #line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37673766 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
37683767 break;
37693768
37703769 case 96:
3771 #line 1210 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3770 #line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37723771 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
37733772 break;
37743773
37753774 case 97:
3776 #line 1211 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3775 #line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37773776 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
37783777 break;
37793778
37803779 case 98:
3781 #line 1214 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3780 #line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37823781 { (yyval.UIntVal) = CallingConv::C; ;}
37833782 break;
37843783
37853784 case 99:
3786 #line 1215 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3785 #line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37873786 { (yyval.UIntVal) = CallingConv::C; ;}
37883787 break;
37893788
37903789 case 100:
3791 #line 1216 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3790 #line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37923791 { (yyval.UIntVal) = CallingConv::Fast; ;}
37933792 break;
37943793
37953794 case 101:
3796 #line 1217 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3795 #line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
37973796 { (yyval.UIntVal) = CallingConv::Cold; ;}
37983797 break;
37993798
38003799 case 102:
3801 #line 1218 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3800 #line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38023801 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
38033802 break;
38043803
38053804 case 103:
3806 #line 1219 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3805 #line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38073806 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
38083807 break;
38093808
38103809 case 104:
3811 #line 1220 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3810 #line 1219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38123811 {
38133812 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
38143813 GEN_ERROR("Calling conv too large");
38183817 break;
38193818
38203819 case 105:
3821 #line 1227 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3820 #line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38223821 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
38233822 break;
38243823
38253824 case 106:
3826 #line 1228 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3825 #line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38273826 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
38283827 break;
38293828
38303829 case 107:
3831 #line 1229 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3830 #line 1228 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38323831 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
38333832 break;
38343833
38353834 case 108:
3836 #line 1230 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3835 #line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38373836 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
38383837 break;
38393838
38403839 case 109:
3841 #line 1231 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3840 #line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38423841 { (yyval.ParamAttrs) = ParamAttr::InReg; ;}
38433842 break;
38443843
38453844 case 110:
3846 #line 1232 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3845 #line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38473846 { (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
38483847 break;
38493848
38503849 case 111:
3851 #line 1233 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3850 #line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38523851 { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
38533852 break;
38543853
38553854 case 112:
3856 #line 1234 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3855 #line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38573856 { (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
38583857 break;
38593858
38603859 case 113:
3861 #line 1235 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3860 #line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38623861 { (yyval.ParamAttrs) = ParamAttr::Nest; ;}
38633862 break;
38643863
38653864 case 114:
3866 #line 1236 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3865 #line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38673866 { (yyval.ParamAttrs) =
38683867 ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
38693868 break;
38703869
38713870 case 115:
3872 #line 1240 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3871 #line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38733872 { (yyval.ParamAttrs) = ParamAttr::None; ;}
38743873 break;
38753874
38763875 case 116:
3877 #line 1241 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3876 #line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38783877 {
38793878 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
38803879 ;}
38813880 break;
38823881
38833882 case 117:
3884 #line 1246 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3883 #line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38853884 { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
38863885 break;
38873886
38883887 case 118:
3889 #line 1247 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3888 #line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38903889 { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
38913890 break;
38923891
38933892 case 119:
3894 #line 1248 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3893 #line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
38953894 { (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
38963895 break;
38973896
38983897 case 120:
3899 #line 1249 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3898 #line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39003899 { (yyval.ParamAttrs) = ParamAttr::SExt; ;}
39013900 break;
39023901
39033902 case 121:
3904 #line 1250 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3903 #line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39053904 { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
39063905 break;
39073906
39083907 case 122:
3909 #line 1251 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3908 #line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39103909 { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
39113910 break;
39123911
39133912 case 123:
3914 #line 1254 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3913 #line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39153914 { (yyval.ParamAttrs) = ParamAttr::None; ;}
39163915 break;
39173916
39183917 case 124:
3919 #line 1255 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3918 #line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39203919 {
39213920 (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
39223921 ;}
39233922 break;
39243923
39253924 case 125:
3926 #line 1260 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3925 #line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39273926 { (yyval.StrVal) = 0; ;}
39283927 break;
39293928
39303929 case 126:
3931 #line 1261 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3930 #line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39323931 {
39333932 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
39343933 ;}
39353934 break;
39363935
39373936 case 127:
3938 #line 1268 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3937 #line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39393938 { (yyval.UIntVal) = 0; ;}
39403939 break;
39413940
39423941 case 128:
3943 #line 1269 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3942 #line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39443943 {
39453944 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
39463945 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
39503949 break;
39513950
39523951 case 129:
3953 #line 1275 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3952 #line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39543953 { (yyval.UIntVal) = 0; ;}
39553954 break;
39563955
39573956 case 130:
3958 #line 1276 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3957 #line 1275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39593958 {
39603959 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
39613960 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
39653964 break;
39663965
39673966 case 131:
3968 #line 1285 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3967 #line 1284 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39693968 {
39703969 for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
39713970 if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
39763975 break;
39773976
39783977 case 132:
3979 #line 1293 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3978 #line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39803979 { (yyval.StrVal) = 0; ;}
39813980 break;
39823981
39833982 case 133:
3984 #line 1294 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3983 #line 1293 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39853984 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
39863985 break;
39873986
39883987 case 134:
3989 #line 1299 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3988 #line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39903989 {;}
39913990 break;
39923991
39933992 case 135:
3994 #line 1300 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3993 #line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
39953994 {;}
39963995 break;
39973996
39983997 case 136:
3999 #line 1301 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
3998 #line 1300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40003999 {
40014000 CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
40024001 delete (yyvsp[(1) - (1)].StrVal);
40054004 break;
40064005
40074006 case 137:
4008 #line 1306 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4007 #line 1305 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40094008 {
40104009 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
40114010 GEN_ERROR("Alignment must be a power of two");
40154014 break;
40164015
40174016 case 145:
4018 #line 1322 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4017 #line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40194018 {
40204019 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
40214020 CHECK_FOR_ERROR
40234022 break;
40244023
40254024 case 146:
4026 #line 1326 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4025 #line 1325 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40274026 {
40284027 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
40294028 CHECK_FOR_ERROR
40314030 break;
40324031
40334032 case 147:
4034 #line 1330 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4033 #line 1329 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40354034 { // Pointer type?
40364035 if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
40374036 GEN_ERROR("Cannot form a pointer to a basic block");
40424041 break;
40434042
40444043 case 148:
4045 #line 1337 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4044 #line 1336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40464045 { // Named types are also simple types...
40474046 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
40484047 CHECK_FOR_ERROR
40514050 break;
40524051
40534052 case 149:
4054 #line 1342 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4053 #line 1341 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40554054 { // Type UpReference
40564055 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
40574056 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
40634062 break;
40644063
40654064 case 150:
4066 #line 1350 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4065 #line 1349 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
40674066 {
40684067 // Allow but ignore attributes on function types; this permits auto-upgrade.
40694068 // FIXME: remove in LLVM 3.0.
40974096 break;
40984097
40994098 case 151:
4100 #line 1380 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4099 #line 1379 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41014100 {
41024101 // Allow but ignore attributes on function types; this permits auto-upgrade.
41034102 // FIXME: remove in LLVM 3.0.
41254124 break;
41264125
41274126 case 152:
4128 #line 1405 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4127 #line 1404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41294128 { // Sized array type?
41304129 (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
41314130 delete (yyvsp[(4) - (5)].TypeVal);
41344133 break;
41354134
41364135 case 153:
4137 #line 1410 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4136 #line 1409 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41384137 { // Vector type?
41394138 const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
41404139 if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
41484147 break;
41494148
41504149 case 154:
4151 #line 1420 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4150 #line 1419 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41524151 { // Structure type?
41534152 std::vector Elements;
41544153 for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
41624161 break;
41634162
41644163 case 155:
4165 #line 1430 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4164 #line 1429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41664165 { // Empty structure type?
41674166 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector()));
41684167 CHECK_FOR_ERROR
41704169 break;
41714170
41724171 case 156:
4173 #line 1434 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4172 #line 1433 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41744173 {
41754174 std::vector Elements;
41764175 for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
41844183 break;
41854184
41864185 case 157:
4187 #line 1444 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4186 #line 1443 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41884187 { // Empty structure type?
41894188 (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true));
41904189 CHECK_FOR_ERROR
41924191 break;
41934192
41944193 case 158:
4195 #line 1451 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4194 #line 1450 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
41964195 {
41974196 // Allow but ignore attributes on function types; this permits auto-upgrade.
41984197 // FIXME: remove in LLVM 3.0.
42024201 break;
42034202
42044203 case 159:
4205 #line 1460 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4204 #line 1459 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42064205 {
42074206 if (!UpRefs.empty())
42084207 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
42134212 break;
42144213
42154214 case 160:
4216 #line 1467 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4215 #line 1466 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42174216 {
42184217 (yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
42194218 ;}
42204219 break;
42214220
42224221 case 161:
4223 #line 1472 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4222 #line 1471 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42244223 {
42254224 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
42264225 (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
42294228 break;
42304229
42314230 case 162:
4232 #line 1477 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4231 #line 1476 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42334232 {
42344233 ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
42354234 CHECK_FOR_ERROR
42374236 break;
42384237
42394238 case 164:
4240 #line 1485 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4239 #line 1484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42414240 {
42424241 (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
42434242 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
42484247 break;
42494248
42504249 case 165:
4251 #line 1492 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4250 #line 1491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42524251 {
42534252 (yyval.TypeWithAttrsList) = new TypeWithAttrsList;
42544253 TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
42594258 break;
42604259
42614260 case 166:
4262 #line 1499 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4261 #line 1498 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42634262 {
42644263 (yyval.TypeWithAttrsList) = new TypeWithAttrsList();
42654264 CHECK_FOR_ERROR
42674266 break;
42684267
42694268 case 167:
4270 #line 1507 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4269 #line 1506 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42714270 {
42724271 (yyval.TypeList) = new std::list();
42734272 (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
42774276 break;
42784277
42794278 case 168:
4280 #line 1513 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4279 #line 1512 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42814280 {
42824281 ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
42834282 delete (yyvsp[(3) - (3)].TypeVal);
42864285 break;
42874286
42884287 case 169:
4289 #line 1525 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4288 #line 1524 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
42904289 { // Nonempty unsized arr
42914290 if (!UpRefs.empty())
42924291 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
43184317 break;
43194318
43204319 case 170:
4321 #line 1553 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4320 #line 1552 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
43224321 {
43234322 if (!UpRefs.empty())
43244323 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
43384337 break;
43394338
43404339 case 171:
4341 #line 1569 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4340 #line 1568 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
43424341 {
43434342 if (!UpRefs.empty())
43444343 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
43694368 break;
43704369
43714370 case 172:
4372 #line 1596 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4371 #line 1595 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
43734372 { // Nonempty unsized arr
43744373 if (!UpRefs.empty())
43754374 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
44014400 break;
44024401
44034402 case 173:
4404 #line 1624 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4403 #line 1623 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
44054404 {
44064405 const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get());
44074406 if (STy == 0)
44314430 break;
44324431
44334432 case 174:
4434 #line 1650 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4433 #line 1649 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
44354434 {
44364435 if (!UpRefs.empty())
44374436 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
44554454 break;
44564455
44574456 case 175:
4458 #line 1670 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4457 #line 1669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
44594458 {
44604459 const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get());
44614460 if (STy == 0)
44854484 break;
44864485
44874486 case 176:
4488 #line 1696 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4487 #line 1695 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
44894488 {
44904489 if (!UpRefs.empty())
44914490 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
45094508 break;
45104509
45114510 case 177:
4512 #line 1716 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4511 #line 1715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
45134512 {
45144513 if (!UpRefs.empty())
45154514 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
45254524 break;
45264525
45274526 case 178:
4528 #line 1728 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4527 #line 1727 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
45294528 {
45304529 if (!UpRefs.empty())
45314530 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
45364535 break;
45374536
45384537 case 179:
4539 #line 1735 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4538 #line 1734 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
45404539 {
45414540 if (!UpRefs.empty())
45424541 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
46064605 break;
46074606
46084607 case 180:
4609 #line 1801 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4608 #line 1800 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46104609 {
46114610 if (!UpRefs.empty())
46124611 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
46204619 break;
46214620
46224621 case 181:
4623 #line 1811 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4622 #line 1810 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46244623 {
46254624 if (!UpRefs.empty())
46264625 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
46344633 break;
46354634
46364635 case 182:
4637 #line 1821 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4636 #line 1820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46384637 { // integral constants
46394638 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
46404639 GEN_ERROR("Constant value doesn't fit in type");
46444643 break;
46454644
46464645 case 183:
4647 #line 1827 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4646 #line 1826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46484647 { // arbitrary precision integer constants
46494648 uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
46504649 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
46584657 break;
46594658
46604659 case 184:
4661 #line 1837 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4660 #line 1836 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46624661 { // integral constants
46634662 if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
46644663 GEN_ERROR("Constant value doesn't fit in type");
46684667 break;
46694668
46704669 case 185:
4671 #line 1843 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4670 #line 1842 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46724671 { // arbitrary precision integer constants
46734672 uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth();
46744673 if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
46824681 break;
46834682
46844683 case 186:
4685 #line 1853 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4684 #line 1852 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46864685 { // Boolean constants
46874686 assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
46884687 (yyval.ConstVal) = ConstantInt::getTrue();
46914690 break;
46924691
46934692 case 187:
4694 #line 1858 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4693 #line 1857 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
46954694 { // Boolean constants
46964695 assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
46974696 (yyval.ConstVal) = ConstantInt::getFalse();
47004699 break;
47014700
47024701 case 188:
4703 #line 1863 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4702 #line 1862 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47044703 { // Floating point constants
47054704 if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
47064705 GEN_ERROR("Floating point constant invalid for type");
47154714 break;
47164715
47174716 case 189:
4718 #line 1876 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4717 #line 1875 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47194718 {
47204719 if (!UpRefs.empty())
47214720 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
47314730 break;
47324731
47334732 case 190:
4734 #line 1888 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4733 #line 1887 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47354734 {
47364735 if (!isa((yyvsp[(3) - (5)].ConstVal)->getType()))
47374736 GEN_ERROR("GetElementPtr requires a pointer operand");
47574756 break;
47584757
47594758 case 191:
4760 #line 1910 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4759 #line 1909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47614760 {
47624761 if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
47634762 GEN_ERROR("Select condition must be of boolean type");
47694768 break;
47704769
47714770 case 192:
4772 #line 1918 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4771 #line 1917 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47734772 {
47744773 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
47754774 GEN_ERROR("Binary operator types must match");
47794778 break;
47804779
47814780 case 193:
4782 #line 1924 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4781 #line 1923 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47834782 {
47844783 if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
47854784 GEN_ERROR("Logical operator types must match");
47944793 break;
47954794
47964795 case 194:
4797 #line 1935 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4796 #line 1934 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
47984797 {
47994798 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
48004799 GEN_ERROR("icmp operand types must match");
48034802 break;
48044803
48054804 case 195:
4806 #line 1940 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4805 #line 1939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48074806 {
48084807 if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
48094808 GEN_ERROR("fcmp operand types must match");
48124811 break;
48134812
48144813 case 196:
4815 #line 1945 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4814 #line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48164815 {
48174816 if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
48184817 GEN_ERROR("Invalid extractelement operands");
48224821 break;
48234822
48244823 case 197:
4825 #line 1951 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4824 #line 1950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48264825 {
48274826 if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
48284827 GEN_ERROR("Invalid insertelement operands");
48324831 break;
48334832
48344833 case 198:
4835 #line 1957 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4834 #line 1956 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48364835 {
48374836 if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
48384837 GEN_ERROR("Invalid shufflevector operands");
48424841 break;
48434842
48444843 case 199:
4845 #line 1966 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4844 #line 1965 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48464845 {
48474846 ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
48484847 CHECK_FOR_ERROR
48504849 break;
48514850
48524851 case 200:
4853 #line 1970 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4852 #line 1969 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48544853 {
48554854 (yyval.ConstVector) = new std::vector();
48564855 (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
48594858 break;
48604859
48614860 case 201:
4862 #line 1978 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4861 #line 1977 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48634862 { (yyval.BoolVal) = false; ;}
48644863 break;
48654864
48664865 case 202:
4867 #line 1978 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4866 #line 1977 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48684867 { (yyval.BoolVal) = true; ;}
48694868 break;
48704869
48714870 case 203:
4872 #line 1981 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4871 #line 1980 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48734872 { (yyval.BoolVal) = true; ;}
48744873 break;
48754874
48764875 case 204:
4877 #line 1981 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4876 #line 1980 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48784877 { (yyval.BoolVal) = false; ;}
48794878 break;
48804879
48814880 case 205:
4882 #line 1984 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4881 #line 1983 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48834882 {
48844883 const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
48854884 Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
48954894 break;
48964895
48974896 case 206:
4898 #line 1996 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4897 #line 1995 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
48994898 {
49004899 Constant *Val = (yyvsp[(3) - (6)].ConstVal);
49014900 const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
49114910 break;
49124911
49134912 case 207:
4914 #line 2017 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4913 #line 2016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49154914 {
49164915 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
49174916 CurModule.ModuleDone();
49204919 break;
49214920
49224921 case 208:
4923 #line 2022 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4922 #line 2021 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49244923 {
49254924 (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
49264925 CurModule.ModuleDone();
49294928 break;
49304929
49314930 case 211:
4932 #line 2035 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4931 #line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49334932 { CurFun.isDeclare = false; ;}
49344933 break;
49354934
49364935 case 212:
4937 #line 2035 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4936 #line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49384937 {
49394938 CurFun.FunctionDone();
49404939 CHECK_FOR_ERROR
49424941 break;
49434942
49444943 case 213:
4945 #line 2039 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4944 #line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49464945 { CurFun.isDeclare = true; ;}
49474946 break;
49484947
49494948 case 214:
4950 #line 2039 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4949 #line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49514950 {
49524951 CHECK_FOR_ERROR
49534952 ;}
49544953 break;
49554954
49564955 case 215:
4957 #line 2042 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4956 #line 2041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49584957 {
49594958 CHECK_FOR_ERROR
49604959 ;}
49614960 break;
49624961
49634962 case 216:
4964 #line 2045 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4963 #line 2044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49654964 {
49664965 if (!UpRefs.empty())
49674966 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
49894988 break;
49904989
49914990 case 217:
4992 #line 2069 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
4991 #line 2068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
49934992 {
49944993 ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
49954994
50045003 break;
50055004
50065005 case 218:
5007 #line 2081 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5006 #line 2080 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50085007 {
50095008 /* "Externally Visible" Linkage */
50105009 if ((yyvsp[(5) - (6)].ConstVal) == 0)
50165015 break;
50175016
50185017 case 219:
5019 #line 2088 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5018 #line 2087 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50205019 {
50215020 CurGV = 0;
50225021 ;}
50235022 break;
50245023
50255024 case 220:
5026 #line 2092 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5025 #line 2091 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50275026 {
50285027 if ((yyvsp[(6) - (7)].ConstVal) == 0)
50295028 GEN_ERROR("Global value initializer is not a constant");
50335032 break;
50345033
50355034 case 221:
5036 #line 2097 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5035 #line 2096 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50375036 {
50385037 CurGV = 0;
50395038 ;}
50405039 break;
50415040
50425041 case 222:
5043 #line 2101 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5042 #line 2100 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50445043 {
50455044 if (!UpRefs.empty())
50465045 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
50515050 break;
50525051
50535052 case 223:
5054 #line 2107 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5053 #line 2106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50555054 {
50565055 CurGV = 0;
50575056 CHECK_FOR_ERROR
50595058 break;
50605059
50615060 case 224:
5062 #line 2111 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5061 #line 2110 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
50635062 {
50645063 std::string Name;
50655064 if ((yyvsp[(1) - (5)].StrVal)) {
51035102 break;
51045103
51055104 case 225:
5106 #line 2151 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5105 #line 2150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51075106 {
51085107 CHECK_FOR_ERROR
51095108 ;}
51105109 break;
51115110
51125111 case 226:
5113 #line 2154 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5112 #line 2153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51145113 {
51155114 CHECK_FOR_ERROR
51165115 ;}
51175116 break;
51185117
51195118 case 227:
5120 #line 2160 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5119 #line 2159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51215120 {
51225121 const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
51235122 if (AsmSoFar.empty())
51305129 break;
51315130
51325131 case 228:
5133 #line 2170 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5132 #line 2169 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51345133 {
51355134 CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
51365135 delete (yyvsp[(3) - (3)].StrVal);
51385137 break;
51395138
51405139 case 229:
5141 #line 2174 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5140 #line 2173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51425141 {
51435142 CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
51445143 delete (yyvsp[(3) - (3)].StrVal);
51465145 break;
51475146
51485147 case 231:
5149 #line 2181 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5148 #line 2180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51505149 {
51515150 CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
51525151 delete (yyvsp[(3) - (3)].StrVal);
51555154 break;
51565155
51575156 case 232:
5158 #line 2186 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5157 #line 2185 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51595158 {
51605159 CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
51615160 delete (yyvsp[(1) - (1)].StrVal);
51645163 break;
51655164
51665165 case 233:
5167 #line 2191 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5166 #line 2190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51685167 {
51695168 CHECK_FOR_ERROR
51705169 ;}
51715170 break;
51725171
51735172 case 234:
5174 #line 2200 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5173 #line 2199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51755174 {
51765175 if (!UpRefs.empty())
51775176 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
51855184 break;
51865185
51875186 case 235:
5188 #line 2210 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5187 #line 2209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
51895188 {
51905189 if (!UpRefs.empty())
51915190 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
51995198 break;
52005199
52015200 case 236:
5202 #line 2221 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5201 #line 2220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
52035202 {
52045203 (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
52055204 CHECK_FOR_ERROR
52075206 break;
52085207
52095208 case 237:
5210 #line 2225 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5209 #line 2224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
52115210 {
52125211 (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
52135212 struct ArgListEntry E;
52205219 break;
52215220
52225221 case 238:
5223 #line 2234 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5222 #line 2233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
52245223 {
52255224 (yyval.ArgList) = new ArgListType;
52265225 struct ArgListEntry E;
52335232 break;
52345233
52355234 case 239:
5236 #line 2243 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5235 #line 2242 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
52375236 {
52385237 (yyval.ArgList) = 0;
52395238 CHECK_FOR_ERROR
52415240 break;
52425241
52435242 case 240:
5244 #line 2249 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5243 #line 2248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
52455244 {
52465245 std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
52475246 delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
52525251 GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
52535252
52545253 std::vector ParamTypeList;
5255 ParamAttrsVector Attrs;
5256 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) {
5257 ParamAttrsWithIndex PAWI;
5258 PAWI.index = 0;
5259 PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs);
5260 Attrs.push_back(PAWI);
5261 }
5254 SmallVector Attrs;
5255 if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
5256 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
52625257 if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
52635258 unsigned index = 1;
52645259 for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
52665261 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
52675262 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
52685263 ParamTypeList.push_back(Ty);
5269 if (Ty != Type::VoidTy)
5270 if (I->Attrs != ParamAttr::None) {
5271 ParamAttrsWithIndex PAWI;
5272 PAWI.index = index;
5273 PAWI.attrs = I->Attrs;
5274 Attrs.push_back(PAWI);
5275 }
5264 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
5265 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
52765266 }
52775267 }
52785268
52795269 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
52805270 if (isVarArg) ParamTypeList.pop_back();
52815271
5282 const ParamAttrsList *PAL = 0;
5272 PAListPtr PAL;
52835273 if (!Attrs.empty())
5284 PAL = ParamAttrsList::get(Attrs);
5274 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
52855275
52865276 FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
52875277 const PointerType *PFT = PointerType::getUnqual(FT);
53005290 // Move the function to the end of the list, from whereever it was
53015291 // previously inserted.
53025292 Fn = cast(FWRef);
5303 assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
5293 assert(Fn->getParamAttrs().isEmpty() &&
5294 "Forward reference has parameter attributes!");
53045295 CurModule.CurrentModule->getFunctionList().remove(Fn);
53055296 CurModule.CurrentModule->getFunctionList().push_back(Fn);
53065297 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
53775368 break;
53785369
53795370 case 243:
5380 #line 2384 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5371 #line 2375 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
53815372 {
53825373 (yyval.FunctionVal) = CurFun.CurrentFunction;
53835374
53895380 break;
53905381
53915382 case 246:
5392 #line 2395 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5383 #line 2386 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
53935384 {
53945385 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
53955386 CHECK_FOR_ERROR
53975388 break;
53985389
53995390 case 247:
5400 #line 2400 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5391 #line 2391 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54015392 {
54025393 CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
54035394 CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
54085399 break;
54095400
54105401 case 248:
5411 #line 2412 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5402 #line 2403 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54125403 {
54135404 (yyval.BoolVal) = false;
54145405 CHECK_FOR_ERROR
54165407 break;
54175408
54185409 case 249:
5419 #line 2416 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5410 #line 2407 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54205411 {
54215412 (yyval.BoolVal) = true;
54225413 CHECK_FOR_ERROR
54245415 break;
54255416
54265417 case 250:
5427 #line 2421 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5418 #line 2412 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54285419 { // A reference to a direct constant
54295420 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
54305421 CHECK_FOR_ERROR
54325423 break;
54335424
54345425 case 251:
5435 #line 2425 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5426 #line 2416 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54365427 {
54375428 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
54385429 CHECK_FOR_ERROR
54405431 break;
54415432
54425433 case 252:
5443 #line 2429 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5434 #line 2420 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54445435 { // Perhaps it's an FP constant?
54455436 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
54465437 CHECK_FOR_ERROR
54485439 break;
54495440
54505441 case 253:
5451 #line 2433 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5442 #line 2424 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54525443 {
54535444 (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
54545445 CHECK_FOR_ERROR
54565447 break;
54575448
54585449 case 254:
5459 #line 2437 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5450 #line 2428 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54605451 {
54615452 (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
54625453 CHECK_FOR_ERROR
54645455 break;
54655456
54665457 case 255:
5467 #line 2441 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5458 #line 2432 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54685459 {
54695460 (yyval.ValIDVal) = ValID::createNull();
54705461 CHECK_FOR_ERROR
54725463 break;
54735464
54745465 case 256:
5475 #line 2445 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5466 #line 2436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54765467 {
54775468 (yyval.ValIDVal) = ValID::createUndef();
54785469 CHECK_FOR_ERROR
54805471 break;
54815472
54825473 case 257:
5483 #line 2449 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5474 #line 2440 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54845475 { // A vector zero constant.
54855476 (yyval.ValIDVal) = ValID::createZeroInit();
54865477 CHECK_FOR_ERROR
54885479 break;
54895480
54905481 case 258:
5491 #line 2453 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5482 #line 2444 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
54925483 { // Nonempty unsized packed vector
54935484 const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
54945485 int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
55175508 break;
55185509
55195510 case 259:
5520 #line 2478 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5511 #line 2469 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55215512 {
55225513 (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
55235514 CHECK_FOR_ERROR
55255516 break;
55265517
55275518 case 260:
5528 #line 2482 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5519 #line 2473 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55295520 {
55305521 (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
55315522 delete (yyvsp[(3) - (5)].StrVal);
55355526 break;
55365527
55375528 case 261:
5538 #line 2492 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5529 #line 2483 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55395530 { // Is it an integer reference...?
55405531 (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
55415532 CHECK_FOR_ERROR
55435534 break;
55445535
55455536 case 262:
5546 #line 2496 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5537 #line 2487 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55475538 {
55485539 (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
55495540 CHECK_FOR_ERROR
55515542 break;
55525543
55535544 case 263:
5554 #line 2500 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5545 #line 2491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55555546 { // Is it a named reference...?
55565547 (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
55575548 delete (yyvsp[(1) - (1)].StrVal);
55605551 break;
55615552
55625553 case 264:
5563 #line 2505 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5554 #line 2496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55645555 { // Is it a named reference...?
55655556 (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
55665557 delete (yyvsp[(1) - (1)].StrVal);
55695560 break;
55705561
55715562 case 267:
5572 #line 2518 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5563 #line 2509 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55735564 {
55745565 if (!UpRefs.empty())
55755566 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
55805571 break;
55815572
55825573 case 268:
5583 #line 2527 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5574 #line 2518 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55845575 {
55855576 (yyval.ValueList) = new std::vector();
55865577 (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
55895580 break;
55905581
55915582 case 269:
5592 #line 2532 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5583 #line 2523 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
55935584 {
55945585 ((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
55955586 CHECK_FOR_ERROR
55975588 break;
55985589
55995590 case 270:
5600 #line 2537 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5591 #line 2528 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56015592 {
56025593 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
56035594 CHECK_FOR_ERROR
56055596 break;
56065597
56075598 case 271:
5608 #line 2541 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5599 #line 2532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56095600 { // Do not allow functions with 0 basic blocks
56105601 (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
56115602 CHECK_FOR_ERROR
56135604 break;
56145605
56155606 case 272:
5616 #line 2550 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5607 #line 2541 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56175608 {
56185609 setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
56195610 CHECK_FOR_ERROR
56255616 break;
56265617
56275618 case 273:
5628 #line 2559 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5619 #line 2550 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56295620 {
56305621 if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal)))
56315622 if (CastInst *CI2 = dyn_cast(CI1->getOperand(0)))
56385629 break;
56395630
56405631 case 274:
5641 #line 2568 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5632 #line 2559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56425633 { // Empty space between instruction lists
56435634 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum), 0);
56445635 CHECK_FOR_ERROR
56465637 break;
56475638
56485639 case 275:
5649 #line 2572 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5640 #line 2563 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56505641 { // Only the unwind to block
56515642 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum), getBBVal((yyvsp[(3) - (3)].ValIDVal)));
56525643 CHECK_FOR_ERROR
56545645 break;
56555646
56565647 case 276:
5657 #line 2576 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5648 #line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56585649 { // Labelled (named) basic block
56595650 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)), 0);
56605651 delete (yyvsp[(1) - (1)].StrVal);
56635654 break;
56645655
56655656 case 277:
5666 #line 2581 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5657 #line 2572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56675658 {
56685659 (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (4)].StrVal)), getBBVal((yyvsp[(4) - (4)].ValIDVal)));
56695660 delete (yyvsp[(1) - (4)].StrVal);
56725663 break;
56735664
56745665 case 278:
5675 #line 2588 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5666 #line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56765667 { // Return with a result...
56775668 ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
56785669 assert(!VL.empty() && "Invalid ret operands!");
56835674 break;
56845675
56855676 case 279:
5686 #line 2595 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5677 #line 2586 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56875678 { // Return with no result...
56885679 (yyval.TermInstVal) = new ReturnInst();
56895680 CHECK_FOR_ERROR
56915682 break;
56925683
56935684 case 280:
5694 #line 2599 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5685 #line 2590 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
56955686 { // Unconditional Branch...
56965687 BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
56975688 CHECK_FOR_ERROR
57005691 break;
57015692
57025693 case 281:
5703 #line 2604 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5694 #line 2595 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
57045695 {
57055696 assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
57065697 BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
57145705 break;
57155706
57165707 case 282:
5717 #line 2614 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5708 #line 2605 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
57185709 {
57195710 Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
57205711 CHECK_FOR_ERROR
57375728 break;
57385729
57395730 case 283:
5740 #line 2633 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5731 #line 2624 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
57415732 {
57425733 Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
57435734 CHECK_FOR_ERROR
57505741 break;
57515742
57525743 case 284:
5753 #line 2643 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5744 #line 2634 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
57545745 {
57555746
57565747 // Handle the short syntax
57805771 BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
57815772 CHECK_FOR_ERROR
57825773
5783 ParamAttrsVector Attrs;
5784 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) {
5785 ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs);
5786 Attrs.push_back(PAWI);
5787 }
5774 SmallVector Attrs;
5775 if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
5776 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
57885777
57895778 // Check the arguments
57905779 ValueList Args;
58065795 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
58075796 (*I)->getDescription() + "'");
58085797 Args.push_back(ArgI->Val);
5809 if (ArgI->Attrs != ParamAttr::None) {
5810 ParamAttrsWithIndex PAWI;
5811 PAWI.index = index;
5812 PAWI.attrs = ArgI->Attrs;
5813 Attrs.push_back(PAWI);
5814 }
5798 if (ArgI->Attrs != ParamAttr::None)
5799 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
58155800 }
58165801
58175802 if (Ty->isVarArg()) {
58185803 if (I == E)
58195804 for (; ArgI != ArgE; ++ArgI, ++index) {
58205805 Args.push_back(ArgI->Val); // push the remaining varargs
5821 if (ArgI->Attrs != ParamAttr::None) {
5822 ParamAttrsWithIndex PAWI;
5823 PAWI.index = index;
5824 PAWI.attrs = ArgI->Attrs;
5825 Attrs.push_back(PAWI);
5826 }
5806 if (ArgI->Attrs != ParamAttr::None)
5807 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
58275808 }
58285809 } else if (I != E || ArgI != ArgE)
58295810 GEN_ERROR("Invalid number of parameters detected");
58305811 }
58315812
5832 const ParamAttrsList *PAL = 0;
5813 PAListPtr PAL;
58335814 if (!Attrs.empty())
5834 PAL = ParamAttrsList::get(Attrs);
5815 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
58355816
58365817 // Create the InvokeInst
5837 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
5818 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(),Args.end());
58385819 II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
58395820 II->setParamAttrs(PAL);
58405821 (yyval.TermInstVal) = II;
58445825 break;
58455826
58465827 case 285:
5847 #line 2733 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5828 #line 2714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
58485829 {
58495830 (yyval.TermInstVal) = new UnwindInst();
58505831 CHECK_FOR_ERROR
58525833 break;
58535834
58545835 case 286:
5855 #line 2737 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5836 #line 2718 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
58565837 {
58575838 (yyval.TermInstVal) = new UnreachableInst();
58585839 CHECK_FOR_ERROR
58605841 break;
58615842
58625843 case 287:
5863 #line 2744 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5844 #line 2725 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
58645845 {
58655846 (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
58665847 Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
58755856 break;
58765857
58775858 case 288:
5878 #line 2755 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5859 #line 2736 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
58795860 {
58805861 (yyval.JumpTable) = new std::vector >();
58815862 Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
58915872 break;
58925873
58935874 case 289:
5894 #line 2768 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5875 #line 2749 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
58955876 {
58965877 // Is this definition named?? if so, assign the name...
58975878 setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
59035884 break;
59045885
59055886 case 290:
5906 #line 2778 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5887 #line 2759 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59075888 { // Used for PHI nodes
59085889 if (!UpRefs.empty())
59095890 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
59185899 break;
59195900
59205901 case 291:
5921 #line 2789 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5902 #line 2770 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59225903 {
59235904 (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
59245905 Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
59305911 break;
59315912
59325913 case 292:
5933 #line 2799 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5914 #line 2780 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59345915 {
59355916 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59365917 if (!UpRefs.empty())
59455926 break;
59465927
59475928 case 293:
5948 #line 2810 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5929 #line 2791 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59495930 {
59505931 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59515932 // Labels are only valid in ASMs
59575938 break;
59585939
59595940 case 294:
5960 #line 2818 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5941 #line 2799 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59615942 {
59625943 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59635944 if (!UpRefs.empty())
59715952 break;
59725953
59735954 case 295:
5974 #line 2828 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5955 #line 2809 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59755956 {
59765957 // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
59775958 (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
59825963 break;
59835964
59845965 case 296:
5985 #line 2835 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5966 #line 2816 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59865967 { (yyval.ParamList) = new ParamList(); ;}
59875968 break;
59885969
59895970 case 297:
5990 #line 2838 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5971 #line 2819 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59915972 { (yyval.ValueList) = new std::vector(); ;}
59925973 break;
59935974
59945975 case 298:
5995 #line 2839 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5976 #line 2820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
59965977 {
59975978 (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
59985979 (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
60015982 break;
60025983
60035984 case 299:
6004 #line 2846 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5985 #line 2827 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60055986 {
60065987 (yyval.BoolVal) = true;
60075988 CHECK_FOR_ERROR
60095990 break;
60105991
60115992 case 300:
6012 #line 2850 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
5993 #line 2831 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60135994 {
60145995 (yyval.BoolVal) = false;
60155996 CHECK_FOR_ERROR
60175998 break;
60185999
60196000 case 301:
6020 #line 2855 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6001 #line 2836 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60216002 {
60226003 if (!UpRefs.empty())
60236004 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
60376018 break;
60386019
60396020 case 302:
6040 #line 2871 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6021 #line 2852 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60416022 {
60426023 if (!UpRefs.empty())
60436024 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
60586039 break;
60596040
60606041 case 303:
6061 #line 2888 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6042 #line 2869 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60626043 {
60636044 if (!UpRefs.empty())
60646045 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
60766057 break;
60776058
60786059 case 304:
6079 #line 2902 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6060 #line 2883 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60806061 {
60816062 if (!UpRefs.empty())
60826063 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
60946075 break;
60956076
60966077 case 305:
6097 #line 2916 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6078 #line 2897 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
60986079 {
60996080 if (!UpRefs.empty())
61006081 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
61106091 break;
61116092
61126093 case 306:
6113 #line 2928 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6094 #line 2909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61146095 {
61156096 if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
61166097 GEN_ERROR("select condition must be boolean");
61226103 break;
61236104
61246105 case 307:
6125 #line 2936 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6106 #line 2917 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61266107 {
61276108 if (!UpRefs.empty())
61286109 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
61336114 break;
61346115
61356116 case 308:
6136 #line 2943 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6117 #line 2924 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61376118 {
61386119 if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
61396120 GEN_ERROR("Invalid extractelement operands");
61436124 break;
61446125
61456126 case 309:
6146 #line 2949 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6127 #line 2930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61476128 {
61486129 if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
61496130 GEN_ERROR("Invalid insertelement operands");
61536134 break;
61546135
61556136 case 310:
6156 #line 2955 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6137 #line 2936 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61576138 {
61586139 if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
61596140 GEN_ERROR("Invalid shufflevector operands");
61636144 break;
61646145
61656146 case 311:
6166 #line 2961 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6147 #line 2942 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61676148 {
61686149 const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
61696150 if (!Ty->isFirstClassType())
61826163 break;
61836164
61846165 case 312:
6185 #line 2977 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6166 #line 2958 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
61866167 {
61876168
61886169 // Handle the short syntax
62166197 }
62176198
62186199 // Set up the ParamAttrs for the function
6219 ParamAttrsVector Attrs;
6220 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) {
6221 ParamAttrsWithIndex PAWI;
6222 PAWI.index = 0;
6223 PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs);
6224 Attrs.push_back(PAWI);
6225 }
6200 SmallVector Attrs;
6201 if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
6202 Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
62266203 // Check the arguments
62276204 ValueList Args;
62286205 if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
62436220 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
62446221 (*I)->getDescription() + "'");
62456222 Args.push_back(ArgI->Val);
6246 if (ArgI->Attrs != ParamAttr::None) {
6247 ParamAttrsWithIndex PAWI;
6248 PAWI.index = index;
6249 PAWI.attrs = ArgI->Attrs;
6250 Attrs.push_back(PAWI);
6251 }
6223 if (ArgI->Attrs != ParamAttr::None)
6224 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
62526225 }
62536226 if (Ty->isVarArg()) {
62546227 if (I == E)
62556228 for (; ArgI != ArgE; ++ArgI, ++index) {
62566229 Args.push_back(ArgI->Val); // push the remaining varargs
6257 if (ArgI->Attrs != ParamAttr::None) {
6258 ParamAttrsWithIndex PAWI;
6259 PAWI.index = index;
6260 PAWI.attrs = ArgI->Attrs;
6261 Attrs.push_back(PAWI);
6262 }
6230 if (ArgI->Attrs != ParamAttr::None)
6231 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
62636232 }
62646233 } else if (I != E || ArgI != ArgE)
62656234 GEN_ERROR("Invalid number of parameters detected");
62666235 }
62676236
62686237 // Finish off the ParamAttrs and check them
6269 const ParamAttrsList *PAL = 0;
6238 PAListPtr PAL;
62706239 if (!Attrs.empty())
6271 PAL = ParamAttrsList::get(Attrs);
6240 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
62726241
62736242 // Create the call node
62746243 CallInst *CI = new CallInst(V, Args.begin(), Args.end());
62836252 break;
62846253
62856254 case 313:
6286 #line 3074 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6255 #line 3043 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
62876256 {
62886257 (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
62896258 CHECK_FOR_ERROR
62916260 break;
62926261
62936262 case 314:
6294 #line 3079 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6263 #line 3048 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
62956264 {
62966265 (yyval.BoolVal) = true;
62976266 CHECK_FOR_ERROR
62996268 break;
63006269
63016270 case 315:
6302 #line 3083 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6271 #line 3052 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63036272 {
63046273 (yyval.BoolVal) = false;
63056274 CHECK_FOR_ERROR
63076276 break;
63086277
63096278 case 316:
6310 #line 3090 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6279 #line 3059 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63116280 {
63126281 if (!UpRefs.empty())
63136282 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
63186287 break;
63196288
63206289 case 317:
6321 #line 3097 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6290 #line 3066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63226291 {
63236292 if (!UpRefs.empty())
63246293 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
63306299 break;
63316300
63326301 case 318:
6333 #line 3105 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6302 #line 3074 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63346303 {
63356304 if (!UpRefs.empty())
63366305 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
63416310 break;
63426311
63436312 case 319:
6344 #line 3112 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6313 #line 3081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63456314 {
63466315 if (!UpRefs.empty())
63476316 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
63536322 break;
63546323
63556324 case 320:
6356 #line 3120 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6325 #line 3089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63576326 {
63586327 if (!isa((yyvsp[(2) - (2)].ValueVal)->getType()))
63596328 GEN_ERROR("Trying to free nonpointer type " +
63646333 break;
63656334
63666335 case 321:
6367 #line 3128 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6336 #line 3097 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63686337 {
63696338 if (!UpRefs.empty())
63706339 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
63826351 break;
63836352
63846353 case 322:
6385 #line 3142 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6354 #line 3111 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
63866355 {
63876356 if (!UpRefs.empty())
63886357 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
64036372 break;
64046373
64056374 case 323:
6406 #line 3159 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6375 #line 3128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
64076376 {
64086377 Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
64096378 if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
64156384 break;
64166385
64176386 case 324:
6418 #line 3167 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6387 #line 3136 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
64196388 {
64206389 if (!UpRefs.empty())
64216390 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
64356404
64366405
64376406 /* Line 1267 of yacc.c. */
6438 #line 6440 "llvmAsmParser.tab.c"
6407 #line 6409 "llvmAsmParser.tab.c"
64396408 default: break;
64406409 }
64416410 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
66496618 }
66506619
66516620
6652 #line 3184 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
6621 #line 3153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
66536622
66546623
66556624 // common code from the two 'RunVMAsmParser' functions
345345
346346 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
347347 typedef union YYSTYPE
348 #line 951 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
348 #line 950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
349349 {
350350 llvm::Module *ModuleVal;
351351 llvm::Function *FunctionVal;
392392 llvm::ICmpInst::Predicate IPredicate;
393393 llvm::FCmpInst::Predicate FPredicate;
394394 }
395 /* Line 1489 of yacc.c. */
395 /* Line 1529 of yacc.c. */
396396 #line 398 "llvmAsmParser.tab.h"
397397 YYSTYPE;
398398 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
2424 #include "llvm/ADT/STLExtras.h"
2525 #include "llvm/Support/MathExtras.h"
2626 #include "llvm/Support/Streams.h"
27 #include "llvm/ParamAttrsList.h"
2827 #include
2928 #include
3029 #include
22552254 GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription());
22562255
22572256 std::vector ParamTypeList;
2258 ParamAttrsVector Attrs;
2259 if ($7 != ParamAttr::None) {
2260 ParamAttrsWithIndex PAWI;
2261 PAWI.index = 0;
2262 PAWI.attrs = $7;
2263 Attrs.push_back(PAWI);
2264 }
2257 SmallVector Attrs;
2258 if ($7 != ParamAttr::None)
2259 Attrs.push_back(ParamAttrsWithIndex::get(0, $7));
22652260 if ($5) { // If there are arguments...
22662261 unsigned index = 1;
22672262 for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) {
22692264 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
22702265 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
22712266 ParamTypeList.push_back(Ty);
2272 if (Ty != Type::VoidTy)
2273 if (I->Attrs != ParamAttr::None) {
2274 ParamAttrsWithIndex PAWI;
2275 PAWI.index = index;
2276 PAWI.attrs = I->Attrs;
2277 Attrs.push_back(PAWI);
2278 }
2267 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
2268 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
22792269 }
22802270 }
22812271
22822272 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
22832273 if (isVarArg) ParamTypeList.pop_back();
22842274
2285 const ParamAttrsList *PAL = 0;
2275 PAListPtr PAL;
22862276 if (!Attrs.empty())
2287 PAL = ParamAttrsList::get(Attrs);
2277 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
22882278
22892279 FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg);
22902280 const PointerType *PFT = PointerType::getUnqual(FT);
23032293 // Move the function to the end of the list, from whereever it was
23042294 // previously inserted.
23052295 Fn = cast(FWRef);
2306 assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
2296 assert(Fn->getParamAttrs().isEmpty() &&
2297 "Forward reference has parameter attributes!");
23072298 CurModule.CurrentModule->getFunctionList().remove(Fn);
23082299 CurModule.CurrentModule->getFunctionList().push_back(Fn);
23092300 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
26682659 BasicBlock *Except = getBBVal($14);
26692660 CHECK_FOR_ERROR
26702661
2671 ParamAttrsVector Attrs;
2672 if ($8 != ParamAttr::None) {
2673 ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8;
2674 Attrs.push_back(PAWI);
2675 }
2662 SmallVector Attrs;
2663 if ($8 != ParamAttr::None)
2664 Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
26762665
26772666 // Check the arguments
26782667 ValueList Args;
26942683 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
26952684 (*I)->getDescription() + "'");
26962685 Args.push_back(ArgI->Val);
2697 if (ArgI->Attrs != ParamAttr::None) {
2698 ParamAttrsWithIndex PAWI;
2699 PAWI.index = index;
2700 PAWI.attrs = ArgI->Attrs;
2701 Attrs.push_back(PAWI);
2702 }
2686 if (ArgI->Attrs != ParamAttr::None)
2687 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
27032688 }
27042689
27052690 if (Ty->isVarArg()) {
27062691 if (I == E)
27072692 for (; ArgI != ArgE; ++ArgI, ++index) {
27082693 Args.push_back(ArgI->Val); // push the remaining varargs
2709 if (ArgI->Attrs != ParamAttr::None) {
2710 ParamAttrsWithIndex PAWI;
2711 PAWI.index = index;
2712 PAWI.attrs = ArgI->Attrs;
2713 Attrs.push_back(PAWI);
2714 }
2694 if (ArgI->Attrs != ParamAttr::None)
2695 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
27152696 }
27162697 } else if (I != E || ArgI != ArgE)
27172698 GEN_ERROR("Invalid number of parameters detected");
27182699 }
27192700
2720 const ParamAttrsList *PAL = 0;
2701 PAListPtr PAL;
27212702 if (!Attrs.empty())
2722 PAL = ParamAttrsList::get(Attrs);
2703 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
27232704
27242705 // Create the InvokeInst
2725 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
2706 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(),Args.end());
27262707 II->setCallingConv($2);
27272708 II->setParamAttrs(PAL);
27282709 $$ = II;
30062987 }
30072988
30082989 // Set up the ParamAttrs for the function
3009 ParamAttrsVector Attrs;
3010 if ($8 != ParamAttr::None) {
3011 ParamAttrsWithIndex PAWI;
3012 PAWI.index = 0;
3013 PAWI.attrs = $8;
3014 Attrs.push_back(PAWI);
3015 }
2990 SmallVector Attrs;
2991 if ($8 != ParamAttr::None)
2992 Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
30162993 // Check the arguments
30172994 ValueList Args;
30182995 if ($6->empty()) { // Has no arguments?
30333010 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
30343011 (*I)->getDescription() + "'");
30353012 Args.push_back(ArgI->Val);
3036 if (ArgI->Attrs != ParamAttr::None) {
3037 ParamAttrsWithIndex PAWI;
3038 PAWI.index = index;
3039 PAWI.attrs = ArgI->Attrs;
3040 Attrs.push_back(PAWI);
3041 }
3013 if (ArgI->Attrs != ParamAttr::None)
3014 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
30423015 }
30433016 if (Ty->isVarArg()) {
30443017 if (I == E)
30453018 for (; ArgI != ArgE; ++ArgI, ++index) {
30463019 Args.push_back(ArgI->Val); // push the remaining varargs
3047 if (ArgI->Attrs != ParamAttr::None) {
3048 ParamAttrsWithIndex PAWI;
3049 PAWI.index = index;
3050 PAWI.attrs = ArgI->Attrs;
3051 Attrs.push_back(PAWI);
3052 }
3020 if (ArgI->Attrs != ParamAttr::None)
3021 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
30533022 }
30543023 } else if (I != E || ArgI != ArgE)
30553024 GEN_ERROR("Invalid number of parameters detected");
30563025 }
30573026
30583027 // Finish off the ParamAttrs and check them
3059 const ParamAttrsList *PAL = 0;
3028 PAListPtr PAL;
30603029 if (!Attrs.empty())
3061 PAL = ParamAttrsList::get(Attrs);
3030 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
30623031
30633032 // Create the call node
30643033 CallInst *CI = new CallInst(V, Args.begin(), Args.end());
2424 #include "llvm/ADT/STLExtras.h"
2525 #include "llvm/Support/MathExtras.h"
2626 #include "llvm/Support/Streams.h"
27 #include "llvm/ParamAttrsList.h"
2827 #include
2928 #include
3029 #include
22552254 GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription());
22562255
22572256 std::vector ParamTypeList;
2258 ParamAttrsVector Attrs;
2259 if ($7 != ParamAttr::None) {
2260 ParamAttrsWithIndex PAWI;
2261 PAWI.index = 0;
2262 PAWI.attrs = $7;
2263 Attrs.push_back(PAWI);
2264 }
2257 SmallVector Attrs;
2258 if ($7 != ParamAttr::None)
2259 Attrs.push_back(ParamAttrsWithIndex::get(0, $7));
22652260 if ($5) { // If there are arguments...
22662261 unsigned index = 1;
22672262 for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) {
22692264 if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
22702265 GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
22712266 ParamTypeList.push_back(Ty);
2272 if (Ty != Type::VoidTy)
2273 if (I->Attrs != ParamAttr::None) {
2274 ParamAttrsWithIndex PAWI;
2275 PAWI.index = index;
2276 PAWI.attrs = I->Attrs;
2277 Attrs.push_back(PAWI);
2278 }
2267 if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
2268 Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
22792269 }
22802270 }
22812271
22822272 bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
22832273 if (isVarArg) ParamTypeList.pop_back();
22842274
2285 const ParamAttrsList *PAL = 0;
2275 PAListPtr PAL;
22862276 if (!Attrs.empty())
2287 PAL = ParamAttrsList::get(Attrs);
2277 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
22882278
22892279 FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg);
22902280 const PointerType *PFT = PointerType::getUnqual(FT);
23032293 // Move the function to the end of the list, from whereever it was
23042294 // previously inserted.
23052295 Fn = cast(FWRef);
2306 assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
2296 assert(Fn->getParamAttrs().isEmpty() &&
2297 "Forward reference has parameter attributes!");
23072298 CurModule.CurrentModule->getFunctionList().remove(Fn);
23082299 CurModule.CurrentModule->getFunctionList().push_back(Fn);
23092300 } else if (!FunctionName.empty() && // Merge with an earlier prototype?
26682659 BasicBlock *Except = getBBVal($14);
26692660 CHECK_FOR_ERROR
26702661
2671 ParamAttrsVector Attrs;
2672 if ($8 != ParamAttr::None) {
2673 ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8;
2674 Attrs.push_back(PAWI);
2675 }
2662 SmallVector Attrs;
2663 if ($8 != ParamAttr::None)
2664 Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
26762665
26772666 // Check the arguments
26782667 ValueList Args;
26942683 GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
26952684 (*I)->getDescription() + "'");
26962685 Args.push_back(ArgI->Val);
2697 if (ArgI->Attrs != ParamAttr::None) {
2698 ParamAttrsWithIndex PAWI;
2699 PAWI.index = index;
2700 PAWI.attrs = ArgI->Attrs;
2701 Attrs.push_back(PAWI);
2702 }
2686 if (ArgI->Attrs != ParamAttr::None)
2687 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
27032688 }
27042689
27052690 if (Ty->isVarArg()) {
27062691 if (I == E)
27072692 for (; ArgI != ArgE; ++ArgI, ++index) {
27082693 Args.push_back(ArgI->Val); // push the remaining varargs
2709 if (ArgI->Attrs != ParamAttr::None) {
2710 ParamAttrsWithIndex PAWI;
2711 PAWI.index = index;
2712 PAWI.attrs = ArgI->Attrs;
2713 Attrs.push_back(PAWI);
2714 }
2694 if (ArgI->Attrs != ParamAttr::None)
2695 Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
27152696 }
27162697 } else if (I != E || ArgI != ArgE)
27172698 GEN_ERROR("Invalid number of parameters detected");
27182699 }
27192700
2720 const ParamAttrsList *PAL = 0;
2701 PAListPtr PAL;
27212702 if (!Attrs.empty())
2722 PAL = ParamAttrsList::get(Attrs);
2703 PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
27232704
27242705 // Create the InvokeInst
2725 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
2706 InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(),Args.end());
27262707 II->setCallingConv($2);
27272708 II->setParamAttrs(PAL);
27282709 $$ = II;
30062987 }
30072988
30082989 // Set up the ParamAttrs for the function
3009 ParamAttrsVector Attrs;
3010 if ($8 != ParamAttr::None) {
3011 ParamAttrsWithIndex PAWI;
3012 PAWI.index = 0;
3013 PAWI.attrs = $8;
3014 Attrs.push_back(PAWI);
3015 }
2990 SmallVector Attrs;
2991