================
@@ -652,6 +659,18 @@ int clangTidyMain(int argc, const char **argv) {
FileName = PathList.front();
const SmallString<256> FilePath = makeAbsolute(FileName);
+
+ std::unique_ptr<llvm::raw_fd_ostream> SarifOS;
+ if (!SarifExport.empty()) {
+ std::error_code EC;
+ SarifOS = std::make_unique<llvm::raw_fd_ostream>(SarifExport, EC,
----------------
zeyi2 wrote:
Could we defer opening the SARIF file until after the informational/validation
paths have returned?
I tried `-list-checks -checks='-*,google-explicit-constructor'
-sarif-export=result.sarif` with an existing `result.sarif`. The file is
truncated to zero bytes without a SARIF document being written.
Since opening this stream truncates the destination, IMO it should happen only
when we are actually going to export diagnostics.
https://github.com/llvm/llvm-project/pull/219182
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits