[PATCH] D40559: Run Wasm entrypoint on load

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 12:53:57 PST 2017


ruiu added a comment.

As to `--entry ''`, I can say as a linker guy that it looks odd. When something shouldn't be set, we usually pass -no-<something> instead of -<something> ''. For consistency with other options, I strongly prefer adding -no-entry, or not to set the entry point function if no -entry option is given. `--entry ''` is, well, just a bit too odd.



================
Comment at: wasm/Driver.cpp:301
   Config->SearchPaths = getArgs(Args, OPT_L);
+  Config->Undefined = getArgs(Args, OPT_undefined);
   Config->StripAll = Args.hasArg(OPT_strip_all);
----------------
ncw wrote:
> sbc100 wrote:
> > Does this need to be in Config, or can it just be a local ?
> Good point, it doesn't _have_ to go in Config. But, if this is ever refactored from being one long do-it-all method, it will have to go there (see ELF driver). It's nicer on the eyes to have all the different options match here, I felt.
It will eventually be in Config (e.g. when you implement the gc-sections), but in general, in lld, we do it when we need it. It looks like you don't need to store it even to a local variable. You could do 

  for (StringRef S : getArgs(Args, OPT_undefined)
    addSyntheticUndefinedFunction(S);

at line 331.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D40559





More information about the llvm-commits mailing list