diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-11-21 20:46:58 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-11-21 20:46:58 +0800 |
commit | a733ee610f0935867bfee93c03e20b483d249aa4 (patch) | |
tree | a9f0235cfdf63d41e3893fb73677f91c9be27ef6 | |
parent | 98949d800e41cba0b5f93f94ce26aea311ede990 (diff) | |
download | mrust-a733ee610f0935867bfee93c03e20b483d249aa4.tar.gz |
MIR Helpers - Print file/line in assert
-rw-r--r-- | src/mir/helpers.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mir/helpers.hpp b/src/mir/helpers.hpp index f845e790..c2ffd13b 100644 --- a/src/mir/helpers.hpp +++ b/src/mir/helpers.hpp @@ -36,7 +36,7 @@ struct CheckFailure: }; #define MIR_BUG(state, ...) do { (state).print_bug( [&](auto& _os){_os << __VA_ARGS__; } ); throw ""; } while(0) -#define MIR_ASSERT(state, cnd, ...) do { if( !(cnd) ) (state).print_bug( [&](auto& _os){_os << "ASSERT " #cnd " failed - " << __VA_ARGS__; } ); } while(0) +#define MIR_ASSERT(state, cnd, ...) do { if( !(cnd) ) (state).print_bug( [&](auto& _os){_os << __FILE__ << ":" << __LINE__ << " ASSERT " #cnd " failed - " << __VA_ARGS__; } ); } while(0) #define MIR_TODO(state, ...) do { (state).print_todo( [&](auto& _os){_os << __VA_ARGS__; } ); throw ""; } while(0) #define MIR_DEBUG(state, ...) do { DEBUG(FMT_CB(_ss, (state).fmt_pos(_ss);) << __VA_ARGS__); } while(0) |