Avoid copying PrettyStackTrace messages an extra time on Apple OSs
We were unnecessarily going from SmallString to std::string just to
get a null-terminated C string. So just...don't do that. Crash
slightly faster!
llvm-svn: 334841
diff --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp
index 9d62d74..f5b6e6f 100644
--- a/llvm/lib/Support/PrettyStackTrace.cpp
+++ b/llvm/lib/Support/PrettyStackTrace.cpp
@@ -118,9 +118,9 @@
if (!TmpStr.empty()) {
#ifdef HAVE_CRASHREPORTERCLIENT_H
// Cast to void to avoid warning.
- (void)CRSetCrashLogMessage(std::string(TmpStr.str()).c_str());
+ (void)CRSetCrashLogMessage(TmpStr.c_str());
#elif HAVE_CRASHREPORTER_INFO
- __crashreporter_info__ = strdup(std::string(TmpStr.str()).c_str());
+ __crashreporter_info__ = strdup(TmpStr.c_str());
#endif
errs() << TmpStr.str();
}