[llvm] 2f268b7 - [dsymutil] Disallow --reproducer=Use

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 11:47:01 PDT 2023


Author: Keith Smiley
Date: 2023-04-04T11:46:41-07:00
New Revision: 2f268b74fdcda025e176f7f47676cdd1507f9709

URL: https://github.com/llvm/llvm-project/commit/2f268b74fdcda025e176f7f47676cdd1507f9709
DIFF: https://github.com/llvm/llvm-project/commit/2f268b74fdcda025e176f7f47676cdd1507f9709.diff

LOG: [dsymutil] Disallow --reproducer=Use

This should be implied by --use-reproducer instead as a path is required
for this mode

Differential Revision: https://reviews.llvm.org/D147499

Added: 
    

Modified: 
    llvm/tools/dsymutil/Options.td
    llvm/tools/dsymutil/dsymutil.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/dsymutil/Options.td b/llvm/tools/dsymutil/Options.td
index abcdc91977f7f..654f5982f8bf7 100644
--- a/llvm/tools/dsymutil/Options.td
+++ b/llvm/tools/dsymutil/Options.td
@@ -169,7 +169,7 @@ def: Separate<["-"], "j">,
 
 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 gen_reproducer: F<"gen-reproducer">,
 
 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>;
 

diff  --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 77a55c8ccc1b9..f2dbba2f349d2 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -250,14 +250,12 @@ static Expected<ReproducerMode> getReproducerMode(opt::InputArgList &Args) {
       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 @@ int main(int argc, char **argv) {
 
   auto OptionsOrErr = getOptions(Args);
   if (!OptionsOrErr) {
-    WithColor::error() << toString(OptionsOrErr.takeError());
+    WithColor::error() << toString(OptionsOrErr.takeError()) << '\n';
     return EXIT_FAILURE;
   }
 
@@ -627,7 +625,7 @@ int main(int argc, char **argv) {
   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;
   }
 


        


More information about the llvm-commits mailing list