-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MIR] track Location in MirVisitor, combine Location #35542
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
pub fn is_terminator(&self, mir: &Mir) -> bool { | ||
self.statement_index < mir.basic_blocks()[self.block].statements.len() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline.
Seems like a win to me. @nagisa I don't quite understand your comment -- are you suggesting we should use a |
@bors r+ |
📌 Commit 16785b6 has been approved by |
@nikomatsakis I’m suggesting there’s a potential overflow. We have |
Well, this is a host- |
@nagisa I'm not quite following. If indeed we are running on a 16-bit host, then yes, usize will be 16-bits -- probably lots of stuff would fail, but anyway we surely (in that case) wouldn't have more than 2^16 statements in any given basic block, since that's the size of the address space we'd have available, and hence we'd still be able to represent the terminator in the same way, right? |
☔ The latest upstream changes (presumably #35403) made this pull request unmergeable. Please resolve the merge conflicts. |
a178a8d
to
fe40004
Compare
@bors r+ |
📌 Commit fe40004 has been approved by |
fe40004
to
fb84bb1
Compare
@bors r+ |
📌 Commit fb84bb1 has been approved by |
…atsakis [MIR] track Location in MirVisitor, combine Location All the users of MirVisitor::visit_statement implement their own statement index tracking. This PR move the tracking into MirVisitor itself. Also, there were 2 separate implementations of Location that were identical. This PR eliminates one of them.
☔ The latest upstream changes (presumably #35409) made this pull request unmergeable. Please resolve the merge conflicts. |
fb84bb1
to
0ff1282
Compare
@bors r+ |
📌 Commit 0ff1282 has been approved by |
@scottcarr hmm, these travis failures look legit...something about the interaction with constant expressions, perhaps an error in the port? |
@bors r+ |
📌 Commit c043a27 has been approved by |
[MIR] track Location in MirVisitor, combine Location All the users of MirVisitor::visit_statement implement their own statement index tracking. This PR move the tracking into MirVisitor itself. Also, there were 2 separate implementations of Location that were identical. This PR eliminates one of them.
All the users of MirVisitor::visit_statement implement their own statement index tracking. This PR move the tracking into MirVisitor itself.
Also, there were 2 separate implementations of Location that were identical. This PR eliminates one of them.