-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Deduplicate pretty printing of constants #67133
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
Changes from all commits
02dbb35
02f4eeb
3b82edd
4ddb4bd
e22ddfd
b837e71
b2e93a4
1191eb4
154f3f1
b78dbf4
fff2e0f
cc9ca64
2e91065
db9ddf1
d0b1211
6e73a14
306df94
6ca65bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ fn main() { | |
// START rustc.main.ConstProp.before.mir | ||
// bb0: { | ||
// ... | ||
// _3 = const Scalar(alloc0+0) : &u8; | ||
// _3 = const {alloc0+0: &u8}; | ||
// _2 = (*_3); | ||
// ... | ||
// _5 = const Scalar(alloc0+0) : &u8; | ||
// _5 = const {alloc0+0: &u8}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably make sure that when printing out some MIR we include all of the referenced allocations as well. Please make an issue and add FIXMEs in every file that mentions miri |
||
// _4 = (*_5); | ||
// _1 = Add(move _2, move _4); | ||
// ... | ||
|
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.
If
+0
is common, maybe it should be omitted?And maybe it should say
&alloc1: &i32
, and for a raw pointer be&raw const alloc1: *const i32
.Or we could have
&(alloc1: i32)
(and no braces?), not sure which one is nicer.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.
I feel that could be confusing... it is more consistent to always have the offset.
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.
I almost feel like
{alloc1+12: &i32}
should be this monster:Is that too much? I don't know.
I care much more about showing what
alloc1
actually consists of, somewhere in the same file, than the syntax here though.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.
OMG WTF.^^
At least for Miri tracing, that would be a disaster -- way too verbose. And it's still not actual Rust code so why bother?
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.
I think I agree for miri purposes, but I'd prefer if constants in MIR were as close to Rust as possible.
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.
I'm going to address this when also starting to emit the allocations