diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-03-20 21:11:09 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-03-20 21:11:09 +0000 |
commit | d068aabc484c4009282122c6ef26e66e68cfa044 (patch) | |
tree | 46adb8ba4c47a66267c484830d3e4ca16a4cab96 /lib/Sema/AnalysisBasedWarnings.cpp | |
parent | dbdbaaf34f798fa5cabec273c4b9397b3fd6a98c (diff) |
Don't bother running the analysis for CFG-based warnings if the
declaration is in a system header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r-- | lib/Sema/AnalysisBasedWarnings.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 9eb5b7f5a5..c4ceec0f81 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -15,6 +15,7 @@ #include "Sema.h" #include "AnalysisBasedWarnings.h" +#include "clang/Basic/SourceManager.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/StmtObjC.h" @@ -325,6 +326,12 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(const Decl *D, assert(BlockTy.isNull() || isa<BlockDecl>(D)); + // Do not do any analysis for declarations in system headers if we are + // going to just ignore them. + if (S.getDiagnostics().getSuppressSystemWarnings() && + S.SourceMgr.isInSystemHeader(D->getLocation())) + return; + // We avoid doing analysis-based warnings when there are errors for // two reasons: // (1) The CFGs often can't be constructed (if the body is invalid), so |