================
@@ -437,14 +474,35 @@ Error llvm::timeTraceProfilerWrite(StringRef 
PreferredFileName,
   if (Path.empty()) {
     Path = FallbackFileName == "-" ? "out" : FallbackFileName.str();
     Path += TimeTraceFileExtension;
+    if (TimeTraceProfilerInstance->TimeTraceCompress ==
----------------
chandlerc wrote:

Done — switched to your suggested `if (Path.empty()) ... else if (CompressType 
== DebugCompressionType::None)` structure, which is much clearer!

And yes, not mutating a non-empty `PreferredFileName` when `CompressType == 
Zstd` is WAI: if a caller or user explicitly specifies an output file path 
(e.g., `-ftime-trace=custom.out`), we write to the exact path they requested 
rather than silently renaming it, and only append `.zst` when synthesizing a 
default filename.

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

Reply via email to