[llvm] [llvm-remarkutil] Auto-detect serializer format based on file extension (PR #160545)
Jon Roelofs via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 09:09:12 PDT 2025
================
@@ -46,12 +46,8 @@ static Error tryFilter() {
return MaybeParser.takeError();
auto &Parser = **MaybeParser;
- Format SerializerFormat = OutputFormat;
- if (SerializerFormat == Format::Auto) {
- SerializerFormat = Parser.ParserFormat;
- if (OutputFileName.empty() || OutputFileName == "-")
- SerializerFormat = Format::YAML;
- }
+ Format SerializerFormat =
+ getSerializerFormat(OutputFileName, OutputFormat, Parser.ParserFormat);
----------------
jroelofs wrote:
WDYT about making the default be bitstream (unless the input was yaml), and then adding a warning/error message here if the output is a tty, kind of like `opt` does when you try to write bitcode to the terminal? I think our "north star" should be to converge on "bitstream for everything except LIT tests".
https://github.com/llvm/llvm-project/pull/160545
More information about the llvm-commits
mailing list