diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-04-28 22:47:59 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-04-28 22:47:59 +0800 |
commit | fc542c7e32eba2639af9f13368d307174d7045e9 (patch) | |
tree | f39dc47a97d56a30976d3f50c9953654bf10d0e6 /src/mir/helpers.cpp | |
parent | 647b1b3f8c55a5d0a7c48e722184b95f1d1dc6dd (diff) | |
download | mrust-fc542c7e32eba2639af9f13368d307174d7045e9.tar.gz |
MIR Check Full - Print the cause of invalidity
Diffstat (limited to 'src/mir/helpers.cpp')
-rw-r--r-- | src/mir/helpers.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mir/helpers.cpp b/src/mir/helpers.cpp index 2f787927..9242ccb7 100644 --- a/src/mir/helpers.cpp +++ b/src/mir/helpers.cpp @@ -34,6 +34,13 @@ void ::MIR::TypeResolve::print_msg(const char* tag, ::std::function<void(::std:: //throw CheckFailure {}; } +unsigned int ::MIR::TypeResolve::get_cur_stmt_ofs() const +{ + if( this->stmt_idx == STMT_TERM ) + return m_fcn.blocks.at(this->bb_idx).statements.size(); + else + return this->stmt_idx; +} const ::MIR::BasicBlock& ::MIR::TypeResolve::get_block(::MIR::BasicBlockId id) const { MIR_ASSERT(*this, id < m_fcn.blocks.size(), "Block ID " << id << " out of range"); |