From: George Rimar Date: Sat, 17 Aug 2019 15:24:16 +0000 (+0000) Subject: [llvm-readobj] - An attemp to fix BB after r369191. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d588d3c3e7630f41c9107a5c3d2d00603ee482ad;p=llvm [llvm-readobj] - An attemp to fix BB after r369191. Few BB failed with the following error: Command Output (stderr): -- /home/buildbots/ppc64be-clang-lnt-test/clang-ppc64be-lnt/llvm/test/tools/llvm-readobj/stack-sizes.test:263:19: error: BADSECTION-OUT: expected string not found in input # BADSECTION-OUT: 8 ? ^ :4:1: note: scanning from here ^ It doesn't reproduce on ubuntu/windows I have. Also, seems many of the bots are happy too. This slightly reorders the code to make fouts().flush() call earlier, like it was before the r369191. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369192 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index 8e89cccf2a8..00f7ab2e341 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/tools/llvm-readobj/llvm-readobj.cpp @@ -395,14 +395,14 @@ LLVM_ATTRIBUTE_NORETURN void reportError(Error Err, StringRef Input) { void reportWarning(Error Err, StringRef Input) { assert(Err); + // Flush the standard output to print the warning at a + // proper place. + fouts().flush(); if (Input == "-") Input = ""; handleAllErrors(createFileError(Input, std::move(Err)), [&](const ErrorInfoBase &EI) { - // Flush the standard output to print the warning at a - // proper place. - fouts().flush(); errs() << "\n"; WithColor::warning(errs()) << EI.message() << "\n"; });