This revision was automatically updated to reflect the committed changes.
Closed by commit rL296135: [libunwind] Disable calls to fprintf for baremetal 
targets. (authored by rsingh).

Changed prior to commit:
  https://reviews.llvm.org/D30340?vs=89676&id=89679#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30340

Files:
  libunwind/trunk/src/config.h


Index: libunwind/trunk/src/config.h
===================================================================
--- libunwind/trunk/src/config.h
+++ libunwind/trunk/src/config.h
@@ -78,16 +78,27 @@
 #define _LIBUNWIND_BUILD_ZERO_COST_APIS 0
 #endif
 
+#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
+#define _LIBUNWIND_ABORT(msg)                                                  
\
+  do {                                                                         
\
+    abort();                                                                   
\
+  } while (0)
+#else
 #define _LIBUNWIND_ABORT(msg)                                                  
\
   do {                                                                         
\
     fprintf(stderr, "libunwind: %s %s:%d - %s\n", __func__, __FILE__,          
\
             __LINE__, msg);                                                    
\
     fflush(stderr);                                                            
\
     abort();                                                                   
\
   } while (0)
+#endif
 
+#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
+#define _LIBUNWIND_LOG(msg, ...)
+#else
 #define _LIBUNWIND_LOG(msg, ...)                                               
\
   fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__)
+#endif
 
 #if defined(_LIBUNWIND_HAS_NO_THREADS)
   // only used with pthread calls, not needed for the single-threaded builds


Index: libunwind/trunk/src/config.h
===================================================================
--- libunwind/trunk/src/config.h
+++ libunwind/trunk/src/config.h
@@ -78,16 +78,27 @@
 #define _LIBUNWIND_BUILD_ZERO_COST_APIS 0
 #endif
 
+#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
+#define _LIBUNWIND_ABORT(msg)                                                  \
+  do {                                                                         \
+    abort();                                                                   \
+  } while (0)
+#else
 #define _LIBUNWIND_ABORT(msg)                                                  \
   do {                                                                         \
     fprintf(stderr, "libunwind: %s %s:%d - %s\n", __func__, __FILE__,          \
             __LINE__, msg);                                                    \
     fflush(stderr);                                                            \
     abort();                                                                   \
   } while (0)
+#endif
 
+#if defined(NDEBUG) && defined(_LIBUNWIND_IS_BAREMETAL)
+#define _LIBUNWIND_LOG(msg, ...)
+#else
 #define _LIBUNWIND_LOG(msg, ...)                                               \
   fprintf(stderr, "libunwind: " msg "\n", __VA_ARGS__)
+#endif
 
 #if defined(_LIBUNWIND_HAS_NO_THREADS)
   // only used with pthread calls, not needed for the single-threaded builds
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to