summaryrefslogtreecommitdiff
path: root/src/mir/helpers.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2017-01-22 12:14:01 +0800
committerJohn Hodge <tpg@mutabah.net>2017-01-22 12:14:01 +0800
commit726e32afac634e89495baca4c8c0ad04e95cec68 (patch)
tree225d49dc2e94527ebef16e141e2cf074bd247e1c /src/mir/helpers.hpp
parent4776f2c628c7c421e71ff89e732ae8aa7dae321f (diff)
downloadmrust-726e32afac634e89495baca4c8c0ad04e95cec68.tar.gz
MIR Optimise - Fixed replacement of unified temporaries
Diffstat (limited to 'src/mir/helpers.hpp')
-rw-r--r--src/mir/helpers.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mir/helpers.hpp b/src/mir/helpers.hpp
index 40dbd4a3..cc0766ec 100644
--- a/src/mir/helpers.hpp
+++ b/src/mir/helpers.hpp
@@ -33,6 +33,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_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)
class TypeResolve
{
@@ -79,6 +80,7 @@ public:
this->stmt_idx = STMT_TERM;
}
+ void fmt_pos(::std::ostream& os) const;
void print_bug(::std::function<void(::std::ostream& os)> cb) const {
print_msg("ERROR", cb);
}
@@ -95,5 +97,4 @@ public:
const ::HIR::TypeRef* is_type_owned_box(const ::HIR::TypeRef& ty) const;
};
-
} // namespace MIR