aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorEndre Fülöp <endre.fulop@sigmatechnology.se>2020-04-27 10:13:34 +0200
committerEndre Fülöp <endre.fulop@sigmatechnology.se>2020-04-27 11:20:35 +0200
commit811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf (patch)
treeec971b7cf202d4c4e19adcb92f8ecafc40b822d6 /clang/lib/Frontend/CompilerInvocation.cpp
parent7a076418dd31dc1ed1d5e88357d9c3e2918c7973 (diff)
downloadllvm-811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf.zip
llvm-811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf.tar.gz
llvm-811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf.tar.bz2
[analyzer] On-demand parsing capability for CTU
Summary: Add an option to enable on-demand parsing of needed ASTs during CTU analysis. Two options are introduced. CTUOnDemandParsing enables the feature, and CTUOnDemandParsingDatabase specifies the path to a compilation database, which has all the necessary information to generate the ASTs. Reviewers: martong, balazske, Szelethus, xazax.hun Subscribers: ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75665
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index b327fa9..c640574 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -511,6 +511,12 @@ static void parseAnalyzerConfigs(AnalyzerOptions &AnOpts,
Diags->Report(diag::err_analyzer_config_invalid_input) << "ctu-dir"
<< "a filename";
+ if (AnOpts.CTUOnDemandParsing &&
+ !llvm::sys::fs::exists(AnOpts.CTUOnDemandParsingDatabase))
+ Diags->Report(diag::err_analyzer_config_invalid_input)
+ << "ctu-on-demand-parsing-database"
+ << "a filename";
+
if (!AnOpts.ModelPath.empty() &&
!llvm::sys::fs::is_directory(AnOpts.ModelPath))
Diags->Report(diag::err_analyzer_config_invalid_input) << "model-path"