summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-07 13:13:38 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-07 13:13:38 +0000
commit7dce1a840cedee83c5f62dcb93b9a65b56823213 (patch)
tree115c345ebe81b68e3b6ce11c269b397720d5d187 /clang/lib/Sema/SemaDecl.cpp
parent690829696ca4c73a8cb1688761e9b1152a7d2254 (diff)
downloadbcm5719-llvm-7dce1a840cedee83c5f62dcb93b9a65b56823213.tar.gz
bcm5719-llvm-7dce1a840cedee83c5f62dcb93b9a65b56823213.zip
Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
llvm-svn: 203237
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index f0a24301d53..9840d1eca11 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1791,16 +1791,16 @@ void Sema::MergeTypedefNameDecl(TypedefNameDecl *New, LookupResult &OldDecls) {
static bool DeclHasAttr(const Decl *D, const Attr *A) {
const OwnershipAttr *OA = dyn_cast<OwnershipAttr>(A);
const AnnotateAttr *Ann = dyn_cast<AnnotateAttr>(A);
- for (auto i : D->attrs())
- if (i->getKind() == A->getKind()) {
+ for (Decl::attr_iterator i = D->attr_begin(), e = D->attr_end(); i != e; ++i)
+ if ((*i)->getKind() == A->getKind()) {
if (Ann) {
- if (Ann->getAnnotation() == cast<AnnotateAttr>(i)->getAnnotation())
+ if (Ann->getAnnotation() == cast<AnnotateAttr>(*i)->getAnnotation())
return true;
continue;
}
// FIXME: Don't hardcode this check
- if (OA && isa<OwnershipAttr>(i))
- return OA->getOwnKind() == cast<OwnershipAttr>(i)->getOwnKind();
+ if (OA && isa<OwnershipAttr>(*i))
+ return OA->getOwnKind() == cast<OwnershipAttr>(*i)->getOwnKind();
return true;
}
@@ -1997,9 +1997,12 @@ static const Decl *getDefinition(const Decl *D) {
}
static bool hasAttribute(const Decl *D, attr::Kind Kind) {
- for (auto Attribute : D->attrs())
+ for (Decl::attr_iterator I = D->attr_begin(), E = D->attr_end();
+ I != E; ++I) {
+ Attr *Attribute = *I;
if (Attribute->getKind() == Kind)
return true;
+ }
return false;
}
OpenPOWER on IntegriCloud