[PATCH] D81413: lld: improve handling of `-platform_version`

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 23:12:28 PDT 2020


gkm requested changes to this revision.
gkm added a comment.
This revision now requires changes to proceed.

I removed the `-parse_version` portions of D80582 <https://reviews.llvm.org/D80582>, since it's better for my diff to be just foundational `Options.td` changes, and because @compnerd's diff is nicer.



================
Comment at: lld/MachO/Driver.cpp:264-265
 
+// -platform_version takes 3 args, which LLVM's option library doesn't support
+// directly.  So this explicitly handles that.
 static void handlePlatformVersion(opt::ArgList::iterator &it,
----------------
LLVM's option library does support multi-part options directly. See the first rev. of D80582.


================
Comment at: lld/MachO/Driver.cpp:296
+    if (config->platform.minimum.tryParse(version))
+      fatal(Twine("malformed minimum version: ") + version);
+  // NOTE: do *NOT* increment here, because the outer loop will increment the
----------------
Use `error()` for option-parsing diagnostics.


================
Comment at: lld/MachO/Driver.cpp:302
+    if (config->platform.sdk.tryParse(version))
+      fatal(Twine("malformed sdk version: ") + version);
 }
----------------
Use `error()` for option-parsing diagnostics.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81413/new/

https://reviews.llvm.org/D81413





More information about the llvm-commits mailing list