diff options
-rw-r--r-- | src/include/debug.hpp | 7 | ||||
-rw-r--r-- | src/include/span.hpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/include/debug.hpp b/src/include/debug.hpp index 2f593cfb..3f059301 100644 --- a/src/include/debug.hpp +++ b/src/include/debug.hpp @@ -1,4 +1,11 @@ /* + * MRustC - Rust Compiler + * - By John Hodge (Mutabah/thePowersGang) + * + * include/debug.hpp + * - Common compiler debugging macros/helpers + * + * see also src/include/span.hpp */ #pragma once #include <sstream> diff --git a/src/include/span.hpp b/src/include/span.hpp index 59c960fc..68d6bfdf 100644 --- a/src/include/span.hpp +++ b/src/include/span.hpp @@ -74,4 +74,4 @@ Spanned<T> make_spanned(Span sp, T val) { #define BUG(span, msg) do { ::Span(span).bug([&](::std::ostream& os) { os << __FILE__ << ":" << __LINE__ << ": " << msg; }); throw ::std::runtime_error("Bug fell through"); } while(0) #define TODO(span, msg) do { const char* __TODO_func = __func__; ::Span(span).bug([&](::std::ostream& os) { os << __FILE__ << ":" << __LINE__ << ": TODO: " << __TODO_func << " - " << msg; }); throw ::std::runtime_error("Bug (todo) fell through"); } while(0) -#define ASSERT_BUG(span, cnd, msg) do { if( !(cnd) ) { ::Span(span).bug([&](::std::ostream& os) { os << "ASSERT FAIL: " #cnd << ": " << msg; }); throw ::std::runtime_error("Bug fell through"); } } while(0) +#define ASSERT_BUG(span, cnd, msg) do { if( !(cnd) ) { ::Span(span).bug([&](::std::ostream& os) { os << "ASSERT FAIL: " << __FILE__ << ":" << __LINE__ << ":" #cnd << ": " << msg; }); throw ::std::runtime_error("Bug fell through"); } } while(0) |