[llvm-commits] [llvm] r48289 - in /llvm/trunk: include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/Bitcode/Writer/ lib/Target/CBackend/ lib/Target/X86/ lib/Transforms/IPO/ lib/Transforms/Scalar/ lib/VMCore/ tools/llvm-upgrade/ tools/llvm2cpp/

Chris Lattner sabre at nondot.org
Wed Mar 12 10:45:30 PDT 2008


Author: lattner
Date: Wed Mar 12 12:45:29 2008
New Revision: 48289

URL: http://llvm.org/viewvc/llvm-project?rev=48289&view=rev
Log:
Reimplement the parameter attributes support, phase #1. hilights:

1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.


Removed:
    llvm/trunk/include/llvm/ParamAttrsList.h
Modified:
    llvm/trunk/include/llvm/Function.h
    llvm/trunk/include/llvm/Instructions.h
    llvm/trunk/include/llvm/Intrinsics.h
    llvm/trunk/include/llvm/ParameterAttributes.h
    llvm/trunk/include/llvm/Support/CallSite.h
    llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs
    llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs
    llvm/trunk/lib/AsmParser/llvmAsmParser.y
    llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
    llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp
    llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h
    llvm/trunk/lib/Target/CBackend/CBackend.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
    llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
    llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
    llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
    llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
    llvm/trunk/lib/VMCore/AsmWriter.cpp
    llvm/trunk/lib/VMCore/AutoUpgrade.cpp
    llvm/trunk/lib/VMCore/Function.cpp
    llvm/trunk/lib/VMCore/Instructions.cpp
    llvm/trunk/lib/VMCore/ParameterAttributes.cpp
    llvm/trunk/lib/VMCore/Verifier.cpp
    llvm/trunk/tools/llvm-upgrade/UpgradeParser.cpp.cvs
    llvm/trunk/tools/llvm-upgrade/UpgradeParser.h.cvs
    llvm/trunk/tools/llvm-upgrade/UpgradeParser.y
    llvm/trunk/tools/llvm-upgrade/UpgradeParser.y.cvs
    llvm/trunk/tools/llvm2cpp/CppWriter.cpp

Modified: llvm/trunk/include/llvm/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Function.h (original)
+++ llvm/trunk/include/llvm/Function.h Wed Mar 12 12:45:29 2008
@@ -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 @@
   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 @@
     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.

Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Wed Mar 12 12:45:29 2008
@@ -30,7 +30,6 @@
 class VectorType;
 class ConstantRange;
 class APInt;
-class ParamAttrsList;
 
 //===----------------------------------------------------------------------===//
 //                             AllocationInst Class
@@ -851,7 +850,7 @@
 ///
 
 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 @@
     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; }
-
-  /// Sets the parameter attributes for this CallInst. To construct a 
-  /// ParamAttrsList, see ParameterAttributes.h
-  /// @brief Set the parameter attributes.
-  void setParamAttrs(const ParamAttrsList *attrs);
+  /// getParamAttrs - Return the PAListPtr for the parameter attributes of this
+  /// call.
+  const PAListPtr &getParamAttrs() const { return ParamAttrs; }
+
+  /// 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 @@
 /// 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 @@
     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; }
-
-  /// Sets the parameter attributes for this InvokeInst. To construct a 
-  /// ParamAttrsList, see ParameterAttributes.h
-  /// @brief Set the parameter attributes.
-  void setParamAttrs(const ParamAttrsList *attrs);
+  /// getParamAttrs - Return the parameter attribute list for this invoke.
+  ///
+  const PAListPtr &getParamAttrs() const { return ParamAttrs; }
+
+  /// 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;

Modified: llvm/trunk/include/llvm/Intrinsics.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Intrinsics.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Intrinsics.h (original)
+++ llvm/trunk/include/llvm/Intrinsics.h Wed Mar 12 12:45:29 2008
@@ -22,7 +22,7 @@
 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 @@
 
   /// 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.

Removed: llvm/trunk/include/llvm/ParamAttrsList.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ParamAttrsList.h?rev=48288&view=auto

==============================================================================
--- llvm/trunk/include/llvm/ParamAttrsList.h (original)
+++ llvm/trunk/include/llvm/ParamAttrsList.h (removed)
@@ -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

Modified: llvm/trunk/include/llvm/ParameterAttributes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ParameterAttributes.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ParameterAttributes.h (original)
+++ llvm/trunk/include/llvm/ParameterAttributes.h Wed Mar 12 12:45:29 2008
@@ -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 @@
 /// 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 @@
 };
 
 /// @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
 

Modified: llvm/trunk/include/llvm/Support/CallSite.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/CallSite.h (original)
+++ llvm/trunk/include/llvm/Support/CallSite.h Wed Mar 12 12:45:29 2008
@@ -28,7 +28,6 @@
 
 class CallInst;
 class InvokeInst;
-class ParamAttrsList;
 
 class CallSite {
   Instruction *I;
@@ -62,8 +61,8 @@
 
   /// 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;

Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Wed Mar 12 12:45:29 2008
@@ -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 @@
 
 #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 @@
   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 @@
 
 
 /* Line 216 of yacc.c.  */
-#line 1403 "llvmAsmParser.tab.c"
+#line 1402 "llvmAsmParser.tab.c"
 
 #ifdef short
 # undef short
@@ -1449,7 +1448,7 @@
 #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 @@
 /* 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 @@
    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 @@
   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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
       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 @@
     // 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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
           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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     }
 
     // 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 @@
           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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
 
 /* 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 @@
 }
 
 
-#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

Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Wed Mar 12 12:45:29 2008
@@ -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 @@
   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 */

Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
       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 @@
     // 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 @@
     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 @@
           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 @@
     }
 
     // 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 @@
           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());

Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original)
+++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
       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 @@
     // 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 @@
     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 @@
           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 @@
     }
 
     // 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 @@
           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());

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
   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 @@
   
   SmallVector<uint64_t, 64> Record;
   
-  ParamAttrsVector Attrs;
+  SmallVector<ParamAttrsWithIndex, 8> Attrs;
   
   // Read all the records.
   while (1) {
@@ -242,13 +237,8 @@
         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 @@
       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 @@
     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 @@
       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;

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h Wed Mar 12 12:45:29 2008
@@ -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 @@
   /// 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 @@
     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

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
 // 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);

Modified: llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.cpp Wed Mar 12 12:45:29 2008
@@ -245,10 +245,10 @@
   }
 }
 
-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);

Modified: llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h (original)
+++ llvm/trunk/lib/Bitcode/Writer/ValueEnumerator.h Wed Mar 12 12:45:29 2008
@@ -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 BasicBlock;
 class Function;
 class Module;
-class ParamAttrsList;
+class PAListPtr;
 class TypeSymbolTable;
 class ValueSymbolTable;
 
@@ -44,9 +45,9 @@
   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 @@
     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 @@
   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 @@
   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);

Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
                             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 @@
 /// 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 @@
     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 @@
   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 @@
 //
 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 @@
     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 @@
     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 @@
         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 @@
   
   // 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 @@
         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 @@
     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 @@
     
   // 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 @@
 
   // 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 @@
         (*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.

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
 
       // 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;
 

Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
   // 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 @@
       ++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 @@
 
   // 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 @@
   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 @@
       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 @@
     // 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 @@
       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();
     }

Modified: llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/DeadArgumentElimination.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
   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 @@
        ++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 @@
   // 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 @@
     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 @@
          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 @@
     // 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();
     }

Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Wed Mar 12 12:45:29 2008
@@ -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 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 @@
         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.

Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
       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) {

Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
           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 @@
   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 @@
   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 @@
   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 @@
   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 @@
     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();
     }

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
         !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 @@
     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 @@
 
   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 @@
   // 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 @@
     }
 
     // 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 @@
         }
 
         // 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 @@
   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 @@
   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 @@
   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 @@
     // 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 @@
       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 @@
 
           // 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 @@
         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)) {

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
   }
 
   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 @@
          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 @@
       // 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 @@
     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 @@
 
   // 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 @@
     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 @@
     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 @@
     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 @@
 // 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
 //===----------------------------------------------------------------------===//

Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
   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 @@
   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 @@
     //  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(

Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
 
 /// @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 @@
 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 @@
   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 @@
     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 @@
   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 @@
   // 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, 

Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
   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 @@
 
 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 *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 *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) {
-  ParamAttrs = 0;
   NumOperands = 1;
   Use *OL = OperandList = new Use[1];
   OL[0].init(Func, this);
@@ -360,8 +353,7 @@
 
 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 @@
     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 @@
 }
 
 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 @@
 
 /// @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 @@
 
 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 @@
 
 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 @@
   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 @@
 }
 
 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 @@
 }
 
 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);
 }
 

Modified: llvm/trunk/lib/VMCore/ParameterAttributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ParameterAttributes.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/ParameterAttributes.cpp (original)
+++ llvm/trunk/lib/VMCore/ParameterAttributes.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
   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;
+}
+
+//===----------------------------------------------------------------------===//
+// 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));
+  }
+};
 }
 
-const ParamAttrsList *
-ParamAttrsList::get(const ParamAttrsVector &attrVec) {
-  // If there are no attributes then return a null ParamAttrsList pointer.
-  if (attrVec.empty())
-    return 0;
+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);
-  }
-
-  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(ParamAttributeListImpl *LI) : PAList(LI) {
+  if (LI) LI->AddRef();
+}
 
-  for (; oldI < oldE; ++oldI)
-    newVec.push_back(oldVec[oldI]);
-  for (; modI < modE; ++modI)
-    if (modVec[modI].attrs != ParamAttr::None)
-      newVec.push_back(modVec[modI]);
-
-  return get(newVec);
+PAListPtr::PAListPtr(const PAListPtr &P) : PAList(P.PAList) {
+  if (PAList) PAList->AddRef();  
 }
 
-const ParamAttrsList *
-ParamAttrsList::includeAttrs(const ParamAttrsList *PAL,
-                             uint16_t idx, ParameterAttributes attrs) {
-  ParameterAttributes OldAttrs = PAL ? PAL->getParamAttrs(idx) : 
-                                       ParamAttr::None;
+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;
+}
+
+/// 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;
+}
+
+/// 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;
+}
+
+
+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);
-}
-
-ParameterAttributes ParamAttr::typeIncompatible (const Type *Ty) {
-  ParameterAttributes Incompatible = None;
+    return *this;
 
-  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;
+  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());
+}
+
+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";
 }

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
                                   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 @@
 
   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 @@
        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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
             "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);
     }
 

Modified: llvm/trunk/tools/llvm-upgrade/UpgradeParser.cpp.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-upgrade/UpgradeParser.cpp.cvs?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-upgrade/UpgradeParser.cpp.cvs (original)
+++ llvm/trunk/tools/llvm-upgrade/UpgradeParser.cpp.cvs Wed Mar 12 12:45:29 2008
@@ -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 @@
 
 #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 @@
   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 @@
 
 
 /* Line 216 of yacc.c.  */
-#line 2128 "UpgradeParser.tab.c"
+#line 2127 "UpgradeParser.tab.c"
 
 #ifdef short
 # undef short
@@ -2548,38 +2547,38 @@
 /* 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 @@
   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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     // 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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     }
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     }
     // 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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
 
 
 /* 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 @@
 }
 
 
-#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) {

Modified: llvm/trunk/tools/llvm-upgrade/UpgradeParser.h.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-upgrade/UpgradeParser.h.cvs?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-upgrade/UpgradeParser.h.cvs (original)
+++ llvm/trunk/tools/llvm-upgrade/UpgradeParser.h.cvs Wed Mar 12 12:45:29 2008
@@ -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;

Modified: llvm/trunk/tools/llvm-upgrade/UpgradeParser.y
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-upgrade/UpgradeParser.y?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-upgrade/UpgradeParser.y (original)
+++ llvm/trunk/tools/llvm-upgrade/UpgradeParser.y Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
     // 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 @@
     }
     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 @@
     }
     // 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;

Modified: llvm/trunk/tools/llvm-upgrade/UpgradeParser.y.cvs
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-upgrade/UpgradeParser.y.cvs?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-upgrade/UpgradeParser.y.cvs (original)
+++ llvm/trunk/tools/llvm-upgrade/UpgradeParser.y.cvs Wed Mar 12 12:45:29 2008
@@ -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 @@
     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 @@
     // 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 @@
     }
     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 @@
     }
     // 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;

Modified: llvm/trunk/tools/llvm2cpp/CppWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm2cpp/CppWriter.cpp?rev=48289&r1=48288&r2=48289&view=diff

==============================================================================
--- llvm/trunk/tools/llvm2cpp/CppWriter.cpp (original)
+++ llvm/trunk/tools/llvm2cpp/CppWriter.cpp Wed Mar 12 12:45:29 2008
@@ -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 @@
   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 @@
 }
 
 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 @@
       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 @@
   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";





More information about the llvm-commits mailing list