-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[lld][wasm] Clear lazyBitcodeFiles while resetting context #118440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-lld Author: Anutosh Bhat (anutosh491) ChangesHi @sbc100 I was looking into a use case involving the link function (which got my attention to reset). I see that Full diff: https://github.com/llvm/llvm-project/pull/118440.diff 1 Files Affected:
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();
|
@llvm/pr-subscribers-lld-wasm Author: Anutosh Bhat (anutosh491) ChangesHi @sbc100 I was looking into a use case involving the link function (which got my attention to reset). I see that Full diff: https://github.com/llvm/llvm-project/pull/118440.diff 1 Files Affected:
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();
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have tests for re-using contexts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % testing question
Hmmm, not sure :( |
My use case of running clang-repl completely in browser technically supports my claim that context resetting works as expected. Screen.Recording.2024-12-04.at.11.03.06.AM.mov |
We have basic unittests in If lld/wasm constructs |
Both of those sounds like good ideas, thank you. I don't think we need to block this change on those though. |
I just skimmed through this blog post pasted above. I think we could try the following out
Let me know if I have the green flag from your side and I'll try to address this on a separate branch. |
I opened an issue to track the progress on this Y'all could let me know your thoughts on the same and let me know if my thinking on the issue makes sense. |
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 #114327 but I don't see it being reset while destroying the context eventually. Hopefully this should be the correct way to address it.