This could previously happen if errors that are emitted after reaching the
error limit. In that case, the flag inside the newline() function will be
set to true which causes the next call to print a newline even though the
actual message will be discarded.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lld/Common/ErrorHandler.cpp | ||
---|---|---|
166 ↗ | (On Diff #211461) | The comment may be too verbose... It should be obvious from the if .. else if ... pattern (there is no else branch). The test may look like: env LLD_IN_TEST=0 ld.lld --error-limit=1 %t.o -o /dev/null 2>&1 | FileCheck %s (You need to find a multi-line error that can be easily replicated.) |
lld/Common/ErrorHandler.cpp | ||
---|---|---|
166 ↗ | (On Diff #211461) | I agree this is quite long. I added the comment here to avoid future refactoring from introducing errors. With the test it is probably fine without a comment. |
Comment Actions
LGTM
lld/Common/ErrorHandler.cpp | ||
---|---|---|
166 ↗ | (On Diff #211461) | Comments work best when explaining why code works some way. In this case, the correct behavior is somewhat self-explanatory, and a unit test works best. |