summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-08 22:19:01 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-08 22:19:01 +0000
commitd856df28b2b1a4bf6e806040a39e0729bb6fc94d (patch)
treed80a3eeb38fe59fa7238aa72eb260fd89684f59d /lib/Sema/SemaCodeComplete.cpp
parent026af422181741967695ad04cf3204b92fead58c (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 9c03f39e68..6a0c4c4d04 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/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)) {