From 9a75332cab42fe7f62306b230bdd01c142c94ec7 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 25 Jan 2017 02:27:45 +0000 Subject: DWARF: fix -Asserts builds no-op the DWARF tracing macros in non-debug builds. llvm-svn: 293008 --- libunwind/src/DwarfParser.hpp | 9 +-------- libunwind/src/config.h | 9 +++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'libunwind') diff --git a/libunwind/src/DwarfParser.hpp b/libunwind/src/DwarfParser.hpp index f4e5d487f4c..610a3aeb0ef 100644 --- a/libunwind/src/DwarfParser.hpp +++ b/libunwind/src/DwarfParser.hpp @@ -22,14 +22,7 @@ #include "dwarf2.h" #include "AddressSpace.hpp" - -extern "C" bool logDWARF(); - -#define _LIBUNWIND_TRACE_DWARF(...) \ - do { \ - if (logDWARF()) \ - fprintf(stderr, __VA_ARGS__); \ - } while (0) +#include "config.h" namespace libunwind { diff --git a/libunwind/src/config.h b/libunwind/src/config.h index fefb44e0a23..55c32825fe4 100644 --- a/libunwind/src/config.h +++ b/libunwind/src/config.h @@ -110,13 +110,16 @@ #define _LIBUNWIND_DEBUG_LOG(msg, ...) #define _LIBUNWIND_TRACE_API(msg, ...) #define _LIBUNWIND_TRACING_UNWINDING (0) + #define _LIBUNWIND_TRACING_DWARF (0) #define _LIBUNWIND_TRACE_UNWINDING(msg, ...) + #define _LIBUNWIND_TRACE_DWARF(...) #else #ifdef __cplusplus extern "C" { #endif extern bool logAPIs(); extern bool logUnwinding(); + extern bool logDWARF(); #ifdef __cplusplus } #endif @@ -127,11 +130,17 @@ _LIBUNWIND_LOG(msg, __VA_ARGS__); \ } while (0) #define _LIBUNWIND_TRACING_UNWINDING logUnwinding() + #define _LIBUNWIND_TRACING_DWARF logDWARF() #define _LIBUNWIND_TRACE_UNWINDING(msg, ...) \ do { \ if (logUnwinding()) \ _LIBUNWIND_LOG(msg, __VA_ARGS__); \ } while (0) + #define _LIBUNWIND_TRACE_DWARF(...) \ + do { \ + if (logDWARF()) \ + fprintf(stderr, __VA_ARGS__); \ + } while (0) #endif #ifdef __cplusplus -- cgit v1.2.1