[PATCH] D93472: [WebAssembly][lld] Don't mark a file live from an undefine symbol

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 10:27:34 PST 2020


dschuff created this revision.
dschuff added a reviewer: sbc100.
Herald added subscribers: ecnelises, sunfish, jgravelle-google.
dschuff requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

Live symbols should only cause the files in which they are defined
to become live.

For now this is only tested in emscripten: we're continuing
to work on reducing the test case further for an lld-style
unit test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93472

Files:
  lld/wasm/Symbols.cpp


Index: lld/wasm/Symbols.cpp
===================================================================
--- lld/wasm/Symbols.cpp
+++ lld/wasm/Symbols.cpp
@@ -137,7 +137,7 @@
 
 void Symbol::markLive() {
   assert(!isDiscarded());
-  if (file != NULL)
+  if (file != NULL && isDefined())
     file->markLive();
   if (auto *g = dyn_cast<DefinedGlobal>(this))
     g->global->live = true;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93472.312553.patch
Type: text/x-patch
Size: 379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201217/5ec9f02f/attachment.bin>


More information about the llvm-commits mailing list