[lld] [lld][wasm] Clear lazyBitcodeFiles while resetting context (PR #118440)

Anutosh Bhat via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 23:57:26 PST 2024


https://github.com/anutosh491 created https://github.com/llvm/llvm-project/pull/118440

Hi @sbc100 

I was looking into a use case involving the link function (which got my attention to reset).

I see that `lazyBitcodeFiles` variable was introduced here https://github.com/llvm/llvm-project/pull/114327 but I don't see it being reset while destroying the context eventually. Hopefully this should be the correct way to address it.

>From 0e3ae7d2d0e82d958cdddbc969c0c889e9398dd7 Mon Sep 17 00:00:00 2001
From: anutosh491 <andersonbhat491 at gmail.com>
Date: Tue, 3 Dec 2024 13:24:41 +0530
Subject: [PATCH] Clear lazyBitcodeFiles while resetting context

---
 lld/wasm/Driver.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index 8d01ff839ddfcf..37a0156c728f6f 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -59,6 +59,7 @@ void Ctx::reset() {
   stubFiles.clear();
   sharedFiles.clear();
   bitcodeFiles.clear();
+  lazyBitcodeFiles.clear();
   syntheticFunctions.clear();
   syntheticGlobals.clear();
   syntheticTables.clear();



More information about the llvm-commits mailing list