]> granicus.if.org Git - clang/commit
[analyzer] Enable analysis of WebKit "unified sources".
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 25 Apr 2018 21:51:26 +0000 (21:51 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 25 Apr 2018 21:51:26 +0000 (21:51 +0000)
commit948124636bd04f1a994eb419b5ede526b0d9de82
tree0bd9e275ab3eb956ab4b50e7616ef9c0212d5442
parent43c40d09e9e080ee67490463dab4fb4f65f9a90c
[analyzer] Enable analysis of WebKit "unified sources".

Normally the analyzer begins path-sensitive analysis from functions within
the main file, even though the path is allowed to go through any functions
within the translation unit.

When a recent version of WebKit is compiled, the "unified sources" technique
is used, that assumes #including multiple code files into a single main file.
Such file would have no functions defined in it, so the analyzer wouldn't be
able to find any entry points for path-sensitive analysis.

This patch pattern-matches unified file names that are similar to those
used by WebKit and allows the analyzer to find entry points in the included
code files. A more aggressive/generic approach is being planned as well.

Differential Revision: https://reviews.llvm.org/D45839

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330876 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
lib/StaticAnalyzer/Core/CallEvent.cpp
lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
lib/StaticAnalyzer/Core/PathDiagnostic.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
test/Analysis/unified-sources/UnifiedSource-1.cpp [new file with mode: 0644]
test/Analysis/unified-sources/container.h [new file with mode: 0644]
test/Analysis/unified-sources/source1.cpp [new file with mode: 0644]
test/Analysis/unified-sources/source2.cpp [new file with mode: 0644]