aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-18 22:04:43 +0000
committerDan Gohman <gohman@apple.com>2010-08-18 22:04:43 +0000
commitd77e5a8176bd45fd26445b03079d690d6c5cfa28 (patch)
treeb4e1381f31aa79f3f32dfaa465b66ef25a58604b
parentad422718f9b3224234f52e84d28d8a57a4e89987 (diff)
Tidy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111432 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Support/ErrorHandling.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp
index 08830dc80b..0b7af3e590 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