diff options
author | Dan Gohman <gohman@apple.com> | 2010-08-18 22:04:43 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-08-18 22:04:43 +0000 |
commit | d77e5a8176bd45fd26445b03079d690d6c5cfa28 (patch) | |
tree | b4e1381f31aa79f3f32dfaa465b66ef25a58604b /lib/Support | |
parent | ad422718f9b3224234f52e84d28d8a57a4e89987 (diff) | |
download | external_llvm-d77e5a8176bd45fd26445b03079d690d6c5cfa28.zip external_llvm-d77e5a8176bd45fd26445b03079d690d6c5cfa28.tar.gz external_llvm-d77e5a8176bd45fd26445b03079d690d6c5cfa28.tar.bz2 |
Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/ErrorHandling.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp index 08830dc..0b7af3e 100644 --- a/lib/Support/ErrorHandling.cpp +++ b/lib/Support/ErrorHandling.cpp @@ -66,11 +66,10 @@ void llvm::report_fatal_error(const Twine &Reason) { // succeeds (e.g. handling EINTR) and we can't use errs() here because // raw ostreams can call report_fatal_error. SmallVector<char, 64> Buffer; - StringRef ReasonStr = Reason.toStringRef(Buffer); - - ::write(2, "LLVM ERROR: ", 12); - ::write(2, ReasonStr.data(), ReasonStr.size()); - ::write(2, "\n", 1); + raw_svector_ostream OS(Buffer); + OS << "LLVM ERROR: " << Reason << "\n"; + StringRef MessageStr = OS.str(); + (void)::write(2, MessageStr.data(), MessageStr.size()); } // If we reached here, we are failing ungracefully. Run the interrupt handlers |