[PATCH] D41038: [WebAssembly] Preserve ordering of global symbols

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 08:53:07 PST 2017


ruiu accepted this revision.
ruiu added a comment.

LGTM



================
Comment at: wasm/Writer.cpp:617-618
     for (Symbol *Sym : File->getSymbols()) {
-      if (Sym->hasOutputIndex() || !Sym->isDefined())
-        continue;
-
-      if (Sym->isFunction()) {
-        if (Sym->getFile() && isa<ObjFile>(Sym->getFile())) {
+      // Assign indexes for symbols defined with this file.
+      if (Sym->isDefined() && File == Sym->getFile()) {
+        if (Sym->isFunction()) {
----------------
Could you invert the boolean expression so that we can still do early continue (to keep the indentation shallower)?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41038





More information about the llvm-commits mailing list