[cfe-commits] r99087 - /cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Ted Kremenek
kremenek at apple.com
Sat Mar 20 14:11:09 PDT 2010
Author: kremenek
Date: Sat Mar 20 16:11:09 2010
New Revision: 99087
URL: http://llvm.org/viewvc/llvm-project?rev=99087&view=rev
Log:
Don't bother running the analysis for CFG-based warnings if the
declaration is in a system header.
Modified:
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=99087&r1=99086&r2=99087&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Sat Mar 20 16:11:09 2010
@@ -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 @@
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
More information about the cfe-commits
mailing list