summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-07 12:50:00 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-07 12:50:00 +0000
commit3dd81e64aba85e0baba65886456fde4130318d59 (patch)
tree3d281ef03c396fd012306babfbf72695cc3fbe38 /lib/Sema/SemaCodeComplete.cpp
parent6b3182d090d38dc786b147625ae94d454d8c5cb0 (diff)
downloadclang-3dd81e64aba85e0baba65886456fde4130318d59.tar.gz
clang-3dd81e64aba85e0baba65886456fde4130318d59.tar.bz2
clang-3dd81e64aba85e0baba65886456fde4130318d59.tar.xz
[C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 28f85d7a9f..887b93ab58 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -2638,12 +2638,11 @@ 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 (auto 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)) {