[Support] Make error banner optional in logAllUnhandledErrors
authorJonas Devlieghere <jonas@devlieghere.com>
Sun, 11 Nov 2018 01:46:03 +0000 (01:46 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Sun, 11 Nov 2018 01:46:03 +0000 (01:46 +0000)
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.

llvm-svn: 346604

25 files changed:
llvm/include/llvm/Support/Error.h
llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFThumb.h
llvm/lib/LTO/LTOModule.cpp
llvm/lib/Object/Object.cpp
llvm/lib/Support/Error.cpp
llvm/tools/lli/lli.cpp
llvm/tools/llvm-cov/TestingSupport.cpp
llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp
llvm/tools/llvm-nm/llvm-nm.cpp
llvm/tools/llvm-objcopy/llvm-objcopy.cpp
llvm/tools/llvm-objcopy/llvm-objcopy.h
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
llvm/tools/llvm-readobj/llvm-readobj.h
llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
llvm/tools/llvm-size/llvm-size.cpp
llvm/tools/llvm-xray/xray-stacks.cpp
llvm/tools/obj2yaml/coff2yaml.cpp
llvm/tools/obj2yaml/obj2yaml.cpp
llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp
llvm/unittests/Support/ErrorTest.cpp

index 4e1619019bb4aba8ba4d80478f9b985434304f7f..4962812e750e6007ce0024c1217c82506c7fff64 100644 (file)
@@ -953,10 +953,14 @@ Expected<T> handleExpected(Expected<T> ValOrErr, RecoveryFtor &&RecoveryPath,
 /// 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.
index 25c0cb5d6eff6e1958834723a79c324d20481ae1..8122ed28b7f237dedbdd7f3dd56b3a2ac1b9eaac 100644 (file)
@@ -216,7 +216,7 @@ void MCJIT::generateCodeForModule(Module *M) {
   if (!LoadedObject) {
     std::string Buf;
     raw_string_ostream OS(Buf);
-    logAllUnhandledErrors(LoadedObject.takeError(), OS, "");
+    logAllUnhandledErrors(LoadedObject.takeError(), OS);
     OS.flush();
     report_fatal_error(Buf);
   }
index 1c54ad6fb03f8d248515ef74dfcba00b4bab1e6b..340ddaab186da07273def89ffa7d17caa3bf5ed8 100644 (file)
@@ -66,7 +66,7 @@ RuntimeDyldCOFF::loadObject(const object::ObjectFile &O) {
   } else {
     HasError = true;
     raw_string_ostream ErrStream(ErrorStr);
-    logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream, "");
+    logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream);
     return nullptr;
   }
 }
index f9a81c7bd1b00538323ac4fe24c75dc060e5b838..226ee715e18bc768a1d48e572265195c9f94e2b4 100644 (file)
@@ -255,7 +255,7 @@ RuntimeDyldELF::loadObject(const object::ObjectFile &O) {
   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);
       }
index c5a215c833315039b643bf685ba79af1429518e5..d47fcd45be8859fa67e164d4a46c491f83f9e2ad 100644 (file)
@@ -370,7 +370,7 @@ RuntimeDyldMachO::loadObject(const object::ObjectFile &O) {
   else {
     HasError = true;
     raw_string_ostream ErrStream(ErrorStr);
-    logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream, "");
+    logAllUnhandledErrors(ObjSectionToIDOrErr.takeError(), ErrStream);
     return nullptr;
   }
 }
index 729ea1ec48a4e9d65b0a8d214811817b4463a29f..8723dd0fd0ea5140fb8ba80d48dcb9d3f915cadb 100644 (file)
@@ -28,7 +28,7 @@ static bool isThumbFunc(symbol_iterator Symbol, const ObjectFile &Obj,
   if (!SymTypeOrErr) {
     std::string Buf;
     raw_string_ostream OS(Buf);
-    logAllUnhandledErrors(SymTypeOrErr.takeError(), OS, "");
+    logAllUnhandledErrors(SymTypeOrErr.takeError(), OS);
     OS.flush();
     report_fatal_error(Buf);
   }
index 20fc0943539f1bd50349bad9664a493c3ffc45ab..0d40d49dbe394e3281164a1ef999d269c6933162 100644 (file)
@@ -73,7 +73,7 @@ bool LTOModule::isBitcodeFile(StringRef Path) {
 bool LTOModule::isThinLTO() {
   Expected<BitcodeLTOInfo> Result = getBitcodeLTOInfo(MBRef);
   if (!Result) {
-    logAllUnhandledErrors(Result.takeError(), errs(), "");
+    logAllUnhandledErrors(Result.takeError(), errs());
     return false;
   }
   return Result->IsThinLTO;
index 5fd823e0117ed6b942625dcb3b9eb0c074691a34..c932e5b55046c1eb378f0d706c55b1b62d221551 100644 (file)
@@ -105,7 +105,7 @@ void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
   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(LLVMSymbolIteratorRef SI) {
   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(LLVMSymbolIteratorRef SI) {
   if (!Ret) {
     std::string Buf;
     raw_string_ostream OS(Buf);
-    logAllUnhandledErrors(Ret.takeError(), OS, "");
+    logAllUnhandledErrors(Ret.takeError(), OS);
     OS.flush();
     report_fatal_error(Buf);
   }
index ad2443db9af596d304976f38f39356745388e781..0b0be8d48fa7a72b9088293b08b598ef6de4c929 100644 (file)
@@ -141,7 +141,7 @@ void report_fatal_error(Error Err, bool GenCrashDiag) {
   std::string ErrMsg;
   {
     raw_string_ostream ErrStream(ErrMsg);
-    logAllUnhandledErrors(std::move(Err), ErrStream, "");
+    logAllUnhandledErrors(std::move(Err), ErrStream);
   }
   report_fatal_error(ErrMsg);
 }
index c3c57e2cdeed3cbfb2a22f463d9587fa2bd7c484..e4a7462a6352ad488a7717fd0167d52550307238 100644 (file)
@@ -511,7 +511,7 @@ int main(int argc, char **argv, char * const *envp) {
     if (!ArOrErr) {
       std::string Buf;
       raw_string_ostream OS(Buf);
-      logAllUnhandledErrors(ArOrErr.takeError(), OS, "");
+      logAllUnhandledErrors(ArOrErr.takeError(), OS);
       OS.flush();
       errs() << Buf;
       exit(1);
index e07abdbd17f1417ee5edb35fd53c8cc443cd697c..16a1c266529968ab0cdf5648a13a246b125df528 100644 (file)
@@ -33,7 +33,7 @@ int convertForTestingMain(int argc, const char *argv[]) {
   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;
index 40db5c933f0371279b7ad93aaabefab022bc51db..7594066a395dd79c0d77cda047f463ef8f5eb0c7 100644 (file)
@@ -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 *Arc) {
       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);
       }
index 21f3a2bade5e2ca812972705a2972c39d3045f47..a30a71ac6a032aceed51946e4e8304eaa26e5ba4 100644 (file)
@@ -209,7 +209,7 @@ static bool error(std::error_code EC, Twine Path = Twine()) {
 
 // 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, StringRef FileName, const Archive::Child &C,
 
   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, StringRef FileName, const Archive::Child &C,
 // 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, StringRef FileName,
 
   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(MachOObjectFile &Obj, basic_symbol_iterator I) {
     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 &Obj, bool printName,
       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);
index 755c786cee95e58968872a10e2cc541e1d1c5692..bc5088061c1966adfa0091b64f06ba4587a8d2ac 100644 (file)
@@ -66,7 +66,7 @@ LLVM_ATTRIBUTE_NORETURN void reportError(StringRef File, Error E) {
   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);
index e222b65dc78fbbc7609f95ba7ad5f4f258b9bfcd..d8edf3e29ee097484e6f360e391287134d5548cf 100644 (file)
@@ -31,7 +31,7 @@ template <class T> T unwrapOrError(Expected<T> EO) {
     return *EO;
   std::string Buf;
   raw_string_ostream OS(Buf);
-  logAllUnhandledErrors(EO.takeError(), OS, "");
+  logAllUnhandledErrors(EO.takeError(), OS);
   OS.flush();
   error(Buf);
 }
index 671e8a2c4f79243808e46bd81c62916e87278dcc..1f936e5b6245a3816ec89ff562df587dc6a05ce7 100644 (file)
@@ -372,7 +372,7 @@ LLVM_ATTRIBUTE_NORETURN void llvm::report_error(StringRef File,
   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::report_error(StringRef ArchiveName,
     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);
index eb575894db587bc6e630bc8cd07bc5d739d26b4f..4b823b816c35a1d67f35ab74905d1b10bc9ceab7 100644 (file)
@@ -903,7 +903,7 @@ bool Decoder::dumpXDataRecord(const COFFObjectFile &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 COFFObjectFile &COFF,
     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 COFFObjectFile &COFF,
     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 COFFObjectFile &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);
     }
@@ -976,7 +976,7 @@ bool Decoder::dumpUnpackedEntry(const COFFObjectFile &COFF,
     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 object::COFFObjectFile &COFF,
     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 object::COFFObjectFile &COFF,
     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);
     }
index 374ffd03e13a24f413ade28d9aac29e1e07e7e09..73eee76029075fa3b57357747e2b400a59b5b49b 100644 (file)
@@ -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);
   }
index 6ef282365745a7d2122cdd976a0b613ca2f91ceb..975638ed82d1dc0dacc330378adfd2ebf7d1e845 100644 (file)
@@ -309,7 +309,7 @@ static int printLineInfoForInput(bool LoadObjects, bool UseDebugObj) {
     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 + "'");
     }
index ad1aefcafcbdbfd9977f933658b42c867d9f5351..3922cad570b5918697097cdcfae4cd33088a8d9a 100644 (file)
@@ -140,7 +140,7 @@ static void error(llvm::Error E, StringRef FileName, const Archive::Child &C,
 
   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, StringRef FileName,
 
   std::string Buf;
   raw_string_ostream OS(Buf);
-  logAllUnhandledErrors(std::move(E), OS, "");
+  logAllUnhandledErrors(std::move(E), OS);
   OS.flush();
   errs() << " " << Buf << "\n";
 }
index 059940b7756ff2b428d85c352c050118bccce6dc..d3af9e25e6f28eafe3ec5447be8aaa11265aa947 100644 (file)
@@ -737,7 +737,7 @@ static CommandRegistration Unused(&Stack, []() -> Error {
                 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;
index e7e9e19fd3dc1b95c33155a8112b4676b32d9b5a..57fb1d040757efaa8d13b90c1bc64933c42225c9 100644 (file)
@@ -188,7 +188,7 @@ void COFFDumper::dumpSections(unsigned NumSections) {
       if (!SymbolNameOrErr) {
        std::string Buf;
        raw_string_ostream OS(Buf);
-       logAllUnhandledErrors(SymbolNameOrErr.takeError(), OS, "");
+       logAllUnhandledErrors(SymbolNameOrErr.takeError(), OS);
        OS.flush();
        report_fatal_error(Buf);
       }
index 76786158d9898169cef66e0d4c580b649118c26b..459572a57344db7368c0c6f05cb8743e9989ec22 100644 (file)
@@ -50,7 +50,7 @@ static void reportError(StringRef Input, Error Err) {
     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();
index ae408a06f84d71273c58acf060490e95c8a00a0d..09224c289b4d1f421fca6614a93e8f7d92ddd017 100644 (file)
@@ -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);
index ed1e2bb458ba9eb221eceee77a6cb7519cc470c1..eee2fe2d649379b9b32cc7813358d05023567e78 100644 (file)
@@ -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";