llvm-project/lld/Common
Fangrui Song 0db402c5b4 [lld] Buffer writes when composing a single diagnostic
llvm::errs() is unbuffered. On a POSIX platform, composing a diagnostic
string may invoke the ::write syscall multiple times, which can be slow.
Buffer writes to a temporary SmallString when composing a single diagnostic to
reduce the number of ::write syscalls to one (also easier to read under
strace/truss).

For an invocation of ld.lld with 62000+ lines of
`ld.lld: warning: symbol ordering file: no such symbol: ` warnings (D87121),
the buffering decreases the write time from 1s to 0.4s (for /dev/tty) and
from 0.4s to 0.1s (for a tmpfs file). This can speed up
`relocation R_X86_64_PC32 out of range` diagnostic printing as well
with `--noinhibit-exec --no-fatal-warnings`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D87272
2021-09-09 09:27:14 -07:00
..
Args.cpp [lld] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
CMakeLists.txt Remove HAVE_VCS_VERSION_INC, not needed 2020-10-29 13:09:05 -07:00
DWARF.cpp [LLD] Move duplicated dwarf parsing code to the Common library. NFC. 2019-10-21 08:01:52 +00:00
ErrorHandler.cpp [lld] Buffer writes when composing a single diagnostic 2021-09-09 09:27:14 -07:00
Filesystem.cpp [LLD][ELF][Windows] small improvement to D82567 2020-07-13 12:02:20 +01:00
Memory.cpp
Reproduce.cpp [lld/mac] Add --reproduce option 2020-11-30 08:40:21 -05:00
Strings.cpp [ELF] Simplify isValidCIdentifier. NFC 2021-03-11 09:38:15 -08:00
TargetOptionsCommandFlags.cpp [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
Timer.cpp [LLD] Fix /time formatting for very long runs. NFC. 2020-10-02 09:53:43 -04:00
Version.cpp [lld] Remove unused LLD_REPOSITORY 2021-08-04 13:04:10 -07:00