================
@@ -125,6 +127,9 @@ buildCompilation(ArrayRef<std::string> ArgStrs, 
DiagnosticsEngine &Diags,
     return std::make_pair(nullptr, nullptr);
   }
 
+  Logger.enable(
+      Compilation->getArgs().getLastArgValue(options::OPT_fdepscan_log_path));
----------------
jansvoboda11 wrote:

Thanks for the info. I think this is fine conceptually, especially now that the 
Clang driver itself embeds the scanner. But for libclang clients, the logger 
needs to be scoped to individual scan queries, not to the entire service. 
Imagine having a project where some targets have `-fdepscan-log-path` and some 
don't. If you scan them in parallel, this will enable logging for the ones 
without the argument mid-scan and the output will be non-sensical.

Another way of being able to extend the scanner configuration without having to 
coordinate with the build system was to provide a way to pass arbitrary string 
to the service options API in libclang and then parse the configuration out of 
that. This gives you the same flexibility but scopes the logger enablement 
correctly.

https://github.com/llvm/llvm-project/pull/211966
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to