================
@@ -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));
----------------
qiongsiwu wrote:
Since the logger is in the service scope, once it is enabled, it is enabled for
all targets. Enabling this for a single target can leak the enablement into
other targets. The other target will never call enable with an empty path.
This can be fixed just by calling enable all the time regardless of the
presence of the flag. When the flag is not in effect, we can always enable with
an empty path. This turns the enablement inconsistency into the problem of
enable it in competing ways. Then we can issue warnings. I think error out is
probably too heavy. We can insert a warning into the log and say the targets
are not consistently enabling the logging to indicate something is off so the
user is less surprised.
Does this sound reasonable?
https://github.com/llvm/llvm-project/pull/211966
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits