diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-03 23:46:09 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-05-03 23:46:09 +0000 |
commit | c95d413660756c474bc8f97e5b32edc7ddff3850 (patch) | |
tree | c7869045d8d9c366f18f60bf94e5722bc5f3c4bd /include | |
parent | 79bef7aea4419b75e2cca0f121c6e1a4232bb03c (diff) |
ArrayRef'ize MultiLevelTemplateArgumentList::ArgList. Patch by Faisal Vali!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Sema/Template.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/clang/Sema/Template.h b/include/clang/Sema/Template.h index 4edfa0a45d..6e054c463a 100644 --- a/include/clang/Sema/Template.h +++ b/include/clang/Sema/Template.h @@ -40,10 +40,9 @@ namespace clang { /// list will contain a template argument list (int) at depth 0 and a /// template argument list (17) at depth 1. class MultiLevelTemplateArgumentList { - public: - typedef std::pair<const TemplateArgument *, unsigned> ArgList; - - private: + /// \brief The template argument list at a certain template depth + typedef ArrayRef<TemplateArgument> ArgList; + /// \brief The template argument lists, stored from the innermost template /// argument list (first) to the outermost template argument list (last). SmallVector<ArgList, 4> TemplateArgumentLists; @@ -65,8 +64,8 @@ namespace clang { /// \brief Retrieve the template argument at a given depth and index. const TemplateArgument &operator()(unsigned Depth, unsigned Index) const { assert(Depth < TemplateArgumentLists.size()); - assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].second); - return TemplateArgumentLists[getNumLevels() - Depth - 1].first[Index]; + assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].size()); + return TemplateArgumentLists[getNumLevels() - Depth - 1][Index]; } /// \brief Determine whether there is a non-NULL template argument at the @@ -76,7 +75,7 @@ namespace clang { bool hasTemplateArgument(unsigned Depth, unsigned Index) const { assert(Depth < TemplateArgumentLists.size()); - if (Index >= TemplateArgumentLists[getNumLevels() - Depth - 1].second) + if (Index >= TemplateArgumentLists[getNumLevels() - Depth - 1].size()) return false; return !(*this)(Depth, Index).isNull(); @@ -86,9 +85,9 @@ namespace clang { void setArgument(unsigned Depth, unsigned Index, TemplateArgument Arg) { assert(Depth < TemplateArgumentLists.size()); - assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].second); + assert(Index < TemplateArgumentLists[getNumLevels() - Depth - 1].size()); const_cast<TemplateArgument&>( - TemplateArgumentLists[getNumLevels() - Depth - 1].first[Index]) + TemplateArgumentLists[getNumLevels() - Depth - 1][Index]) = Arg; } |