[llvm] 5d929e6 - Move setBugReportMsg() out from under a conditional

Leonard Chan via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 16:39:44 PDT 2020


Author: Leonard Chan
Date: 2020-03-26T16:39:03-07:00
New Revision: 5d929e66469d7d9ff8c63e7e1ec139c195510c94

URL: https://github.com/llvm/llvm-project/commit/5d929e66469d7d9ff8c63e7e1ec139c195510c94
DIFF: https://github.com/llvm/llvm-project/commit/5d929e66469d7d9ff8c63e7e1ec139c195510c94.diff

LOG: Move setBugReportMsg() out from under a conditional

Fixes a build break with LLVM_ENABLE_BACKTRACES=OFF.

Differential Revision: https://reviews.llvm.org/D76893

Added: 
    

Modified: 
    llvm/lib/Support/PrettyStackTrace.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Support/PrettyStackTrace.cpp b/llvm/lib/Support/PrettyStackTrace.cpp
index e1b834fe1347..3d310ed8916e 100644
--- a/llvm/lib/Support/PrettyStackTrace.cpp
+++ b/llvm/lib/Support/PrettyStackTrace.cpp
@@ -146,8 +146,6 @@ static const char *BugReportMsg =
     "PLEASE submit a bug report to " BUG_REPORT_URL
     " and include the crash backtrace.\n";
 
-void llvm::setBugReportMsg(const char *Msg) { BugReportMsg = Msg; }
-
 /// This callback is run if a fatal signal is delivered to the process, it
 /// prints the pretty stack trace.
 static void CrashHandler(void *) {
@@ -204,6 +202,12 @@ static void printForSigInfoIfNeeded() {
 
 #endif // ENABLE_BACKTRACES
 
+void llvm::setBugReportMsg(const char *Msg) {
+#if ENABLE_BACKTRACES
+  BugReportMsg = Msg;
+#endif
+}
+
 PrettyStackTraceEntry::PrettyStackTraceEntry() {
 #if ENABLE_BACKTRACES
   // Handle SIGINFO first, because we haven't finished constructing yet.


        


More information about the llvm-commits mailing list