Config->ColorDiagnostics was of type enum before. Now it is just a
boolean flag. Thanks Rafael for suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287978 91177308-0d34-0410-b5e6-96231b3b80d8
-color-diagnostics=auto is default because that's the same as
Clang's default. When color is enabled, error or warning messages
are colored like this.
error:
<bold>ld.lld</bold> <red>error:</red> foo.o: no such file
warning:
<bold>ld.lld</bold> <magenta>warning:</magenta> foo.o: no such file
Differential Revision: https://reviews.llvm.org/D27117
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287949 91177308-0d34-0410-b5e6-96231b3b80d8
This patch changes the error message from
too many errors emitted, stopping now
to
too many errors emitted, stopping now (use -error-limit=0 to see all errors)
Thanks for Sean for the suggestion!
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287900 91177308-0d34-0410-b5e6-96231b3b80d8
This is in the context of https://llvm.org/bugs/show_bug.cgi?id=31109.
When LLD prints out errors for relocations, it tends to print out
extremely large number of errors (like millions) because it would
print out one error per relocation.
This patch makes LLD bail out if it prints out more than 20 errors.
You can configure the limitation using -error-limit argument.
-error-limit=0 means no limit.
I chose the flag name because Clang has the same feature as -ferror-limit.
"f" doesn't make sense to us, so I omitted it.
Differential Revision: https://reviews.llvm.org/D26981
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@287789 91177308-0d34-0410-b5e6-96231b3b80d8
llvm_shutdown could write something to outs or errs,
so we need to flush them after calling llvm_shutdown.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@286548 91177308-0d34-0410-b5e6-96231b3b80d8
In a non-LTO build is a nop. In a LTO build, we deallocate/destroy
managed static and this allows us to get the output of, e.g.,
-time-passes without performing a full shutdown.
Differential Revision: https://reviews.llvm.org/D26517
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@286493 91177308-0d34-0410-b5e6-96231b3b80d8
Instead of having 3 section allocators per file, have 3 for all files.
This is a substantial performance improvement for some cases. Linking
chromium without gc speeds up by 1.065x.
This requires using _exit in fatal since we have to avoid destructing
an InputSection if fatal is called from the constructor.
Thanks to Rui for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@285290 91177308-0d34-0410-b5e6-96231b3b80d8
createELFObj() may call error(...), for example when file is too short.
In that case header is not set and following line lead to crash:
EMachine = ELFObj.getHeader()->e_machine;
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D25233
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@283532 91177308-0d34-0410-b5e6-96231b3b80d8
We should write to ErrorOS instead. Normaly, *ErrorOS == errs(),
but they can be different if LLD is embedded.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275525 91177308-0d34-0410-b5e6-96231b3b80d8
Previously, it checked for the EC parameter and set HasError
only when there was an error. But in most places we called
error only when error had occurred, so this behavior was confusing.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@275517 91177308-0d34-0410-b5e6-96231b3b80d8