From 811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Endre=20F=C3=BCl=C3=B6p?= Date: Mon, 27 Apr 2020 10:13:34 +0200 Subject: [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 --- clang/lib/Frontend/CompilerInvocation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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" -- cgit v1.1