diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-08 22:19:01 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-08 22:19:01 +0000 |
commit | b97112e4bd8bf9051822ca2b3d99115c683c2cae (patch) | |
tree | 7f78697a4a91e3ab33ee3396f5da6bcdc9b90fce /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 4203039760356c388745025b99b04ae52c4b5c49 (diff) | |
download | bcm5719-llvm-b97112e4bd8bf9051822ca2b3d99115c683c2cae.tar.gz bcm5719-llvm-b97112e4bd8bf9051822ca2b3d99115c683c2cae.zip |
[C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.
llvm-svn: 203362
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 9c03f39e68d..6a0c4c4d04a 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -2638,12 +2638,13 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx, return Result.TakeString(); } - for (Decl::attr_iterator i = ND->attr_begin(); i != ND->attr_end(); ++i) { - if (AnnotateAttr *Attr = dyn_cast_or_null<AnnotateAttr>(*i)) { - Result.AddAnnotation(Result.getAllocator().CopyString(Attr->getAnnotation())); - } - } - + for (specific_attr_iterator<AnnotateAttr> + i = ND->specific_attr_begin<AnnotateAttr>(), + e = ND->specific_attr_end<AnnotateAttr>(); + i != e; ++i) + Result.AddAnnotation( + Result.getAllocator().CopyString((*i)->getAnnotation())); + AddResultTypeChunk(Ctx, Policy, ND, Result); if (const FunctionDecl *Function = dyn_cast<FunctionDecl>(ND)) { |