[lld] r275525 - Avoid writing to errs().
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 14 19:51:06 PDT 2016
Author: ruiu
Date: Thu Jul 14 21:51:05 2016
New Revision: 275525
URL: http://llvm.org/viewvc/llvm-project?rev=275525&view=rev
Log:
Avoid writing to errs().
We should write to ErrorOS instead. Normaly, *ErrorOS == errs(),
but they can be different if LLD is embedded.
Modified:
lld/trunk/ELF/Error.cpp
Modified: lld/trunk/ELF/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Error.cpp?rev=275525&r1=275524&r2=275525&view=diff
==============================================================================
--- lld/trunk/ELF/Error.cpp (original)
+++ lld/trunk/ELF/Error.cpp Thu Jul 14 21:51:05 2016
@@ -31,7 +31,7 @@ void warning(const Twine &Msg) {
if (Config->FatalWarnings)
error(Msg);
else
- errs() << Msg << "\n";
+ *ErrorOS << Msg << "\n";
}
void error(const Twine &Msg) {
@@ -44,7 +44,7 @@ void error(std::error_code EC, const Twi
}
void fatal(const Twine &Msg) {
- errs() << Msg << "\n";
+ *ErrorOS << Msg << "\n";
exit(1);
}
More information about the llvm-commits
mailing list