[PATCH] D147499: [dsymutil] Improve error with invalid reproducer args
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 4 10:30:12 PDT 2023
keith updated this revision to Diff 510851.
keith added a comment.
Disallow Use reproducer mode
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147499/new/
https://reviews.llvm.org/D147499
Files:
llvm/tools/dsymutil/Options.td
llvm/tools/dsymutil/dsymutil.cpp
Index: llvm/tools/dsymutil/dsymutil.cpp
===================================================================
--- llvm/tools/dsymutil/dsymutil.cpp
+++ llvm/tools/dsymutil/dsymutil.cpp
@@ -250,14 +250,12 @@
return ReproducerMode::GenerateOnExit;
if (S == "GenerateOnCrash")
return ReproducerMode::GenerateOnCrash;
- if (S == "Use")
- return ReproducerMode::Use;
if (S == "Off")
return ReproducerMode::Off;
return make_error<StringError>(
"invalid reproducer mode: '" + S +
"'. Supported values are 'GenerateOnExit', 'GenerateOnCrash', "
- "'Use', 'Off'.",
+ "'Off'.",
inconvertibleErrorCode());
}
return ReproducerMode::GenerateOnCrash;
@@ -613,7 +611,7 @@
auto OptionsOrErr = getOptions(Args);
if (!OptionsOrErr) {
- WithColor::error() << toString(OptionsOrErr.takeError());
+ WithColor::error() << toString(OptionsOrErr.takeError()) << '\n';
return EXIT_FAILURE;
}
@@ -627,7 +625,7 @@
auto Repro = Reproducer::createReproducer(Options.ReproMode,
Options.ReproducerPath, argc, argv);
if (!Repro) {
- WithColor::error() << toString(Repro.takeError());
+ WithColor::error() << toString(Repro.takeError()) << '\n';
return EXIT_FAILURE;
}
Index: llvm/tools/dsymutil/Options.td
===================================================================
--- llvm/tools/dsymutil/Options.td
+++ llvm/tools/dsymutil/Options.td
@@ -169,7 +169,7 @@
def reproducer: Separate<["--", "-"], "reproducer">,
MetaVarName<"<mode>">,
- HelpText<"Specify the reproducer generation mode. Valid options are 'GenerateOnExit', 'GenerateOnCrash', 'Use', 'Off'.">,
+ HelpText<"Specify the reproducer generation mode. Valid options are 'GenerateOnExit', 'GenerateOnCrash', 'Off'.">,
Group<grp_general>;
def: Joined<["--", "-"], "reproducer=">, Alias<reproducer>;
@@ -179,7 +179,7 @@
def use_reproducer: Separate<["--", "-"], "use-reproducer">,
MetaVarName<"<path>">,
- HelpText<"Use the object files from the given reproducer path. Alias for --reproducer=Use.">,
+ HelpText<"Use the object files from the given reproducer path.">,
Group<grp_general>;
def: Joined<["--", "-"], "use-reproducer=">, Alias<use_reproducer>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147499.510851.patch
Type: text/x-patch
Size: 2304 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230404/034d514e/attachment.bin>
More information about the llvm-commits
mailing list