]> granicus.if.org Git - llvm/commitdiff
Unix/Signals.inc: Let findModulesAndOffsets() built conditionally regarding to (defin...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 13 Oct 2014 04:32:43 +0000 (04:32 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Mon, 13 Oct 2014 04:32:43 +0000 (04:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219596 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Unix/Signals.inc

index 39cf662c13594125ccdd73e870e7cfe475dc0171..d9463b915b9880bf30f2dddd985d95e22f7dc14c 100644 (file)
@@ -272,6 +272,8 @@ void llvm::sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) {
   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 **StackTrace, int Depth,
 }
 #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(void **StackTrace, int Depth, FILE *FD) {
   }
   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.