From 44cb8f56e6f2828b588408a9efd1f1fa019ab11c Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 4 Dec 2016 20:57:37 +0800 Subject: MIR - Move vtable conversion to its own pass --- src/mir/helpers.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/mir/helpers.cpp') diff --git a/src/mir/helpers.cpp b/src/mir/helpers.cpp index 59aa3420..e0721549 100644 --- a/src/mir/helpers.cpp +++ b/src/mir/helpers.cpp @@ -11,9 +11,21 @@ #include #include -#define MIR_ASSERT(...) do{}while(0) -#define MIR_BUG(...) do{}while(0) -#define MIR_TODO(_, v...) TODO(sp, v) +void ::MIR::TypeResolve::print_msg(const char* tag, ::std::function cb) const +{ + auto& os = ::std::cerr; + os << "MIR " << tag << ": " << this->m_path << " BB" << this->bb_idx << "/"; + if( this->stmt_idx == STMT_TERM ) { + os << "TERM"; + } + else { + os << this->stmt_idx; + } + os << ": "; + cb(os); + os << ::std::endl; + throw CheckFailure {}; +} const ::HIR::TypeRef& ::MIR::TypeResolve::get_lvalue_type(::HIR::TypeRef& tmp, const ::MIR::LValue& val) const { -- cgit v1.2.3