summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Function.h18
-rw-r--r--include/llvm/Instructions.h34
-rw-r--r--include/llvm/Intrinsics.h4
-rw-r--r--include/llvm/ParamAttrsList.h226
-rw-r--r--include/llvm/ParameterAttributes.h138
-rw-r--r--include/llvm/Support/CallSite.h5
-rw-r--r--lib/AsmParser/llvmAsmParser.cpp.cvs703
-rw-r--r--lib/AsmParser/llvmAsmParser.h.cvs4
-rw-r--r--lib/AsmParser/llvmAsmParser.y87
-rw-r--r--lib/AsmParser/llvmAsmParser.y.cvs87
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp23
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h8
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp12
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.cpp6
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.h17
-rw-r--r--lib/Target/CBackend/CBackend.cpp39
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp7
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp31
-rw-r--r--lib/Transforms/IPO/DeadArgumentElimination.cpp52
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp17
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp6
-rw-r--r--lib/Transforms/IPO/StructRetPromotion.cpp44
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp67
-rw-r--r--lib/VMCore/AsmWriter.cpp50
-rw-r--r--lib/VMCore/AutoUpgrade.cpp18
-rw-r--r--lib/VMCore/Function.cpp37
-rw-r--r--lib/VMCore/Instructions.cpp79
-rw-r--r--lib/VMCore/ParameterAttributes.cpp343
-rw-r--r--lib/VMCore/Verifier.cpp125
-rw-r--r--tools/llvm-upgrade/UpgradeParser.cpp.cvs571
-rw-r--r--tools/llvm-upgrade/UpgradeParser.h.cvs2
-rw-r--r--tools/llvm-upgrade/UpgradeParser.y35
-rw-r--r--tools/llvm-upgrade/UpgradeParser.y.cvs35
-rw-r--r--tools/llvm2cpp/CppWriter.cpp20
34 files changed, 1320 insertions, 1630 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 3d75db8a03..2ffd5eaacd 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -27,7 +27,6 @@
namespace llvm {
class FunctionType;
-class ParamAttrsList;
// Traits for intrusive list of instructions...
template<> struct ilist_traits<BasicBlock>
@@ -69,7 +68,7 @@ private:
BasicBlockListType BasicBlocks; ///< The basic blocks
mutable ArgumentListType ArgumentList; ///< The formal arguments
ValueSymbolTable *SymTab; ///< Symbol table of args/instructions
- const ParamAttrsList *ParamAttrs; ///< Parameter attributes
+ PAListPtr ParamAttrs; ///< Parameter attributes
// The Calling Convention is stored in Value::SubclassData.
/*unsigned CallingConvention;*/
@@ -145,16 +144,11 @@ public:
SubclassData = (SubclassData & 1) | (CC << 1);
}
- /// Obtains a constant pointer to the ParamAttrsList object which holds the
- /// parameter attributes information, if any.
- /// @returns 0 if no parameter attributes have been set.
- /// @brief Get the parameter attributes.
- const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
-
- /// Sets the parameter attributes for this Function. To construct a
- /// ParamAttrsList, see ParameterAttributes.h
- /// @brief Set the parameter attributes.
- void setParamAttrs(const ParamAttrsList *attrs);
+ /// getParamAttrs - Return the parameter attributes for this function.
+ const PAListPtr &getParamAttrs() const { return ParamAttrs; }
+
+ /// setParamAttrs - Set the parameter attributes for this Function.
+ void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; }
/// hasCollector/getCollector/setCollector/clearCollector - The name of the
/// garbage collection algorithm to use during code generation.
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 3aa8d6879c..d29e11ca27 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -30,7 +30,6 @@ class PointerType;
class VectorType;
class ConstantRange;
class APInt;
-class ParamAttrsList;
//===----------------------------------------------------------------------===//
// AllocationInst Class
@@ -851,7 +850,7 @@ public:
///
class CallInst : public Instruction {
- const ParamAttrsList *ParamAttrs; ///< parameter attributes for call
+ PAListPtr ParamAttrs; ///< parameter attributes for call
CallInst(const CallInst &CI);
void init(Value *Func, Value* const *Params, unsigned NumParams);
void init(Value *Func, Value *Actual1, Value *Actual2);
@@ -927,16 +926,12 @@ public:
SubclassData = (SubclassData & 1) | (CC << 1);
}
- /// Obtains a pointer to the ParamAttrsList object which holds the
- /// parameter attributes information, if any.
- /// @returns 0 if no attributes have been set.
- /// @brief Get the parameter attributes.
- const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+ /// getParamAttrs - Return the PAListPtr for the parameter attributes of this
+ /// call.
+ const PAListPtr &getParamAttrs() const { return ParamAttrs; }
- /// Sets the parameter attributes for this CallInst. To construct a
- /// ParamAttrsList, see ParameterAttributes.h
- /// @brief Set the parameter attributes.
- void setParamAttrs(const ParamAttrsList *attrs);
+ /// setParamAttrs - Sets the parameter attributes for this CallInst.
+ void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, unsigned attr) const;
@@ -1678,7 +1673,7 @@ private:
/// calling convention of the call.
///
class InvokeInst : public TerminatorInst {
- const ParamAttrsList *ParamAttrs;
+ PAListPtr ParamAttrs;
InvokeInst(const InvokeInst &BI);
void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
Value* const *Args, unsigned NumArgs);
@@ -1745,16 +1740,13 @@ public:
SubclassData = CC;
}
- /// Obtains a pointer to the ParamAttrsList object which holds the
- /// parameter attributes information, if any.
- /// @returns 0 if no attributes have been set.
- /// @brief Get the parameter attributes.
- const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+ /// getParamAttrs - Return the parameter attribute list for this invoke.
+ ///
+ const PAListPtr &getParamAttrs() const { return ParamAttrs; }
- /// Sets the parameter attributes for this InvokeInst. To construct a
- /// ParamAttrsList, see ParameterAttributes.h
- /// @brief Set the parameter attributes.
- void setParamAttrs(const ParamAttrsList *attrs);
+ /// setParamAttrs - Set the parameter attribute list for this invoke.
+ ///
+ void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h
index d3aed6b7cf..2027383dbf 100644
--- a/include/llvm/Intrinsics.h
+++ b/include/llvm/Intrinsics.h
@@ -22,7 +22,7 @@ class Type;
class FunctionType;
class Function;
class Module;
-class ParamAttrsList;
+class PAListPtr;
/// Intrinsic Namespace - This namespace contains an enum with a value for
/// every intrinsic/builtin function known by LLVM. These enum values are
@@ -49,7 +49,7 @@ namespace Intrinsic {
/// Intrinsic::getParamAttrs(ID) - Return the attributes for an intrinsic.
///
- const ParamAttrsList *getParamAttrs(ID id);
+ PAListPtr getParamAttrs(ID id);
/// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
/// declaration for an intrinsic, and return it.
diff --git a/include/llvm/ParamAttrsList.h b/include/llvm/ParamAttrsList.h
deleted file mode 100644
index 00e9707beb..0000000000
--- a/include/llvm/ParamAttrsList.h
+++ /dev/null
@@ -1,226 +0,0 @@
-//===-- llvm/ParamAttrsList.h - List and Vector of ParamAttrs ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains classes used to represent the parameter attributes
-// associated with functions and their calls.
-//
-// The implementation of ParamAttrsList is in VMCore/ParameterAttributes.cpp.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_PARAM_ATTRS_LIST_H
-#define LLVM_PARAM_ATTRS_LIST_H
-
-#include "llvm/ParameterAttributes.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/FoldingSet.h"
-
-namespace llvm {
-
-/// @brief A vector of attribute/index pairs.
-typedef SmallVector<ParamAttrsWithIndex,4> ParamAttrsVector;
-
-/// This class represents a list of attribute/index pairs for parameter
-/// attributes. Each entry in the list contains the index of a function
-/// parameter and the associated ParameterAttributes. If a parameter's index is
-/// not present in the list, then no attributes are set for that parameter. The
-/// list may also be empty, but this does not occur in practice. An item in
-/// the list with an index of 0 refers to the function as a whole or its result.
-/// To construct a ParamAttrsList, you must first fill a ParamAttrsVector with
-/// the attribute/index pairs you wish to set. The list of attributes can be
-/// turned into a string of mnemonics suitable for LLVM Assembly output.
-/// Various accessors are provided to obtain information about the attributes.
-/// Note that objects of this class are "uniqued". The \p get method can return
-/// the pointer of an existing and identical instance. Consequently, reference
-/// counting is necessary in order to determine when the last reference to a
-/// ParamAttrsList of a given shape is dropped. Users of this class should use
-/// the addRef and dropRef methods to add/drop references. When the reference
-/// count goes to zero, the ParamAttrsList object is deleted.
-/// This class is used by Function, CallInst and InvokeInst to represent their
-/// sets of parameter attributes.
-/// @brief A List of ParameterAttributes.
-class ParamAttrsList : public FoldingSetNode {
- /// @name Construction
- /// @{
- private:
- // ParamAttrsList is uniqued, these should not be publicly available
- void operator=(const ParamAttrsList &); // Do not implement
- ParamAttrsList(const ParamAttrsList &); // Do not implement
- ~ParamAttrsList(); // Private implementation
-
- /// Only the \p get method can invoke this when it wants to create a
- /// new instance.
- /// @brief Construct an ParamAttrsList from a ParamAttrsVector
- explicit ParamAttrsList(const ParamAttrsVector &attrVec);
-
- public:
- /// This method ensures the uniqueness of ParamAttrsList instances. The
- /// argument is a vector of attribute/index pairs as represented by the
- /// ParamAttrsWithIndex structure. The index values must be in strictly
- /// increasing order and ParamAttr::None is not allowed. The vector is
- /// used to construct the ParamAttrsList instance. If an instance with
- /// identical vector pairs exists, it will be returned instead of creating
- /// a new instance.
- /// @brief Get a ParamAttrsList instance.
- static const ParamAttrsList *get(const ParamAttrsVector &attrVec);
-
- /// Returns the ParamAttrsList obtained by modifying PAL using the supplied
- /// list of attribute/index pairs. Any existing attributes for the given
- /// index are replaced by the given attributes. If there were no attributes
- /// then the new ones are inserted. Attributes can be deleted by replacing
- /// them with ParamAttr::None. Index values must be strictly increasing.
- /// @brief Get a new ParamAttrsList instance by modifying an existing one.
- static const ParamAttrsList *getModified(const ParamAttrsList *PAL,
- const ParamAttrsVector &modVec);
-
- /// @brief Add the specified attributes to those in PAL at index idx.
- static const ParamAttrsList *includeAttrs(const ParamAttrsList *PAL,
- uint16_t idx,
- ParameterAttributes attrs);
-
- /// @brief Remove the specified attributes from those in PAL at index idx.
- static const ParamAttrsList *excludeAttrs(const ParamAttrsList *PAL,
- uint16_t idx,
- ParameterAttributes attrs);
-
- /// @}
- /// @name Accessors
- /// @{
- public:
- /// The parameter attributes for the \p indexth parameter are returned.
- /// The 0th parameter refers to the return type of the function. Note that
- /// the \p param_index is an index into the function's parameters, not an
- /// index into this class's list of attributes. The result of getParamIndex
- /// is always suitable input to this function.
- /// @returns The all the ParameterAttributes for the \p indexth parameter
- /// as a uint16_t of enumeration values OR'd together.
- /// @brief Get the attributes for a parameter
- ParameterAttributes getParamAttrs(uint16_t param_index) const;
-
- /// This checks to see if the \p ith function parameter has the parameter
- /// attribute given by \p attr set.
- /// @returns true if the parameter attribute is set
- /// @brief Determine if a ParameterAttributes is set
- bool paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- return getParamAttrs(i) & attr;
- }
-
- /// This extracts the alignment for the \p ith function parameter.
- /// @returns 0 if unknown, else the alignment in bytes
- /// @brief Extract the Alignment
- uint16_t getParamAlignment(uint16_t i) const {
- return (getParamAttrs(i) & ParamAttr::Alignment) >> 16;
- }
-
- /// This returns whether the given attribute is set for at least one
- /// parameter or for the return value.
- /// @returns true if the parameter attribute is set somewhere
- /// @brief Determine if a ParameterAttributes is set somewhere
- bool hasAttrSomewhere(ParameterAttributes attr) const;
-
- /// The set of ParameterAttributes set in Attributes is converted to a
- /// string of equivalent mnemonics. This is, presumably, for writing out
- /// the mnemonics for the assembly writer.
- /// @brief Convert parameter attribute bits to text
- static std::string getParamAttrsText(ParameterAttributes Attributes);
-
- /// The \p Indexth parameter attribute is converted to string.
- /// @brief Get the text for the parmeter attributes for one parameter.
- std::string getParamAttrsTextByIndex(uint16_t Index) const {
- return getParamAttrsText(getParamAttrs(Index));
- }
-
- /// @brief Comparison operator for ParamAttrsList
- bool operator < (const ParamAttrsList& that) const {
- if (this->attrs.size() < that.attrs.size())
- return true;
- if (this->attrs.size() > that.attrs.size())
- return false;
- for (unsigned i = 0; i < attrs.size(); ++i) {
- if (attrs[i].index < that.attrs[i].index)
- return true;
- if (attrs[i].index > that.attrs[i].index)
- return false;
- if (attrs[i].attrs < that.attrs[i].attrs)
- return true;
- if (attrs[i].attrs > that.attrs[i].attrs)
- return false;
- }
- return false;
- }
-
- /// Returns the parameter index of a particular parameter attribute in this
- /// list of attributes. Note that the attr_index is an index into this
- /// class's list of attributes, not the index of a parameter. The result
- /// is the index of the parameter. Clients generally should not use this
- /// method. It is used internally by LLVM.
- /// @brief Get a parameter index
- uint16_t getParamIndex(unsigned attr_index) const {
- return attrs[attr_index].index;
- }
-
- ParameterAttributes getParamAttrsAtIndex(unsigned attr_index) const {
- return attrs[attr_index].attrs;
- }
-
- /// Determines how many parameter attributes are set in this ParamAttrsList.
- /// This says nothing about how many parameters the function has. It also
- /// says nothing about the highest parameter index that has attributes.
- /// Clients generally should not use this method. It is used internally by
- /// LLVM.
- /// @returns the number of parameter attributes in this ParamAttrsList.
- /// @brief Return the number of parameter attributes this type has.
- unsigned size() const { return attrs.size(); }
-
- /// @brief Return the number of references to this ParamAttrsList.
- unsigned numRefs() const { return refCount; }
-
- /// @}
- /// @name Mutators
- /// @{
- public:
- /// Classes retaining references to ParamAttrsList objects should call this
- /// method to increment the reference count. This ensures that the
- /// ParamAttrsList object will not disappear until the class drops it.
- /// @brief Add a reference to this instance.
- void addRef() const { refCount++; }
-
- /// Classes retaining references to ParamAttrsList objects should call this
- /// method to decrement the reference count and possibly delete the
- /// ParamAttrsList object. This ensures that ParamAttrsList objects are
- /// cleaned up only when the last reference to them is dropped.
- /// @brief Drop a reference to this instance.
- void dropRef() const {
- assert(refCount != 0 && "dropRef without addRef");
- if (--refCount == 0)
- delete this;
- }
-
- /// @}
- /// @name Implementation Details
- /// @{
- public:
- void Profile(FoldingSetNodeID &ID) const {
- Profile(ID, attrs);
- }
- static void Profile(FoldingSetNodeID &ID, const ParamAttrsVector &Attrs);
- void dump() const;
-
- /// @}
- /// @name Data
- /// @{
- private:
- ParamAttrsVector attrs; ///< The list of attributes
- mutable unsigned refCount; ///< The number of references to this object
- /// @}
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/include/llvm/ParameterAttributes.h b/include/llvm/ParameterAttributes.h
index 3de5f0537a..4a68a7d7b6 100644
--- a/include/llvm/ParameterAttributes.h
+++ b/include/llvm/ParameterAttributes.h
@@ -15,12 +15,14 @@
#ifndef LLVM_PARAMETER_ATTRIBUTES_H
#define LLVM_PARAMETER_ATTRIBUTES_H
-#include "llvm/Support/DataTypes.h"
-#include <cassert>
+#include <string>
namespace llvm {
class Type;
+/// ParameterAttributes - A bitset of attributes for a parameter.
+typedef unsigned ParameterAttributes;
+
namespace ParamAttr {
/// Function parameters and results can have attributes to indicate how they
@@ -28,9 +30,7 @@ namespace ParamAttr {
/// lists the attributes that can be associated with parameters or function
/// results.
/// @brief Function parameter attributes.
-
-/// @brief A more friendly way to reference the attributes.
-typedef uint32_t Attributes;
+typedef ParameterAttributes Attributes;
const Attributes None = 0; ///< No attributes have been set
const Attributes ZExt = 1<<0; ///< Zero extended before/after call
@@ -64,33 +64,141 @@ const Attributes MutuallyIncompatible[3] = {
};
/// @brief Which attributes cannot be applied to a type.
-Attributes typeIncompatible (const Type *Ty);
+Attributes typeIncompatible(const Type *Ty);
/// This turns an int alignment (a power of 2, normally) into the
/// form used internally in ParameterAttributes.
-ParamAttr::Attributes inline constructAlignmentFromInt(uint32_t i) {
+ParamAttr::Attributes inline constructAlignmentFromInt(unsigned i) {
return (i << 16);
}
+/// The set of ParameterAttributes set in Attributes is converted to a
+/// string of equivalent mnemonics. This is, presumably, for writing out
+/// the mnemonics for the assembly writer.
+/// @brief Convert parameter attribute bits to text
+std::string getAsString(ParameterAttributes Attrs);
} // end namespace ParamAttr
-/// @brief A more friendly way to reference the attributes.
-typedef ParamAttr::Attributes ParameterAttributes;
/// This is just a pair of values to associate a set of parameter attributes
/// with a parameter index.
-/// @brief ParameterAttributes with a parameter index.
struct ParamAttrsWithIndex {
- ParameterAttributes attrs; ///< The attributes that are set, or'd together
- uint16_t index; ///< Index of the parameter for which the attributes apply
+ ParameterAttributes Attrs; ///< The attributes that are set, or'd together.
+ unsigned Index; ///< Index of the parameter for which the attributes apply.
- static ParamAttrsWithIndex get(uint16_t idx, ParameterAttributes attrs) {
+ static ParamAttrsWithIndex get(unsigned Idx, ParameterAttributes Attrs) {
ParamAttrsWithIndex P;
- P.index = idx;
- P.attrs = attrs;
+ P.Index = Idx;
+ P.Attrs = Attrs;
return P;
}
};
+
+//===----------------------------------------------------------------------===//
+// PAListPtr Smart Pointer
+//===----------------------------------------------------------------------===//
+
+class ParamAttributeListImpl;
+
+/// PAListPtr - This class manages the ref count for the opaque
+/// ParamAttributeListImpl object and provides accessors for it.
+class PAListPtr {
+ /// PAList - The parameter attributes that we are managing. This can be null
+ /// to represent the empty parameter attributes list.
+ ParamAttributeListImpl *PAList;
+public:
+ PAListPtr() : PAList(0) {}
+ PAListPtr(const PAListPtr &P);
+ const PAListPtr &operator=(const PAListPtr &RHS);
+ ~PAListPtr();
+
+ //===--------------------------------------------------------------------===//
+ // Parameter Attribute List Construction and Mutation
+ //===--------------------------------------------------------------------===//
+
+ /// get - Return a ParamAttrs list with the specified parameter in it.
+ static PAListPtr get(const ParamAttrsWithIndex *Attr, unsigned NumAttrs);
+
+ /// get - Return a ParamAttr list with the parameters specified by the
+ /// consequtive random access iterator range.
+ template <typename Iter>
+ static PAListPtr get(const Iter &I, const Iter &E) {
+ if (I == E) return PAListPtr(); // Empty list.
+ return get(&*I, E-I);
+ }
+
+ /// addAttr - Add the specified attribute at the specified index to this
+ /// attribute list. Since parameter attribute lists are immutable, this
+ /// returns the new list.
+ PAListPtr addAttr(unsigned Idx, ParameterAttributes Attrs) const;
+
+ /// removeAttr - Remove the specified attribute at the specified index from
+ /// this attribute list. Since parameter attribute lists are immutable, this
+ /// returns the new list.
+ PAListPtr removeAttr(unsigned Idx, ParameterAttributes Attrs) const;
+
+ //===--------------------------------------------------------------------===//
+ // Parameter Attribute List Accessors
+ //===--------------------------------------------------------------------===//
+
+ /// getParamAttrs - The parameter attributes for the specified parameter are
+ /// returned. Parameters for the result are denoted with Idx = 0.
+ ParameterAttributes getParamAttrs(unsigned Idx) const;
+
+ /// paramHasAttr - Return true if the specified parameter index has the
+ /// specified attribute set.
+ bool paramHasAttr(unsigned Idx, ParameterAttributes Attr) const {
+ return getParamAttrs(Idx) & Attr;
+ }
+
+ /// getParamAlignment - Return the alignment for the specified function
+ /// parameter.
+ unsigned getParamAlignment(unsigned Idx) const {
+ return (getParamAttrs(Idx) & ParamAttr::Alignment) >> 16;
+ }
+
+ /// hasAttrSomewhere - Return true if the specified attribute is set for at
+ /// least one parameter or for the return value.
+ bool hasAttrSomewhere(ParameterAttributes Attr) const;
+
+ /// operator< - Provide an ordering for parameter attribute lists.
+ bool operator==(const PAListPtr &RHS) const { return PAList == RHS.PAList; }
+ bool operator!=(const PAListPtr &RHS) const { return PAList != RHS.PAList; }
+
+ void dump() const;
+
+ //===--------------------------------------------------------------------===//
+ // Parameter Attribute List Introspection
+ //===--------------------------------------------------------------------===//
+
+ /// getRawPointer - Return a raw pointer that uniquely identifies this
+ /// parameter attribute list.
+ void *getRawPointer() const {
+ return PAList;
+ }
+
+ // Parameter attributes are stored as a dense set of slots, where there is one
+ // slot for each argument that has an attribute. This allows walking over the
+ // dense set instead of walking the sparse list of attributes.
+
+ /// isEmpty - Return true if no parameters have an attribute.
+ ///
+ bool isEmpty() const {
+ return PAList == 0;
+ }
+
+ /// getNumSlots - Return the number of slots used in this attribute list.
+ /// This is the number of arguments that have an attribute set on them
+ /// (including the function itself).
+ unsigned getNumSlots() const;
+
+ /// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
+ /// holds a parameter number plus a set of attributes.
+ const ParamAttrsWithIndex &getSlot(unsigned Slot) const;
+
+private:
+ explicit PAListPtr(ParamAttributeListImpl *L);
+};
} // End llvm namespace
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index 3bd4ef256c..6a6bcf185b 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -28,7 +28,6 @@ namespace llvm {
class CallInst;
class InvokeInst;
-class ParamAttrsList;
class CallSite {
Instruction *I;
@@ -62,8 +61,8 @@ public:
/// getParamAttrs/setParamAttrs - get or set the parameter attributes of
/// the call.
- const ParamAttrsList *getParamAttrs() const;
- void setParamAttrs(const ParamAttrsList *PAL);
+ const PAListPtr &getParamAttrs() const;
+ void setParamAttrs(const PAListPtr &PAL);
/// paramHasAttr - whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs
index c0de61723e..56c36db13d 100644
--- a/lib/AsmParser/llvmAsmParser.cpp.cvs
+++ b/lib/AsmParser/llvmAsmParser.cpp.cvs
@@ -380,7 +380,7 @@
/* Copy the first part of user declarations. */
-#line 14 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
#include "ParserInternals.h"
#include "llvm/CallingConv.h"
@@ -395,7 +395,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
-#include "llvm/ParamAttrsList.h"
#include <algorithm>
#include <list>
#include <map>
@@ -1338,7 +1337,7 @@ Module *llvm::RunVMAsmParser(llvm::MemoryBuffer *MB) {
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 951 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -1385,8 +1384,8 @@ typedef union YYSTYPE
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
}
-/* Line 187 of yacc.c. */
-#line 1390 "llvmAsmParser.tab.c"
+/* Line 193 of yacc.c. */
+#line 1389 "llvmAsmParser.tab.c"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -1399,7 +1398,7 @@ typedef union YYSTYPE
/* Line 216 of yacc.c. */
-#line 1403 "llvmAsmParser.tab.c"
+#line 1402 "llvmAsmParser.tab.c"
#ifdef short
# undef short
@@ -1449,7 +1448,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -1829,39 +1828,39 @@ static const yytype_int16 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113,
- 1113, 1114, 1114, 1114, 1114, 1114, 1114, 1115, 1115, 1115,
- 1115, 1115, 1115, 1116, 1116, 1116, 1116, 1116, 1116, 1119,
- 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1127,
- 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131, 1131, 1132,
- 1132, 1133, 1133, 1134, 1135, 1140, 1141, 1141, 1141, 1141,
- 1141, 1143, 1143, 1143, 1144, 1144, 1146, 1147, 1151, 1155,
- 1160, 1160, 1162, 1163, 1168, 1174, 1175, 1176, 1177, 1178,
- 1182, 1183, 1184, 1188, 1189, 1190, 1191, 1195, 1196, 1197,
- 1201, 1202, 1203, 1204, 1205, 1209, 1210, 1211, 1214, 1215,
- 1216, 1217, 1218, 1219, 1220, 1227, 1228, 1229, 1230, 1231,
- 1232, 1233, 1234, 1235, 1236, 1240, 1241, 1246, 1247, 1248,
- 1249, 1250, 1251, 1254, 1255, 1260, 1261, 1268, 1269, 1275,
- 1276, 1285, 1293, 1294, 1299, 1300, 1301, 1306, 1319, 1319,
- 1319, 1319, 1319, 1319, 1319, 1322, 1326, 1330, 1337, 1342,
- 1350, 1380, 1405, 1410, 1420, 1430, 1434, 1444, 1451, 1460,
- 1467, 1472, 1477, 1484, 1485, 1492, 1499, 1507, 1513, 1525,
- 1553, 1569, 1596, 1624, 1650, 1670, 1696, 1716, 1728, 1735,
- 1801, 1811, 1821, 1827, 1837, 1843, 1853, 1858, 1863, 1876,
- 1888, 1910, 1918, 1924, 1935, 1940, 1945, 1951, 1957, 1966,
- 1970, 1978, 1978, 1981, 1981, 1984, 1996, 2017, 2022, 2030,
- 2031, 2035, 2035, 2039, 2039, 2042, 2045, 2069, 2081, 2080,
- 2092, 2091, 2101, 2100, 2111, 2151, 2154, 2160, 2170, 2174,
- 2179, 2181, 2186, 2191, 2200, 2210, 2221, 2225, 2234, 2243,
- 2248, 2382, 2382, 2384, 2393, 2393, 2395, 2400, 2412, 2416,
- 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2449, 2453, 2478,
- 2482, 2492, 2496, 2500, 2505, 2512, 2512, 2518, 2527, 2532,
- 2537, 2541, 2550, 2559, 2568, 2572, 2576, 2581, 2588, 2595,
- 2599, 2604, 2614, 2633, 2642, 2733, 2737, 2744, 2755, 2768,
- 2778, 2789, 2799, 2810, 2818, 2828, 2835, 2838, 2839, 2846,
- 2850, 2855, 2871, 2888, 2902, 2916, 2928, 2936, 2943, 2949,
- 2955, 2961, 2976, 3074, 3079, 3083, 3090, 3097, 3105, 3112,
- 3120, 3128, 3142, 3159, 3167
+ 0, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112,
+ 1112, 1113, 1113, 1113, 1113, 1113, 1113, 1114, 1114, 1114,
+ 1114, 1114, 1114, 1115, 1115, 1115, 1115, 1115, 1115, 1118,
+ 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1126,
+ 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1130, 1131,
+ 1131, 1132, 1132, 1133, 1134, 1139, 1140, 1140, 1140, 1140,
+ 1140, 1142, 1142, 1142, 1143, 1143, 1145, 1146, 1150, 1154,
+ 1159, 1159, 1161, 1162, 1167, 1173, 1174, 1175, 1176, 1177,
+ 1181, 1182, 1183, 1187, 1188, 1189, 1190, 1194, 1195, 1196,
+ 1200, 1201, 1202, 1203, 1204, 1208, 1209, 1210, 1213, 1214,
+ 1215, 1216, 1217, 1218, 1219, 1226, 1227, 1228, 1229, 1230,
+ 1231, 1232, 1233, 1234, 1235, 1239, 1240, 1245, 1246, 1247,
+ 1248, 1249, 1250, 1253, 1254, 1259, 1260, 1267, 1268, 1274,
+ 1275, 1284, 1292, 1293, 1298, 1299, 1300, 1305, 1318, 1318,
+ 1318, 1318, 1318, 1318, 1318, 1321, 1325, 1329, 1336, 1341,
+ 1349, 1379, 1404, 1409, 1419, 1429, 1433, 1443, 1450, 1459,
+ 1466, 1471, 1476, 1483, 1484, 1491, 1498, 1506, 1512, 1524,
+ 1552, 1568, 1595, 1623, 1649, 1669, 1695, 1715, 1727, 1734,
+ 1800, 1810, 1820, 1826, 1836, 1842, 1852, 1857, 1862, 1875,
+ 1887, 1909, 1917, 1923, 1934, 1939, 1944, 1950, 1956, 1965,
+ 1969, 1977, 1977, 1980, 1980, 1983, 1995, 2016, 2021, 2029,
+ 2030, 2034, 2034, 2038, 2038, 2041, 2044, 2068, 2080, 2079,
+ 2091, 2090, 2100, 2099, 2110, 2150, 2153, 2159, 2169, 2173,
+ 2178, 2180, 2185, 2190, 2199, 2209, 2220, 2224, 2233, 2242,
+ 2247, 2373, 2373, 2375, 2384, 2384, 2386, 2391, 2403, 2407,
+ 2412, 2416, 2420, 2424, 2428, 2432, 2436, 2440, 2444, 2469,
+ 2473, 2483, 2487, 2491, 2496, 2503, 2503, 2509, 2518, 2523,
+ 2528, 2532, 2541, 2550, 2559, 2563, 2567, 2572, 2579, 2586,
+ 2590, 2595, 2605, 2624, 2633, 2714, 2718, 2725, 2736, 2749,
+ 2759, 2770, 2780, 2791, 2799, 2809, 2816, 2819, 2820, 2827,
+ 2831, 2836, 2852, 2869, 2883, 2897, 2909, 2917, 2924, 2930,
+ 2936, 2942, 2957, 3043, 3048, 3052, 3059, 3066, 3074, 3081,
+ 3089, 3097, 3111, 3128, 3136
};
#endif
@@ -2746,7 +2745,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@@ -3487,152 +3486,152 @@ yyreduce:
switch (yyn)
{
case 29:
-#line 1119 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
break;
case 30:
-#line 1119 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
break;
case 31:
-#line 1120 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
break;
case 32:
-#line 1120 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
break;
case 33:
-#line 1121 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
break;
case 34:
-#line 1121 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1120 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
break;
case 35:
-#line 1122 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
break;
case 36:
-#line 1122 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1121 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
break;
case 37:
-#line 1123 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
break;
case 38:
-#line 1123 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1122 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
break;
case 39:
-#line 1127 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
break;
case 40:
-#line 1127 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1126 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
break;
case 41:
-#line 1128 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
break;
case 42:
-#line 1128 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1127 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
break;
case 43:
-#line 1129 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
break;
case 44:
-#line 1129 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
break;
case 45:
-#line 1130 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
break;
case 46:
-#line 1130 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
break;
case 47:
-#line 1131 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
break;
case 48:
-#line 1131 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
break;
case 49:
-#line 1132 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
break;
case 50:
-#line 1132 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
break;
case 51:
-#line 1133 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
break;
case 52:
-#line 1133 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
break;
case 53:
-#line 1134 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
break;
case 54:
-#line 1135 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1134 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
break;
case 65:
-#line 1144 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1143 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 66:
-#line 1146 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1145 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;}
break;
case 67:
-#line 1147 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1146 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal)=0; ;}
break;
case 68:
-#line 1151 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
CHECK_FOR_ERROR
@@ -3640,7 +3639,7 @@ yyreduce:
break;
case 69:
-#line 1155 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1154 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = 0;
CHECK_FOR_ERROR
@@ -3648,7 +3647,7 @@ yyreduce:
break;
case 73:
-#line 1163 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = 0;
CHECK_FOR_ERROR
@@ -3656,7 +3655,7 @@ yyreduce:
break;
case 74:
-#line 1168 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1167 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
CHECK_FOR_ERROR
@@ -3664,152 +3663,152 @@ yyreduce:
break;
case 75:
-#line 1174 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 76:
-#line 1175 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 77:
-#line 1176 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1175 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 78:
-#line 1177 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1176 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
break;
case 79:
-#line 1178 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1177 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 80:
-#line 1182 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 81:
-#line 1183 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1182 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 82:
-#line 1184 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1183 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 83:
-#line 1188 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1187 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
break;
case 84:
-#line 1189 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1188 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::DefaultVisibility; ;}
break;
case 85:
-#line 1190 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::HiddenVisibility; ;}
break;
case 86:
-#line 1191 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;}
break;
case 87:
-#line 1195 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 88:
-#line 1196 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1195 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 89:
-#line 1197 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1196 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 90:
-#line 1201 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1200 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 91:
-#line 1202 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1201 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 92:
-#line 1203 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1202 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 93:
-#line 1204 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 94:
-#line 1205 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 95:
-#line 1209 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1208 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 96:
-#line 1210 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 97:
-#line 1211 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 98:
-#line 1214 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1213 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::C; ;}
break;
case 99:
-#line 1215 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1214 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::C; ;}
break;
case 100:
-#line 1216 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::Fast; ;}
break;
case 101:
-#line 1217 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1216 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::Cold; ;}
break;
case 102:
-#line 1218 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1217 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
break;
case 103:
-#line 1219 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1218 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
break;
case 104:
-#line 1220 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
GEN_ERROR("Calling conv too large");
@@ -3819,129 +3818,129 @@ yyreduce:
break;
case 105:
-#line 1227 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
break;
case 106:
-#line 1228 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
break;
case 107:
-#line 1229 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1228 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::SExt; ;}
break;
case 108:
-#line 1230 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1229 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::SExt; ;}
break;
case 109:
-#line 1231 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::InReg; ;}
break;
case 110:
-#line 1232 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::StructRet; ;}
break;
case 111:
-#line 1233 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1232 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::NoAlias; ;}
break;
case 112:
-#line 1234 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ByVal; ;}
break;
case 113:
-#line 1235 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::Nest; ;}
break;
case 114:
-#line 1236 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1235 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) =
ParamAttr::constructAlignmentFromInt((yyvsp[(2) - (2)].UInt64Val)); ;}
break;
case 115:
-#line 1240 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1239 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::None; ;}
break;
case 116:
-#line 1241 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1240 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
;}
break;
case 117:
-#line 1246 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1245 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::NoReturn; ;}
break;
case 118:
-#line 1247 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;}
break;
case 119:
-#line 1248 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1247 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ZExt; ;}
break;
case 120:
-#line 1249 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::SExt; ;}
break;
case 121:
-#line 1250 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1249 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ReadNone; ;}
break;
case 122:
-#line 1251 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1250 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;}
break;
case 123:
-#line 1254 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1253 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamAttrs) = ParamAttr::None; ;}
break;
case 124:
-#line 1255 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs);
;}
break;
case 125:
-#line 1260 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1259 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 126:
-#line 1261 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
;}
break;
case 127:
-#line 1268 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1267 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 128:
-#line 1269 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1268 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3951,12 +3950,12 @@ yyreduce:
break;
case 129:
-#line 1275 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 130:
-#line 1276 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1275 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -3966,7 +3965,7 @@ yyreduce:
break;
case 131:
-#line 1285 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1284 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i)
if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\')
@@ -3977,27 +3976,27 @@ yyreduce:
break;
case 132:
-#line 1293 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1292 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 133:
-#line 1294 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1293 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
break;
case 134:
-#line 1299 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{;}
break;
case 135:
-#line 1300 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1299 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{;}
break;
case 136:
-#line 1301 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1300 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV->setSection(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -4006,7 +4005,7 @@ yyreduce:
break;
case 137:
-#line 1306 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1305 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
GEN_ERROR("Alignment must be a power of two");
@@ -4016,7 +4015,7 @@ yyreduce:
break;
case 145:
-#line 1322 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
CHECK_FOR_ERROR
@@ -4024,7 +4023,7 @@ yyreduce:
break;
case 146:
-#line 1326 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1325 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
CHECK_FOR_ERROR
@@ -4032,7 +4031,7 @@ yyreduce:
break;
case 147:
-#line 1330 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1329 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Pointer type?
if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy)
GEN_ERROR("Cannot form a pointer to a basic block");
@@ -4043,7 +4042,7 @@ yyreduce:
break;
case 148:
-#line 1337 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1336 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Named types are also simple types...
const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
CHECK_FOR_ERROR
@@ -4052,7 +4051,7 @@ yyreduce:
break;
case 149:
-#line 1342 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1341 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Type UpReference
if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range");
OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
@@ -4064,7 +4063,7 @@ yyreduce:
break;
case 150:
-#line 1350 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1349 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Allow but ignore attributes on function types; this permits auto-upgrade.
// FIXME: remove in LLVM 3.0.
@@ -4098,7 +4097,7 @@ yyreduce:
break;
case 151:
-#line 1380 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1379 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Allow but ignore attributes on function types; this permits auto-upgrade.
// FIXME: remove in LLVM 3.0.
@@ -4126,7 +4125,7 @@ yyreduce:
break;
case 152:
-#line 1405 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1404 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Sized array type?
(yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val))));
delete (yyvsp[(4) - (5)].TypeVal);
@@ -4135,7 +4134,7 @@ yyreduce:
break;
case 153:
-#line 1410 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1409 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Vector type?
const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get();
if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
@@ -4149,7 +4148,7 @@ yyreduce:
break;
case 154:
-#line 1420 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1419 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Structure type?
std::vector<const Type*> Elements;
for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(),
@@ -4163,7 +4162,7 @@ yyreduce:
break;
case 155:
-#line 1430 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1429 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty structure type?
(yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>()));
CHECK_FOR_ERROR
@@ -4171,7 +4170,7 @@ yyreduce:
break;
case 156:
-#line 1434 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1433 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::vector<const Type*> Elements;
for (std::list<llvm::PATypeHolder>::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(),
@@ -4185,7 +4184,7 @@ yyreduce:
break;
case 157:
-#line 1444 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1443 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty structure type?
(yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector<const Type*>(), true));
CHECK_FOR_ERROR
@@ -4193,7 +4192,7 @@ yyreduce:
break;
case 158:
-#line 1451 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1450 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Allow but ignore attributes on function types; this permits auto-upgrade.
// FIXME: remove in LLVM 3.0.
@@ -4203,7 +4202,7 @@ yyreduce:
break;
case 159:
-#line 1460 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1459 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
@@ -4214,14 +4213,14 @@ yyreduce:
break;
case 160:
-#line 1467 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1466 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeVal) = new PATypeHolder(Type::VoidTy);
;}
break;
case 161:
-#line 1472 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1471 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList) = new TypeWithAttrsList();
(yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs));
@@ -4230,7 +4229,7 @@ yyreduce:
break;
case 162:
-#line 1477 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1476 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs));
CHECK_FOR_ERROR
@@ -4238,7 +4237,7 @@ yyreduce:
break;
case 164:
-#line 1485 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1484 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList);
TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
@@ -4249,7 +4248,7 @@ yyreduce:
break;
case 165:
-#line 1492 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList) = new TypeWithAttrsList;
TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None;
@@ -4260,7 +4259,7 @@ yyreduce:
break;
case 166:
-#line 1499 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1498 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeWithAttrsList) = new TypeWithAttrsList();
CHECK_FOR_ERROR
@@ -4268,7 +4267,7 @@ yyreduce:
break;
case 167:
-#line 1507 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1506 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TypeList) = new std::list<PATypeHolder>();
(yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal));
@@ -4278,7 +4277,7 @@ yyreduce:
break;
case 168:
-#line 1513 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1512 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal));
delete (yyvsp[(3) - (3)].TypeVal);
@@ -4287,7 +4286,7 @@ yyreduce:
break;
case 169:
-#line 1525 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1524 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
@@ -4319,7 +4318,7 @@ yyreduce:
break;
case 170:
-#line 1553 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1552 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -4339,7 +4338,7 @@ yyreduce:
break;
case 171:
-#line 1569 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1568 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -4370,7 +4369,7 @@ yyreduce:
break;
case 172:
-#line 1596 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1595 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized arr
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription());
@@ -4402,7 +4401,7 @@ yyreduce:
break;
case 173:
-#line 1624 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1623 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal)->get());
if (STy == 0)
@@ -4432,7 +4431,7 @@ yyreduce:
break;
case 174:
-#line 1650 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1649 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -4456,7 +4455,7 @@ yyreduce:
break;
case 175:
-#line 1670 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1669 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal)->get());
if (STy == 0)
@@ -4486,7 +4485,7 @@ yyreduce:
break;
case 176:
-#line 1696 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1695 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription());
@@ -4510,7 +4509,7 @@ yyreduce:
break;
case 177:
-#line 1716 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1715 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4526,7 +4525,7 @@ yyreduce:
break;
case 178:
-#line 1728 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1727 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4537,7 +4536,7 @@ yyreduce:
break;
case 179:
-#line 1735 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1734 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4607,7 +4606,7 @@ yyreduce:
break;
case 180:
-#line 1801 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1800 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4621,7 +4620,7 @@ yyreduce:
break;
case 181:
-#line 1811 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1810 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -4635,7 +4634,7 @@ yyreduce:
break;
case 182:
-#line 1821 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)))
GEN_ERROR("Constant value doesn't fit in type");
@@ -4645,7 +4644,7 @@ yyreduce:
break;
case 183:
-#line 1827 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // arbitrary precision integer constants
uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
@@ -4659,7 +4658,7 @@ yyreduce:
break;
case 184:
-#line 1837 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1836 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // integral constants
if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)))
GEN_ERROR("Constant value doesn't fit in type");
@@ -4669,7 +4668,7 @@ yyreduce:
break;
case 185:
-#line 1843 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1842 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // arbitrary precision integer constants
uint32_t BitWidth = cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth();
if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) {
@@ -4683,7 +4682,7 @@ yyreduce:
break;
case 186:
-#line 1853 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1852 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
(yyval.ConstVal) = ConstantInt::getTrue();
@@ -4692,7 +4691,7 @@ yyreduce:
break;
case 187:
-#line 1858 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1857 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Boolean constants
assert(cast<IntegerType>((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?");
(yyval.ConstVal) = ConstantInt::getFalse();
@@ -4701,7 +4700,7 @@ yyreduce:
break;
case 188:
-#line 1863 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1862 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Floating point constants
if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)))
GEN_ERROR("Floating point constant invalid for type");
@@ -4716,7 +4715,7 @@ yyreduce:
break;
case 189:
-#line 1876 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1875 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription());
@@ -4732,7 +4731,7 @@ yyreduce:
break;
case 190:
-#line 1888 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1887 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>((yyvsp[(3) - (5)].ConstVal)->getType()))
GEN_ERROR("GetElementPtr requires a pointer operand");
@@ -4758,7 +4757,7 @@ yyreduce:
break;
case 191:
-#line 1910 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty)
GEN_ERROR("Select condition must be of boolean type");
@@ -4770,7 +4769,7 @@ yyreduce:
break;
case 192:
-#line 1918 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1917 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
GEN_ERROR("Binary operator types must match");
@@ -4780,7 +4779,7 @@ yyreduce:
break;
case 193:
-#line 1924 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1923 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType())
GEN_ERROR("Logical operator types must match");
@@ -4795,7 +4794,7 @@ yyreduce:
break;
case 194:
-#line 1935 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1934 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
GEN_ERROR("icmp operand types must match");
@@ -4804,7 +4803,7 @@ yyreduce:
break;
case 195:
-#line 1940 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1939 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType())
GEN_ERROR("fcmp operand types must match");
@@ -4813,7 +4812,7 @@ yyreduce:
break;
case 196:
-#line 1945 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)))
GEN_ERROR("Invalid extractelement operands");
@@ -4823,7 +4822,7 @@ yyreduce:
break;
case 197:
-#line 1951 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
GEN_ERROR("Invalid insertelement operands");
@@ -4833,7 +4832,7 @@ yyreduce:
break;
case 198:
-#line 1957 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1956 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)))
GEN_ERROR("Invalid shufflevector operands");
@@ -4843,7 +4842,7 @@ yyreduce:
break;
case 199:
-#line 1966 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1965 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal));
CHECK_FOR_ERROR
@@ -4851,7 +4850,7 @@ yyreduce:
break;
case 200:
-#line 1970 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1969 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ConstVector) = new std::vector<Constant*>();
(yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
@@ -4860,27 +4859,27 @@ yyreduce:
break;
case 201:
-#line 1978 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1977 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 202:
-#line 1978 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1977 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 203:
-#line 1981 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1980 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 204:
-#line 1981 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1980 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 205:
-#line 1984 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1983 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get();
Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal));
@@ -4896,7 +4895,7 @@ yyreduce:
break;
case 206:
-#line 1996 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 1995 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
Constant *Val = (yyvsp[(3) - (6)].ConstVal);
const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get();
@@ -4912,7 +4911,7 @@ yyreduce:
break;
case 207:
-#line 2017 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2016 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
CurModule.ModuleDone();
@@ -4921,7 +4920,7 @@ yyreduce:
break;
case 208:
-#line 2022 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2021 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ModuleVal) = ParserResult = CurModule.CurrentModule;
CurModule.ModuleDone();
@@ -4930,12 +4929,12 @@ yyreduce:
break;
case 211:
-#line 2035 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.isDeclare = false; ;}
break;
case 212:
-#line 2035 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurFun.FunctionDone();
CHECK_FOR_ERROR
@@ -4943,26 +4942,26 @@ yyreduce:
break;
case 213:
-#line 2039 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ CurFun.isDeclare = true; ;}
break;
case 214:
-#line 2039 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2038 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 215:
-#line 2042 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2041 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 216:
-#line 2045 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2044 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription());
@@ -4990,7 +4989,7 @@ yyreduce:
break;
case 217:
-#line 2069 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType));
@@ -5005,7 +5004,7 @@ yyreduce:
break;
case 218:
-#line 2081 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2080 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
/* "Externally Visible" Linkage */
if ((yyvsp[(5) - (6)].ConstVal) == 0)
@@ -5017,14 +5016,14 @@ yyreduce:
break;
case 219:
-#line 2088 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2087 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
;}
break;
case 220:
-#line 2092 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2091 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(6) - (7)].ConstVal) == 0)
GEN_ERROR("Global value initializer is not a constant");
@@ -5034,14 +5033,14 @@ yyreduce:
break;
case 221:
-#line 2097 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2096 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
;}
break;
case 222:
-#line 2101 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2100 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription());
@@ -5052,7 +5051,7 @@ yyreduce:
break;
case 223:
-#line 2107 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurGV = 0;
CHECK_FOR_ERROR
@@ -5060,7 +5059,7 @@ yyreduce:
break;
case 224:
-#line 2111 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2110 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::string Name;
if ((yyvsp[(1) - (5)].StrVal)) {
@@ -5104,21 +5103,21 @@ yyreduce:
break;
case 225:
-#line 2151 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 226:
-#line 2154 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 227:
-#line 2160 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2159 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
if (AsmSoFar.empty())
@@ -5131,7 +5130,7 @@ yyreduce:
break;
case 228:
-#line 2170 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2169 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal));
delete (yyvsp[(3) - (3)].StrVal);
@@ -5139,7 +5138,7 @@ yyreduce:
break;
case 229:
-#line 2174 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal));
delete (yyvsp[(3) - (3)].StrVal);
@@ -5147,7 +5146,7 @@ yyreduce:
break;
case 231:
-#line 2181 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal));
delete (yyvsp[(3) - (3)].StrVal);
@@ -5156,7 +5155,7 @@ yyreduce:
break;
case 232:
-#line 2186 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2185 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5165,14 +5164,14 @@ yyreduce:
break;
case 233:
-#line 2191 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CHECK_FOR_ERROR
;}
break;
case 234:
-#line 2200 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
@@ -5186,7 +5185,7 @@ yyreduce:
break;
case 235:
-#line 2210 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2209 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription());
@@ -5200,7 +5199,7 @@ yyreduce:
break;
case 236:
-#line 2221 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2220 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[(1) - (1)].ArgList);
CHECK_FOR_ERROR
@@ -5208,7 +5207,7 @@ yyreduce:
break;
case 237:
-#line 2225 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2224 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
struct ArgListEntry E;
@@ -5221,7 +5220,7 @@ yyreduce:
break;
case 238:
-#line 2234 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2233 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = new ArgListType;
struct ArgListEntry E;
@@ -5234,7 +5233,7 @@ yyreduce:
break;
case 239:
-#line 2243 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2242 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ArgList) = 0;
CHECK_FOR_ERROR
@@ -5242,7 +5241,7 @@ yyreduce:
break;
case 240:
-#line 2249 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2248 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
std::string FunctionName(*(yyvsp[(3) - (10)].StrVal));
delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory!
@@ -5253,13 +5252,9 @@ yyreduce:
GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription());
std::vector<const Type*> ParamTypeList;
- ParamAttrsVector Attrs;
- if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0;
- PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs);
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(7) - (10)].ParamAttrs)));
if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments...
unsigned index = 1;
for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) {
@@ -5267,22 +5262,17 @@ yyreduce:
if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
ParamTypeList.push_back(Ty);
- if (Ty != Type::VoidTy)
- if (I->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = I->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
}
}
bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
if (isVarArg) ParamTypeList.pop_back();
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg);
const PointerType *PFT = PointerType::getUnqual(FT);
@@ -5301,7 +5291,8 @@ yyreduce:
// Move the function to the end of the list, from whereever it was
// previously inserted.
Fn = cast<Function>(FWRef);
- assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
+ assert(Fn->getParamAttrs().isEmpty() &&
+ "Forward reference has parameter attributes!");
CurModule.CurrentModule->getFunctionList().remove(Fn);
CurModule.CurrentModule->getFunctionList().push_back(Fn);
} else if (!FunctionName.empty() && // Merge with an earlier prototype?
@@ -5378,7 +5369,7 @@ yyreduce:
break;
case 243:
-#line 2384 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2375 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
@@ -5390,7 +5381,7 @@ yyreduce:
break;
case 246:
-#line 2395 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2386 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
@@ -5398,7 +5389,7 @@ yyreduce:
break;
case 247:
-#line 2400 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2391 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage));
CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility));
@@ -5409,7 +5400,7 @@ yyreduce:
break;
case 248:
-#line 2412 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2403 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -5417,7 +5408,7 @@ yyreduce:
break;
case 249:
-#line 2416 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2407 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -5425,7 +5416,7 @@ yyreduce:
break;
case 250:
-#line 2421 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2412 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A reference to a direct constant
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val));
CHECK_FOR_ERROR
@@ -5433,7 +5424,7 @@ yyreduce:
break;
case 251:
-#line 2425 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2416 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val));
CHECK_FOR_ERROR
@@ -5441,7 +5432,7 @@ yyreduce:
break;
case 252:
-#line 2429 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2420 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Perhaps it's an FP constant?
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal));
CHECK_FOR_ERROR
@@ -5449,7 +5440,7 @@ yyreduce:
break;
case 253:
-#line 2433 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2424 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantInt::getTrue());
CHECK_FOR_ERROR
@@ -5457,7 +5448,7 @@ yyreduce:
break;
case 254:
-#line 2437 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2428 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantInt::getFalse());
CHECK_FOR_ERROR
@@ -5465,7 +5456,7 @@ yyreduce:
break;
case 255:
-#line 2441 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2432 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createNull();
CHECK_FOR_ERROR
@@ -5473,7 +5464,7 @@ yyreduce:
break;
case 256:
-#line 2445 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createUndef();
CHECK_FOR_ERROR
@@ -5481,7 +5472,7 @@ yyreduce:
break;
case 257:
-#line 2449 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2440 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // A vector zero constant.
(yyval.ValIDVal) = ValID::createZeroInit();
CHECK_FOR_ERROR
@@ -5489,7 +5480,7 @@ yyreduce:
break;
case 258:
-#line 2453 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2444 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Nonempty unsized packed vector
const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType();
int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
@@ -5518,7 +5509,7 @@ yyreduce:
break;
case 259:
-#line 2478 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2469 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal));
CHECK_FOR_ERROR
@@ -5526,7 +5517,7 @@ yyreduce:
break;
case 260:
-#line 2482 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2473 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal));
delete (yyvsp[(3) - (5)].StrVal);
@@ -5536,7 +5527,7 @@ yyreduce:
break;
case 261:
-#line 2492 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2483 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it an integer reference...?
(yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal));
CHECK_FOR_ERROR
@@ -5544,7 +5535,7 @@ yyreduce:
break;
case 262:
-#line 2496 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2487 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal));
CHECK_FOR_ERROR
@@ -5552,7 +5543,7 @@ yyreduce:
break;
case 263:
-#line 2500 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2491 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it a named reference...?
(yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5561,7 +5552,7 @@ yyreduce:
break;
case 264:
-#line 2505 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2496 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Is it a named reference...?
(yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal));
delete (yyvsp[(1) - (1)].StrVal);
@@ -5570,7 +5561,7 @@ yyreduce:
break;
case 267:
-#line 2518 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2509 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription());
@@ -5581,7 +5572,7 @@ yyreduce:
break;
case 268:
-#line 2527 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2518 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueList) = new std::vector<Value *>();
(yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
@@ -5590,7 +5581,7 @@ yyreduce:
break;
case 269:
-#line 2532 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2523 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
((yyval.ValueList)=(yyvsp[(1) - (3)].ValueList))->push_back((yyvsp[(3) - (3)].ValueVal));
CHECK_FOR_ERROR
@@ -5598,7 +5589,7 @@ yyreduce:
break;
case 270:
-#line 2537 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2528 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
@@ -5606,7 +5597,7 @@ yyreduce:
break;
case 271:
-#line 2541 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2532 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Do not allow functions with 0 basic blocks
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
CHECK_FOR_ERROR
@@ -5614,7 +5605,7 @@ yyreduce:
break;
case 272:
-#line 2550 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2541 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal));
CHECK_FOR_ERROR
@@ -5626,7 +5617,7 @@ yyreduce:
break;
case 273:
-#line 2559 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2550 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (CastInst *CI1 = dyn_cast<CastInst>((yyvsp[(2) - (2)].InstVal)))
if (CastInst *CI2 = dyn_cast<CastInst>(CI1->getOperand(0)))
@@ -5639,7 +5630,7 @@ yyreduce:
break;
case 274:
-#line 2568 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2559 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Empty space between instruction lists
(yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum), 0);
CHECK_FOR_ERROR
@@ -5647,7 +5638,7 @@ yyreduce:
break;
case 275:
-#line 2572 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2563 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Only the unwind to block
(yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum), getBBVal((yyvsp[(3) - (3)].ValIDVal)));
CHECK_FOR_ERROR
@@ -5655,7 +5646,7 @@ yyreduce:
break;
case 276:
-#line 2576 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Labelled (named) basic block
(yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)), 0);
delete (yyvsp[(1) - (1)].StrVal);
@@ -5664,7 +5655,7 @@ yyreduce:
break;
case 277:
-#line 2581 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2572 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (4)].StrVal)), getBBVal((yyvsp[(4) - (4)].ValIDVal)));
delete (yyvsp[(1) - (4)].StrVal);
@@ -5673,7 +5664,7 @@ yyreduce:
break;
case 278:
-#line 2588 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with a result...
ValueList &VL = *(yyvsp[(2) - (2)].ValueList);
assert(!VL.empty() && "Invalid ret operands!");
@@ -5684,7 +5675,7 @@ yyreduce:
break;
case 279:
-#line 2595 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2586 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Return with no result...
(yyval.TermInstVal) = new ReturnInst();
CHECK_FOR_ERROR
@@ -5692,7 +5683,7 @@ yyreduce:
break;
case 280:
-#line 2599 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2590 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Unconditional Branch...
BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
CHECK_FOR_ERROR
@@ -5701,7 +5692,7 @@ yyreduce:
break;
case 281:
-#line 2604 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2595 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
assert(cast<IntegerType>((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?");
BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal));
@@ -5715,7 +5706,7 @@ yyreduce:
break;
case 282:
-#line 2614 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2605 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal));
CHECK_FOR_ERROR
@@ -5738,7 +5729,7 @@ yyreduce:
break;
case 283:
-#line 2633 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2624 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal));
CHECK_FOR_ERROR
@@ -5751,7 +5742,7 @@ yyreduce:
break;
case 284:
-#line 2643 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2634 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Handle the short syntax
@@ -5781,11 +5772,9 @@ yyreduce:
BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal));
CHECK_FOR_ERROR
- ParamAttrsVector Attrs;
- if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) {
- ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs);
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (14)].ParamAttrs)));
// Check the arguments
ValueList Args;
@@ -5807,35 +5796,27 @@ yyreduce:
GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
(*I)->getDescription() + "'");
Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
if (Ty->isVarArg()) {
if (I == E)
for (; ArgI != ArgE; ++ArgI, ++index) {
Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
} else if (I != E || ArgI != ArgE)
GEN_ERROR("Invalid number of parameters detected");
}
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
// Create the InvokeInst
- InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
+ InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(),Args.end());
II->setCallingConv((yyvsp[(2) - (14)].UIntVal));
II->setParamAttrs(PAL);
(yyval.TermInstVal) = II;
@@ -5845,7 +5826,7 @@ yyreduce:
break;
case 285:
-#line 2733 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TermInstVal) = new UnwindInst();
CHECK_FOR_ERROR
@@ -5853,7 +5834,7 @@ yyreduce:
break;
case 286:
-#line 2737 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2718 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.TermInstVal) = new UnreachableInst();
CHECK_FOR_ERROR
@@ -5861,7 +5842,7 @@ yyreduce:
break;
case 287:
-#line 2744 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2725 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
Constant *V = cast<Constant>(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal)));
@@ -5876,7 +5857,7 @@ yyreduce:
break;
case 288:
-#line 2755 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2736 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
Constant *V = cast<Constant>(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal)));
@@ -5892,7 +5873,7 @@ yyreduce:
break;
case 289:
-#line 2768 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2749 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Is this definition named?? if so, assign the name...
setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal));
@@ -5904,7 +5885,7 @@ yyreduce:
break;
case 290:
-#line 2778 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2759 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ // Used for PHI nodes
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription());
@@ -5919,7 +5900,7 @@ yyreduce:
break;
case 291:
-#line 2789 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2770 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal));
@@ -5931,7 +5912,7 @@ yyreduce:
break;
case 292:
-#line 2799 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2780 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
if (!UpRefs.empty())
@@ -5946,7 +5927,7 @@ yyreduce:
break;
case 293:
-#line 2810 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2791 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
// Labels are only valid in ASMs
@@ -5958,7 +5939,7 @@ yyreduce:
break;
case 294:
-#line 2818 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2799 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
if (!UpRefs.empty())
@@ -5972,7 +5953,7 @@ yyreduce:
break;
case 295:
-#line 2828 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2809 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0
(yyval.ParamList) = (yyvsp[(1) - (6)].ParamList);
@@ -5983,17 +5964,17 @@ yyreduce:
break;
case 296:
-#line 2835 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2816 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ParamList) = new ParamList(); ;}
break;
case 297:
-#line 2838 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2819 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{ (yyval.ValueList) = new std::vector<Value*>(); ;}
break;
case 298:
-#line 2839 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2820 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
(yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
@@ -6002,7 +5983,7 @@ yyreduce:
break;
case 299:
-#line 2846 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2827 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -6010,7 +5991,7 @@ yyreduce:
break;
case 300:
-#line 2850 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2831 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -6018,7 +5999,7 @@ yyreduce:
break;
case 301:
-#line 2855 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2836 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
@@ -6038,7 +6019,7 @@ yyreduce:
break;
case 302:
-#line 2871 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2852 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription());
@@ -6059,7 +6040,7 @@ yyreduce:
break;
case 303:
-#line 2888 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2869 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
@@ -6077,7 +6058,7 @@ yyreduce:
break;
case 304:
-#line 2902 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2883 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription());
@@ -6095,7 +6076,7 @@ yyreduce:
break;
case 305:
-#line 2916 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2897 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
@@ -6111,7 +6092,7 @@ yyreduce:
break;
case 306:
-#line 2928 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty)
GEN_ERROR("select condition must be boolean");
@@ -6123,7 +6104,7 @@ yyreduce:
break;
case 307:
-#line 2936 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2917 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription());
@@ -6134,7 +6115,7 @@ yyreduce:
break;
case 308:
-#line 2943 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2924 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)))
GEN_ERROR("Invalid extractelement operands");
@@ -6144,7 +6125,7 @@ yyreduce:
break;
case 309:
-#line 2949 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
GEN_ERROR("Invalid insertelement operands");
@@ -6154,7 +6135,7 @@ yyreduce:
break;
case 310:
-#line 2955 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2936 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)))
GEN_ERROR("Invalid shufflevector operands");
@@ -6164,7 +6145,7 @@ yyreduce:
break;
case 311:
-#line 2961 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2942 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType();
if (!Ty->isFirstClassType())
@@ -6183,7 +6164,7 @@ yyreduce:
break;
case 312:
-#line 2977 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 2958 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
// Handle the short syntax
@@ -6217,13 +6198,9 @@ yyreduce:
}
// Set up the ParamAttrs for the function
- ParamAttrsVector Attrs;
- if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0;
- PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs);
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, (yyvsp[(8) - (8)].ParamAttrs)));
// Check the arguments
ValueList Args;
if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments?
@@ -6244,32 +6221,24 @@ yyreduce:
GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
(*I)->getDescription() + "'");
Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
if (Ty->isVarArg()) {
if (I == E)
for (; ArgI != ArgE; ++ArgI, ++index) {
Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
} else if (I != E || ArgI != ArgE)
GEN_ERROR("Invalid number of parameters detected");
}
// Finish off the ParamAttrs and check them
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
// Create the call node
CallInst *CI = new CallInst(V, Args.begin(), Args.end());
@@ -6284,7 +6253,7 @@ yyreduce:
break;
case 313:
-#line 3074 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3043 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
CHECK_FOR_ERROR
@@ -6292,7 +6261,7 @@ yyreduce:
break;
case 314:
-#line 3079 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3048 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = true;
CHECK_FOR_ERROR
@@ -6300,7 +6269,7 @@ yyreduce:
break;
case 315:
-#line 3083 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3052 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
(yyval.BoolVal) = false;
CHECK_FOR_ERROR
@@ -6308,7 +6277,7 @@ yyreduce:
break;
case 316:
-#line 3090 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3059 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
@@ -6319,7 +6288,7 @@ yyreduce:
break;
case 317:
-#line 3097 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
@@ -6331,7 +6300,7 @@ yyreduce:
break;
case 318:
-#line 3105 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3074 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription());
@@ -6342,7 +6311,7 @@ yyreduce:
break;
case 319:
-#line 3112 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3081 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription());
@@ -6354,7 +6323,7 @@ yyreduce:
break;
case 320:
-#line 3120 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3089 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!isa<PointerType>((yyvsp[(2) - (2)].ValueVal)->getType()))
GEN_ERROR("Trying to free nonpointer type " +
@@ -6365,7 +6334,7 @@ yyreduce:
break;
case 321:
-#line 3128 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3097 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription());
@@ -6383,7 +6352,7 @@ yyreduce:
break;
case 322:
-#line 3142 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3111 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription());
@@ -6404,7 +6373,7 @@ yyreduce:
break;
case 323:
-#line 3159 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3128 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
Value *TmpVal = getVal((yyvsp[(2) - (5)].TypeVal)->get(), (yyvsp[(3) - (5)].ValIDVal));
if (!GetResultInst::isValidOperands(TmpVal, (yyvsp[(5) - (5)].UInt64Val)))
@@ -6416,7 +6385,7 @@ yyreduce:
break;
case 324:
-#line 3167 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3136 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
if (!UpRefs.empty())
GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription());
@@ -6436,7 +6405,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
-#line 6440 "llvmAsmParser.tab.c"
+#line 6409 "llvmAsmParser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -6650,7 +6619,7 @@ yyreturn:
}
-#line 3184 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 3153 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
// common code from the two 'RunVMAsmParser' functions
diff --git a/lib/AsmParser/llvmAsmParser.h.cvs b/lib/AsmParser/llvmAsmParser.h.cvs
index e750b1244b..c6765bb52e 100644
--- a/lib/AsmParser/llvmAsmParser.h.cvs
+++ b/lib/AsmParser/llvmAsmParser.h.cvs
@@ -346,7 +346,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 951 "/home/nicholas/llvm-commit/lib/AsmParser/llvmAsmParser.y"
+#line 950 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -393,7 +393,7 @@ typedef union YYSTYPE
llvm::ICmpInst::Predicate IPredicate;
llvm::FCmpInst::Predicate FPredicate;
}
-/* Line 1489 of yacc.c. */
+/* Line 1529 of yacc.c. */
#line 398 "llvmAsmParser.tab.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 76ad346fed..6aab1fe40b 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -25,7 +25,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
-#include "llvm/ParamAttrsList.h"
#include <algorithm>
#include <list>
#include <map>
@@ -2256,13 +2255,9 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription());
std::vector<const Type*> ParamTypeList;
- ParamAttrsVector Attrs;
- if ($7 != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0;
- PAWI.attrs = $7;
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ($7 != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, $7));
if ($5) { // If there are arguments...
unsigned index = 1;
for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) {
@@ -2270,22 +2265,17 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
ParamTypeList.push_back(Ty);
- if (Ty != Type::VoidTy)
- if (I->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = I->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
}
}
bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
if (isVarArg) ParamTypeList.pop_back();
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg);
const PointerType *PFT = PointerType::getUnqual(FT);
@@ -2304,7 +2294,8 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
// Move the function to the end of the list, from whereever it was
// previously inserted.
Fn = cast<Function>(FWRef);
- assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
+ assert(Fn->getParamAttrs().isEmpty() &&
+ "Forward reference has parameter attributes!");
CurModule.CurrentModule->getFunctionList().remove(Fn);
CurModule.CurrentModule->getFunctionList().push_back(Fn);
} else if (!FunctionName.empty() && // Merge with an earlier prototype?
@@ -2669,11 +2660,9 @@ BBTerminatorInst :
BasicBlock *Except = getBBVal($14);
CHECK_FOR_ERROR
- ParamAttrsVector Attrs;
- if ($8 != ParamAttr::None) {
- ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8;
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ($8 != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
// Check the arguments
ValueList Args;
@@ -2695,35 +2684,27 @@ BBTerminatorInst :
GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
(*I)->getDescription() + "'");
Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
if (Ty->isVarArg()) {
if (I == E)
for (; ArgI != ArgE; ++ArgI, ++index) {
Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
} else if (I != E || ArgI != ArgE)
GEN_ERROR("Invalid number of parameters detected");
}
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
// Create the InvokeInst
- InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
+ InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(),Args.end());
II->setCallingConv($2);
II->setParamAttrs(PAL);
$$ = II;
@@ -3007,13 +2988,9 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
}
// Set up the ParamAttrs for the function
- ParamAttrsVector Attrs;
- if ($8 != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0;
- PAWI.attrs = $8;
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ($8 != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
// Check the arguments
ValueList Args;
if ($6->empty()) { // Has no arguments?
@@ -3034,32 +3011,24 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
(*I)->getDescription() + "'");
Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
if (Ty->isVarArg()) {
if (I == E)
for (; ArgI != ArgE; ++ArgI, ++index) {
Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
} else if (I != E || ArgI != ArgE)
GEN_ERROR("Invalid number of parameters detected");
}
// Finish off the ParamAttrs and check them
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
// Create the call node
CallInst *CI = new CallInst(V, Args.begin(), Args.end());
diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs
index 76ad346fed..6aab1fe40b 100644
--- a/lib/AsmParser/llvmAsmParser.y.cvs
+++ b/lib/AsmParser/llvmAsmParser.y.cvs
@@ -25,7 +25,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Streams.h"
-#include "llvm/ParamAttrsList.h"
#include <algorithm>
#include <list>
#include <map>
@@ -2256,13 +2255,9 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
GEN_ERROR("Reference to abstract result: "+ $2->get()->getDescription());
std::vector<const Type*> ParamTypeList;
- ParamAttrsVector Attrs;
- if ($7 != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0;
- PAWI.attrs = $7;
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ($7 != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, $7));
if ($5) { // If there are arguments...
unsigned index = 1;
for (ArgListType::iterator I = $5->begin(); I != $5->end(); ++I, ++index) {
@@ -2270,22 +2265,17 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty))
GEN_ERROR("Reference to abstract argument: " + Ty->getDescription());
ParamTypeList.push_back(Ty);
- if (Ty != Type::VoidTy)
- if (I->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = I->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (Ty != Type::VoidTy && I->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, I->Attrs));
}
}
bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy;
if (isVarArg) ParamTypeList.pop_back();
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
FunctionType *FT = FunctionType::get(*$2, ParamTypeList, isVarArg);
const PointerType *PFT = PointerType::getUnqual(FT);
@@ -2304,7 +2294,8 @@ FunctionHeaderH : OptCallingConv ResultTypes GlobalName '(' ArgList ')'
// Move the function to the end of the list, from whereever it was
// previously inserted.
Fn = cast<Function>(FWRef);
- assert(!Fn->getParamAttrs() && "Forward reference has parameter attributes!");
+ assert(Fn->getParamAttrs().isEmpty() &&
+ "Forward reference has parameter attributes!");
CurModule.CurrentModule->getFunctionList().remove(Fn);
CurModule.CurrentModule->getFunctionList().push_back(Fn);
} else if (!FunctionName.empty() && // Merge with an earlier prototype?
@@ -2669,11 +2660,9 @@ BBTerminatorInst :
BasicBlock *Except = getBBVal($14);
CHECK_FOR_ERROR
- ParamAttrsVector Attrs;
- if ($8 != ParamAttr::None) {
- ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8;
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ($8 != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
// Check the arguments
ValueList Args;
@@ -2695,35 +2684,27 @@ BBTerminatorInst :
GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
(*I)->getDescription() + "'");
Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
if (Ty->isVarArg()) {
if (I == E)
for (; ArgI != ArgE; ++ArgI, ++index) {
Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
} else if (I != E || ArgI != ArgE)
GEN_ERROR("Invalid number of parameters detected");
}
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
// Create the InvokeInst
- InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end());
+ InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(),Args.end());
II->setCallingConv($2);
II->setParamAttrs(PAL);
$$ = II;
@@ -3007,13 +2988,9 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
}
// Set up the ParamAttrs for the function
- ParamAttrsVector Attrs;
- if ($8 != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = 0;
- PAWI.attrs = $8;
- Attrs.push_back(PAWI);
- }
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
+ if ($8 != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(0, $8));
// Check the arguments
ValueList Args;
if ($6->empty()) { // Has no arguments?
@@ -3034,32 +3011,24 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
GEN_ERROR("Parameter " + ArgI->Val->getName()+ " is not of type '" +
(*I)->getDescription() + "'");
Args.push_back(ArgI->Val);
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
if (Ty->isVarArg()) {
if (I == E)
for (; ArgI != ArgE; ++ArgI, ++index) {
Args.push_back(ArgI->Val); // push the remaining varargs
- if (ArgI->Attrs != ParamAttr::None) {
- ParamAttrsWithIndex PAWI;
- PAWI.index = index;
- PAWI.attrs = ArgI->Attrs;
- Attrs.push_back(PAWI);
- }
+ if (ArgI->Attrs != ParamAttr::None)
+ Attrs.push_back(ParamAttrsWithIndex::get(index, ArgI->Attrs));
}
} else if (I != E || ArgI != ArgE)
GEN_ERROR("Invalid number of parameters detected");
}
// Finish off the ParamAttrs and check them
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (!Attrs.empty())
- PAL = ParamAttrsList::get(Attrs);
+ PAL = PAListPtr::get(Attrs.begin(), Attrs.end());
// Create the call node
CallInst *CI = new CallInst(V, Args.begin(), Args.end());
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index c86ee3048a..e948329fe8 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -18,7 +18,6 @@
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/AutoUpgrade.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
@@ -32,11 +31,7 @@ void BitcodeReader::FreeState() {
std::vector<PATypeHolder>().swap(TypeList);
ValueList.clear();
- // Drop references to ParamAttrs.
- for (unsigned i = 0, e = ParamAttrs.size(); i != e; ++i)
- ParamAttrs[i]->dropRef();
-
- std::vector<const ParamAttrsList*>().swap(ParamAttrs);
+ std::vector<PAListPtr>().swap(ParamAttrs);
std::vector<BasicBlock*>().swap(FunctionBBs);
std::vector<Function*>().swap(FunctionsWithBodies);
DeferredFunctionInfo.clear();
@@ -205,7 +200,7 @@ bool BitcodeReader::ParseParamAttrBlock() {
SmallVector<uint64_t, 64> Record;
- ParamAttrsVector Attrs;
+ SmallVector<ParamAttrsWithIndex, 8> Attrs;
// Read all the records.
while (1) {
@@ -242,13 +237,8 @@ bool BitcodeReader::ParseParamAttrBlock() {
if (Record[i+1] != ParamAttr::None)
Attrs.push_back(ParamAttrsWithIndex::get(Record[i], Record[i+1]));
}
- if (Attrs.empty()) {
- ParamAttrs.push_back(0);
- } else {
- ParamAttrs.push_back(ParamAttrsList::get(Attrs));
- ParamAttrs.back()->addRef();
- }
+ ParamAttrs.push_back(PAListPtr::get(Attrs.begin(), Attrs.end()));
Attrs.clear();
break;
}
@@ -1062,8 +1052,7 @@ bool BitcodeReader::ParseModule(const std::string &ModuleID) {
Func->setCallingConv(Record[1]);
bool isProto = Record[2];
Func->setLinkage(GetDecodedLinkage(Record[3]));
- const ParamAttrsList *PAL = getParamAttrs(Record[4]);
- Func->setParamAttrs(PAL);
+ Func->setParamAttrs(getParamAttrs(Record[4]));
Func->setAlignment((1 << Record[5]) >> 1);
if (Record[6]) {
@@ -1427,7 +1416,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
case bitc::FUNC_CODE_INST_INVOKE: {
// INVOKE: [attrs, cc, normBB, unwindBB, fnty, op0,op1,op2, ...]
if (Record.size() < 4) return Error("Invalid INVOKE record");
- const ParamAttrsList *PAL = getParamAttrs(Record[0]);
+ PAListPtr PAL = getParamAttrs(Record[0]);
unsigned CCInfo = Record[1];
BasicBlock *NormalBB = getBasicBlock(Record[2]);
BasicBlock *UnwindBB = getBasicBlock(Record[3]);
@@ -1565,7 +1554,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
if (Record.size() < 3)
return Error("Invalid CALL record");
- const ParamAttrsList *PAL = getParamAttrs(Record[0]);
+ PAListPtr PAL = getParamAttrs(Record[0]);
unsigned CCInfo = Record[1];
unsigned OpNum = 2;
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index d7df1a1b02..9a140d9524 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/Reader/BitcodeReader.h
@@ -15,6 +15,7 @@
#define BITCODE_READER_H
#include "llvm/ModuleProvider.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/Type.h"
#include "llvm/User.h"
#include "llvm/Bitcode/BitstreamReader.h"
@@ -24,7 +25,6 @@
namespace llvm {
class MemoryBuffer;
- class ParamAttrsList;
class BitcodeReaderValueList : public User {
std::vector<Use> Uses;
@@ -93,7 +93,7 @@ class BitcodeReader : public ModuleProvider {
/// ParamAttrs - The set of parameter attributes by index. Index zero in the
/// file is for null, and is thus not represented here. As such all indices
/// are off by one.
- std::vector<const ParamAttrsList*> ParamAttrs;
+ std::vector<PAListPtr> ParamAttrs;
/// FunctionBBs - While parsing a function body, this is a list of the basic
/// blocks for the function.
@@ -156,10 +156,10 @@ private:
if (ID >= FunctionBBs.size()) return 0; // Invalid ID
return FunctionBBs[ID];
}
- const ParamAttrsList *getParamAttrs(unsigned i) const {
+ PAListPtr getParamAttrs(unsigned i) const {
if (i-1 < ParamAttrs.size())
return ParamAttrs[i-1];
- return 0;
+ return PAListPtr();
}
/// getValueTypePair - Read a value/type pair out of the specified record from
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index aaad22688a..96f045cd47 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -20,7 +20,6 @@
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/TypeSymbolTable.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/Support/MathExtras.h"
@@ -109,17 +108,18 @@ static void WriteStringRecord(unsigned Code, const std::string &Str,
// Emit information about parameter attributes.
static void WriteParamAttrTable(const ValueEnumerator &VE,
BitstreamWriter &Stream) {
- const std::vector<const ParamAttrsList*> &Attrs = VE.getParamAttrs();
+ const std::vector<PAListPtr> &Attrs = VE.getParamAttrs();
if (Attrs.empty()) return;
Stream.EnterSubblock(bitc::PARAMATTR_BLOCK_ID, 3);
SmallVector<uint64_t, 64> Record;
for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
- const ParamAttrsList *A = Attrs[i];
- for (unsigned op = 0, e = A->size(); op != e; ++op) {
- Record.push_back(A->getParamIndex(op));
- Record.push_back(A->getParamAttrsAtIndex(op));
+ const PAListPtr &A = Attrs[i];
+ for (unsigned i = 0, e = A.getNumSlots(); i != e; ++i) {
+ const ParamAttrsWithIndex &PAWI = A.getSlot(i);
+ Record.push_back(PAWI.Index);
+ Record.push_back(PAWI.Attrs);
}
Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record);
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp
index d2efe078c0..09a1db3d62 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -245,10 +245,10 @@ void ValueEnumerator::EnumerateOperandType(const Value *V) {
}
}
-void ValueEnumerator::EnumerateParamAttrs(const ParamAttrsList *PAL) {
- if (PAL == 0) return; // null is always 0.
+void ValueEnumerator::EnumerateParamAttrs(const PAListPtr &PAL) {
+ if (PAL.isEmpty()) return; // null is always 0.
// Do a lookup.
- unsigned &Entry = ParamAttrMap[PAL];
+ unsigned &Entry = ParamAttrMap[PAL.getRawPointer()];
if (Entry == 0) {
// Never saw this before, add it.
ParamAttrs.push_back(PAL);
diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h
index 9fb916a515..dc40d016dc 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/lib/Bitcode/Writer/ValueEnumerator.h
@@ -15,6 +15,7 @@
#define VALUE_ENUMERATOR_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ParameterAttributes.h"
#include <vector>
namespace llvm {
@@ -24,7 +25,7 @@ class Value;
class BasicBlock;
class Function;
class Module;
-class ParamAttrsList;
+class PAListPtr;
class TypeSymbolTable;
class ValueSymbolTable;
@@ -44,9 +45,9 @@ private:
ValueMapType ValueMap;
ValueList Values;
- typedef DenseMap<const ParamAttrsList*, unsigned> ParamAttrMapType;
+ typedef DenseMap<void*, unsigned> ParamAttrMapType;
ParamAttrMapType ParamAttrMap;
- std::vector<const ParamAttrsList*> ParamAttrs;
+ std::vector<PAListPtr> ParamAttrs;
/// BasicBlocks - This contains all the basic blocks for the currently
/// incorporated function. Their reverse mapping is stored in ValueMap.
@@ -75,9 +76,9 @@ public:
return I->second-1;
}
- unsigned getParamAttrID(const ParamAttrsList *PAL) const {
- if (PAL == 0) return 0; // Null maps to zero.
- ParamAttrMapType::const_iterator I = ParamAttrMap.find(PAL);
+ unsigned getParamAttrID(const PAListPtr &PAL) const {
+ if (PAL.isEmpty()) return 0; // Null maps to zero.
+ ParamAttrMapType::const_iterator I = ParamAttrMap.find(PAL.getRawPointer());
assert(I != ParamAttrMap.end() && "ParamAttr not in ValueEnumerator!");
return I->second;
}
@@ -94,7 +95,7 @@ public:
const std::vector<const BasicBlock*> &getBasicBlocks() const {
return BasicBlocks;
}
- const std::vector<const ParamAttrsList*> &getParamAttrs() const {
+ const std::vector<PAListPtr> &getParamAttrs() const {
return ParamAttrs;
}
@@ -115,7 +116,7 @@ private:
void EnumerateValue(const Value *V);
void EnumerateType(const Type *T);
void EnumerateOperandType(const Value *V);
- void EnumerateParamAttrs(const ParamAttrsList *PAL);
+ void EnumerateParamAttrs(const PAListPtr &PAL);
void EnumerateTypeSymbolTable(const TypeSymbolTable &ST);
void EnumerateValueSymbolTable(const ValueSymbolTable &ST);
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 4732e4d6d8..eb7d58517b 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -18,7 +18,6 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Instructions.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Pass.h"
#include "llvm/PassManager.h"
#include "llvm/TypeSymbolTable.h"
@@ -131,13 +130,13 @@ namespace {
bool isSigned = false,
const std::string &VariableName = "",
bool IgnoreName = false,
- const ParamAttrsList *PAL = 0);
+ const PAListPtr &PAL = PAListPtr());
std::ostream &printSimpleType(std::ostream &Out, const Type *Ty,
bool isSigned,
const std::string &NameSoFar = "");
void printStructReturnPointerFunctionType(std::ostream &Out,
- const ParamAttrsList *PAL,
+ const PAListPtr &PAL,
const PointerType *Ty);
/// writeOperandDeref - Print the result of dereferencing the specified
@@ -395,7 +394,7 @@ bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) {
/// return type, except, instead of printing the type as void (*)(Struct*, ...)
/// print it as "Struct (*)(...)", for struct return functions.
void CWriter::printStructReturnPointerFunctionType(std::ostream &Out,
- const ParamAttrsList *PAL,
+ const PAListPtr &PAL,
const PointerType *TheTy) {
const FunctionType *FTy = cast<FunctionType>(TheTy->getElementType());
std::stringstream FunctionInnards;
@@ -409,12 +408,12 @@ void CWriter::printStructReturnPointerFunctionType(std::ostream &Out,
if (PrintedType)
FunctionInnards << ", ";
const Type *ArgTy = *I;
- if (PAL && PAL->paramHasAttr(Idx, ParamAttr::ByVal)) {
+ if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
assert(isa<PointerType>(ArgTy));
ArgTy = cast<PointerType>(ArgTy)->getElementType();
}
printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL && PAL->paramHasAttr(Idx, ParamAttr::SExt), "");
+ /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt), "");
PrintedType = true;
}
if (FTy->isVarArg()) {
@@ -426,7 +425,7 @@ void CWriter::printStructReturnPointerFunctionType(std::ostream &Out,
FunctionInnards << ')';
std::string tstr = FunctionInnards.str();
printType(Out, RetTy,
- /*isSigned=*/PAL && PAL->paramHasAttr(0, ParamAttr::SExt), tstr);
+ /*isSigned=*/PAL.paramHasAttr(0, ParamAttr::SExt), tstr);
}
std::ostream &
@@ -477,7 +476,7 @@ CWriter::printSimpleType(std::ostream &Out, const Type *Ty, bool isSigned,
//
std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
bool isSigned, const std::string &NameSoFar,
- bool IgnoreName, const ParamAttrsList* PAL) {
+ bool IgnoreName, const PAListPtr &PAL) {
if (Ty->isPrimitiveType() || Ty->isInteger() || isa<VectorType>(Ty)) {
printSimpleType(Out, Ty, isSigned, NameSoFar);
return Out;
@@ -498,14 +497,14 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
for (FunctionType::param_iterator I = FTy->param_begin(),
E = FTy->param_end(); I != E; ++I) {
const Type *ArgTy = *I;
- if (PAL && PAL->paramHasAttr(Idx, ParamAttr::ByVal)) {
+ if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
assert(isa<PointerType>(ArgTy));
ArgTy = cast<PointerType>(ArgTy)->getElementType();
}
if (I != FTy->param_begin())
FunctionInnards << ", ";
printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL && PAL->paramHasAttr(Idx, ParamAttr::SExt), "");
+ /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt), "");
++Idx;
}
if (FTy->isVarArg()) {
@@ -517,7 +516,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
FunctionInnards << ')';
std::string tstr = FunctionInnards.str();
printType(Out, FTy->getReturnType(),
- /*isSigned=*/PAL && PAL->paramHasAttr(0, ParamAttr::SExt), tstr);
+ /*isSigned=*/PAL.paramHasAttr(0, ParamAttr::SExt), tstr);
return Out;
}
case Type::StructTyID: {
@@ -544,7 +543,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
isa<VectorType>(PTy->getElementType()))
ptrName = "(" + ptrName + ")";
- if (PAL)
+ if (!PAL.isEmpty())
// Must be a function ptr cast!
return printType(Out, PTy->getElementType(), false, ptrName, true, PAL);
return printType(Out, PTy->getElementType(), false, ptrName);
@@ -1920,7 +1919,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
// Loop over the arguments, printing them...
const FunctionType *FT = cast<FunctionType>(F->getFunctionType());
- const ParamAttrsList *PAL = F->getParamAttrs();
+ const PAListPtr &PAL = F->getParamAttrs();
std::stringstream FunctionInnards;
@@ -1949,12 +1948,12 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
else
ArgName = "";
const Type *ArgTy = I->getType();
- if (PAL && PAL->paramHasAttr(Idx, ParamAttr::ByVal)) {
+ if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
ArgTy = cast<PointerType>(ArgTy)->getElementType();
ByValParams.insert(I);
}
printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL && PAL->paramHasAttr(Idx, ParamAttr::SExt),
+ /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt),
ArgName);
PrintedArg = true;
++Idx;
@@ -1976,12 +1975,12 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
for (; I != E; ++I) {
if (PrintedArg) FunctionInnards << ", ";
const Type *ArgTy = *I;
- if (PAL && PAL->paramHasAttr(Idx, ParamAttr::ByVal)) {
+ if (PAL.paramHasAttr(Idx, ParamAttr::ByVal)) {
assert(isa<PointerType>(ArgTy));
ArgTy = cast<PointerType>(ArgTy)->getElementType();
}
printType(FunctionInnards, ArgTy,
- /*isSigned=*/PAL && PAL->paramHasAttr(Idx, ParamAttr::SExt));
+ /*isSigned=*/PAL.paramHasAttr(Idx, ParamAttr::SExt));
PrintedArg = true;
++Idx;
}
@@ -2009,7 +2008,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
// Print out the return type and the signature built above.
printType(Out, RetTy,
- /*isSigned=*/ PAL && PAL->paramHasAttr(0, ParamAttr::SExt),
+ /*isSigned=*/PAL.paramHasAttr(0, ParamAttr::SExt),
FunctionInnards.str());
}
@@ -2582,7 +2581,7 @@ void CWriter::visitCallInst(CallInst &I) {
// If this is a call to a struct-return function, assign to the first
// parameter instead of passing it to the call.
- const ParamAttrsList *PAL = I.getParamAttrs();
+ const PAListPtr &PAL = I.getParamAttrs();
bool hasByVal = I.hasByValArgument();
bool isStructRet = I.hasStructRetAttr();
if (isStructRet) {
@@ -2650,7 +2649,7 @@ void CWriter::visitCallInst(CallInst &I) {
(*AI)->getType() != FTy->getParamType(ArgNo)) {
Out << '(';
printType(Out, FTy->getParamType(ArgNo),
- /*isSigned=*/PAL && PAL->paramHasAttr(ArgNo+1, ParamAttr::SExt));
+ /*isSigned=*/PAL.paramHasAttr(ArgNo+1, ParamAttr::SExt));
Out << ')';
}
// Check if the argument is expected to be passed by value.
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 2587188006..8655eff488 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -39,7 +39,6 @@
#include "llvm/Target/TargetOptions.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
-#include "llvm/ParamAttrsList.h"
using namespace llvm;
X86TargetLowering::X86TargetLowering(TargetMachine &TM)
@@ -5251,15 +5250,15 @@ SDOperand X86TargetLowering::LowerTRAMPOLINE(SDOperand Op,
// Check that ECX wasn't needed by an 'inreg' parameter.
const FunctionType *FTy = Func->getFunctionType();
- const ParamAttrsList *Attrs = Func->getParamAttrs();
+ const PAListPtr &Attrs = Func->getParamAttrs();
- if (Attrs && !Func->isVarArg()) {
+ if (!Attrs.isEmpty() && !Func->isVarArg()) {
unsigned InRegCount = 0;
unsigned Idx = 1;
for (FunctionType::param_iterator I = FTy->param_begin(),
E = FTy->param_end(); I != E; ++I, ++Idx)
- if (Attrs->paramHasAttr(Idx, ParamAttr::InReg))
+ if (Attrs.paramHasAttr(Idx, ParamAttr::InReg))
// FIXME: should only count parameters that are lowered to integers.
InRegCount += (getTargetData()->getTypeSizeInBits(*I) + 31) / 32;
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 25fa0a292b..d7f122b564 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -35,7 +35,6 @@
#include "llvm/Module.h"
#include "llvm/CallGraphSCCPass.h"
#include "llvm/Instructions.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Target/TargetData.h"
@@ -401,11 +400,11 @@ Function *ArgPromotion::DoPromotion(Function *F,
// ParamAttrs - Keep track of the parameter attributes for the arguments
// that we are *not* promoting. For the ones that we do promote, the parameter
// attributes are lost
- ParamAttrsVector ParamAttrsVec;
- const ParamAttrsList *PAL = F->getParamAttrs();
+ SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
+ const PAListPtr &PAL = F->getParamAttrs();
// Add any return attributes.
- if (ParameterAttributes attrs = PAL ? PAL->getParamAttrs(0) : ParamAttr::None)
+ if (ParameterAttributes attrs = PAL.getParamAttrs(0))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
unsigned ArgIndex = 1;
@@ -420,8 +419,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
++NumByValArgsPromoted;
} else if (!ArgsToPromote.count(I)) {
Params.push_back(I->getType());
- if (ParameterAttributes attrs = PAL ? PAL->getParamAttrs(ArgIndex) :
- ParamAttr::None)
+ if (ParameterAttributes attrs = PAL.getParamAttrs(ArgIndex))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), attrs));
} else if (I->use_empty()) {
++NumArgumentsDead;
@@ -476,8 +474,8 @@ Function *ArgPromotion::DoPromotion(Function *F,
// Recompute the parameter attributes list based on the new arguments for
// the function.
- NF->setParamAttrs(ParamAttrsList::get(ParamAttrsVec));
- ParamAttrsVec.clear(); PAL = 0;
+ NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end()));
+ ParamAttrsVec.clear();
if (F->hasCollector())
NF->setCollector(F->getCollector());
@@ -494,11 +492,10 @@ Function *ArgPromotion::DoPromotion(Function *F,
while (!F->use_empty()) {
CallSite CS = CallSite::get(F->use_back());
Instruction *Call = CS.getInstruction();
- PAL = CS.getParamAttrs();
+ const PAListPtr &CallPAL = CS.getParamAttrs();
// Add any return attributes.
- if (ParameterAttributes attrs = PAL ? PAL->getParamAttrs(0) :
- ParamAttr::None)
+ if (ParameterAttributes attrs = CallPAL.getParamAttrs(0))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
// Loop over the operands, inserting GEP and loads in the caller as
@@ -510,8 +507,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
if (!ArgsToPromote.count(I) && !ByValArgsToTransform.count(I)) {
Args.push_back(*AI); // Unmodified argument
- if (ParameterAttributes Attrs = PAL ? PAL->getParamAttrs(ArgIndex) :
- ParamAttr::None)
+ if (ParameterAttributes Attrs = CallPAL.getParamAttrs(ArgIndex))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
} else if (ByValArgsToTransform.count(I)) {
@@ -550,8 +546,7 @@ Function *ArgPromotion::DoPromotion(Function *F,
// Push any varargs arguments on the list
for (; AI != CS.arg_end(); ++AI, ++ArgIndex) {
Args.push_back(*AI);
- if (ParameterAttributes Attrs = PAL ? PAL->getParamAttrs(ArgIndex) :
- ParamAttr::None)
+ if (ParameterAttributes Attrs = CallPAL.getParamAttrs(ArgIndex))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
}
@@ -560,11 +555,13 @@ Function *ArgPromotion::DoPromotion(Function *F,
New = new InvokeInst(NF, II->getNormalDest(), II->getUnwindDest(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(ParamAttrsList::get(ParamAttrsVec));
+ cast<InvokeInst>(New)->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(),
+ ParamAttrsVec.end()));
} else {
New = new CallInst(NF, Args.begin(), Args.end(), "", Call);
cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(ParamAttrsList::get(ParamAttrsVec));
+ cast<CallInst>(New)->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(),
+ ParamAttrsVec.end()));
if (cast<CallInst>(Call)->isTailCall())
cast<CallInst>(New)->setTailCall();
}
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp
index 088269d816..27501778da 100644
--- a/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -26,9 +26,9 @@
#include "llvm/IntrinsicInst.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/Debug.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Compiler.h"
#include <set>
@@ -176,16 +176,12 @@ bool DAE::DeleteDeadVarargs(Function &Fn) {
Args.assign(CS.arg_begin(), CS.arg_begin()+NumArgs);
// Drop any attributes that were on the vararg arguments.
- const ParamAttrsList *PAL = CS.getParamAttrs();
- if (PAL && PAL->getParamIndex(PAL->size() - 1) > NumArgs) {
- ParamAttrsVector ParamAttrsVec;
- for (unsigned i = 0; PAL->getParamIndex(i) <= NumArgs; ++i) {
- ParamAttrsWithIndex PAWI;
- PAWI = ParamAttrsWithIndex::get(PAL->getParamIndex(i),
- PAL->getParamAttrsAtIndex(i));
- ParamAttrsVec.push_back(PAWI);
- }
- PAL = ParamAttrsList::get(ParamAttrsVec);
+ PAListPtr PAL = CS.getParamAttrs();
+ if (!PAL.isEmpty() && PAL.getSlot(PAL.getNumSlots() - 1).Index > NumArgs) {
+ SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
+ for (unsigned i = 0; PAL.getSlot(i).Index <= NumArgs; ++i)
+ ParamAttrsVec.push_back(PAL.getSlot(i));
+ PAL = PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end());
}
Instruction *New;
@@ -508,11 +504,11 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
std::vector<const Type*> Params;
// Set up to build a new list of parameter attributes
- ParamAttrsVector ParamAttrsVec;
- const ParamAttrsList *PAL = F->getParamAttrs();
+ SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
+ const PAListPtr &PAL = F->getParamAttrs();
// The existing function return attributes.
- ParameterAttributes RAttrs = PAL ? PAL->getParamAttrs(0) : ParamAttr::None;
+ ParameterAttributes RAttrs = PAL.getParamAttrs(0);
// Make the function return void if the return value is dead.
const Type *RetTy = FTy->getReturnType();
@@ -532,14 +528,13 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
++I, ++index)
if (!DeadArguments.count(I)) {
Params.push_back(I->getType());
- ParameterAttributes Attrs = PAL ? PAL->getParamAttrs(index) :
- ParamAttr::None;
- if (Attrs)
+
+ if (ParameterAttributes Attrs = PAL.getParamAttrs(index))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Params.size(), Attrs));
}
// Reconstruct the ParamAttrsList based on the vector we constructed.
- PAL = ParamAttrsList::get(ParamAttrsVec);
+ PAListPtr NewPAL = PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end());
// Work around LLVM bug PR56: the CWriter cannot emit varargs functions which
// have zero fixed arguments.
@@ -556,7 +551,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
// Create the new function body and insert it into the module...
Function *NF = new Function(NFTy, F->getLinkage());
NF->setCallingConv(F->getCallingConv());
- NF->setParamAttrs(PAL);
+ NF->setParamAttrs(NewPAL);
if (F->hasCollector())
NF->setCollector(F->getCollector());
F->getParent()->getFunctionList().insert(F, NF);
@@ -570,10 +565,10 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
CallSite CS = CallSite::get(F->use_back());
Instruction *Call = CS.getInstruction();
ParamAttrsVec.clear();
- PAL = CS.getParamAttrs();
+ const PAListPtr &CallPAL = CS.getParamAttrs();
// The call return attributes.
- ParameterAttributes RAttrs = PAL ? PAL->getParamAttrs(0) : ParamAttr::None;
+ ParameterAttributes RAttrs = CallPAL.getParamAttrs(0);
// Adjust in case the function was changed to return void.
RAttrs &= ~ParamAttr::typeIncompatible(NF->getReturnType());
if (RAttrs)
@@ -586,9 +581,7 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
I != E; ++I, ++AI, ++index)
if (!DeadArguments.count(I)) { // Remove operands for dead arguments
Args.push_back(*AI);
- ParameterAttributes Attrs = PAL ? PAL->getParamAttrs(index) :
- ParamAttr::None;
- if (Attrs)
+ if (ParameterAttributes Attrs = CallPAL.getParamAttrs(index))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
}
@@ -598,25 +591,24 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) {
// Push any varargs arguments on the list. Don't forget their attributes.
for (; AI != CS.arg_end(); ++AI) {
Args.push_back(*AI);
- ParameterAttributes Attrs = PAL ? PAL->getParamAttrs(index++) :
- ParamAttr::None;
- if (Attrs)
+ if (ParameterAttributes Attrs = CallPAL.getParamAttrs(index++))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(Args.size(), Attrs));
}
// Reconstruct the ParamAttrsList based on the vector we constructed.
- PAL = ParamAttrsList::get(ParamAttrsVec);
+ PAListPtr NewCallPAL = PAListPtr::get(ParamAttrsVec.begin(),
+ ParamAttrsVec.end());
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = new InvokeInst(NF, II->getNormalDest(), II->getUnwindDest(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(PAL);
+ cast<InvokeInst>(New)->setParamAttrs(NewCallPAL);
} else {
New = new CallInst(NF, Args.begin(), Args.end(), "", Call);
cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(PAL);
+ cast<CallInst>(New)->setParamAttrs(NewCallPAL);
if (cast<CallInst>(Call)->isTailCall())
cast<CallInst>(New)->setTailCall();
}
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 7bfed8afc6..5bb7494cd1 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -21,7 +21,6 @@
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Target/TargetData.h"
@@ -1592,18 +1591,13 @@ static void ChangeCalleesToFastCall(Function *F) {
}
}
-static const ParamAttrsList *StripNest(const ParamAttrsList *Attrs) {
- if (!Attrs)
- return NULL;
-
- for (unsigned i = 0, e = Attrs->size(); i != e; ++i) {
- if ((Attrs->getParamAttrsAtIndex(i) & ParamAttr::Nest) == 0)
+static PAListPtr StripNest(const PAListPtr &Attrs) {
+ for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
+ if ((Attrs.getSlot(i).Attrs & ParamAttr::Nest) == 0)
continue;
- Attrs = ParamAttrsList::excludeAttrs(Attrs, Attrs->getParamIndex(i),
- ParamAttr::Nest);
// There can be only one.
- break;
+ return Attrs.removeAttr(Attrs.getSlot(i).Index, ParamAttr::Nest);
}
return Attrs;
@@ -1640,8 +1634,7 @@ bool GlobalOpt::OptimizeFunctions(Module &M) {
Changed = true;
}
- if (F->getParamAttrs() &&
- F->getParamAttrs()->hasAttrSomewhere(ParamAttr::Nest) &&
+ if (F->getParamAttrs().hasAttrSomewhere(ParamAttr::Nest) &&
OnlyCalledDirectly(F)) {
// The function is not used by a trampoline intrinsic, so it is safe
// to remove the 'nest' attribute.
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index 147818a47e..46e11280b0 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -25,7 +25,6 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/ParamAttrsList.h"
#include <set>
#include <algorithm>
using namespace llvm;
@@ -131,9 +130,8 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
if (!SCCMightReturn)
NewAttributes |= ParamAttr::NoReturn;
- const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs();
- PAL = ParamAttrsList::includeAttrs(PAL, 0, NewAttributes);
- SCC[i]->getFunction()->setParamAttrs(PAL);
+ const PAListPtr &PAL = SCC[i]->getFunction()->getParamAttrs();
+ SCC[i]->getFunction()->setParamAttrs(PAL.addAttr(0, NewAttributes));
}
for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
diff --git a/lib/Transforms/IPO/StructRetPromotion.cpp b/lib/Transforms/IPO/StructRetPromotion.cpp
index c6b561dfd3..1e51cb96c9 100644
--- a/lib/Transforms/IPO/StructRetPromotion.cpp
+++ b/lib/Transforms/IPO/StructRetPromotion.cpp
@@ -17,7 +17,6 @@
#include "llvm/Module.h"
#include "llvm/CallGraphSCCPass.h"
#include "llvm/Instructions.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/CFG.h"
@@ -117,7 +116,8 @@ bool SRETPromotion::PromoteReturn(CallGraphNode *CGN) {
SmallVector<Value*, 2> GEPIdx;
GEPIdx.push_back(ConstantInt::get(Type::Int32Ty, 0));
GEPIdx.push_back(ConstantInt::get(Type::Int32Ty, idx));
- Value *NGEPI = new GetElementPtrInst(TheAlloca, GEPIdx.begin(), GEPIdx.end(),
+ Value *NGEPI = new GetElementPtrInst(TheAlloca, GEPIdx.begin(),
+ GEPIdx.end(),
"mrv.gep", I);
Value *NV = new LoadInst(NGEPI, "mrv.ld", I);
RetVals.push_back(NV);
@@ -200,11 +200,11 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
std::vector<const Type*> Params;
// ParamAttrs - Keep track of the parameter attributes for the arguments.
- ParamAttrsVector ParamAttrsVec;
- const ParamAttrsList *PAL = F->getParamAttrs();
+ SmallVector<ParamAttrsWithIndex, 8> ParamAttrsVec;
+ const PAListPtr &PAL = F->getParamAttrs();
// Add any return attributes.
- if (ParameterAttributes attrs = PAL ? PAL->getParamAttrs(0) : ParamAttr::None)
+ if (ParameterAttributes attrs = PAL.getParamAttrs(0))
ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
// Skip first argument.
@@ -215,12 +215,8 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
unsigned ParamIndex = 2;
while (I != E) {
Params.push_back(I->getType());
- if (PAL) {
- ParameterAttributes Attrs = PAL->getParamAttrs(ParamIndex);
- if (Attrs != ParamAttr::None)
- ParamAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1,
- Attrs));
- }
+ if (ParameterAttributes Attrs = PAL.getParamAttrs(ParamIndex))
+ ParamAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1, Attrs));
++I;
++ParamIndex;
}
@@ -228,7 +224,7 @@ Function *SRETPromotion::cloneFunctionBody(Function *F,
FunctionType *NFTy = FunctionType::get(STy, Params, FTy->isVarArg());
Function *NF = new Function(NFTy, F->getLinkage(), F->getName());
NF->setCallingConv(F->getCallingConv());
- NF->setParamAttrs(ParamAttrsList::get(ParamAttrsVec));
+ NF->setParamAttrs(PAListPtr::get(ParamAttrsVec.begin(), ParamAttrsVec.end()));
F->getParent()->getFunctionList().insert(F, NF);
NF->getBasicBlockList().splice(NF->begin(), F->getBasicBlockList());
@@ -253,16 +249,17 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
SmallVector<Value*, 16> Args;
// ParamAttrs - Keep track of the parameter attributes for the arguments.
- ParamAttrsVector ArgAttrsVec;
+ SmallVector<ParamAttrsWithIndex, 8> ArgAttrsVec;
- for (Value::use_iterator FUI = F->use_begin(), FUE = F->use_end(); FUI != FUE;) {
+ for (Value::use_iterator FUI = F->use_begin(), FUE = F->use_end();
+ FUI != FUE;) {
CallSite CS = CallSite::get(*FUI);
++FUI;
Instruction *Call = CS.getInstruction();
- const ParamAttrsList *PAL = F->getParamAttrs();
+ const PAListPtr &PAL = F->getParamAttrs();
// Add any return attributes.
- if (ParameterAttributes attrs = PAL ? PAL->getParamAttrs(0) : ParamAttr::None)
+ if (ParameterAttributes attrs = PAL.getParamAttrs(0))
ArgAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
// Copy arguments, however skip first one.
@@ -274,27 +271,26 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
unsigned ParamIndex = 2;
while (AI != AE) {
Args.push_back(*AI);
- if (PAL) {
- ParameterAttributes Attrs = PAL->getParamAttrs(ParamIndex);
- if (Attrs != ParamAttr::None)
- ArgAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1,
- Attrs));
- }
+ if (ParameterAttributes Attrs = PAL.getParamAttrs(ParamIndex))
+ ArgAttrsVec.push_back(ParamAttrsWithIndex::get(ParamIndex - 1, Attrs));
++ParamIndex;
++AI;
}
+
+ PAListPtr NewPAL = PAListPtr::get(ArgAttrsVec.begin(), ArgAttrsVec.end());
+
// Build new call instruction.
Instruction *New;
if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
New = new InvokeInst(NF, II->getNormalDest(), II->getUnwindDest(),
Args.begin(), Args.end(), "", Call);
cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
- cast<InvokeInst>(New)->setParamAttrs(ParamAttrsList::get(ArgAttrsVec));
+ cast<InvokeInst>(New)->setParamAttrs(NewPAL);
} else {
New = new CallInst(NF, Args.begin(), Args.end(), "", Call);
cast<CallInst>(New)->setCallingConv(CS.getCallingConv());
- cast<CallInst>(New)->setParamAttrs(ParamAttrsList::get(ArgAttrsVec));
+ cast<CallInst>(New)->setParamAttrs(NewPAL);
if (cast<CallInst>(Call)->isTailCall())
cast<CallInst>(New)->setTailCall();
}
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 4f517e6fbf..ec51508e65 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -39,7 +39,6 @@
#include "llvm/Pass.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
@@ -8419,7 +8418,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
return false;
Function *Callee = cast<Function>(CE->getOperand(0));
Instruction *Caller = CS.getInstruction();
- const ParamAttrsList* CallerPAL = CS.getParamAttrs();
+ const PAListPtr &CallerPAL = CS.getParamAttrs();
// Okay, this is a cast from a function to a different type. Unless doing so
// would cause a type conversion of one of our arguments, change this call to
@@ -8445,8 +8444,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
!CastInst::isCastable(FT->getReturnType(), OldRetTy))
return false; // Cannot transform this return value.
- if (CallerPAL && !Caller->use_empty()) {
- ParameterAttributes RAttrs = CallerPAL->getParamAttrs(0);
+ if (!CallerPAL.isEmpty() && !Caller->use_empty()) {
+ ParameterAttributes RAttrs = CallerPAL.getParamAttrs(0);
if (RAttrs & ParamAttr::typeIncompatible(FT->getReturnType()))
return false; // Attribute not compatible with transformed value.
}
@@ -8476,11 +8475,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
if (!CastInst::isCastable(ActTy, ParamTy))
return false; // Cannot transform this parameter value.
- if (CallerPAL) {
- ParameterAttributes PAttrs = CallerPAL->getParamAttrs(i + 1);
- if (PAttrs & ParamAttr::typeIncompatible(ParamTy))
- return false; // Attribute not compatible with transformed value.
- }
+ if (CallerPAL.getParamAttrs(i + 1) & ParamAttr::typeIncompatible(ParamTy))
+ return false; // Attribute not compatible with transformed value.
ConstantInt *c = dyn_cast<ConstantInt>(*AI);
// Some conversions are safe even if we do not have a body.
@@ -8496,16 +8492,17 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() &&
Callee->isDeclaration())
- return false; // Do not delete arguments unless we have a function body...
+ return false; // Do not delete arguments unless we have a function body.
- if (FT->getNumParams() < NumActualArgs && FT->isVarArg() && CallerPAL)
+ if (FT->getNumParams() < NumActualArgs && FT->isVarArg() &&
+ !CallerPAL.isEmpty())
// In this case we have more arguments than the new function type, but we
// won't be dropping them. Check that these extra arguments have attributes
// that are compatible with being a vararg call argument.
- for (unsigned i = CallerPAL->size(); i; --i) {
- if (CallerPAL->getParamIndex(i - 1) <= FT->getNumParams())
+ for (unsigned i = CallerPAL.getNumSlots(); i; --i) {
+ if (CallerPAL.getSlot(i - 1).Index <= FT->getNumParams())
break;
- ParameterAttributes PAttrs = CallerPAL->getParamAttrsAtIndex(i - 1);
+ ParameterAttributes PAttrs = CallerPAL.getSlot(i - 1).Attrs;
if (PAttrs & ParamAttr::VarArgsIncompatible)
return false;
}
@@ -8514,12 +8511,11 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
// inserting cast instructions as necessary...
std::vector<Value*> Args;
Args.reserve(NumActualArgs);
- ParamAttrsVector attrVec;
+ SmallVector<ParamAttrsWithIndex, 8> attrVec;
attrVec.reserve(NumCommonArgs);
// Get any return attributes.
- ParameterAttributes RAttrs = CallerPAL ? CallerPAL->getParamAttrs(0) :
- ParamAttr::None;
+ ParameterAttributes RAttrs = CallerPAL.getParamAttrs(0);
// If the return value is not being used, the type may not be compatible
// with the existing attributes. Wipe out any problematic attributes.
@@ -8542,9 +8538,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
}
// Add any parameter attributes.
- ParameterAttributes PAttrs = CallerPAL ? CallerPAL->getParamAttrs(i + 1) :
- ParamAttr::None;
- if (PAttrs)
+ if (ParameterAttributes PAttrs = CallerPAL.getParamAttrs(i + 1))
attrVec.push_back(ParamAttrsWithIndex::get(i + 1, PAttrs));
}
@@ -8574,10 +8568,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
}
// Add any parameter attributes.
- ParameterAttributes PAttrs = CallerPAL ?
- CallerPAL->getParamAttrs(i + 1) :
- ParamAttr::None;
- if (PAttrs)
+ if (ParameterAttributes PAttrs = CallerPAL.getParamAttrs(i + 1))
attrVec.push_back(ParamAttrsWithIndex::get(i + 1, PAttrs));
}
}
@@ -8586,7 +8577,7 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
if (FT->getReturnType() == Type::VoidTy)
Caller->setName(""); // Void type should not have a name.
- const ParamAttrsList* NewCallerPAL = ParamAttrsList::get(attrVec);
+ const PAListPtr &NewCallerPAL = PAListPtr::get(attrVec.begin(),attrVec.end());
Instruction *NC;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
@@ -8642,11 +8633,11 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
Value *Callee = CS.getCalledValue();
const PointerType *PTy = cast<PointerType>(Callee->getType());
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
- const ParamAttrsList *Attrs = CS.getParamAttrs();
+ const PAListPtr &Attrs = CS.getParamAttrs();
// If the call already has the 'nest' attribute somewhere then give up -
// otherwise 'nest' would occur twice after splicing in the chain.
- if (Attrs && Attrs->hasAttrSomewhere(ParamAttr::Nest))
+ if (Attrs.hasAttrSomewhere(ParamAttr::Nest))
return 0;
IntrinsicInst *Tramp =
@@ -8657,7 +8648,8 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
const PointerType *NestFPTy = cast<PointerType>(NestF->getType());
const FunctionType *NestFTy = cast<FunctionType>(NestFPTy->getElementType());
- if (const ParamAttrsList *NestAttrs = NestF->getParamAttrs()) {
+ const PAListPtr &NestAttrs = NestF->getParamAttrs();
+ if (!NestAttrs.isEmpty()) {
unsigned NestIdx = 1;
const Type *NestTy = 0;
ParameterAttributes NestAttr = ParamAttr::None;
@@ -8665,10 +8657,10 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
// Look for a parameter marked with the 'nest' attribute.
for (FunctionType::param_iterator I = NestFTy->param_begin(),
E = NestFTy->param_end(); I != E; ++NestIdx, ++I)
- if (NestAttrs->paramHasAttr(NestIdx, ParamAttr::Nest)) {
+ if (NestAttrs.paramHasAttr(NestIdx, ParamAttr::Nest)) {
// Record the parameter type and any other attributes.
NestTy = *I;
- NestAttr = NestAttrs->getParamAttrs(NestIdx);
+ NestAttr = NestAttrs.getParamAttrs(NestIdx);
break;
}
@@ -8677,17 +8669,15 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
std::vector<Value*> NewArgs;
NewArgs.reserve(unsigned(CS.arg_end()-CS.arg_begin())+1);
- ParamAttrsVector NewAttrs;
- NewAttrs.reserve(Attrs ? Attrs->size() + 1 : 1);
+ SmallVector<ParamAttrsWithIndex, 8> NewAttrs;
+ NewAttrs.reserve(Attrs.getNumSlots() + 1);
// Insert the nest argument into the call argument list, which may
// mean appending it. Likewise for attributes.
// Add any function result attributes.
- ParameterAttributes Attr = Attrs ? Attrs->getParamAttrs(0) :
- ParamAttr::None;
- if (Attr)
- NewAttrs.push_back (ParamAttrsWithIndex::get(0, Attr));
+ if (ParameterAttributes Attr = Attrs.getParamAttrs(0))
+ NewAttrs.push_back(ParamAttrsWithIndex::get(0, Attr));
{
unsigned Idx = 1;
@@ -8707,8 +8697,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
// Add the original argument and attributes.
NewArgs.push_back(*I);
- Attr = Attrs ? Attrs->getParamAttrs(Idx) : 0;
- if (Attr)
+ if (ParameterAttributes Attr = Attrs.getParamAttrs(Idx))
NewAttrs.push_back
(ParamAttrsWithIndex::get(Idx + (Idx >= NestIdx), Attr));
@@ -8751,7 +8740,7 @@ Instruction *InstCombiner::transformCallThroughTrampoline(CallSite CS) {
FunctionType::get(FTy->getReturnType(), NewTypes, FTy->isVarArg());
Constant *NewCallee = NestF->getType() == PointerType::getUnqual(NewFTy) ?
NestF : ConstantExpr::getBitCast(NestF, PointerType::getUnqual(NewFTy));
- const ParamAttrsList *NewPAL = ParamAttrsList::get(NewAttrs);
+ const PAListPtr &NewPAL = PAListPtr::get(NewAttrs.begin(),NewAttrs.end());
Instruction *NewCaller;
if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 438bdadcd0..aba66c85a7 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -20,7 +20,6 @@
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/InlineAsm.h"
#include "llvm/Instruction.h"
#include "llvm/Instructions.h"
@@ -849,7 +848,7 @@ void AssemblyWriter::writeParamOperand(const Value *Operand,
printType(Operand->getType());
// Print parameter attributes list
if (Attrs != ParamAttr::None)
- Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs);
+ Out << ' ' << ParamAttr::getAsString(Attrs);
// Print the operand
WriteAsOperandInternal(Out, Operand, TypeNames, &Machine);
}
@@ -1074,7 +1073,7 @@ void AssemblyWriter::printFunction(const Function *F) {
}
const FunctionType *FT = F->getFunctionType();
- const ParamAttrsList *Attrs = F->getParamAttrs();
+ const PAListPtr &Attrs = F->getParamAttrs();
printType(F->getReturnType()) << ' ';
if (!F->getName().empty())
Out << getLLVMName(F->getName(), GlobalPrefix);
@@ -1092,8 +1091,7 @@ void AssemblyWriter::printFunction(const Function *F) {
I != E; ++I) {
// Insert commas as we go... the first arg doesn't get a comma
if (I != F->arg_begin()) Out << ", ";
- printArgument(I, (Attrs ? Attrs->getParamAttrs(Idx)
- : ParamAttr::None));
+ printArgument(I, Attrs.getParamAttrs(Idx));
Idx++;
}
} else {
@@ -1105,10 +1103,9 @@ void AssemblyWriter::printFunction(const Function *F) {
// Output type...
printType(FT->getParamType(i));
- ParameterAttributes ArgAttrs = ParamAttr::None;
- if (Attrs) ArgAttrs = Attrs->getParamAttrs(i+1);
+ ParameterAttributes ArgAttrs = Attrs.getParamAttrs(i+1);
if (ArgAttrs != ParamAttr::None)
- Out << ' ' << ParamAttrsList::getParamAttrsText(ArgAttrs);
+ Out << ' ' << ParamAttr::getAsString(ArgAttrs);
}
}
@@ -1118,8 +1115,9 @@ void AssemblyWriter::printFunction(const Function *F) {
Out << "..."; // Output varargs portion of signature!
}
Out << ')';
- if (Attrs && Attrs->getParamAttrs(0) != ParamAttr::None)
- Out << ' ' << Attrs->getParamAttrsTextByIndex(0);
+ ParameterAttributes RetAttrs = Attrs.getParamAttrs(0);
+ if (RetAttrs != ParamAttr::None)
+ Out << ' ' << ParamAttr::getAsString(Attrs.getParamAttrs(0));
if (F->hasSection())
Out << " section \"" << F->getSection() << '"';
if (F->getAlignment())
@@ -1152,7 +1150,7 @@ void AssemblyWriter::printArgument(const Argument *Arg,
// Output parameter attributes list
if (Attrs != ParamAttr::None)
- Out << ' ' << ParamAttrsList::getParamAttrsText(Attrs);
+ Out << ' ' << ParamAttr::getAsString(Attrs);
// Output name, if available...
if (Arg->hasName())
@@ -1321,7 +1319,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
const PointerType *PTy = cast<PointerType>(Operand->getType());
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
const Type *RetTy = FTy->getReturnType();
- const ParamAttrsList *PAL = CI->getParamAttrs();
+ const PAListPtr &PAL = CI->getParamAttrs();
// If possible, print out the short form of the call instruction. We can
// only do this if the first argument is a pointer to a nonvararg function,
@@ -1339,17 +1337,16 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
for (unsigned op = 1, Eop = I.getNumOperands(); op < Eop; ++op) {
if (op > 1)
Out << ',';
- writeParamOperand(I.getOperand(op), PAL ? PAL->getParamAttrs(op) :
- ParamAttr::None);
+ writeParamOperand(I.getOperand(op), PAL.getParamAttrs(op));
}
Out << " )";
- if (PAL && PAL->getParamAttrs(0) != ParamAttr::None)
- Out << ' ' << PAL->getParamAttrsTextByIndex(0);
+ if (PAL.getParamAttrs(0) != ParamAttr::None)
+ Out << ' ' << ParamAttr::getAsString(PAL.getParamAttrs(0));
} else if (const InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
const PointerType *PTy = cast<PointerType>(Operand->getType());
const FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
const Type *RetTy = FTy->getReturnType();
- const ParamAttrsList *PAL = II->getParamAttrs();
+ const PAListPtr &PAL = II->getParamAttrs();
// Print the calling convention being used.
switch (II->getCallingConv()) {
@@ -1378,13 +1375,12 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
for (unsigned op = 3, Eop = I.getNumOperands(); op < Eop; ++op) {
if (op > 3)
Out << ',';
- writeParamOperand(I.getOperand(op), PAL ? PAL->getParamAttrs(op-2) :
- ParamAttr::None);
+ writeParamOperand(I.getOperand(op), PAL.getParamAttrs(op-2));
}
Out << " )";
- if (PAL && PAL->getParamAttrs(0) != ParamAttr::None)
- Out << " " << PAL->getParamAttrsTextByIndex(0);
+ if (PAL.getParamAttrs(0) != ParamAttr::None)
+ Out << " " << ParamAttr::getAsString(PAL.getParamAttrs(0));
Out << "\n\t\t\tto";
writeOperand(II->getNormalDest(), true);
Out << " unwind";
@@ -1529,18 +1525,6 @@ void Value::dump() const { print(*cerr.stream()); cerr << '\n'; }
// Located here because so much of the needed functionality is here.
void Type::dump() const { print(*cerr.stream()); cerr << '\n'; }
-void
-ParamAttrsList::dump() const {
- cerr << "PAL[ ";
- for (unsigned i = 0; i < attrs.size(); ++i) {
- uint16_t index = getParamIndex(i);
- ParameterAttributes attrs = getParamAttrs(index);
- cerr << "{" << index << "," << attrs << "} ";
- }
-
- cerr << "]\n";
-}
-
//===----------------------------------------------------------------------===//
// SlotMachine Implementation
//===----------------------------------------------------------------------===//
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp
index f322e692fa..343a4b6431 100644
--- a/lib/VMCore/AutoUpgrade.cpp
+++ b/lib/VMCore/AutoUpgrade.cpp
@@ -17,7 +17,7 @@
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
-#include "llvm/ParamAttrsList.h"
+#include "llvm/ADT/SmallVector.h"
#include <cstring>
using namespace llvm;
@@ -226,18 +226,18 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
case Intrinsic::x86_mmx_psrl_d:
case Intrinsic::x86_mmx_psrl_q:
case Intrinsic::x86_mmx_psrl_w: {
- SmallVector<Value*, 2> Operands;
+ Value *Operands[2];
- Operands.push_back(CI->getOperand(1));
+ Operands[0] = CI->getOperand(1);
// Cast the second parameter to the correct type.
BitCastInst *BC = new BitCastInst(CI->getOperand(2),
NewFn->getFunctionType()->getParamType(1),
"upgraded", CI);
- Operands.push_back(BC);
+ Operands[1] = BC;
// Construct a new CallInst
- CallInst *NewCI = new CallInst(NewFn, Operands.begin(), Operands.end(),
+ CallInst *NewCI = new CallInst(NewFn, Operands, Operands+2,
"upgraded."+CI->getName(), CI);
NewCI->setTailCall(CI->isTailCall());
NewCI->setCallingConv(CI->getCallingConv());
@@ -257,7 +257,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
case Intrinsic::cttz:
// Build a small vector of the 1..(N-1) operands, which are the
// parameters.
- SmallVector<Value*, 8> Operands(CI->op_begin()+1, CI->op_end());
+ SmallVector<Value*, 8> Operands(CI->op_begin()+1, CI->op_end());
// Construct a new CallInst
CallInst *NewCI = new CallInst(NewFn, Operands.begin(), Operands.end(),
@@ -268,10 +268,8 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
// Handle any uses of the old CallInst.
if (!CI->use_empty()) {
// Check for sign extend parameter attributes on the return values.
- bool SrcSExt = NewFn->getParamAttrs() &&
- NewFn->getParamAttrs()->paramHasAttr(0,ParamAttr::SExt);
- bool DestSExt = F->getParamAttrs() &&
- F->getParamAttrs()->paramHasAttr(0,ParamAttr::SExt);
+ bool SrcSExt = NewFn->getParamAttrs().paramHasAttr(0, ParamAttr::SExt);
+ bool DestSExt = F->getParamAttrs().paramHasAttr(0, ParamAttr::SExt);
// Construct an appropriate cast from the new return type to the old.
CastInst *RetCast = CastInst::create(
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index f5712e7561..5a69c099f6 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -14,7 +14,6 @@
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
#include "llvm/IntrinsicInst.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/Support/LeakDetector.h"
#include "llvm/Support/StringPool.h"
@@ -140,12 +139,12 @@ void Function::eraseFromParent() {
/// @brief Determine whether the function has the given attribute.
bool Function::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- return ParamAttrs && ParamAttrs->paramHasAttr(i, attr);
+ return ParamAttrs.paramHasAttr(i, attr);
}
/// @brief Extract the alignment for a call or parameter (0=unknown).
uint16_t Function::getParamAlignment(uint16_t i) const {
- return ParamAttrs ? ParamAttrs->getParamAlignment(i) : 0;
+ return ParamAttrs.getParamAlignment(i);
}
/// @brief Determine if the function cannot return.
@@ -181,8 +180,7 @@ bool Function::hasStructRetAttr() const {
Function::Function(const FunctionType *Ty, LinkageTypes Linkage,
const std::string &name, Module *ParentModule)
: GlobalValue(PointerType::getUnqual(Ty),
- Value::FunctionVal, 0, 0, Linkage, name),
- ParamAttrs(0) {
+ Value::FunctionVal, 0, 0, Linkage, name) {
SymTab = new ValueSymbolTable();
assert((getReturnType()->isFirstClassType() ||getReturnType() == Type::VoidTy
@@ -207,10 +205,6 @@ Function::~Function() {
ArgumentList.clear();
delete SymTab;
- // Drop our reference to the parameter attributes, if any.
- if (ParamAttrs)
- ParamAttrs->dropRef();
-
// Remove the function from the on-the-side collector table.
clearCollector();
}
@@ -243,24 +237,6 @@ void Function::setParent(Module *parent) {
LeakDetector::removeGarbageObject(this);
}
-void Function::setParamAttrs(const ParamAttrsList *attrs) {
- // Avoid deleting the ParamAttrsList if they are setting the
- // attributes to the same list.
- if (ParamAttrs == attrs)
- return;
-
- // Drop reference on the old ParamAttrsList
- if (ParamAttrs)
- ParamAttrs->dropRef();
-
- // Add reference to the new ParamAttrsList
- if (attrs)
- attrs->addRef();
-
- // Set the new ParamAttrsList.
- ParamAttrs = attrs;
-}
-
// dropAllReferences() - This function causes all the subinstructions to "let
// go" of all references that they are maintaining. This allows one to
// 'delete' a whole class at a time, even though there may be circular
@@ -370,8 +346,7 @@ const FunctionType *Intrinsic::getType(ID id, const Type **Tys,
return FunctionType::get(ResultTy, ArgTys, IsVarArg);
}
-const ParamAttrsList *Intrinsic::getParamAttrs(ID id) {
- ParamAttrsVector Attrs;
+PAListPtr Intrinsic::getParamAttrs(ID id) {
ParameterAttributes Attr = ParamAttr::None;
#define GET_INTRINSIC_ATTRIBUTES
@@ -381,8 +356,8 @@ const ParamAttrsList *Intrinsic::getParamAttrs(ID id) {
// Intrinsics cannot throw exceptions.
Attr |= ParamAttr::NoUnwind;
- Attrs.push_back(ParamAttrsWithIndex::get(0, Attr));
- return ParamAttrsList::get(Attrs);
+ ParamAttrsWithIndex PAWI = ParamAttrsWithIndex::get(0, Attr);
+ return PAListPtr::get(&PAWI, 1);
}
Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys,
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index f7401ec979..ee9a02e91a 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -17,7 +17,6 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/MathExtras.h"
@@ -43,13 +42,13 @@ void CallSite::setCallingConv(unsigned CC) {
else
cast<InvokeInst>(I)->setCallingConv(CC);
}
-const ParamAttrsList* CallSite::getParamAttrs() const {
+const PAListPtr &CallSite::getParamAttrs() const {
if (CallInst *CI = dyn_cast<CallInst>(I))
return CI->getParamAttrs();
else
return cast<InvokeInst>(I)->getParamAttrs();
}
-void CallSite::setParamAttrs(const ParamAttrsList *PAL) {
+void CallSite::setParamAttrs(const PAListPtr &PAL) {
if (CallInst *CI = dyn_cast<CallInst>(I))
CI->setParamAttrs(PAL);
else
@@ -243,12 +242,9 @@ Value *PHINode::hasConstantValue(bool AllowNonDominatingInstruction) const {
CallInst::~CallInst() {
delete [] OperandList;
- if (ParamAttrs)
- ParamAttrs->dropRef();
}
void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
- ParamAttrs = 0;
NumOperands = NumParams+1;
Use *OL = OperandList = new Use[NumParams+1];
OL[0].init(Func, this);
@@ -269,7 +265,6 @@ void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
}
void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) {
- ParamAttrs = 0;
NumOperands = 3;
Use *OL = OperandList = new Use[3];
OL[0].init(Func, this);
@@ -292,7 +287,6 @@ void CallInst::init(Value *Func, Value *Actual1, Value *Actual2) {
}
void CallInst::init(Value *Func, Value *Actual) {
- ParamAttrs = 0;
NumOperands = 2;
Use *OL = OperandList = new Use[2];
OL[0].init(Func, this);
@@ -311,7 +305,6 @@ void CallInst::init(Value *Func, Value *Actual) {
}
void CallInst::init(Value *Func) {
- ParamAttrs = 0;
NumOperands = 1;
Use *OL = OperandList = new Use[1];
OL[0].init(Func, this);
@@ -360,8 +353,7 @@ CallInst::CallInst(Value *Func, const std::string &Name,
CallInst::CallInst(const CallInst &CI)
: Instruction(CI.getType(), Instruction::Call, new Use[CI.getNumOperands()],
- CI.getNumOperands()),
- ParamAttrs(0) {
+ CI.getNumOperands()) {
setParamAttrs(CI.getParamAttrs());
SubclassData = CI.SubclassData;
Use *OL = OperandList;
@@ -370,21 +362,8 @@ CallInst::CallInst(const CallInst &CI)
OL[i].init(InOL[i], this);
}
-void CallInst::setParamAttrs(const ParamAttrsList *newAttrs) {
- if (ParamAttrs == newAttrs)
- return;
-
- if (ParamAttrs)
- ParamAttrs->dropRef();
-
- if (newAttrs)
- newAttrs->addRef();
-
- ParamAttrs = newAttrs;
-}
-
bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- if (ParamAttrs && ParamAttrs->paramHasAttr(i, attr))
+ if (ParamAttrs.paramHasAttr(i, attr))
return true;
if (const Function *F = getCalledFunction())
return F->paramHasAttr(i, attr);
@@ -392,11 +371,7 @@ bool CallInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
}
uint16_t CallInst::getParamAlignment(uint16_t i) const {
- if (ParamAttrs && ParamAttrs->getParamAlignment(i))
- return ParamAttrs->getParamAlignment(i);
- if (const Function *F = getCalledFunction())
- return F->getParamAlignment(i);
- return 0;
+ return ParamAttrs.getParamAlignment(i);
}
/// @brief Determine if the call does not access memory.
@@ -428,21 +403,20 @@ bool CallInst::hasStructRetAttr() const {
/// @brief Determine if any call argument is an aggregate passed by value.
bool CallInst::hasByValArgument() const {
- if (ParamAttrs && ParamAttrs->hasAttrSomewhere(ParamAttr::ByVal))
+ if (ParamAttrs.hasAttrSomewhere(ParamAttr::ByVal))
return true;
// Be consistent with other methods and check the callee too.
if (const Function *F = getCalledFunction())
- if (const ParamAttrsList *PAL = F->getParamAttrs())
- return PAL->hasAttrSomewhere(ParamAttr::ByVal);
+ return F->getParamAttrs().hasAttrSomewhere(ParamAttr::ByVal);
return false;
}
void CallInst::setDoesNotThrow(bool doesNotThrow) {
- const ParamAttrsList *PAL = getParamAttrs();
+ PAListPtr PAL = getParamAttrs();
if (doesNotThrow)
- PAL = ParamAttrsList::includeAttrs(PAL, 0, ParamAttr::NoUnwind);
+ PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
else
- PAL = ParamAttrsList::excludeAttrs(PAL, 0, ParamAttr::NoUnwind);
+ PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
setParamAttrs(PAL);
}
@@ -453,13 +427,10 @@ void CallInst::setDoesNotThrow(bool doesNotThrow) {
InvokeInst::~InvokeInst() {
delete [] OperandList;
- if (ParamAttrs)
- ParamAttrs->dropRef();
}
void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
Value* const *Args, unsigned NumArgs) {
- ParamAttrs = 0;
NumOperands = 3+NumArgs;
Use *OL = OperandList = new Use[3+NumArgs];
OL[0].init(Fn, this);
@@ -484,8 +455,7 @@ void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
InvokeInst::InvokeInst(const InvokeInst &II)
: TerminatorInst(II.getType(), Instruction::Invoke,
- new Use[II.getNumOperands()], II.getNumOperands()),
- ParamAttrs(0) {
+ new Use[II.getNumOperands()], II.getNumOperands()) {
setParamAttrs(II.getParamAttrs());
SubclassData = II.SubclassData;
Use *OL = OperandList, *InOL = II.OperandList;
@@ -503,21 +473,8 @@ void InvokeInst::setSuccessorV(unsigned idx, BasicBlock *B) {
return setSuccessor(idx, B);
}
-void InvokeInst::setParamAttrs(const ParamAttrsList *newAttrs) {
- if (ParamAttrs == newAttrs)
- return;
-
- if (ParamAttrs)
- ParamAttrs->dropRef();
-
- if (newAttrs)
- newAttrs->addRef();
-
- ParamAttrs = newAttrs;
-}
-
bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- if (ParamAttrs && ParamAttrs->paramHasAttr(i, attr))
+ if (ParamAttrs.paramHasAttr(i, attr))
return true;
if (const Function *F = getCalledFunction())
return F->paramHasAttr(i, attr);
@@ -525,11 +482,7 @@ bool InvokeInst::paramHasAttr(uint16_t i, ParameterAttributes attr) const {
}
uint16_t InvokeInst::getParamAlignment(uint16_t i) const {
- if (ParamAttrs && ParamAttrs->getParamAlignment(i))
- return ParamAttrs->getParamAlignment(i);
- if (const Function *F = getCalledFunction())
- return F->getParamAlignment(i);
- return 0;
+ return ParamAttrs.getParamAlignment(i);
}
/// @brief Determine if the call does not access memory.
@@ -553,11 +506,11 @@ bool InvokeInst::doesNotThrow() const {
}
void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
- const ParamAttrsList *PAL = getParamAttrs();
+ PAListPtr PAL = getParamAttrs();
if (doesNotThrow)
- PAL = ParamAttrsList::includeAttrs(PAL, 0, ParamAttr::NoUnwind);
+ PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
else
- PAL = ParamAttrsList::excludeAttrs(PAL, 0, ParamAttr::NoUnwind);
+ PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
setParamAttrs(PAL);
}
diff --git a/lib/VMCore/ParameterAttributes.cpp b/lib/VMCore/ParameterAttributes.cpp
index bebee3e3d7..7501a35087 100644
--- a/lib/VMCore/ParameterAttributes.cpp
+++ b/lib/VMCore/ParameterAttributes.cpp
@@ -11,41 +11,19 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/ParamAttrsList.h"
-#include "llvm/DerivedTypes.h"
+#include "llvm/ParameterAttributes.h"
+#include "llvm/Type.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/FoldingSet.h"
+#include "llvm/Support/Streams.h"
#include "llvm/Support/ManagedStatic.h"
-
using namespace llvm;
-static ManagedStatic<FoldingSet<ParamAttrsList> > ParamAttrsLists;
-
-ParamAttrsList::ParamAttrsList(const ParamAttrsVector &attrVec)
- : attrs(attrVec), refCount(0) {
-}
-
-ParamAttrsList::~ParamAttrsList() {
- ParamAttrsLists->RemoveNode(this);
-}
-
-ParameterAttributes
-ParamAttrsList::getParamAttrs(uint16_t Index) const {
- unsigned limit = attrs.size();
- for (unsigned i = 0; i < limit && attrs[i].index <= Index; ++i)
- if (attrs[i].index == Index)
- return attrs[i].attrs;
- return ParamAttr::None;
-}
-
-bool ParamAttrsList::hasAttrSomewhere(ParameterAttributes attr) const {
- for (unsigned i = 0, e = attrs.size(); i < e; ++i)
- if (attrs[i].attrs & attr)
- return true;
- return false;
-}
+//===----------------------------------------------------------------------===//
+// ParamAttr Function Definitions
+//===----------------------------------------------------------------------===//
-std::string
-ParamAttrsList::getParamAttrsText(ParameterAttributes Attrs) {
+std::string ParamAttr::getAsString(ParameterAttributes Attrs) {
std::string Result;
if (Attrs & ParamAttr::ZExt)
Result += "zeroext ";
@@ -77,155 +55,240 @@ ParamAttrsList::getParamAttrsText(ParameterAttributes Attrs) {
return Result;
}
-void ParamAttrsList::Profile(FoldingSetNodeID &ID,
- const ParamAttrsVector &Attrs) {
- for (unsigned i = 0; i < Attrs.size(); ++i)
- ID.AddInteger(uint64_t(Attrs[i].attrs) << 16 | unsigned(Attrs[i].index));
+ParameterAttributes ParamAttr::typeIncompatible(const Type *Ty) {
+ ParameterAttributes Incompatible = None;
+
+ if (!Ty->isInteger())
+ // Attributes that only apply to integers.
+ Incompatible |= SExt | ZExt;
+
+ if (!isa<PointerType>(Ty))
+ // Attributes that only apply to pointers.
+ Incompatible |= ByVal | Nest | NoAlias | StructRet;
+
+ return Incompatible;
}
-const ParamAttrsList *
-ParamAttrsList::get(const ParamAttrsVector &attrVec) {
- // If there are no attributes then return a null ParamAttrsList pointer.
- if (attrVec.empty())
- return 0;
+//===----------------------------------------------------------------------===//
+// ParamAttributeListImpl Definition
+//===----------------------------------------------------------------------===//
+
+namespace llvm {
+class ParamAttributeListImpl : public FoldingSetNode {
+ unsigned RefCount;
+
+ // ParamAttrsList is uniqued, these should not be publicly available
+ void operator=(const ParamAttributeListImpl &); // Do not implement
+ ParamAttributeListImpl(const ParamAttributeListImpl &); // Do not implement
+ ~ParamAttributeListImpl(); // Private implementation
+public:
+ SmallVector<ParamAttrsWithIndex, 4> Attrs;
+
+ ParamAttributeListImpl(const ParamAttrsWithIndex *Attr, unsigned NumAttrs)
+ : Attrs(Attr, Attr+NumAttrs) {
+ RefCount = 0;
+ }
+
+ void AddRef() { ++RefCount; }
+ void DropRef() { if (--RefCount == 0) delete this; }
+
+ void Profile(FoldingSetNodeID &ID) const {
+ Profile(ID, &Attrs[0], Attrs.size());
+ }
+ static void Profile(FoldingSetNodeID &ID, const ParamAttrsWithIndex *Attr,
+ unsigned NumAttrs) {
+ for (unsigned i = 0; i != NumAttrs; ++i)
+ ID.AddInteger(uint64_t(Attr[i].Attrs) << 32 | unsigned(Attr[i].Index));
+ }
+};
+}
+static ManagedStatic<FoldingSet<ParamAttributeListImpl> > ParamAttrsLists;
+
+ParamAttributeListImpl::~ParamAttributeListImpl() {
+ ParamAttrsLists->RemoveNode(this);
+}
+
+
+PAListPtr PAListPtr::get(const ParamAttrsWithIndex *Attrs, unsigned NumAttrs) {
+ // If there are no attributes then return a null ParamAttrsList pointer.
+ if (NumAttrs == 0)
+ return PAListPtr();
+
#ifndef NDEBUG
- for (unsigned i = 0, e = attrVec.size(); i < e; ++i) {
- assert(attrVec[i].attrs != ParamAttr::None
- && "Pointless parameter attribute!");
- assert((!i || attrVec[i-1].index < attrVec[i].index)
- && "Misordered ParamAttrsList!");
+ for (unsigned i = 0; i != NumAttrs; ++i) {
+ assert(Attrs[i].Attrs != ParamAttr::None &&
+ "Pointless parameter attribute!");
+ assert((!i || Attrs[i-1].Index < Attrs[i].Index) &&
+ "Misordered ParamAttrsList!");
}
#endif
-
+
// Otherwise, build a key to look up the existing attributes.
FoldingSetNodeID ID;
- ParamAttrsList::Profile(ID, attrVec);
+ ParamAttributeListImpl::Profile(ID, Attrs, NumAttrs);
void *InsertPos;
- ParamAttrsList *PAL = ParamAttrsLists->FindNodeOrInsertPos(ID, InsertPos);
-
+ ParamAttributeListImpl *PAL =
+ ParamAttrsLists->FindNodeOrInsertPos(ID, InsertPos);
+
// If we didn't find any existing attributes of the same shape then
// create a new one and insert it.
if (!PAL) {
- PAL = new ParamAttrsList(attrVec);
+ PAL = new ParamAttributeListImpl(Attrs, NumAttrs);
ParamAttrsLists->InsertNode(PAL, InsertPos);
}
-
+
// Return the ParamAttrsList that we found or created.
- return PAL;
+ return PAListPtr(PAL);
}
-const ParamAttrsList *
-ParamAttrsList::getModified(const ParamAttrsList *PAL,
- const ParamAttrsVector &modVec) {
- if (modVec.empty())
- return PAL;
-#ifndef NDEBUG
- for (unsigned i = 0, e = modVec.size(); i < e; ++i)
- assert((!i || modVec[i-1].index < modVec[i].index)
- && "Misordered ParamAttrsList!");
-#endif
+//===----------------------------------------------------------------------===//
+// PAListPtr Method Implementations
+//===----------------------------------------------------------------------===//
- if (!PAL) {
- // Strip any instances of ParamAttr::None from modVec before calling 'get'.
- ParamAttrsVector newVec;
- newVec.reserve(modVec.size());
- for (unsigned i = 0, e = modVec.size(); i < e; ++i)
- if (modVec[i].attrs != ParamAttr::None)
- newVec.push_back(modVec[i]);
- return get(newVec);
- }
+PAListPtr::PAListPtr(ParamAttributeListImpl *LI) : PAList(LI) {
+ if (LI) LI->AddRef();
+}
- const ParamAttrsVector &oldVec = PAL->attrs;
-
- ParamAttrsVector newVec;
- unsigned oldI = 0;
- unsigned modI = 0;
- unsigned oldE = oldVec.size();
- unsigned modE = modVec.size();
-
- while (oldI < oldE && modI < modE) {
- uint16_t oldIndex = oldVec[oldI].index;
- uint16_t modIndex = modVec[modI].index;
-
- if (oldIndex < modIndex) {
- newVec.push_back(oldVec[oldI]);
- ++oldI;
- } else if (modIndex < oldIndex) {
- if (modVec[modI].attrs != ParamAttr::None)
- newVec.push_back(modVec[modI]);
- ++modI;
- } else {
- // Same index - overwrite or delete existing attributes.
- if (modVec[modI].attrs != ParamAttr::None)
- newVec.push_back(modVec[modI]);
- ++oldI;
- ++modI;
- }
- }
+PAListPtr::PAListPtr(const PAListPtr &P) : PAList(P.PAList) {
+ if (PAList) PAList->AddRef();
+}
+
+const PAListPtr &PAListPtr::operator=(const PAListPtr &RHS) {
+ if (PAList == RHS.PAList) return *this;
+ if (PAList) PAList->DropRef();
+ PAList = RHS.PAList;
+ if (PAList) PAList->AddRef();
+ return *this;
+}
+
+PAListPtr::~PAListPtr() {
+ if (PAList) PAList->DropRef();
+}
+
+/// getNumSlots - Return the number of slots used in this attribute list.
+/// This is the number of arguments that have an attribute set on them
+/// (including the function itself).
+unsigned PAListPtr::getNumSlots() const {
+ return PAList ? PAList->Attrs.size() : 0;
+}
- for (; oldI < oldE; ++oldI)
- newVec.push_back(oldVec[oldI]);
- for (; modI < modE; ++modI)
- if (modVec[modI].attrs != ParamAttr::None)
- newVec.push_back(modVec[modI]);
+/// getSlot - Return the ParamAttrsWithIndex at the specified slot. This
+/// holds a parameter number plus a set of attributes.
+const ParamAttrsWithIndex &PAListPtr::getSlot(unsigned Slot) const {
+ assert(PAList && Slot < PAList->Attrs.size() && "Slot # out of range!");
+ return PAList->Attrs[Slot];
+}
+
+
+/// getParamAttrs - The parameter attributes for the specified parameter are
+/// returned. Parameters for the result are denoted with Idx = 0.
+ParameterAttributes PAListPtr::getParamAttrs(unsigned Idx) const {
+ if (PAList == 0) return ParamAttr::None;
+
+ const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs;
+ for (unsigned i = 0, e = Attrs.size(); i != e && Attrs[i].Index <= Idx; ++i)
+ if (Attrs[i].Index == Idx)
+ return Attrs[i].Attrs;
+ return ParamAttr::None;
+}
- return get(newVec);
+/// hasAttrSomewhere - Return true if the specified attribute is set for at
+/// least one parameter or for the return value.
+bool PAListPtr::hasAttrSomewhere(ParameterAttributes Attr) const {
+ if (PAList == 0) return false;
+
+ const SmallVector<ParamAttrsWithIndex, 4> &Attrs = PAList->Attrs;
+ for (unsigned i = 0, e = Attrs.size(); i != e; ++i)
+ if (Attrs[i].Attrs & Attr)
+ return true;
+ return false;
}
-const ParamAttrsList *
-ParamAttrsList::includeAttrs(const ParamAttrsList *PAL,
- uint16_t idx, ParameterAttributes attrs) {
- ParameterAttributes OldAttrs = PAL ? PAL->getParamAttrs(idx) :
- ParamAttr::None;
+
+PAListPtr PAListPtr::addAttr(unsigned Idx, ParameterAttributes Attrs) const {
+ ParameterAttributes OldAttrs = getParamAttrs(Idx);
#ifndef NDEBUG
// FIXME it is not obvious how this should work for alignment.
// For now, say we can't change a known alignment.
ParameterAttributes OldAlign = OldAttrs & ParamAttr::Alignment;
- ParameterAttributes NewAlign = attrs & ParamAttr::Alignment;
+ ParameterAttributes NewAlign = Attrs & ParamAttr::Alignment;
assert((!OldAlign || !NewAlign || OldAlign == NewAlign) &&
"Attempt to change alignment!");
#endif
-
- ParameterAttributes NewAttrs = OldAttrs | attrs;
+
+ ParameterAttributes NewAttrs = OldAttrs | Attrs;
if (NewAttrs == OldAttrs)
- return PAL;
-
- ParamAttrsVector modVec(1);
- modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs);
- return getModified(PAL, modVec);
+ return *this;
+
+ SmallVector<ParamAttrsWithIndex, 8> NewAttrList;
+ if (PAList == 0)
+ NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
+ else {
+ const SmallVector<ParamAttrsWithIndex, 4> &OldAttrList = PAList->Attrs;
+ unsigned i = 0, e = OldAttrList.size();
+ // Copy attributes for arguments before this one.
+ for (; i != e && OldAttrList[i].Index < Idx; ++i)
+ NewAttrList.push_back(OldAttrList[i]);
+
+ // If there are attributes already at this index, merge them in.
+ if (i != e && OldAttrList[i].Index == Idx) {
+ Attrs |= OldAttrList[i].Attrs;
+ ++i;
+ }
+
+ NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
+
+ // Copy attributes for arguments after this one.
+ NewAttrList.insert(NewAttrList.end(),
+ OldAttrList.begin()+i, OldAttrList.end());
+ }
+
+ return get(&NewAttrList[0], NewAttrList.size());
}
-const ParamAttrsList *
-ParamAttrsList::excludeAttrs(const ParamAttrsList *PAL,
- uint16_t idx, ParameterAttributes attrs) {
+PAListPtr PAListPtr::removeAttr(unsigned Idx, ParameterAttributes Attrs) const {
#ifndef NDEBUG
// FIXME it is not obvious how this should work for alignment.
// For now, say we can't pass in alignment, which no current use does.
- assert(!(attrs & ParamAttr::Alignment) && "Attempt to exclude alignment!");
+ assert(!(Attrs & ParamAttr::Alignment) && "Attempt to exclude alignment!");
#endif
- ParameterAttributes OldAttrs = PAL ? PAL->getParamAttrs(idx) :
- ParamAttr::None;
- ParameterAttributes NewAttrs = OldAttrs & ~attrs;
+ if (PAList == 0) return PAListPtr();
+
+ ParameterAttributes OldAttrs = getParamAttrs(Idx);
+ ParameterAttributes NewAttrs = OldAttrs & ~Attrs;
if (NewAttrs == OldAttrs)
- return PAL;
-
- ParamAttrsVector modVec(1);
- modVec[0] = ParamAttrsWithIndex::get(idx, NewAttrs);
- return getModified(PAL, modVec);
+ return *this;
+
+ SmallVector<ParamAttrsWithIndex, 8> NewAttrList;
+ const SmallVector<ParamAttrsWithIndex, 4> &OldAttrList = PAList->Attrs;
+ unsigned i = 0, e = OldAttrList.size();
+
+ // Copy attributes for arguments before this one.
+ for (; i != e && OldAttrList[i].Index < Idx; ++i)
+ NewAttrList.push_back(OldAttrList[i]);
+
+ // If there are attributes already at this index, merge them in.
+ assert(OldAttrList[i].Index == Idx && "Attribute isn't set?");
+ Attrs = OldAttrList[i].Attrs & ~Attrs;
+ ++i;
+ if (Attrs) // If any attributes left for this parameter, add them.
+ NewAttrList.push_back(ParamAttrsWithIndex::get(Idx, Attrs));
+
+ // Copy attributes for arguments after this one.
+ NewAttrList.insert(NewAttrList.end(),
+ OldAttrList.begin()+i, OldAttrList.end());
+
+ return get(&NewAttrList[0], NewAttrList.size());
}
-ParameterAttributes ParamAttr::typeIncompatible (const Type *Ty) {
- ParameterAttributes Incompatible = None;
-
- if (!Ty->isInteger())
- // Attributes that only apply to integers.
- Incompatible |= SExt | ZExt;
-
- if (!isa<PointerType>(Ty))
- // Attributes that only apply to pointers.
- Incompatible |= ByVal | Nest | NoAlias | StructRet;
-
- return Incompatible;
+void PAListPtr::dump() const {
+ cerr << "PAL[ ";
+ for (unsigned i = 0; i < getNumSlots(); ++i) {
+ const ParamAttrsWithIndex &PAWI = getSlot(i);
+ cerr << "{" << PAWI.Index << "," << PAWI.Attrs << "} ";
+ }
+
+ cerr << "]\n";
}
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 01a4a941ef..6126253bfb 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -40,18 +40,17 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/Verifier.h"
-#include "llvm/Assembly/Writer.h"
#include "llvm/CallingConv.h"
#include "llvm/Constants.h"
-#include "llvm/Pass.h"
-#include "llvm/Module.h"
-#include "llvm/ModuleProvider.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/DerivedTypes.h"
#include "llvm/InlineAsm.h"
#include "llvm/IntrinsicInst.h"
+#include "llvm/Module.h"
+#include "llvm/ModuleProvider.h"
+#include "llvm/Pass.h"
#include "llvm/PassManager.h"
#include "llvm/Analysis/Dominators.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/CFG.h"
@@ -264,7 +263,7 @@ namespace { // Anonymous namespace for class
unsigned Count, ...);
void VerifyAttrs(ParameterAttributes Attrs, const Type *Ty,
bool isReturnValue, const Value *V);
- void VerifyFunctionAttrs(const FunctionType *FT, const ParamAttrsList *Attrs,
+ void VerifyFunctionAttrs(const FunctionType *FT, const PAListPtr &Attrs,
const Value *V);
void WriteValue(const Value *V) {
@@ -394,11 +393,11 @@ void Verifier::VerifyAttrs(ParameterAttributes Attrs, const Type *Ty,
if (isReturnValue) {
ParameterAttributes RetI = Attrs & ParamAttr::ParameterOnly;
- Assert1(!RetI, "Attribute " + ParamAttrsList::getParamAttrsText(RetI) +
+ Assert1(!RetI, "Attribute " + ParamAttr::getAsString(RetI) +
"does not apply to return values!", V);
} else {
ParameterAttributes ParmI = Attrs & ParamAttr::ReturnOnly;
- Assert1(!ParmI, "Attribute " + ParamAttrsList::getParamAttrsText(ParmI) +
+ Assert1(!ParmI, "Attribute " + ParamAttr::getAsString(ParmI) +
"only applies to return values!", V);
}
@@ -406,37 +405,44 @@ void Verifier::VerifyAttrs(ParameterAttributes Attrs, const Type *Ty,
i < array_lengthof(ParamAttr::MutuallyIncompatible); ++i) {
ParameterAttributes MutI = Attrs & ParamAttr::MutuallyIncompatible[i];
Assert1(!(MutI & (MutI - 1)), "Attributes " +
- ParamAttrsList::getParamAttrsText(MutI) + "are incompatible!", V);
+ ParamAttr::getAsString(MutI) + "are incompatible!", V);
}
ParameterAttributes TypeI = Attrs & ParamAttr::typeIncompatible(Ty);
Assert1(!TypeI, "Wrong type for attribute " +
- ParamAttrsList::getParamAttrsText(TypeI), V);
+ ParamAttr::getAsString(TypeI), V);
}
// VerifyFunctionAttrs - Check parameter attributes against a function type.
// The value V is printed in error messages.
void Verifier::VerifyFunctionAttrs(const FunctionType *FT,
- const ParamAttrsList *Attrs,
+ const PAListPtr &Attrs,
const Value *V) {
- if (!Attrs)
+ if (Attrs.isEmpty())
return;
bool SawNest = false;
- for (unsigned Idx = 0; Idx <= FT->getNumParams(); ++Idx) {
- ParameterAttributes Attr = Attrs->getParamAttrs(Idx);
+ for (unsigned i = 0, e = Attrs.getNumSlots(); i != e; ++i) {
+ const ParamAttrsWithIndex &Attr = Attrs.getSlot(i);
- VerifyAttrs(Attr, FT->getParamType(Idx-1), !Idx, V);
+ const Type *Ty;
+ if (Attr.Index == 0)
+ Ty = FT->getReturnType();
+ else if (Attr.Index-1 < FT->getNumParams())
+ Ty = FT->getParamType(Attr.Index-1);
+ else
+ break; // VarArgs attributes, don't verify.
+
+ VerifyAttrs(Attr.Attrs, Ty, Attr.Index == 0, V);
- if (Attr & ParamAttr::Nest) {
+ if (Attr.Attrs & ParamAttr::Nest) {
Assert1(!SawNest, "More than one parameter has attribute nest!", V);
SawNest = true;
}
- if (Attr & ParamAttr::StructRet) {
- Assert1(Idx == 1, "Attribute sret not on first parameter!", V);
- }
+ if (Attr.Attrs & ParamAttr::StructRet)
+ Assert1(Attr.Index == 1, "Attribute sret not on first parameter!", V);
}
}
@@ -458,11 +464,10 @@ void Verifier::visitFunction(Function &F) {
Assert1(!F.hasStructRetAttr() || F.getReturnType() == Type::VoidTy,
"Invalid struct return type!", &F);
- const ParamAttrsList *Attrs = F.getParamAttrs();
+ const PAListPtr &Attrs = F.getParamAttrs();
- Assert1(!Attrs ||
- (Attrs->size() &&
- Attrs->getParamIndex(Attrs->size()-1) <= FT->getNumParams()),
+ Assert1(Attrs.isEmpty() ||
+ Attrs.getSlot(Attrs.getNumSlots()-1).Index <= FT->getNumParams(),
"Attributes after last parameter!", &F);
// Check function attributes.
@@ -712,15 +717,19 @@ void Verifier::visitUIToFPInst(UIToFPInst &I) {
const Type *SrcTy = I.getOperand(0)->getType();
const Type *DestTy = I.getType();
- bool SrcVec = SrcTy->getTypeID() == Type::VectorTyID;
- bool DstVec = DestTy->getTypeID() == Type::VectorTyID;
+ bool SrcVec = isa<VectorType>(SrcTy);
+ bool DstVec = isa<VectorType>(DestTy);
- Assert1(SrcVec == DstVec,"UIToFP source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isIntOrIntVector(),"UIToFP source must be integer or integer vector", &I);
- Assert1(DestTy->isFPOrFPVector(),"UIToFP result must be FP or FP vector", &I);
+ Assert1(SrcVec == DstVec,
+ "UIToFP source and dest must both be vector or scalar", &I);
+ Assert1(SrcTy->isIntOrIntVector(),
+ "UIToFP source must be integer or integer vector", &I);
+ Assert1(DestTy->isFPOrFPVector(),
+ "UIToFP result must be FP or FP vector", &I);
if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() == cast<VectorType>(DestTy)->getNumElements(),
+ Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
+ cast<VectorType>(DestTy)->getNumElements(),
"UIToFP source and dest vector length mismatch", &I);
visitInstruction(I);
@@ -734,12 +743,16 @@ void Verifier::visitSIToFPInst(SIToFPInst &I) {
bool SrcVec = SrcTy->getTypeID() == Type::VectorTyID;
bool DstVec = DestTy->getTypeID() == Type::VectorTyID;
- Assert1(SrcVec == DstVec,"SIToFP source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isIntOrIntVector(),"SIToFP source must be integer or integer vector", &I);
- Assert1(DestTy->isFPOrFPVector(),"SIToFP result must be FP or FP vector", &I);
+ Assert1(SrcVec == DstVec,
+ "SIToFP source and dest must both be vector or scalar", &I);
+ Assert1(SrcTy->isIntOrIntVector(),
+ "SIToFP source must be integer or integer vector", &I);
+ Assert1(DestTy->isFPOrFPVector(),
+ "SIToFP result must be FP or FP vector", &I);
if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() == cast<VectorType>(DestTy)->getNumElements(),
+ Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
+ cast<VectorType>(DestTy)->getNumElements(),
"SIToFP source and dest vector length mismatch", &I);
visitInstruction(I);
@@ -750,15 +763,18 @@ void Verifier::visitFPToUIInst(FPToUIInst &I) {
const Type *SrcTy = I.getOperand(0)->getType();
const Type *DestTy = I.getType();
- bool SrcVec = SrcTy->getTypeID() == Type::VectorTyID;
- bool DstVec = DestTy->getTypeID() == Type::VectorTyID;
+ bool SrcVec = isa<VectorType>(SrcTy);
+ bool DstVec = isa<VectorType>(DestTy);
- Assert1(SrcVec == DstVec,"FPToUI source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isFPOrFPVector(),"FPToUI source must be FP or FP vector", &I);
- Assert1(DestTy->isIntOrIntVector(),"FPToUI result must be integer or integer vector", &I);
+ Assert1(SrcVec == DstVec,
+ "FPToUI source and dest must both be vector or scalar", &I);
+ Assert1(SrcTy->isFPOrFPVector(), "FPToUI source must be FP or FP vector", &I);
+ Assert1(DestTy->isIntOrIntVector(),
+ "FPToUI result must be integer or integer vector", &I);
if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() == cast<VectorType>(DestTy)->getNumElements(),
+ Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
+ cast<VectorType>(DestTy)->getNumElements(),
"FPToUI source and dest vector length mismatch", &I);
visitInstruction(I);
@@ -769,15 +785,19 @@ void Verifier::visitFPToSIInst(FPToSIInst &I) {
const Type *SrcTy = I.getOperand(0)->getType();
const Type *DestTy = I.getType();
- bool SrcVec = SrcTy->getTypeID() == Type::VectorTyID;
- bool DstVec = DestTy->getTypeID() == Type::VectorTyID;
+ bool SrcVec = isa<VectorType>(SrcTy);
+ bool DstVec = isa<VectorType>(DestTy);
- Assert1(SrcVec == DstVec,"FPToSI source and dest must both be vector or scalar", &I);
- Assert1(SrcTy->isFPOrFPVector(),"FPToSI source must be FP or FP vector", &I);
- Assert1(DestTy->isIntOrIntVector(),"FPToSI result must be integer or integer vector", &I);
+ Assert1(SrcVec == DstVec,
+ "FPToSI source and dest must both be vector or scalar", &I);
+ Assert1(SrcTy->isFPOrFPVector(),
+ "FPToSI source must be FP or FP vector", &I);
+ Assert1(DestTy->isIntOrIntVector(),
+ "FPToSI result must be integer or integer vector", &I);
if (SrcVec && DstVec)
- Assert1(cast<VectorType>(SrcTy)->getNumElements() == cast<VectorType>(DestTy)->getNumElements(),
+ Assert1(cast<VectorType>(SrcTy)->getNumElements() ==
+ cast<VectorType>(DestTy)->getNumElements(),
"FPToSI source and dest vector length mismatch", &I);
visitInstruction(I);
@@ -871,25 +891,24 @@ void Verifier::VerifyCallSite(CallSite CS) {
"Call parameter type does not match function signature!",
CS.getArgument(i), FTy->getParamType(i), I);
- const ParamAttrsList *Attrs = CS.getParamAttrs();
+ const PAListPtr &Attrs = CS.getParamAttrs();
- Assert1(!Attrs ||
- (Attrs->size() &&
- Attrs->getParamIndex(Attrs->size()-1) <= CS.arg_size()),
- "Attributes after last argument!", I);
+ Assert1(Attrs.isEmpty() ||
+ Attrs.getSlot(Attrs.getNumSlots()-1).Index <= CS.arg_size(),
+ "Attributes after last parameter!", I);
// Verify call attributes.
VerifyFunctionAttrs(FTy, Attrs, I);
- if (Attrs && FTy->isVarArg())
+ if (FTy->isVarArg())
// Check attributes on the varargs part.
for (unsigned Idx = 1 + FTy->getNumParams(); Idx <= CS.arg_size(); ++Idx) {
- ParameterAttributes Attr = Attrs->getParamAttrs(Idx);
+ ParameterAttributes Attr = Attrs.getParamAttrs(Idx);
VerifyAttrs(Attr, CS.getArgument(Idx-1)->getType(), false, I);
ParameterAttributes VArgI = Attr & ParamAttr::VarArgsIncompatible;
- Assert1(!VArgI, "Attribute " + ParamAttrsList::getParamAttrsText(VArgI) +
+ Assert1(!VArgI, "Attribute " + ParamAttr::getAsString(VArgI) +
"cannot be used for vararg call arguments!", I);
}
diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
index d252d1d0db..6bddc30917 100644
--- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
@@ -380,14 +380,13 @@
/* Copy the first part of user declarations. */
-#line 14 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 14 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
#include "UpgradeInternals.h"
#include "llvm/CallingConv.h"
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/ADT/STLExtras.h"
@@ -2068,7 +2067,7 @@ using namespace llvm;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1681 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1680 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
@@ -2111,7 +2110,7 @@ typedef union YYSTYPE
llvm::Module::Endianness Endianness;
}
/* Line 193 of yacc.c. */
-#line 2115 "UpgradeParser.tab.c"
+#line 2114 "UpgradeParser.tab.c"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -2124,7 +2123,7 @@ typedef union YYSTYPE
/* Line 216 of yacc.c. */
-#line 2128 "UpgradeParser.tab.c"
+#line 2127 "UpgradeParser.tab.c"
#ifdef short
# undef short
@@ -2548,38 +2547,38 @@ static const yytype_int16 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 1821, 1821, 1822, 1830, 1831, 1841, 1841, 1841, 1841,
- 1841, 1841, 1841, 1841, 1841, 1841, 1841, 1845, 1845, 1845,
- 1849, 1849, 1849, 1849, 1849, 1849, 1853, 1853, 1854, 1854,
- 1855, 1855, 1856, 1856, 1857, 1857, 1861, 1861, 1862, 1862,
- 1863, 1863, 1864, 1864, 1865, 1865, 1866, 1866, 1867, 1867,
- 1868, 1869, 1872, 1872, 1872, 1872, 1876, 1876, 1876, 1876,
- 1876, 1876, 1876, 1877, 1877, 1877, 1877, 1877, 1877, 1883,
- 1883, 1883, 1883, 1887, 1887, 1887, 1887, 1891, 1891, 1895,
- 1895, 1900, 1903, 1908, 1909, 1910, 1911, 1912, 1913, 1914,
- 1915, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1936,
- 1937, 1945, 1946, 1954, 1963, 1964, 1971, 1972, 1976, 1980,
- 1996, 1997, 2004, 2005, 2012, 2020, 2020, 2020, 2020, 2020,
- 2020, 2020, 2021, 2021, 2021, 2021, 2021, 2026, 2030, 2034,
- 2039, 2048, 2075, 2081, 2094, 2105, 2109, 2122, 2126, 2141,
- 2145, 2152, 2153, 2159, 2166, 2178, 2208, 2221, 2244, 2272,
- 2294, 2305, 2327, 2338, 2347, 2352, 2411, 2418, 2426, 2433,
- 2440, 2444, 2448, 2462, 2477, 2489, 2498, 2526, 2539, 2548,
- 2554, 2560, 2571, 2577, 2583, 2594, 2595, 2604, 2605, 2617,
- 2626, 2627, 2628, 2629, 2630, 2646, 2666, 2668, 2670, 2670,
- 2677, 2677, 2685, 2685, 2693, 2693, 2702, 2704, 2706, 2711,
- 2725, 2726, 2730, 2733, 2741, 2745, 2752, 2756, 2760, 2764,
- 2772, 2772, 2776, 2777, 2781, 2789, 2794, 2802, 2803, 2810,
- 2817, 2821, 3009, 3009, 3013, 3013, 3023, 3023, 3027, 3032,
- 3033, 3034, 3038, 3039, 3038, 3051, 3052, 3057, 3058, 3059,
- 3060, 3064, 3068, 3069, 3070, 3071, 3092, 3096, 3111, 3112,
- 3117, 3117, 3125, 3135, 3138, 3147, 3158, 3163, 3172, 3183,
- 3183, 3186, 3190, 3194, 3199, 3209, 3227, 3236, 3309, 3313,
- 3320, 3332, 3347, 3377, 3387, 3397, 3401, 3408, 3409, 3413,
- 3416, 3422, 3441, 3459, 3475, 3489, 3503, 3514, 3532, 3541,
- 3550, 3557, 3578, 3602, 3608, 3614, 3620, 3636, 3728, 3736,
- 3737, 3741, 3742, 3746, 3752, 3759, 3765, 3772, 3779, 3792,
- 3812
+ 0, 1820, 1820, 1821, 1829, 1830, 1840, 1840, 1840, 1840,
+ 1840, 1840, 1840, 1840, 1840, 1840, 1840, 1844, 1844, 1844,
+ 1848, 1848, 1848, 1848, 1848, 1848, 1852, 1852, 1853, 1853,
+ 1854, 1854, 1855, 1855, 1856, 1856, 1860, 1860, 1861, 1861,
+ 1862, 1862, 1863, 1863, 1864, 1864, 1865, 1865, 1866, 1866,
+ 1867, 1868, 1871, 1871, 1871, 1871, 1875, 1875, 1875, 1875,
+ 1875, 1875, 1875, 1876, 1876, 1876, 1876, 1876, 1876, 1882,
+ 1882, 1882, 1882, 1886, 1886, 1886, 1886, 1890, 1890, 1894,
+ 1894, 1899, 1902, 1907, 1908, 1909, 1910, 1911, 1912, 1913,
+ 1914, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1935,
+ 1936, 1944, 1945, 1953, 1962, 1963, 1970, 1971, 1975, 1979,
+ 1995, 1996, 2003, 2004, 2011, 2019, 2019, 2019, 2019, 2019,
+ 2019, 2019, 2020, 2020, 2020, 2020, 2020, 2025, 2029, 2033,
+ 2038, 2047, 2072, 2078, 2091, 2102, 2106, 2119, 2123, 2138,
+ 2142, 2149, 2150, 2156, 2163, 2175, 2205, 2218, 2241, 2269,
+ 2291, 2302, 2324, 2335, 2344, 2349, 2408, 2415, 2423, 2430,
+ 2437, 2441, 2445, 2459, 2474, 2486, 2495, 2523, 2536, 2545,
+ 2551, 2557, 2568, 2574, 2580, 2591, 2592, 2601, 2602, 2614,
+ 2623, 2624, 2625, 2626, 2627, 2643, 2663, 2665, 2667, 2667,
+ 2674, 2674, 2682, 2682, 2690, 2690, 2699, 2701, 2703, 2708,
+ 2722, 2723, 2727, 2730, 2738, 2742, 2749, 2753, 2757, 2761,
+ 2769, 2769, 2773, 2774, 2778, 2786, 2791, 2799, 2800, 2807,
+ 2814, 2818, 3004, 3004, 3008, 3008, 3018, 3018, 3022, 3027,
+ 3028, 3029, 3033, 3034, 3033, 3046, 3047, 3052, 3053, 3054,
+ 3055, 3059, 3063, 3064, 3065, 3066, 3087, 3091, 3106, 3107,
+ 3112, 3112, 3120, 3130, 3133, 3142, 3153, 3158, 3167, 3178,
+ 3178, 3181, 3185, 3189, 3194, 3204, 3222, 3231, 3302, 3306,
+ 3313, 3325, 3340, 3370, 3380, 3390, 3394, 3401, 3402, 3406,
+ 3409, 3415, 3434, 3452, 3468, 3482, 3496, 3507, 3525, 3534,
+ 3543, 3550, 3571, 3595, 3601, 3607, 3613, 3629, 3719, 3727,
+ 3728, 3732, 3733, 3737, 3743, 3750, 3756, 3763, 3770, 3783,
+ 3803
};
#endif
@@ -4114,7 +4113,7 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 1822 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1821 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(1) - (1)].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range!
error("Value too large for type");
@@ -4123,7 +4122,7 @@ yyreduce:
break;
case 5:
-#line 1831 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1830 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(1) - (1)].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range!
error("Value too large for type");
@@ -4132,226 +4131,226 @@ yyreduce:
break;
case 26:
-#line 1853 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1852 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_EQ; ;}
break;
case 27:
-#line 1853 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1852 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_NE; ;}
break;
case 28:
-#line 1854 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1853 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SLT; ;}
break;
case 29:
-#line 1854 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1853 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SGT; ;}
break;
case 30:
-#line 1855 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1854 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SLE; ;}
break;
case 31:
-#line 1855 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1854 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_SGE; ;}
break;
case 32:
-#line 1856 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1855 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_ULT; ;}
break;
case 33:
-#line 1856 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1855 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_UGT; ;}
break;
case 34:
-#line 1857 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1856 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_ULE; ;}
break;
case 35:
-#line 1857 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1856 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.IPred) = ICmpInst::ICMP_UGE; ;}
break;
case 36:
-#line 1861 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1860 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OEQ; ;}
break;
case 37:
-#line 1861 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1860 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ONE; ;}
break;
case 38:
-#line 1862 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1861 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OLT; ;}
break;
case 39:
-#line 1862 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1861 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OGT; ;}
break;
case 40:
-#line 1863 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1862 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OLE; ;}
break;
case 41:
-#line 1863 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1862 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_OGE; ;}
break;
case 42:
-#line 1864 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1863 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ORD; ;}
break;
case 43:
-#line 1864 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1863 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UNO; ;}
break;
case 44:
-#line 1865 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1864 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UEQ; ;}
break;
case 45:
-#line 1865 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1864 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UNE; ;}
break;
case 46:
-#line 1866 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1865 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ULT; ;}
break;
case 47:
-#line 1866 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1865 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UGT; ;}
break;
case 48:
-#line 1867 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1866 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_ULE; ;}
break;
case 49:
-#line 1867 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1866 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_UGE; ;}
break;
case 50:
-#line 1868 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1867 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_TRUE; ;}
break;
case 51:
-#line 1869 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1868 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.FPred) = FCmpInst::FCMP_FALSE; ;}
break;
case 81:
-#line 1900 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1899 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
;}
break;
case 82:
-#line 1903 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1902 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.StrVal) = 0;
;}
break;
case 83:
-#line 1908 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1907 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
break;
case 84:
-#line 1909 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1908 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
break;
case 85:
-#line 1910 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1909 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
break;
case 86:
-#line 1911 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1910 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
break;
case 87:
-#line 1912 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1911 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 88:
-#line 1913 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1912 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
break;
case 89:
-#line 1914 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1913 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 90:
-#line 1915 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1914 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 91:
-#line 1919 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1918 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::C; ;}
break;
case 92:
-#line 1920 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1919 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::C; ;}
break;
case 93:
-#line 1921 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1920 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::CSRet; ;}
break;
case 94:
-#line 1922 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1921 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::Fast; ;}
break;
case 95:
-#line 1923 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1922 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::Cold; ;}
break;
case 96:
-#line 1924 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1923 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::X86_StdCall; ;}
break;
case 97:
-#line 1925 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1924 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = lastCallingConv = OldCallingConv::X86_FastCall; ;}
break;
case 98:
-#line 1926 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1925 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
error("Calling conv too large");
@@ -4360,12 +4359,12 @@ yyreduce:
break;
case 99:
-#line 1936 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1935 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 100:
-#line 1937 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1936 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -4374,12 +4373,12 @@ yyreduce:
break;
case 101:
-#line 1945 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1944 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.UIntVal) = 0; ;}
break;
case 102:
-#line 1946 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1945 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
@@ -4388,7 +4387,7 @@ yyreduce:
break;
case 103:
-#line 1954 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1953 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i)
if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\')
@@ -4398,27 +4397,27 @@ yyreduce:
break;
case 104:
-#line 1963 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1962 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 105:
-#line 1964 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1963 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
break;
case 106:
-#line 1971 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1970 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{;}
break;
case 107:
-#line 1972 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1971 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{;}
break;
case 108:
-#line 1976 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1975 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV->setSection((yyvsp[(1) - (1)].StrVal));
free((yyvsp[(1) - (1)].StrVal));
@@ -4426,7 +4425,7 @@ yyreduce:
break;
case 109:
-#line 1980 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1979 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
error("Alignment must be a power of two");
@@ -4436,7 +4435,7 @@ yyreduce:
break;
case 111:
-#line 1997 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1996 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T);
(yyval.TypeVal).S.makeSignless();
@@ -4444,7 +4443,7 @@ yyreduce:
break;
case 113:
-#line 2005 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2004 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T);
(yyval.TypeVal).S.makeSignless();
@@ -4452,7 +4451,7 @@ yyreduce:
break;
case 114:
-#line 2012 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2011 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!UpRefs.empty())
error("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal).PAT)->getDescription());
@@ -4461,7 +4460,7 @@ yyreduce:
break;
case 127:
-#line 2026 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2025 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T);
(yyval.TypeVal).S.copy((yyvsp[(1) - (1)].PrimType).S);
@@ -4469,7 +4468,7 @@ yyreduce:
break;
case 128:
-#line 2030 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2029 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get());
(yyval.TypeVal).S.makeSignless();
@@ -4477,7 +4476,7 @@ yyreduce:
break;
case 129:
-#line 2034 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2033 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Named types are also simple types...
(yyval.TypeVal).S.copy(getTypeSign((yyvsp[(1) - (1)].ValIDVal)));
const Type* tmp = getType((yyvsp[(1) - (1)].ValIDVal));
@@ -4486,7 +4485,7 @@ yyreduce:
break;
case 130:
-#line 2039 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2038 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Type UpReference
if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U)
error("Value out of range");
@@ -4499,7 +4498,7 @@ yyreduce:
break;
case 131:
-#line 2048 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2047 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Function derived type?
(yyval.TypeVal).S.makeComposite((yyvsp[(1) - (4)].TypeVal).S);
std::vector<const Type*> Params;
@@ -4511,13 +4510,11 @@ yyreduce:
bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
if (isVarArg) Params.pop_back();
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (lastCallingConv == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- PAL = ParamAttrsList::get(Attrs);
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet);
+ PAL = PAListPtr::get(&PAWI, 1);
}
const FunctionType *FTy =
@@ -4530,7 +4527,7 @@ yyreduce:
break;
case 132:
-#line 2075 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2072 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Sized array type?
(yyval.TypeVal).S.makeComposite((yyvsp[(4) - (5)].TypeVal).S);
(yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[(4) - (5)].TypeVal).PAT->get(),
@@ -4540,7 +4537,7 @@ yyreduce:
break;
case 133:
-#line 2081 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2078 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Vector type?
const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal).PAT->get();
if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val))
@@ -4557,7 +4554,7 @@ yyreduce:
break;
case 134:
-#line 2094 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2091 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Structure type?
std::vector<const Type*> Elements;
(yyval.TypeVal).S.makeComposite();
@@ -4572,7 +4569,7 @@ yyreduce:
break;
case 135:
-#line 2105 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2102 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Empty structure type?
(yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector<const Type*>()));
(yyval.TypeVal).S.makeComposite();
@@ -4580,7 +4577,7 @@ yyreduce:
break;
case 136:
-#line 2109 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2106 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Packed Structure type?
(yyval.TypeVal).S.makeComposite();
std::vector<const Type*> Elements;
@@ -4597,7 +4594,7 @@ yyreduce:
break;
case 137:
-#line 2122 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2119 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Empty packed structure type?
(yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector<const Type*>(),true));
(yyval.TypeVal).S.makeComposite();
@@ -4605,7 +4602,7 @@ yyreduce:
break;
case 138:
-#line 2126 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2123 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Pointer type?
if ((yyvsp[(1) - (2)].TypeVal).PAT->get() == Type::LabelTy)
error("Cannot form a pointer to a basic block");
@@ -4618,7 +4615,7 @@ yyreduce:
break;
case 139:
-#line 2141 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2138 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeList) = new std::list<PATypeInfo>();
(yyval.TypeList)->push_back((yyvsp[(1) - (1)].TypeVal));
@@ -4626,14 +4623,14 @@ yyreduce:
break;
case 140:
-#line 2145 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2142 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back((yyvsp[(3) - (3)].TypeVal));
;}
break;
case 142:
-#line 2153 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2150 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
PATypeInfo VoidTI;
VoidTI.PAT = new PATypeHolder(Type::VoidTy);
@@ -4643,7 +4640,7 @@ yyreduce:
break;
case 143:
-#line 2159 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2156 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeList) = new std::list<PATypeInfo>();
PATypeInfo VoidTI;
@@ -4654,14 +4651,14 @@ yyreduce:
break;
case 144:
-#line 2166 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2163 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TypeList) = new std::list<PATypeInfo>();
;}
break;
case 145:
-#line 2178 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2175 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Nonempty unsized arr
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (4)].TypeVal).PAT->get());
if (ATy == 0)
@@ -4695,7 +4692,7 @@ yyreduce:
break;
case 146:
-#line 2208 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2205 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal).PAT->get());
if (ATy == 0)
@@ -4712,7 +4709,7 @@ yyreduce:
break;
case 147:
-#line 2221 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2218 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const ArrayType *ATy = dyn_cast<ArrayType>((yyvsp[(1) - (3)].TypeVal).PAT->get());
if (ATy == 0)
@@ -4739,7 +4736,7 @@ yyreduce:
break;
case 148:
-#line 2244 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2241 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Nonempty unsized arr
const VectorType *PTy = dyn_cast<VectorType>((yyvsp[(1) - (4)].TypeVal).PAT->get());
if (PTy == 0)
@@ -4771,7 +4768,7 @@ yyreduce:
break;
case 149:
-#line 2272 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2269 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (4)].TypeVal).PAT->get());
if (STy == 0)
@@ -4797,7 +4794,7 @@ yyreduce:
break;
case 150:
-#line 2294 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2291 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (3)].TypeVal).PAT->get());
if (STy == 0)
@@ -4812,7 +4809,7 @@ yyreduce:
break;
case 151:
-#line 2305 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2302 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (6)].TypeVal).PAT->get());
if (STy == 0)
@@ -4838,7 +4835,7 @@ yyreduce:
break;
case 152:
-#line 2327 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2324 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const StructType *STy = dyn_cast<StructType>((yyvsp[(1) - (5)].TypeVal).PAT->get());
if (STy == 0)
@@ -4853,7 +4850,7 @@ yyreduce:
break;
case 153:
-#line 2338 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2335 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal).PAT->get());
if (PTy == 0)
@@ -4866,7 +4863,7 @@ yyreduce:
break;
case 154:
-#line 2347 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2344 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ConstVal).C = UndefValue::get((yyvsp[(1) - (2)].TypeVal).PAT->get());
(yyval.ConstVal).S.copy((yyvsp[(1) - (2)].TypeVal).S);
@@ -4875,7 +4872,7 @@ yyreduce:
break;
case 155:
-#line 2352 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2349 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *Ty = dyn_cast<PointerType>((yyvsp[(1) - (2)].TypeVal).PAT->get());
if (Ty == 0)
@@ -4938,7 +4935,7 @@ yyreduce:
break;
case 156:
-#line 2411 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2408 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(1) - (2)].TypeVal).PAT->get() != (yyvsp[(2) - (2)].ConstVal).C->getType())
error("Mismatched types for constant expression");
@@ -4949,7 +4946,7 @@ yyreduce:
break;
case 157:
-#line 2418 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2415 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(1) - (2)].TypeVal).PAT->get();
if (isa<FunctionType>(Ty) || Ty == Type::LabelTy || isa<OpaqueType>(Ty))
@@ -4961,7 +4958,7 @@ yyreduce:
break;
case 158:
-#line 2426 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2423 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // integral constants
const Type *Ty = (yyvsp[(1) - (2)].PrimType).T;
if (!ConstantInt::isValueValidForType(Ty, (yyvsp[(2) - (2)].SInt64Val)))
@@ -4972,7 +4969,7 @@ yyreduce:
break;
case 159:
-#line 2433 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2430 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // integral constants
const Type *Ty = (yyvsp[(1) - (2)].PrimType).T;
if (!ConstantInt::isValueValidForType(Ty, (yyvsp[(2) - (2)].UInt64Val)))
@@ -4983,7 +4980,7 @@ yyreduce:
break;
case 160:
-#line 2440 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2437 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Boolean constants
(yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true);
(yyval.ConstVal).S.makeUnsigned();
@@ -4991,7 +4988,7 @@ yyreduce:
break;
case 161:
-#line 2444 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2441 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Boolean constants
(yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false);
(yyval.ConstVal).S.makeUnsigned();
@@ -4999,7 +4996,7 @@ yyreduce:
break;
case 162:
-#line 2448 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2445 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Float & Double constants
if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType).T, *(yyvsp[(2) - (2)].FPVal)))
error("Floating point constant invalid for type");
@@ -5014,7 +5011,7 @@ yyreduce:
break;
case 163:
-#line 2462 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2459 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* SrcTy = (yyvsp[(3) - (6)].ConstVal).C->getType();
const Type* DstTy = (yyvsp[(5) - (6)].TypeVal).PAT->get();
@@ -5033,7 +5030,7 @@ yyreduce:
break;
case 164:
-#line 2477 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2474 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(3) - (5)].ConstVal).C->getType();
if (!isa<PointerType>(Ty))
@@ -5049,7 +5046,7 @@ yyreduce:
break;
case 165:
-#line 2489 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2486 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[(3) - (8)].ConstVal).C->getType()->isInteger() ||
cast<IntegerType>((yyvsp[(3) - (8)].ConstVal).C->getType())->getBitWidth() != 1)
@@ -5062,7 +5059,7 @@ yyreduce:
break;
case 166:
-#line 2498 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2495 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(3) - (6)].ConstVal).C->getType();
if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType())
@@ -5094,7 +5091,7 @@ yyreduce:
break;
case 167:
-#line 2526 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2523 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType();
if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType())
@@ -5111,7 +5108,7 @@ yyreduce:
break;
case 168:
-#line 2539 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2536 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType();
if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType())
@@ -5124,7 +5121,7 @@ yyreduce:
break;
case 169:
-#line 2548 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2545 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(4) - (7)].ConstVal).C->getType() != (yyvsp[(6) - (7)].ConstVal).C->getType())
error("icmp operand types must match");
@@ -5134,7 +5131,7 @@ yyreduce:
break;
case 170:
-#line 2554 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2551 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(4) - (7)].ConstVal).C->getType() != (yyvsp[(6) - (7)].ConstVal).C->getType())
error("fcmp operand types must match");
@@ -5144,7 +5141,7 @@ yyreduce:
break;
case 171:
-#line 2560 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2557 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[(5) - (6)].ConstVal).C->getType()->isInteger() ||
cast<IntegerType>((yyvsp[(5) - (6)].ConstVal).C->getType())->getBitWidth() != 8)
@@ -5159,7 +5156,7 @@ yyreduce:
break;
case 172:
-#line 2571 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2568 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C))
error("Invalid extractelement operands");
@@ -5169,7 +5166,7 @@ yyreduce:
break;
case 173:
-#line 2577 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2574 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C))
error("Invalid insertelement operands");
@@ -5179,7 +5176,7 @@ yyreduce:
break;
case 174:
-#line 2583 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2580 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C))
error("Invalid shufflevector operands");
@@ -5189,12 +5186,12 @@ yyreduce:
break;
case 175:
-#line 2594 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2591 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); ;}
break;
case 176:
-#line 2595 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2592 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ConstVector) = new std::vector<ConstInfo>();
(yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal));
@@ -5202,17 +5199,17 @@ yyreduce:
break;
case 177:
-#line 2604 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2601 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 178:
-#line 2605 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2602 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 179:
-#line 2617 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2614 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ModuleVal) = ParserResult = (yyvsp[(1) - (1)].ModuleVal);
CurModule.ModuleDone();
@@ -5220,27 +5217,27 @@ yyreduce:
break;
case 180:
-#line 2626 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2623 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); CurFun.FunctionDone(); ;}
break;
case 181:
-#line 2627 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2624 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); ;}
break;
case 182:
-#line 2628 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2625 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[(1) - (4)].ModuleVal); ;}
break;
case 183:
-#line 2629 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2626 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); ;}
break;
case 184:
-#line 2630 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2627 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ModuleVal) = CurModule.CurrentModule;
// Emit an error if there are any unresolved types left.
@@ -5256,7 +5253,7 @@ yyreduce:
break;
case 185:
-#line 2646 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2643 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
// Eagerly resolve types. This is not an optimization, this is a
// requirement that is due to the fact that we could have this:
@@ -5280,19 +5277,19 @@ yyreduce:
break;
case 186:
-#line 2666 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2663 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Function prototypes can be in const pool
;}
break;
case 187:
-#line 2668 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2665 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Asm blocks can be in the const pool
;}
break;
case 188:
-#line 2670 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2667 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(5) - (5)].ConstVal).C == 0)
error("Global value initializer is not a constant");
@@ -5301,14 +5298,14 @@ yyreduce:
break;
case 189:
-#line 2674 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2671 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 190:
-#line 2677 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2674 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get();
CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::ExternalLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0,
@@ -5318,14 +5315,14 @@ yyreduce:
break;
case 191:
-#line 2682 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2679 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 192:
-#line 2685 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2682 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get();
CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0,
@@ -5335,14 +5332,14 @@ yyreduce:
break;
case 193:
-#line 2690 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2687 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 194:
-#line 2693 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2690 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get();
CurGV =
@@ -5353,32 +5350,32 @@ yyreduce:
break;
case 195:
-#line 2699 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2696 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurGV = 0;
;}
break;
case 196:
-#line 2702 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2699 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
;}
break;
case 197:
-#line 2704 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2701 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
;}
break;
case 198:
-#line 2706 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2703 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
;}
break;
case 199:
-#line 2711 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2708 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm();
char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true);
@@ -5393,24 +5390,24 @@ yyreduce:
break;
case 200:
-#line 2725 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2722 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Endianness) = Module::BigEndian; ;}
break;
case 201:
-#line 2726 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2723 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Endianness) = Module::LittleEndian; ;}
break;
case 202:
-#line 2730 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2727 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.setEndianness((yyvsp[(3) - (3)].Endianness));
;}
break;
case 203:
-#line 2733 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2730 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(3) - (3)].UInt64Val) == 32)
CurModule.setPointerSize(Module::Pointer32);
@@ -5422,7 +5419,7 @@ yyreduce:
break;
case 204:
-#line 2741 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2738 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal));
free((yyvsp[(3) - (3)].StrVal));
@@ -5430,7 +5427,7 @@ yyreduce:
break;
case 205:
-#line 2745 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2742 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal));
free((yyvsp[(3) - (3)].StrVal));
@@ -5438,7 +5435,7 @@ yyreduce:
break;
case 207:
-#line 2756 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2753 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal));
free((yyvsp[(3) - (3)].StrVal));
@@ -5446,7 +5443,7 @@ yyreduce:
break;
case 208:
-#line 2760 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2757 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal));
free((yyvsp[(1) - (1)].StrVal));
@@ -5454,17 +5451,17 @@ yyreduce:
break;
case 209:
-#line 2764 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2761 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ ;}
break;
case 213:
-#line 2777 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2774 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.StrVal) = 0; ;}
break;
case 214:
-#line 2781 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2778 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(1) - (2)].TypeVal).PAT->get() == Type::VoidTy)
error("void typed arguments are invalid");
@@ -5473,7 +5470,7 @@ yyreduce:
break;
case 215:
-#line 2789 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2786 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
(yyval.ArgList)->push_back(*(yyvsp[(3) - (3)].ArgVal));
@@ -5482,7 +5479,7 @@ yyreduce:
break;
case 216:
-#line 2794 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2791 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = new std::vector<std::pair<PATypeInfo,char*> >();
(yyval.ArgList)->push_back(*(yyvsp[(1) - (1)].ArgVal));
@@ -5491,12 +5488,12 @@ yyreduce:
break;
case 217:
-#line 2802 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2799 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); ;}
break;
case 218:
-#line 2803 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2800 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = (yyvsp[(1) - (3)].ArgList);
PATypeInfo VoidTI;
@@ -5507,7 +5504,7 @@ yyreduce:
break;
case 219:
-#line 2810 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2807 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ArgList) = new std::vector<std::pair<PATypeInfo,char*> >();
PATypeInfo VoidTI;
@@ -5518,12 +5515,12 @@ yyreduce:
break;
case 220:
-#line 2817 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2814 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ArgList) = 0; ;}
break;
case 221:
-#line 2821 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 2818 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
UnEscapeLexed((yyvsp[(3) - (8)].StrVal));
std::string FunctionName((yyvsp[(3) - (8)].StrVal));
@@ -5680,11 +5677,9 @@ yyreduce:
// Convert the CSRet calling convention into the corresponding parameter
// attribute.
if ((yyvsp[(1) - (8)].UIntVal) == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- Fn->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ Fn->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
// Add all of the arguments we parsed to the function...
@@ -5712,12 +5707,12 @@ yyreduce:
break;
case 224:
-#line 3013 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3008 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.Linkage = (yyvsp[(1) - (1)].Linkage); ;}
break;
case 225:
-#line 3013 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3008 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
@@ -5728,39 +5723,39 @@ yyreduce:
break;
case 228:
-#line 3027 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3022 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
;}
break;
case 229:
-#line 3032 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3027 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
break;
case 230:
-#line 3033 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3028 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
break;
case 231:
-#line 3034 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3029 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
break;
case 232:
-#line 3038 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3033 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.isDeclare = true; ;}
break;
case 233:
-#line 3039 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3034 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ CurFun.Linkage = (yyvsp[(3) - (3)].Linkage); ;}
break;
case 234:
-#line 3039 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3034 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = CurFun.CurrentFunction;
CurFun.FunctionDone();
@@ -5769,32 +5764,32 @@ yyreduce:
break;
case 235:
-#line 3051 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3046 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 236:
-#line 3052 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3047 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 237:
-#line 3057 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3052 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); ;}
break;
case 238:
-#line 3058 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3053 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); ;}
break;
case 239:
-#line 3059 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3054 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); ;}
break;
case 240:
-#line 3060 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3055 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true));
(yyval.ValIDVal).S.makeUnsigned();
@@ -5802,7 +5797,7 @@ yyreduce:
break;
case 241:
-#line 3064 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3059 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false));
(yyval.ValIDVal).S.makeUnsigned();
@@ -5810,22 +5805,22 @@ yyreduce:
break;
case 242:
-#line 3068 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3063 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::createNull(); ;}
break;
case 243:
-#line 3069 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3064 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::createUndef(); ;}
break;
case 244:
-#line 3070 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3065 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::createZeroInit(); ;}
break;
case 245:
-#line 3071 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3066 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Nonempty unsized packed vector
const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0].C->getType();
int NumElements = (yyvsp[(2) - (3)].ConstVector)->size();
@@ -5850,7 +5845,7 @@ yyreduce:
break;
case 246:
-#line 3092 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3087 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal).C);
(yyval.ValIDVal).S.copy((yyvsp[(1) - (1)].ConstVal).S);
@@ -5858,7 +5853,7 @@ yyreduce:
break;
case 247:
-#line 3096 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3091 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true);
std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End);
@@ -5871,17 +5866,17 @@ yyreduce:
break;
case 248:
-#line 3111 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3106 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SIntVal)); (yyval.ValIDVal).S.makeSignless(); ;}
break;
case 249:
-#line 3112 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3107 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].StrVal)); (yyval.ValIDVal).S.makeSignless(); ;}
break;
case 252:
-#line 3125 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3120 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(1) - (2)].TypeVal).PAT->get();
(yyvsp[(2) - (2)].ValIDVal).S.copy((yyvsp[(1) - (2)].TypeVal).S);
@@ -5892,21 +5887,21 @@ yyreduce:
break;
case 253:
-#line 3135 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3130 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
;}
break;
case 254:
-#line 3138 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3133 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Do not allow functions with 0 basic blocks
(yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal);
;}
break;
case 255:
-#line 3147 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3142 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
ValueInfo VI; VI.V = (yyvsp[(3) - (3)].TermInstVal).TI; VI.S.copy((yyvsp[(3) - (3)].TermInstVal).S);
setValueName(VI, (yyvsp[(2) - (3)].StrVal));
@@ -5918,7 +5913,7 @@ yyreduce:
break;
case 256:
-#line 3158 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3153 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if ((yyvsp[(2) - (2)].InstVal).I)
(yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal).I);
@@ -5927,7 +5922,7 @@ yyreduce:
break;
case 257:
-#line 3163 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3158 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++),true);
// Make sure to move the basic block to the correct location in the
@@ -5940,7 +5935,7 @@ yyreduce:
break;
case 258:
-#line 3172 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3167 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[(1) - (1)].StrVal)), true);
// Make sure to move the basic block to the correct location in the
@@ -5953,7 +5948,7 @@ yyreduce:
break;
case 261:
-#line 3186 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3181 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Return with a result...
(yyval.TermInstVal).TI = new ReturnInst((yyvsp[(2) - (2)].ValueVal).V);
(yyval.TermInstVal).S.makeSignless();
@@ -5961,7 +5956,7 @@ yyreduce:
break;
case 262:
-#line 3190 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3185 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Return with no result...
(yyval.TermInstVal).TI = new ReturnInst();
(yyval.TermInstVal).S.makeSignless();
@@ -5969,7 +5964,7 @@ yyreduce:
break;
case 263:
-#line 3194 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3189 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Unconditional Branch...
BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal));
(yyval.TermInstVal).TI = new BranchInst(tmpBB);
@@ -5978,7 +5973,7 @@ yyreduce:
break;
case 264:
-#line 3199 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3194 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(6) - (9)].ValIDVal).S.makeSignless();
(yyvsp[(9) - (9)].ValIDVal).S.makeSignless();
@@ -5992,7 +5987,7 @@ yyreduce:
break;
case 265:
-#line 3209 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3204 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(3) - (9)].ValIDVal).S.copy((yyvsp[(2) - (9)].PrimType).S);
Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType).T, (yyvsp[(3) - (9)].ValIDVal));
@@ -6014,7 +6009,7 @@ yyreduce:
break;
case 266:
-#line 3227 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3222 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(3) - (8)].ValIDVal).S.copy((yyvsp[(2) - (8)].PrimType).S);
Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType).T, (yyvsp[(3) - (8)].ValIDVal));
@@ -6027,7 +6022,7 @@ yyreduce:
break;
case 267:
-#line 3237 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3232 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const PointerType *PFTy;
const FunctionType *Ty;
@@ -6090,11 +6085,9 @@ yyreduce:
}
cast<InvokeInst>((yyval.TermInstVal).TI)->setCallingConv(upgradeCallingConv((yyvsp[(2) - (13)].UIntVal)));
if ((yyvsp[(2) - (13)].UIntVal) == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- cast<InvokeInst>((yyval.TermInstVal).TI)->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ cast<InvokeInst>((yyval.TermInstVal).TI)->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
delete (yyvsp[(3) - (13)].TypeVal).PAT;
delete (yyvsp[(6) - (13)].ValueList);
@@ -6103,7 +6096,7 @@ yyreduce:
break;
case 268:
-#line 3309 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3302 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TermInstVal).TI = new UnwindInst();
(yyval.TermInstVal).S.makeSignless();
@@ -6111,7 +6104,7 @@ yyreduce:
break;
case 269:
-#line 3313 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3306 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TermInstVal).TI = new UnreachableInst();
(yyval.TermInstVal).S.makeSignless();
@@ -6119,7 +6112,7 @@ yyreduce:
break;
case 270:
-#line 3320 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3313 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable);
(yyvsp[(3) - (6)].ValIDVal).S.copy((yyvsp[(2) - (6)].PrimType).S);
@@ -6135,7 +6128,7 @@ yyreduce:
break;
case 271:
-#line 3332 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3325 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
(yyvsp[(2) - (5)].ValIDVal).S.copy((yyvsp[(1) - (5)].PrimType).S);
@@ -6151,7 +6144,7 @@ yyreduce:
break;
case 272:
-#line 3347 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3340 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
bool omit = false;
if ((yyvsp[(1) - (2)].StrVal))
@@ -6184,7 +6177,7 @@ yyreduce:
break;
case 273:
-#line 3377 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3370 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Used for PHI nodes
(yyval.PHIList).P = new std::list<std::pair<Value*, BasicBlock*> >();
(yyval.PHIList).S.copy((yyvsp[(1) - (6)].TypeVal).S);
@@ -6198,7 +6191,7 @@ yyreduce:
break;
case 274:
-#line 3387 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3380 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.PHIList) = (yyvsp[(1) - (7)].PHIList);
(yyvsp[(4) - (7)].ValIDVal).S.copy((yyvsp[(1) - (7)].PHIList).S);
@@ -6210,7 +6203,7 @@ yyreduce:
break;
case 275:
-#line 3397 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3390 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ // Used for call statements, and memory insts...
(yyval.ValueList) = new std::vector<ValueInfo>();
(yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal));
@@ -6218,7 +6211,7 @@ yyreduce:
break;
case 276:
-#line 3401 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3394 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValueList) = (yyvsp[(1) - (3)].ValueList);
(yyvsp[(1) - (3)].ValueList)->push_back((yyvsp[(3) - (3)].ValueVal));
@@ -6226,26 +6219,26 @@ yyreduce:
break;
case 278:
-#line 3409 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3402 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = 0; ;}
break;
case 279:
-#line 3413 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3406 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BoolVal) = true;
;}
break;
case 280:
-#line 3416 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3409 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BoolVal) = false;
;}
break;
case 281:
-#line 3422 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3415 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(3) - (5)].ValIDVal).S.copy((yyvsp[(2) - (5)].TypeVal).S);
(yyvsp[(5) - (5)].ValIDVal).S.copy((yyvsp[(2) - (5)].TypeVal).S);
@@ -6268,7 +6261,7 @@ yyreduce:
break;
case 282:
-#line 3441 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3434 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(3) - (5)].ValIDVal).S.copy((yyvsp[(2) - (5)].TypeVal).S);
(yyvsp[(5) - (5)].ValIDVal).S.copy((yyvsp[(2) - (5)].TypeVal).S);
@@ -6290,7 +6283,7 @@ yyreduce:
break;
case 283:
-#line 3459 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3452 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(3) - (5)].ValIDVal).S.copy((yyvsp[(2) - (5)].TypeVal).S);
(yyvsp[(5) - (5)].ValIDVal).S.copy((yyvsp[(2) - (5)].TypeVal).S);
@@ -6310,7 +6303,7 @@ yyreduce:
break;
case 284:
-#line 3475 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3468 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(4) - (6)].ValIDVal).S.copy((yyvsp[(3) - (6)].TypeVal).S);
(yyvsp[(6) - (6)].ValIDVal).S.copy((yyvsp[(3) - (6)].TypeVal).S);
@@ -6328,7 +6321,7 @@ yyreduce:
break;
case 285:
-#line 3489 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3482 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(4) - (6)].ValIDVal).S.copy((yyvsp[(3) - (6)].TypeVal).S);
(yyvsp[(6) - (6)].ValIDVal).S.copy((yyvsp[(3) - (6)].TypeVal).S);
@@ -6346,7 +6339,7 @@ yyreduce:
break;
case 286:
-#line 3503 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3496 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
warning("Use of obsolete 'not' instruction: Replacing with 'xor");
const Type *Ty = (yyvsp[(2) - (2)].ValueVal).V->getType();
@@ -6361,7 +6354,7 @@ yyreduce:
break;
case 287:
-#line 3514 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3507 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[(4) - (4)].ValueVal).V->getType()->isInteger() ||
cast<IntegerType>((yyvsp[(4) - (4)].ValueVal).V->getType())->getBitWidth() != 8)
@@ -6383,7 +6376,7 @@ yyreduce:
break;
case 288:
-#line 3532 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3525 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get();
if (!DstTy->isFirstClassType())
@@ -6396,7 +6389,7 @@ yyreduce:
break;
case 289:
-#line 3541 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3534 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[(2) - (6)].ValueVal).V->getType()->isInteger() ||
cast<IntegerType>((yyvsp[(2) - (6)].ValueVal).V->getType())->getBitWidth() != 1)
@@ -6409,7 +6402,7 @@ yyreduce:
break;
case 290:
-#line 3550 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3543 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(4) - (4)].TypeVal).PAT->get();
NewVarArgs = true;
@@ -6420,7 +6413,7 @@ yyreduce:
break;
case 291:
-#line 3557 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3550 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* ArgTy = (yyvsp[(2) - (4)].ValueVal).V->getType();
const Type* DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get();
@@ -6445,7 +6438,7 @@ yyreduce:
break;
case 292:
-#line 3578 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3571 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* ArgTy = (yyvsp[(2) - (4)].ValueVal).V->getType();
const Type* DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get();
@@ -6473,7 +6466,7 @@ yyreduce:
break;
case 293:
-#line 3602 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3595 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(4) - (4)].ValueVal).V))
error("Invalid extractelement operands");
@@ -6483,7 +6476,7 @@ yyreduce:
break;
case 294:
-#line 3608 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3601 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V))
error("Invalid insertelement operands");
@@ -6493,7 +6486,7 @@ yyreduce:
break;
case 295:
-#line 3614 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3607 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V))
error("Invalid shufflevector operands");
@@ -6503,7 +6496,7 @@ yyreduce:
break;
case 296:
-#line 3620 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3613 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(2) - (2)].PHIList).P->front().first->getType();
if (!Ty->isFirstClassType())
@@ -6523,7 +6516,7 @@ yyreduce:
break;
case 297:
-#line 3636 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3629 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
// Handle the short call syntax
const PointerType *PFTy;
@@ -6606,11 +6599,9 @@ yyreduce:
}
// Deal with CSRetCC
if ((yyvsp[(2) - (7)].UIntVal) == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- cast<CallInst>((yyval.InstVal).I)->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ cast<CallInst>((yyval.InstVal).I)->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
delete (yyvsp[(3) - (7)].TypeVal).PAT;
delete (yyvsp[(6) - (7)].ValueList);
@@ -6619,34 +6610,34 @@ yyreduce:
break;
case 298:
-#line 3728 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3719 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.InstVal) = (yyvsp[(1) - (1)].InstVal);
;}
break;
case 299:
-#line 3736 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3727 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = (yyvsp[(2) - (2)].ValueList); ;}
break;
case 300:
-#line 3737 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3728 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = new std::vector<ValueInfo>(); ;}
break;
case 301:
-#line 3741 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3732 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 302:
-#line 3742 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3733 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 303:
-#line 3746 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3737 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(2) - (3)].TypeVal).PAT->get();
(yyval.InstVal).S.makeComposite((yyvsp[(2) - (3)].TypeVal).S);
@@ -6656,7 +6647,7 @@ yyreduce:
break;
case 304:
-#line 3752 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3743 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(2) - (6)].TypeVal).PAT->get();
(yyvsp[(5) - (6)].ValIDVal).S.makeUnsigned();
@@ -6667,7 +6658,7 @@ yyreduce:
break;
case 305:
-#line 3759 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3750 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(2) - (3)].TypeVal).PAT->get();
(yyval.InstVal).S.makeComposite((yyvsp[(2) - (3)].TypeVal).S);
@@ -6677,7 +6668,7 @@ yyreduce:
break;
case 306:
-#line 3765 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3756 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[(2) - (6)].TypeVal).PAT->get();
(yyvsp[(5) - (6)].ValIDVal).S.makeUnsigned();
@@ -6688,7 +6679,7 @@ yyreduce:
break;
case 307:
-#line 3772 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3763 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *PTy = (yyvsp[(2) - (2)].ValueVal).V->getType();
if (!isa<PointerType>(PTy))
@@ -6699,7 +6690,7 @@ yyreduce:
break;
case 308:
-#line 3779 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3770 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[(3) - (4)].TypeVal).PAT->get();
(yyvsp[(4) - (4)].ValIDVal).S.copy((yyvsp[(3) - (4)].TypeVal).S);
@@ -6716,7 +6707,7 @@ yyreduce:
break;
case 309:
-#line 3792 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3783 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(6) - (6)].ValIDVal).S.copy((yyvsp[(5) - (6)].TypeVal).S);
const PointerType *PTy = dyn_cast<PointerType>((yyvsp[(5) - (6)].TypeVal).PAT->get());
@@ -6740,7 +6731,7 @@ yyreduce:
break;
case 310:
-#line 3812 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3803 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[(3) - (4)].ValIDVal).S.copy((yyvsp[(2) - (4)].TypeVal).S);
const Type* Ty = (yyvsp[(2) - (4)].TypeVal).PAT->get();
@@ -6761,7 +6752,7 @@ yyreduce:
/* Line 1267 of yacc.c. */
-#line 6765 "UpgradeParser.tab.c"
+#line 6756 "UpgradeParser.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -6975,7 +6966,7 @@ yyreturn:
}
-#line 3830 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 3821 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
int yyerror(const char *ErrorMsg) {
diff --git a/tools/llvm-upgrade/UpgradeParser.h.cvs b/tools/llvm-upgrade/UpgradeParser.h.cvs
index 177836474a..4d6e1f727d 100644
--- a/tools/llvm-upgrade/UpgradeParser.h.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.h.cvs
@@ -346,7 +346,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 1681 "/Volumes/MacOS9/gcc/llvm/tools/llvm-upgrade/UpgradeParser.y"
+#line 1680 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y"
{
llvm::Module *ModuleVal;
llvm::Function *FunctionVal;
diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y
index 0b96c2cfb7..39172c3657 100644
--- a/tools/llvm-upgrade/UpgradeParser.y
+++ b/tools/llvm-upgrade/UpgradeParser.y
@@ -17,7 +17,6 @@
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/ADT/STLExtras.h"
@@ -2056,13 +2055,11 @@ UpRTypes
bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
if (isVarArg) Params.pop_back();
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (lastCallingConv == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- PAL = ParamAttrsList::get(Attrs);
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet);
+ PAL = PAListPtr::get(&PAWI, 1);
}
const FunctionType *FTy =
@@ -2974,11 +2971,9 @@ FunctionHeaderH
// Convert the CSRet calling convention into the corresponding parameter
// attribute.
if ($1 == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- Fn->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ Fn->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
// Add all of the arguments we parsed to the function...
@@ -3296,11 +3291,9 @@ BBTerminatorInst
}
cast<InvokeInst>($$.TI)->setCallingConv(upgradeCallingConv($2));
if ($2 == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- cast<InvokeInst>($$.TI)->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ cast<InvokeInst>($$.TI)->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
delete $3.PAT;
delete $6;
@@ -3715,11 +3708,9 @@ InstVal
}
// Deal with CSRetCC
if ($2 == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- cast<CallInst>($$.I)->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ cast<CallInst>($$.I)->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
delete $3.PAT;
delete $6;
diff --git a/tools/llvm-upgrade/UpgradeParser.y.cvs b/tools/llvm-upgrade/UpgradeParser.y.cvs
index 0b96c2cfb7..39172c3657 100644
--- a/tools/llvm-upgrade/UpgradeParser.y.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.y.cvs
@@ -17,7 +17,6 @@
#include "llvm/InlineAsm.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/ADT/STLExtras.h"
@@ -2056,13 +2055,11 @@ UpRTypes
bool isVarArg = Params.size() && Params.back() == Type::VoidTy;
if (isVarArg) Params.pop_back();
- const ParamAttrsList *PAL = 0;
+ PAListPtr PAL;
if (lastCallingConv == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- PAL = ParamAttrsList::get(Attrs);
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet);
+ PAL = PAListPtr::get(&PAWI, 1);
}
const FunctionType *FTy =
@@ -2974,11 +2971,9 @@ FunctionHeaderH
// Convert the CSRet calling convention into the corresponding parameter
// attribute.
if ($1 == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- Fn->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ Fn->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
// Add all of the arguments we parsed to the function...
@@ -3296,11 +3291,9 @@ BBTerminatorInst
}
cast<InvokeInst>($$.TI)->setCallingConv(upgradeCallingConv($2));
if ($2 == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- cast<InvokeInst>($$.TI)->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ cast<InvokeInst>($$.TI)->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
delete $3.PAT;
delete $6;
@@ -3715,11 +3708,9 @@ InstVal
}
// Deal with CSRetCC
if ($2 == OldCallingConv::CSRet) {
- ParamAttrsVector Attrs;
- ParamAttrsWithIndex PAWI;
- PAWI.index = 1; PAWI.attrs = ParamAttr::StructRet; // first arg
- Attrs.push_back(PAWI);
- cast<CallInst>($$.I)->setParamAttrs(ParamAttrsList::get(Attrs));
+ ParamAttrsWithIndex PAWI =
+ ParamAttrsWithIndex::get(1, ParamAttr::StructRet); // first arg
+ cast<CallInst>($$.I)->setParamAttrs(PAListPtr::get(&PAWI, 1));
}
delete $3.PAT;
delete $6;
diff --git a/tools/llvm2cpp/CppWriter.cpp b/tools/llvm2cpp/CppWriter.cpp
index 45810c36d0..a10fec00fd 100644
--- a/tools/llvm2cpp/CppWriter.cpp
+++ b/tools/llvm2cpp/CppWriter.cpp
@@ -18,7 +18,6 @@
#include "llvm/InlineAsm.h"
#include "llvm/Instruction.h"
#include "llvm/Instructions.h"
-#include "llvm/ParamAttrsList.h"
#include "llvm/Module.h"
#include "llvm/TypeSymbolTable.h"
#include "llvm/ADT/StringExtras.h"
@@ -125,7 +124,7 @@ private:
std::string getCppName(const Value* val);
inline void printCppName(const Value* val);
- void printParamAttrs(const ParamAttrsList* PAL, const std::string &name);
+ void printParamAttrs(const PAListPtr &PAL, const std::string &name);
bool printTypeInternal(const Type* Ty);
inline void printType(const Type* Ty);
void printTypes(const Module* M);
@@ -438,16 +437,16 @@ CppWriter::printCppName(const Value* val) {
}
void
-CppWriter::printParamAttrs(const ParamAttrsList* PAL, const std::string &name) {
- Out << "ParamAttrsList *" << name << "_PAL = 0;";
+CppWriter::printParamAttrs(const PAListPtr &PAL, const std::string &name) {
+ Out << "PAListPtr " << name << "_PAL = 0;";
nl(Out);
- if (PAL) {
+ if (!PAL.isEmpty()) {
Out << '{'; in(); nl(Out);
- Out << "ParamAttrsVector Attrs;"; nl(Out);
+ Out << "SmallVector<ParamAttrsWithIndex, 4> Attrs;"; nl(Out);
Out << "ParamAttrsWithIndex PAWI;"; nl(Out);
- for (unsigned i = 0; i < PAL->size(); ++i) {
- uint16_t index = PAL->getParamIndex(i);
- ParameterAttributes attrs = PAL->getParamAttrs(index);
+ for (unsigned i = 0; i < PAL.getNumSlots(); ++i) {
+ uint16_t index = PAL.getSlot(i).Index;
+ ParameterAttributes attrs = PAL.getSlot(i).Attrs;
Out << "PAWI.index = " << index << "; PAWI.attrs = 0 ";
if (attrs & ParamAttr::SExt)
Out << " | ParamAttr::SExt";
@@ -466,7 +465,7 @@ CppWriter::printParamAttrs(const ParamAttrsList* PAL, const std::string &name) {
Out << "Attrs.push_back(PAWI);";
nl(Out);
}
- Out << name << "_PAL = ParamAttrsList::get(Attrs);";
+ Out << name << "_PAL = PAListPtr::get(Attrs.begin(), Attrs.end());";
nl(Out);
out(); nl(Out);
Out << '}'; nl(Out);
@@ -1748,7 +1747,6 @@ void CppWriter::printProgram(
Out << "#include <llvm/BasicBlock.h>\n";
Out << "#include <llvm/Instructions.h>\n";
Out << "#include <llvm/InlineAsm.h>\n";
- Out << "#include <llvm/ParamAttrsList.h>\n";
Out << "#include <llvm/Support/MathExtras.h>\n";
Out << "#include <llvm/Pass.h>\n";
Out << "#include <llvm/PassManager.h>\n";