[llvm] r227424 - Fix the preprocessor checks used to determine if backtraces have been enabled.
Owen Anderson
resistor at mac.com
Wed Jan 28 23:53:14 PST 2015
Author: resistor
Date: Thu Jan 29 01:53:13 2015
New Revision: 227424
URL: http://llvm.org/viewvc/llvm-project?rev=227424&view=rev
Log:
Fix the preprocessor checks used to determine if backtraces have been enabled.
Modified:
llvm/trunk/lib/Support/PrettyStackTrace.cpp
Modified: llvm/trunk/lib/Support/PrettyStackTrace.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/PrettyStackTrace.cpp?rev=227424&r1=227423&r2=227424&view=diff
==============================================================================
--- llvm/trunk/lib/Support/PrettyStackTrace.cpp (original)
+++ llvm/trunk/lib/Support/PrettyStackTrace.cpp Thu Jan 29 01:53:13 2015
@@ -30,7 +30,7 @@ using namespace llvm;
// If backtrace support is not enabled, compile out support for pretty stack
// traces. This has the secondary effect of not requiring thread local storage
// when backtrace support is disabled.
-#if ENABLE_BACKTRACE
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
// We need a thread local pointer to manage the stack of our stack trace
// objects, but we *really* cannot tolerate destructors running and do not want
@@ -108,11 +108,11 @@ static void CrashHandler(void *) {
#endif
}
-// ENABLE_BACKTRACE
+// defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
#endif
PrettyStackTraceEntry::PrettyStackTraceEntry() {
-#if ENABLE_BACKTRACE
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
// Link ourselves.
NextEntry = PrettyStackTraceHead;
PrettyStackTraceHead = this;
@@ -120,7 +120,7 @@ PrettyStackTraceEntry::PrettyStackTraceE
}
PrettyStackTraceEntry::~PrettyStackTraceEntry() {
-#if ENABLE_BACKTRACE
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
assert(PrettyStackTraceHead == this &&
"Pretty stack trace entry destruction is out of order");
PrettyStackTraceHead = getNextEntry();
@@ -139,7 +139,7 @@ void PrettyStackTraceProgram::print(raw_
OS << '\n';
}
-#if ENABLE_BACKTRACE
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
static bool RegisterCrashPrinter() {
sys::AddSignalHandler(CrashHandler, nullptr);
return false;
@@ -147,7 +147,7 @@ static bool RegisterCrashPrinter() {
#endif
void llvm::EnablePrettyStackTrace() {
-#if ENABLE_BACKTRACE
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
// The first time this is called, we register the crash printer.
static bool HandlerRegistered = RegisterCrashPrinter();
(void)HandlerRegistered;
More information about the llvm-commits
mailing list