From 5adece02b6d0f29aef09e45863c2d37ba5ff0c6b Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 13 Oct 2014 04:32:43 +0000 Subject: [PATCH] Unix/Signals.inc: Let findModulesAndOffsets() built conditionally regarding to (defined(HAVE_BACKTRACE) && defined(ENABLE_BACKTRACES)). [-Wunused-function] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219596 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Signals.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc index 39cf662c135..d9463b915b9 100644 --- a/lib/Support/Unix/Signals.inc +++ b/lib/Support/Unix/Signals.inc @@ -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.