-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
stage2: add compile log statement #7191
Conversation
As a temporary solution, Ill just make it print to stderr instead of using the mod.fail so that a decl can have other errors too. |
…t gets displayed so the binary still gets produced
1db5e91
to
3a7c08e
Compare
Just saw your comment on #7239 about this, the reason it was ok to just use ArrayListUnmanaged(usize) was because the error message for a |
…ge s instead of a Module.compile_log_decls field
Making this a draft until #7239 gets solved because it is very hard to debug this. |
… bug is stopping me from really doing anything, cleaned up a little
c62380a
to
9f75473
Compare
self.bin_file.updateDecl(module, decl) catch |err| { | ||
switch (err) { | ||
error.OutOfMemory => return error.OutOfMemory, | ||
error.AnalysisFail => { | ||
decl.analysis = .dependency_failure; | ||
}, | ||
else => { | ||
try module.failed_decls.ensureCapacity(module.gpa, module.failed_decls.items().len + 1); | ||
module.failed_decls.putAssumeCapacityNoClobber(decl, try ErrorMsg.create( | ||
try module.addDeclErr(decl, try ErrorMsg.create( |
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.
Every instance of this change introduced a memory leak if ErrorMsg.create
fails.
The addition of `addDeclErr` introduced a memory leak at every call site, and I also would like to push back on having more than 1 compilation error per `Decl`. This reverts commit 1634d45.
The addition of `addDeclErr` introduced a memory leak at every call site, and I also would like to push back on having more than 1 compilation error per `Decl`. This reverts commit 1634d45.
The addition of `addDeclErr` introduced a memory leak at every call site, and I also would like to push back on having more than 1 compilation error per `Decl`. This reverts commit 1634d45.
The only problem that I ran into making this pr was that the output of the
@compilelog
can't be tested. There is no way to test compile-time output besides errors. Should this be added just to enable compile logging testing?