diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-30 18:19:18 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-30 18:19:18 +0000 |
commit | 757d243167a52fef433146be11fa1462f6468270 (patch) | |
tree | aa3c16399f7b2fdb1556a69aef681da2ff8d4678 /include | |
parent | a8b974648f9d8bacc43280653dc654c9120d05ca (diff) | |
download | external_llvm-757d243167a52fef433146be11fa1462f6468270.zip external_llvm-757d243167a52fef433146be11fa1462f6468270.tar.gz external_llvm-757d243167a52fef433146be11fa1462f6468270.tar.bz2 |
Add a convenience method for modifying parameter
attributes. While there, I noticed that not all
attribute methods returned a pointer-to-constant,
so I fixed that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ParameterAttributes.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/llvm/ParameterAttributes.h b/include/llvm/ParameterAttributes.h index 79b5d0c..29bbd23 100644 --- a/include/llvm/ParameterAttributes.h +++ b/include/llvm/ParameterAttributes.h @@ -130,13 +130,24 @@ class ParamAttrsList : public FoldingSetNode { : attrs(attrVec), refCount(0) {} public: - /// This method ensures the uniqueness of ParamAttrsList instances. The + /// This method ensures the uniqueness of ParamAttrsList instances. The /// argument is a vector of attribute/index pairs as represented by the - /// ParamAttrsWithIndex structure. The vector is used in the construction of - /// the ParamAttrsList instance. If an instance with identical vector pairs - /// exists, it will be returned instead of creating a new instance. + /// 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 ParamAttrsList *get(const ParamAttrsVector &attrVec); + 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); /// Returns whether each of the specified lists of attributes can be safely /// replaced with the other in a function or a function call. |