diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-14 16:38:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-14 16:38:05 +0000 |
commit | ec9fd13c775ae53ecde15da9bb725e66a7e52664 (patch) | |
tree | af59921e4cb903673bd786592979581ce449d270 /clang/lib/Sema/SemaAccess.cpp | |
parent | b009517ad48365a16f45d482deea28a4af40ebaa (diff) | |
download | bcm5719-llvm-ec9fd13c775ae53ecde15da9bb725e66a7e52664.tar.gz bcm5719-llvm-ec9fd13c775ae53ecde15da9bb725e66a7e52664.zip |
De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).
Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.
llvm-svn: 148187
Diffstat (limited to 'clang/lib/Sema/SemaAccess.cpp')
-rw-r--r-- | clang/lib/Sema/SemaAccess.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp index 7991a46ca69..e1322ed8a22 100644 --- a/clang/lib/Sema/SemaAccess.cpp +++ b/clang/lib/Sema/SemaAccess.cpp @@ -1020,15 +1020,15 @@ static void DiagnoseAccessPath(Sema &S, while (D->isOutOfLine()) { NamedDecl *PrevDecl = 0; if (VarDecl *VD = dyn_cast<VarDecl>(D)) - PrevDecl = VD->getPreviousDeclaration(); + PrevDecl = VD->getPreviousDecl(); else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) - PrevDecl = FD->getPreviousDeclaration(); + PrevDecl = FD->getPreviousDecl(); else if (TypedefNameDecl *TND = dyn_cast<TypedefNameDecl>(D)) - PrevDecl = TND->getPreviousDeclaration(); + PrevDecl = TND->getPreviousDecl(); else if (TagDecl *TD = dyn_cast<TagDecl>(D)) { if (isa<RecordDecl>(D) && cast<RecordDecl>(D)->isInjectedClassName()) break; - PrevDecl = TD->getPreviousDeclaration(); + PrevDecl = TD->getPreviousDecl(); } if (!PrevDecl) break; D = PrevDecl; |