-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Fix a bug in inline assembly llvm IR generation #23466
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
Conversation
…used regardless of target
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
Great first pr!! (Haven't read diff properly and can't r+, just wanted to thank and welcome) On Tuesday, March 17, 2015, Jordan Woehr [email protected] wrote:
|
} | ||
let clobbers = ia.clobbers.iter() | ||
.map(|s| format!("~{{{}}}", &s)) | ||
.collect::<Vec<String>>(); |
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 suspect this collect
may be unnecessary, and .chain(clobbers.into_iter())
below can become .chain(clobbers)
.
I addressed the unnecessary vector creation that @huonw pointed out. In doing so I now realize I accidentally changed an |
It largely depends on the use case at hand (whether you want to transfer ownership or not) so there's not really a hard-and-fast convention on which to prefer. For small cases like this it's generally whichever works out best! Thanks! |
This fixes a bug in LLVM IR generation for in-line assembly where Rust would always use the host clobbers instead of target clobbers. I also took this opportunity to clean/simplify the ```trans_inline_asm``` function. This is my first Rust pull request; please let me know if I'm missing anything.
This fixes a bug in LLVM IR generation for in-line assembly where Rust would always use the host clobbers instead of target clobbers.
I also took this opportunity to clean/simplify the
trans_inline_asm
function.This is my first Rust pull request; please let me know if I'm missing anything.