summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-04-28 14:07:30 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-04-28 14:07:30 +0800
commit8d08853331807ad28058487e875e2f9adbfa92da (patch)
treead4104bde2bd8a6c5919893db357c20bd417dfa0 /src
parent52345410605ff97a996a6f18383e7544fbf0b159 (diff)
downloadmrust-8d08853331807ad28058487e875e2f9adbfa92da.tar.gz
MIR Helpers - Fill bitmap after a read of a borrowed value
Diffstat (limited to 'src')
-rw-r--r--src/mir/helpers.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mir/helpers.cpp b/src/mir/helpers.cpp
index 7e9e209c..839cfe71 100644
--- a/src/mir/helpers.cpp
+++ b/src/mir/helpers.cpp
@@ -663,6 +663,12 @@ void MIR_Helper_GetLifetimes_DetermineValueLifetime(
{
this->fill_to(stmt_idx);
}
+ else
+ {
+ m_is_borrowed = false;
+ this->fill_to(stmt_idx);
+ m_is_borrowed = true;
+ }
}
void fmt(::std::ostream& os) const {
os << "BB" << bb_history.front() << "/" << last_read_ofs << "--";
@@ -958,6 +964,7 @@ void MIR_Helper_GetLifetimes_DetermineValueLifetime(
}
}
+#if 0
// TODO: Have a bitmap of if a BB mentions this value. If there are no unvisited BBs that mention this value, stop early.
// - CATCH: The original BB contains a reference, but might not have been visited (if it was the terminating call that triggered)
// - Also, we don't want to give up early (if we loop back to the start of the first block)
@@ -988,6 +995,7 @@ void MIR_Helper_GetLifetimes_DetermineValueLifetime(
return ;
}
}
+#endif
// Special case for when doing multiple runs on the same output
if( vl.stmt_bitmap.at( block_offsets.at(bb_idx) + 0) )