diff options
| author | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | 2018-04-20 17:18:06 +0000 |
|---|---|---|
| committer | Nicholas Wilson <nicholas@nicholaswilson.me.uk> | 2018-04-20 17:18:06 +0000 |
| commit | a1e299f58b2340a3c452f567626ed4baa62f8818 (patch) | |
| tree | 248938db3dbcc4a307c0c5d9c170c6ea0e688a96 /lld/wasm/MarkLive.cpp | |
| parent | 21d9c70b91ec7a8dc1e204502f3f3d429938e1d6 (diff) | |
| download | bcm5719-llvm-a1e299f58b2340a3c452f567626ed4baa62f8818.tar.gz bcm5719-llvm-a1e299f58b2340a3c452f567626ed4baa62f8818.zip | |
[WebAssembly] Implement GC for imports
Differential Revision: https://reviews.llvm.org/D44313
llvm-svn: 330454
Diffstat (limited to 'lld/wasm/MarkLive.cpp')
| -rw-r--r-- | lld/wasm/MarkLive.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lld/wasm/MarkLive.cpp b/lld/wasm/MarkLive.cpp index 38ffbcbc3d2..2b30f6a2ffd 100644 --- a/lld/wasm/MarkLive.cpp +++ b/lld/wasm/MarkLive.cpp @@ -40,13 +40,11 @@ void lld::wasm::markLive() { SmallVector<InputChunk *, 256> Q; auto Enqueue = [&](Symbol *Sym) { - if (!Sym) + if (!Sym || Sym->isLive()) return; - InputChunk *Chunk = Sym->getChunk(); - if (!Chunk || Chunk->Live) - return; - Chunk->Live = true; - Q.push_back(Chunk); + Sym->markLive(); + if (InputChunk *Chunk = Sym->getChunk()) + Q.push_back(Chunk); }; // Add GC root symbols. |

