[llvm] r219596 - Unix/Signals.inc: Let findModulesAndOffsets() built conditionally regarding to (defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)). [-Wunused-function]

NAKAMURA Takumi geek4civic at gmail.com
Sun Oct 12 21:32:43 PDT 2014


Author: chapuni
Date: Sun Oct 12 23:32:43 2014
New Revision: 219596

URL: http://llvm.org/viewvc/llvm-project?rev=219596&view=rev
Log:
Unix/Signals.inc: Let findModulesAndOffsets() built conditionally regarding to (defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)). [-Wunused-function]

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=219596&r1=219595&r2=219596&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc (original)
+++ llvm/trunk/lib/Support/Unix/Signals.inc Sun Oct 12 23:32:43 2014
@@ -272,6 +272,8 @@ void llvm::sys::AddSignalHandler(void (*
   RegisterHandlers();
 }
 
+#if defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
+
 #if HAVE_LINK_H && (defined(__linux__) || defined(__FreeBSD__) ||              \
                     defined(__FreeBSD_kernel__) || defined(__NetBSD__))
 struct DlIteratePhdrData {
@@ -322,7 +324,6 @@ 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.
@@ -407,7 +408,7 @@ static bool printSymbolizedStackTrace(vo
   }
   return true;
 }
-#endif
+#endif // defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)
 
 // 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