diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-22 16:41:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-22 16:41:17 -0800 |
commit | 3ad9c4ef9547611c451eefe9e5c35b03cdad3fe0 (patch) | |
tree | 916902b7d09e609fef67e9b5689b72f0d7367cbd /lib/Target/CppBackend/CPPBackend.cpp | |
parent | a3e2798dc1941d69edac9bbbb95384b89b7d8bfb (diff) |
make assert show something even in release builds
Diffstat (limited to 'lib/Target/CppBackend/CPPBackend.cpp')
-rw-r--r-- | lib/Target/CppBackend/CPPBackend.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index 0555d3a11c..453da61561 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -48,8 +48,11 @@ using namespace llvm; #define dumpv(x, ...) #endif -#define dumpfail(x) { fprintf(stderr, x "\n"); report_fatal_error("fail"); } -#define dumpfailv(x, ...) { fprintf(stderr, x "\n", __VA_ARGS__); report_fatal_error("fail"); } +#define dumpfail(x) { fprintf(stderr, x "\n"); fprintf(stderr, "%s : %d\n", __FILE__, __LINE__); report_fatal_error("fail"); } +#define dumpfailv(x, ...) { fprintf(stderr, x "\n", __VA_ARGS__); fprintf(stderr, "%s : %d\n", __FILE__, __LINE__); report_fatal_error("fail"); } + +#undef assert +#define assert(x) { if (!x) dumpfail(#x); } static cl::opt<std::string> FuncName("cppfname", cl::desc("Specify the name of the generated function"), |