diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-04 20:57:37 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-04 20:57:37 +0800 |
commit | 44cb8f56e6f2828b588408a9efd1f1fa019ab11c (patch) | |
tree | a72777d75c8af4e013133f02e0da449c5256c89f /src/mir/helpers.cpp | |
parent | 1cb526a077bfef3aba508927250e3213186cf496 (diff) | |
download | mrust-44cb8f56e6f2828b588408a9efd1f1fa019ab11c.tar.gz |
MIR - Move vtable conversion to its own pass
Diffstat (limited to 'src/mir/helpers.cpp')
-rw-r--r-- | src/mir/helpers.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
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 <hir/type.hpp> #include <mir/mir.hpp> -#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<void(::std::ostream& os)> 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 { |