[PATCH] D40725: Wasm entrypoint changes #3 (add --no-entry argument to LLD)

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 06:42:00 PST 2017


ncw added inline comments.


================
Comment at: wasm/Driver.cpp:224-227
+  StringRef Entry(Arg->getValue());
+  if (Entry.empty())
+    error("empty string invalid for entry point");
+  return Entry;
----------------
ruiu wrote:
> Let's not too picky about "". In other ports, we don't check whether a given value is empty or not. If you pass --entry '', the linker should do whatever it is instructed to do. We allow users to shoot themselves in the foot. If they really want to use an empty string as an entry symbol name, they should be able to do that.
> 
> So, let's return `Arg->getValue()` without assigning it to Entry and check if it is empty string.
Using empty string as the entrypoint name still won't work - because we just got rid of the code that handled unset/empty string differently.

I've made the change you requested to get rid of the empty-string check, but just bear in mind it won't actually make empty-string usable, it just makes `--entry ''` a legal synonym for `--no-entry`.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40725





More information about the llvm-commits mailing list