[llvm] r346604 - [Support] Make error banner optional in logAllUnhandledErrors
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 10 17:46:03 PST 2018
Author: jdevlieghere
Date: Sat Nov 10 17:46:03 2018
New Revision: 346604
URL: http://llvm.org/viewvc/llvm-project?rev=346604&view=rev
Log:
[Support] Make error banner optional in logAllUnhandledErrors
In a lot of places an empty string was passed as the ErrorBanner to
logAllUnhandledErrors. This patch makes that argument optional to
simplify the call sites.
Modified:
llvm/trunk/include/llvm/Support/Error.h
llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h
llvm/trunk/lib/LTO/LTOModule.cpp
llvm/trunk/lib/Object/Object.cpp
llvm/trunk/lib/Support/Error.cpp
llvm/trunk/tools/lli/lli.cpp
llvm/trunk/tools/llvm-cov/TestingSupport.cpp
llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp
llvm/trunk/tools/llvm-objcopy/llvm-objcopy.h
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp
llvm/trunk/tools/llvm-readobj/llvm-readobj.h
llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
llvm/trunk/tools/llvm-size/llvm-size.cpp
llvm/trunk/tools/llvm-xray/xray-stacks.cpp
llvm/trunk/tools/obj2yaml/coff2yaml.cpp
llvm/trunk/tools/obj2yaml/obj2yaml.cpp
llvm/trunk/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
llvm/trunk/unittests/Support/ErrorTest.cpp
Modified: llvm/trunk/include/llvm/Support/Error.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Error.h?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Error.h (original)
+++ llvm/trunk/include/llvm/Support/Error.h Sat Nov 10 17:46:03 2018
@@ -953,10 +953,14 @@ Expected<T> handleExpected(Expected<T> V
/// will be printed before the first one is logged. A newline will be printed
/// after each error.
///
+/// This function is compatible with the helpers from Support/WithColor.h. You
+/// can pass any of them as the OS. Please consider using them instead of
+/// including 'error: ' in the ErrorBanner.
+///
/// This is useful in the base level of your program to allow clean termination
/// (allowing clean deallocation of resources, etc.), while reporting error
/// information to the user.
-void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner);
+void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner = {});
/// Write all error messages (if any) in E to a string. The newline character
/// is used to separate error messages.
Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Sat Nov 10 17:46:03 2018
@@ -216,7 +216,7 @@ void MCJIT::generateCodeForModule(Module
if (!LoadedObject) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(LoadedObject.takeError(), OS, "");
+ logAllUnhandledErrors(LoadedObject.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp Sat Nov 10 17:46:03 2018
@@ -66,7 +66,7 @@ RuntimeDyldCOFF::loadObject(const object
} else {
HasError = true;
raw_string_ostream ErrStream(ErrorStr);
- logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream, "");
+ logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream);
return nullptr;
}
}
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Sat Nov 10 17:46:03 2018
@@ -255,7 +255,7 @@ RuntimeDyldELF::loadObject(const object:
else {
HasError = true;
raw_string_ostream ErrStream(ErrorStr);
- logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream, "");
+ logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream);
return nullptr;
}
}
@@ -1130,7 +1130,7 @@ RuntimeDyldELF::processRelocationRef(
if (!SymTypeOrErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(SymTypeOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(SymTypeOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -1151,7 +1151,7 @@ RuntimeDyldELF::processRelocationRef(
if (!SectionOrErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(SectionOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(SectionOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp Sat Nov 10 17:46:03 2018
@@ -370,7 +370,7 @@ RuntimeDyldMachO::loadObject(const objec
else {
HasError = true;
raw_string_ostream ErrStream(ErrorStr);
- logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream, "");
+ logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream);
return nullptr;
}
}
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h Sat Nov 10 17:46:03 2018
@@ -28,7 +28,7 @@ static bool isThumbFunc(symbol_iterator
if (!SymTypeOrErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(SymTypeOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(SymTypeOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
Modified: llvm/trunk/lib/LTO/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOModule.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOModule.cpp (original)
+++ llvm/trunk/lib/LTO/LTOModule.cpp Sat Nov 10 17:46:03 2018
@@ -73,7 +73,7 @@ bool LTOModule::isBitcodeFile(StringRef
bool LTOModule::isThinLTO() {
Expected<BitcodeLTOInfo> Result = getBitcodeLTOInfo(MBRef);
if (!Result) {
- logAllUnhandledErrors(Result.takeError(), errs(), "");
+ logAllUnhandledErrors(Result.takeError(), errs());
return false;
}
return Result->IsThinLTO;
Modified: llvm/trunk/lib/Object/Object.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Object.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Object.cpp (original)
+++ llvm/trunk/lib/Object/Object.cpp Sat Nov 10 17:46:03 2018
@@ -105,7 +105,7 @@ void LLVMMoveToContainingSection(LLVMSec
if (!SecOrErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(SecOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(SecOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -187,7 +187,7 @@ const char *LLVMGetSymbolName(LLVMSymbol
if (!Ret) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(Ret.takeError(), OS, "");
+ logAllUnhandledErrors(Ret.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -199,7 +199,7 @@ uint64_t LLVMGetSymbolAddress(LLVMSymbol
if (!Ret) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(Ret.takeError(), OS, "");
+ logAllUnhandledErrors(Ret.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
Modified: llvm/trunk/lib/Support/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Error.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Error.cpp (original)
+++ llvm/trunk/lib/Support/Error.cpp Sat Nov 10 17:46:03 2018
@@ -141,7 +141,7 @@ void report_fatal_error(Error Err, bool
std::string ErrMsg;
{
raw_string_ostream ErrStream(ErrMsg);
- logAllUnhandledErrors(std::move(Err), ErrStream, "");
+ logAllUnhandledErrors(std::move(Err), ErrStream);
}
report_fatal_error(ErrMsg);
}
Modified: llvm/trunk/tools/lli/lli.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/lli.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/lli/lli.cpp (original)
+++ llvm/trunk/tools/lli/lli.cpp Sat Nov 10 17:46:03 2018
@@ -511,7 +511,7 @@ int main(int argc, char **argv, char * c
if (!ArOrErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(ArOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(ArOrErr.takeError(), OS);
OS.flush();
errs() << Buf;
exit(1);
Modified: llvm/trunk/tools/llvm-cov/TestingSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/TestingSupport.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/TestingSupport.cpp (original)
+++ llvm/trunk/tools/llvm-cov/TestingSupport.cpp Sat Nov 10 17:46:03 2018
@@ -33,7 +33,7 @@ int convertForTestingMain(int argc, cons
if (!ObjErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(ObjErr.takeError(), OS, "");
+ logAllUnhandledErrors(ObjErr.takeError(), OS);
OS.flush();
errs() << "error: " << Buf;
return 1;
Modified: llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp (original)
+++ llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp Sat Nov 10 17:46:03 2018
@@ -52,7 +52,8 @@ static void error(std::error_code EC) {
static void error(Error Err) {
if (!Err)
return;
- logAllUnhandledErrors(std::move(Err), WithColor::error(outs(), ""), "reading file: ");
+ logAllUnhandledErrors(std::move(Err), WithColor::error(outs()),
+ "reading file: ");
outs().flush();
exit(1);
}
@@ -497,7 +498,7 @@ static void dumpArchive(const Archive *A
if (auto E = isNotObjectErrorInvalidFileType(ChildOrErr.takeError())) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
reportError(Arc->getFileName(), Buf);
}
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Sat Nov 10 17:46:03 2018
@@ -209,7 +209,7 @@ static bool error(std::error_code EC, Tw
// This version of error() prints the archive name and member name, for example:
// "libx.a(foo.o)" after the ToolName before the error message. It sets
-// HadError but returns allowing the code to move on to other archive members.
+// HadError but returns allowing the code to move on to other archive members.
static void error(llvm::Error E, StringRef FileName, const Archive::Child &C,
StringRef ArchitectureName = StringRef()) {
HadError = true;
@@ -230,7 +230,7 @@ static void error(llvm::Error E, StringR
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << " " << Buf << "\n";
}
@@ -238,7 +238,7 @@ static void error(llvm::Error E, StringR
// This version of error() prints the file name and which architecture slice it
// is from, for example: "foo.o (for architecture i386)" after the ToolName
// before the error message. It sets HadError but returns allowing the code to
-// move on to other architecture slices.
+// move on to other architecture slices.
static void error(llvm::Error E, StringRef FileName,
StringRef ArchitectureName = StringRef()) {
HadError = true;
@@ -249,7 +249,7 @@ static void error(llvm::Error E, StringR
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << " " << Buf << "\n";
}
@@ -1029,8 +1029,7 @@ static char getSymbolNMTypeChar(MachOObj
StringRef SectionName;
Obj.getSectionName(Ref, SectionName);
StringRef SegmentName = Obj.getSectionFinalSegmentName(Ref);
- if (Obj.is64Bit() &&
- Obj.getHeader64().filetype == MachO::MH_KEXT_BUNDLE &&
+ if (Obj.is64Bit() && Obj.getHeader64().filetype == MachO::MH_KEXT_BUNDLE &&
SegmentName == "__TEXT_EXEC" && SectionName == "__text")
return 't';
if (SegmentName == "__TEXT" && SectionName == "__text")
@@ -1606,7 +1605,7 @@ dumpSymbolNamesFromObject(SymbolicFile &
uint64_t lc_main_offset = UINT64_MAX;
for (const auto &Command : MachO->load_commands()) {
if (Command.C.cmd == MachO::LC_FUNCTION_STARTS) {
- // We found a function starts segment, parse the addresses for
+ // We found a function starts segment, parse the addresses for
// consumption.
MachO::linkedit_data_command LLC =
MachO->getLinkeditDataLoadCommand(Command);
Modified: llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp (original)
+++ llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp Sat Nov 10 17:46:03 2018
@@ -66,7 +66,7 @@ LLVM_ATTRIBUTE_NORETURN void reportError
assert(E);
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
WithColor::error(errs(), ToolName) << "'" << File << "': " << Buf;
exit(1);
Modified: llvm/trunk/tools/llvm-objcopy/llvm-objcopy.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objcopy/llvm-objcopy.h?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objcopy/llvm-objcopy.h (original)
+++ llvm/trunk/tools/llvm-objcopy/llvm-objcopy.h Sat Nov 10 17:46:03 2018
@@ -31,7 +31,7 @@ template <class T> T unwrapOrError(Expec
return *EO;
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(EO.takeError(), OS, "");
+ logAllUnhandledErrors(EO.takeError(), OS);
OS.flush();
error(Buf);
}
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Sat Nov 10 17:46:03 2018
@@ -372,7 +372,7 @@ LLVM_ATTRIBUTE_NORETURN void llvm::repor
assert(E);
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << ToolName << ": '" << File << "': " << Buf;
exit(1);
@@ -392,7 +392,7 @@ LLVM_ATTRIBUTE_NORETURN void llvm::repor
errs() << " (for architecture " << ArchitectureName << ")";
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << ": " << Buf;
exit(1);
Modified: llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ARMWinEHPrinter.cpp Sat Nov 10 17:46:03 2018
@@ -903,7 +903,7 @@ bool Decoder::dumpXDataRecord(const COFF
if (!Name) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(Name.takeError(), OS, "");
+ logAllUnhandledErrors(Name.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -942,7 +942,7 @@ bool Decoder::dumpUnpackedEntry(const CO
if (!FunctionNameOrErr) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -951,7 +951,7 @@ bool Decoder::dumpUnpackedEntry(const CO
if (!FunctionAddressOrErr) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(FunctionAddressOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(FunctionAddressOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -967,7 +967,7 @@ bool Decoder::dumpUnpackedEntry(const CO
if (!Name) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(Name.takeError(), OS, "");
+ logAllUnhandledErrors(Name.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -976,7 +976,7 @@ bool Decoder::dumpUnpackedEntry(const CO
if (!AddressOrErr) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(AddressOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(AddressOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -1025,7 +1025,7 @@ bool Decoder::dumpPackedEntry(const obje
if (!FunctionNameOrErr) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(FunctionNameOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
@@ -1034,7 +1034,7 @@ bool Decoder::dumpPackedEntry(const obje
if (!FunctionAddressOrErr) {
std::string Buf;
llvm::raw_string_ostream OS(Buf);
- logAllUnhandledErrors(FunctionAddressOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(FunctionAddressOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.h?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/llvm-readobj.h (original)
+++ llvm/trunk/tools/llvm-readobj/llvm-readobj.h Sat Nov 10 17:46:03 2018
@@ -40,7 +40,7 @@ namespace llvm {
return *EO;
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(EO.takeError(), OS, "");
+ logAllUnhandledErrors(EO.takeError(), OS);
OS.flush();
reportError(Buf);
}
Modified: llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp (original)
+++ llvm/trunk/tools/llvm-rtdyld/llvm-rtdyld.cpp Sat Nov 10 17:46:03 2018
@@ -309,7 +309,7 @@ static int printLineInfoForInput(bool Lo
if (!MaybeObj) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(MaybeObj.takeError(), OS, "");
+ logAllUnhandledErrors(MaybeObj.takeError(), OS);
OS.flush();
ErrorAndExit("unable to create object file: '" + Buf + "'");
}
@@ -438,7 +438,7 @@ static int executeInput() {
if (!MaybeObj) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(MaybeObj.takeError(), OS, "");
+ logAllUnhandledErrors(MaybeObj.takeError(), OS);
OS.flush();
ErrorAndExit("unable to create object file: '" + Buf + "'");
}
@@ -710,7 +710,7 @@ static int linkAndVerify() {
if (!MaybeObj) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(MaybeObj.takeError(), OS, "");
+ logAllUnhandledErrors(MaybeObj.takeError(), OS);
OS.flush();
ErrorAndExit("unable to create object file: '" + Buf + "'");
}
Modified: llvm/trunk/tools/llvm-size/llvm-size.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-size/llvm-size.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-size/llvm-size.cpp (original)
+++ llvm/trunk/tools/llvm-size/llvm-size.cpp Sat Nov 10 17:46:03 2018
@@ -140,7 +140,7 @@ static void error(llvm::Error E, StringR
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << " " << Buf << "\n";
}
@@ -158,7 +158,7 @@ static void error(llvm::Error E, StringR
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(std::move(E), OS, "");
+ logAllUnhandledErrors(std::move(E), OS);
OS.flush();
errs() << " " << Buf << "\n";
}
Modified: llvm/trunk/tools/llvm-xray/xray-stacks.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-xray/xray-stacks.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-xray/xray-stacks.cpp (original)
+++ llvm/trunk/tools/llvm-xray/xray-stacks.cpp Sat Nov 10 17:46:03 2018
@@ -737,7 +737,7 @@ static CommandRegistration Unused(&Stack
Twine("Failed loading input file '") + Filename + "'",
std::make_error_code(std::errc::invalid_argument)),
TraceOrErr.takeError());
- logAllUnhandledErrors(TraceOrErr.takeError(), errs(), "");
+ logAllUnhandledErrors(TraceOrErr.takeError(), errs());
continue;
}
auto &T = *TraceOrErr;
Modified: llvm/trunk/tools/obj2yaml/coff2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/coff2yaml.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/coff2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/coff2yaml.cpp Sat Nov 10 17:46:03 2018
@@ -188,7 +188,7 @@ void COFFDumper::dumpSections(unsigned N
if (!SymbolNameOrErr) {
std::string Buf;
raw_string_ostream OS(Buf);
- logAllUnhandledErrors(SymbolNameOrErr.takeError(), OS, "");
+ logAllUnhandledErrors(SymbolNameOrErr.takeError(), OS);
OS.flush();
report_fatal_error(Buf);
}
Modified: llvm/trunk/tools/obj2yaml/obj2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/obj2yaml.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/obj2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/obj2yaml.cpp Sat Nov 10 17:46:03 2018
@@ -50,7 +50,7 @@ static void reportError(StringRef Input,
Input = "<stdin>";
std::string ErrMsg;
raw_string_ostream OS(ErrMsg);
- logAllUnhandledErrors(std::move(Err), OS, "");
+ logAllUnhandledErrors(std::move(Err), OS);
OS.flush();
errs() << "Error reading file: " << Input << ": " << ErrMsg;
errs().flush();
Modified: llvm/trunk/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp (original)
+++ llvm/trunk/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp Sat Nov 10 17:46:03 2018
@@ -112,10 +112,9 @@ TEST(RemoteObjectLayer, AddObject) {
auto Channels = createPairedQueueChannels();
- auto ReportError =
- [](Error Err) {
- logAllUnhandledErrors(std::move(Err), llvm::errs(), "");
- };
+ auto ReportError = [](Error Err) {
+ logAllUnhandledErrors(std::move(Err), llvm::errs());
+ };
// Copy the bytes out of the test object: the copy will be used to verify
// that the original is correctly transmitted over RPC to the mock layer.
@@ -225,10 +224,9 @@ TEST(RemoteObjectLayer, RemoveObject) {
auto Channels = createPairedQueueChannels();
- auto ReportError =
- [](Error Err) {
- logAllUnhandledErrors(std::move(Err), llvm::errs(), "");
- };
+ auto ReportError = [](Error Err) {
+ logAllUnhandledErrors(std::move(Err), llvm::errs());
+ };
RPCEndpoint ClientEP(*Channels.first, true);
RemoteObjectClientLayer<RPCEndpoint> Client(ClientEP, ReportError);
@@ -489,10 +487,9 @@ TEST(RemoteObjectLayer, EmitAndFinalize)
auto Channels = createPairedQueueChannels();
- auto ReportError =
- [](Error Err) {
- logAllUnhandledErrors(std::move(Err), llvm::errs(), "");
- };
+ auto ReportError = [](Error Err) {
+ logAllUnhandledErrors(std::move(Err), llvm::errs());
+ };
RPCEndpoint ClientEP(*Channels.first, true);
RemoteObjectClientLayer<RPCEndpoint> Client(ClientEP, ReportError);
Modified: llvm/trunk/unittests/Support/ErrorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ErrorTest.cpp?rev=346604&r1=346603&r2=346604&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ErrorTest.cpp (original)
+++ llvm/trunk/unittests/Support/ErrorTest.cpp Sat Nov 10 17:46:03 2018
@@ -434,9 +434,8 @@ TEST(Error, CatchErrorFromHandler) {
TEST(Error, StringError) {
std::string Msg;
raw_string_ostream S(Msg);
- logAllUnhandledErrors(make_error<StringError>("foo" + Twine(42),
- inconvertibleErrorCode()),
- S, "");
+ logAllUnhandledErrors(
+ make_error<StringError>("foo" + Twine(42), inconvertibleErrorCode()), S);
EXPECT_EQ(S.str(), "foo42\n") << "Unexpected StringError log result";
auto EC =
@@ -451,13 +450,13 @@ TEST(Error, createStringError) {
std::string Msg;
raw_string_ostream S(Msg);
logAllUnhandledErrors(createStringError(EC, "foo%s%d0x%" PRIx8, Bar, 1, 0xff),
- S, "");
+ S);
EXPECT_EQ(S.str(), "foobar10xff\n")
<< "Unexpected createStringError() log result";
S.flush();
Msg.clear();
- logAllUnhandledErrors(createStringError(EC, Bar), S, "");
+ logAllUnhandledErrors(createStringError(EC, Bar), S);
EXPECT_EQ(S.str(), "bar\n")
<< "Unexpected createStringError() (overloaded) log result";
More information about the llvm-commits
mailing list