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
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 35598 Build 35597: arc lint + arc unit
Event Timeline
lld/Common/ErrorHandler.cpp | ||
---|---|---|
166 | 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 | 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. |
LGTM
lld/Common/ErrorHandler.cpp | ||
---|---|---|
166 | 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. |
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.)