Add a LLVM_DUMP_METHOD macro.
[oota-llvm.git] / include / llvm / Support / Compiler.h
index d4f55e1a1b275d8ded36c2dcc586c6430eac5c8d..a6b5687d505e087a79b708220e3154bbe9a92bdd 100644 (file)
 #define LLVM_HAS_INITIALIZER_LISTS 0
 #endif
 
+/// \brief Mark debug helper function definitions like dump() that should not be
+/// stripped from debug builds.
+// FIXME: Move this to a private config.h as it's not usable in public headers.
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+#define LLVM_DUMP_METHOD LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED
+#else
+#define LLVM_DUMP_METHOD LLVM_ATTRIBUTE_NOINLINE
+#endif
+
 #endif