[llvm] r219558 - Guard the definition of the stack tracing function with the same macros

Chandler Carruth chandlerc at gmail.com
Fri Oct 10 18:04:41 PDT 2014


Author: chandlerc
Date: Fri Oct 10 20:04:40 2014
New Revision: 219558

URL: http://llvm.org/viewvc/llvm-project?rev=219558&view=rev
Log:
Guard the definition of the stack tracing function with the same macros
that guard its usage. Without this, we can get unused function warnings
when backtraces are disabled.

Modified:
    llvm/trunk/lib/Support/Unix/Signals.inc

Modified: llvm/trunk/lib/Support/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Signals.inc?rev=219558&r1=219557&r2=219558&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc (original)
+++ llvm/trunk/lib/Support/Unix/Signals.inc Fri Oct 10 20:04:40 2014
@@ -322,6 +322,7 @@ static bool findModulesAndOffsets(void *
 }
 #endif
 
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
 static bool printSymbolizedStackTrace(void **StackTrace, int Depth, FILE *FD) {
   // FIXME: Subtract necessary number from StackTrace entries to turn return addresses
   // into actual instruction addresses.
@@ -406,6 +407,7 @@ static bool printSymbolizedStackTrace(vo
   }
   return true;
 }
+#endif
 
 // PrintStackTrace - In the case of a program crash or fault, print out a stack
 // trace so that the user has an indication of why and where we died.





More information about the llvm-commits mailing list