r228246 - [analyzer] Don't skip analyzing the functions in preprocessed files.

Anna Zaks ganna at apple.com
Wed Feb 4 17:02:47 PST 2015


Author: zaks
Date: Wed Feb  4 19:02:47 2015
New Revision: 228246

URL: http://llvm.org/viewvc/llvm-project?rev=228246&view=rev
Log:
[analyzer] Don't skip analyzing the functions in preprocessed files.

The change in main file detection ended up disabling the path-sensitive
analysis of functions within preprocessed files.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=228246&r1=228245&r2=228246&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Wed Feb  4 19:02:47 2015
@@ -590,7 +590,7 @@ AnalysisConsumer::getModeForDecl(Decl *D
   // - System headers: don't run any checks.
   SourceManager &SM = Ctx->getSourceManager();
   SourceLocation SL = SM.getExpansionLoc(D->getLocation());
-  if (!Opts->AnalyzeAll && !SM.isInMainFile(SL)) {
+  if (!Opts->AnalyzeAll && !SM.isWrittenInMainFile(SL)) {
     if (SL.isInvalid() || SM.isInSystemHeader(SL))
       return AM_None;
     return Mode & ~AM_Path;





More information about the cfe-commits mailing list