diff options
author | Manuel Klimek <klimek@google.com> | 2012-12-12 13:26:54 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2012-12-12 13:26:54 +0000 |
commit | 5704e4e91cd4de216ef18e1b1209119ec4bd9266 (patch) | |
tree | 7f30a3d90dc3bc580dfe8af8e0c4b6af1814351f /clang/lib/Sema/SemaDecl.cpp | |
parent | 7d95323047c42edfb35b228e40fec5532bc03731 (diff) | |
download | bcm5719-llvm-5704e4e91cd4de216ef18e1b1209119ec4bd9266.tar.gz bcm5719-llvm-5704e4e91cd4de216ef18e1b1209119ec4bd9266.zip |
Speeds up parsing of global declarations in cases where the warning
is switched of by about 0.8% (tested with int i<N>).
Additionally, this puts computing the diagnostic class into the hot
path more when parsing, in preparation for upcoming optimizations
in this area.
llvm-svn: 169976
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index aa0b41bc7a6..10e871a630d 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -7233,7 +7233,10 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) { } if (var->isThisDeclarationADefinition() && - var->getLinkage() == ExternalLinkage) { + var->getLinkage() == ExternalLinkage && + getDiagnostics().getDiagnosticLevel( + diag::warn_missing_variable_declarations, + var->getLocation())) { // Find a previous declaration that's not a definition. VarDecl *prev = var->getPreviousDecl(); while (prev && prev->isThisDeclarationADefinition()) |