summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r--clang/tools/libclang/CIndex.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index d98acb197fa..6646200934e 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -1671,9 +1671,8 @@ bool CursorVisitor::VisitCXXRecordDecl(CXXRecordDecl *D) {
}
bool CursorVisitor::VisitAttributes(Decl *D) {
- for (AttrVec::const_iterator i = D->attr_begin(), e = D->attr_end();
- i != e; ++i)
- if (Visit(MakeCXCursor(*i, D, TU)))
+ for (const auto *I : D->attrs())
+ if (Visit(MakeCXCursor(I, D, TU)))
return true;
return false;
@@ -6026,9 +6025,8 @@ static int getCursorPlatformAvailabilityForDecl(const Decl *D,
int availability_size) {
bool HadAvailAttr = false;
int N = 0;
- for (Decl::attr_iterator A = D->attr_begin(), AEnd = D->attr_end(); A != AEnd;
- ++A) {
- if (DeprecatedAttr *Deprecated = dyn_cast<DeprecatedAttr>(*A)) {
+ for (auto A : D->attrs()) {
+ if (DeprecatedAttr *Deprecated = dyn_cast<DeprecatedAttr>(A)) {
HadAvailAttr = true;
if (always_deprecated)
*always_deprecated = 1;
@@ -6037,7 +6035,7 @@ static int getCursorPlatformAvailabilityForDecl(const Decl *D,
continue;
}
- if (UnavailableAttr *Unavailable = dyn_cast<UnavailableAttr>(*A)) {
+ if (UnavailableAttr *Unavailable = dyn_cast<UnavailableAttr>(A)) {
HadAvailAttr = true;
if (always_unavailable)
*always_unavailable = 1;
@@ -6047,7 +6045,7 @@ static int getCursorPlatformAvailabilityForDecl(const Decl *D,
continue;
}
- if (AvailabilityAttr *Avail = dyn_cast<AvailabilityAttr>(*A)) {
+ if (AvailabilityAttr *Avail = dyn_cast<AvailabilityAttr>(A)) {
HadAvailAttr = true;
if (N < availability_size) {
availability[N].Platform
OpenPOWER on IntegriCloud