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/SemaDeclCXX.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/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 0b89e1b2a5b..918f97245e6 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -420,8 +420,8 @@ bool Sema::MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old) { // Look for the function declaration where the default argument was // actually written, which may be a declaration prior to Old. - for (FunctionDecl *Older = Old->getPreviousDeclaration(); - Older; Older = Older->getPreviousDeclaration()) { + for (FunctionDecl *Older = Old->getPreviousDecl(); + Older; Older = Older->getPreviousDecl()) { if (!Older->getParamDecl(p)->hasDefaultArg()) break; @@ -8977,7 +8977,7 @@ void Sema::AddCXXDirectInitializerToDecl(Decl *RealDecl, // If this is a redeclaration, check that the type we just deduced matches // the previously declared type. - if (VarDecl *Old = VDecl->getPreviousDeclaration()) + if (VarDecl *Old = VDecl->getPreviousDecl()) MergeVarDeclTypes(VDecl, Old); } @@ -10310,7 +10310,7 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) { Diag(DelLoc, diag::err_deleted_non_function); return; } - if (const FunctionDecl *Prev = Fn->getPreviousDeclaration()) { + if (const FunctionDecl *Prev = Fn->getPreviousDecl()) { Diag(DelLoc, diag::err_deleted_decl_not_first); Diag(Prev->getLocation(), diag::note_previous_declaration); // If the declaration wasn't the first, we delete the function anyway for |

