diff options
| author | David Blaikie <dblaikie@gmail.com> | 2012-05-01 00:48:43 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2012-05-01 00:48:43 +0000 |
| commit | b15de1eaedfc0344161f00f270c2d495a01459a1 (patch) | |
| tree | 1c34db3a8ab474dd61e5b20c1375a46edbe8dc01 /clang/lib | |
| parent | d7bca7629c94c923fe394fad7de303339bc5bced (diff) | |
| download | bcm5719-llvm-b15de1eaedfc0344161f00f270c2d495a01459a1.tar.gz bcm5719-llvm-b15de1eaedfc0344161f00f270c2d495a01459a1.zip | |
Remove ref/value inconsistency in redecl_iterator.
Similar to r155808 - this mistake has been made in a few iterators.
Based on Chandler Carruth's feedback to r155808 I added an implicit conversion
to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the
dyn_cast (due to template argument deduction causing the conversion not to be
used) - there for future convenience, though. This idiom (op T* for iterators)
seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I
fix up the other iterators here.
llvm-svn: 155869
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/ARCMigrate/TransGCAttrs.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/IdentifierResolver.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/ARCMigrate/TransGCAttrs.cpp b/clang/lib/ARCMigrate/TransGCAttrs.cpp index a206683bc3d..007b8f2f88c 100644 --- a/clang/lib/ARCMigrate/TransGCAttrs.cpp +++ b/clang/lib/ARCMigrate/TransGCAttrs.cpp @@ -166,7 +166,7 @@ public: for (Decl::redecl_iterator I = D->redecls_begin(), E = D->redecls_end(); I != E; ++I) - if (!isInMainFile((*I)->getLocation())) + if (!isInMainFile(I->getLocation())) return false; return true; diff --git a/clang/lib/Sema/IdentifierResolver.cpp b/clang/lib/Sema/IdentifierResolver.cpp index 4d62cab1676..4c6898cb7a5 100644 --- a/clang/lib/Sema/IdentifierResolver.cpp +++ b/clang/lib/Sema/IdentifierResolver.cpp @@ -304,7 +304,7 @@ static DeclMatchKind compareDeclarations(NamedDecl *Existing, NamedDecl *New) { for (Decl::redecl_iterator RD = New->redecls_begin(), RDEnd = New->redecls_end(); RD != RDEnd; ++RD) { - if (*RD == Existing) + if (RD == Existing) return DMK_Replace; if (RD->isCanonicalDecl()) diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 9f5138ba4a4..3a6e2903260 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -1069,7 +1069,7 @@ static NamedDecl *getVisibleDecl(NamedDecl *D) { for (Decl::redecl_iterator RD = D->redecls_begin(), RDEnd = D->redecls_end(); RD != RDEnd; ++RD) { - if (NamedDecl *ND = dyn_cast<NamedDecl>(*RD)) { + if (NamedDecl *ND = dyn_cast<NamedDecl>(&*RD)) { if (LookupResult::isVisible(ND)) return ND; } |

