[PATCH] D43527: Handle --version before handling --mllvm.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 13:34:50 PST 2018


ruiu created this revision.
ruiu added a reviewer: sbc100.
Herald added a subscriber: aheejin.

Because there's no point to handle --mllvm before --version.


https://reviews.llvm.org/D43527

Files:
  lld/wasm/Driver.cpp


Index: lld/wasm/Driver.cpp
===================================================================
--- lld/wasm/Driver.cpp
+++ lld/wasm/Driver.cpp
@@ -226,6 +226,12 @@
     return;
   }
 
+  // Handle --version
+  if (Args.hasArg(OPT_version) || Args.hasArg(OPT_v)) {
+    outs() << getLLDVersion() << "\n";
+    return;
+  }
+
   // Parse and evaluate -mllvm options.
   std::vector<const char *> V;
   V.push_back("wasm-ld (LLVM option parsing)");
@@ -235,11 +241,6 @@
 
   errorHandler().ErrorLimit = args::getInteger(Args, OPT_error_limit, 20);
 
-  if (Args.hasArg(OPT_version) || Args.hasArg(OPT_v)) {
-    outs() << getLLDVersion() << "\n";
-    return;
-  }
-
   Config->AllowUndefined = Args.hasArg(OPT_allow_undefined);
   Config->CheckSignatures =
       Args.hasFlag(OPT_check_signatures, OPT_no_check_signatures, false);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43527.135134.patch
Type: text/x-patch
Size: 830 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180220/032c9efe/attachment.bin>


More information about the llvm-commits mailing list