Skip to content
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

truncate i8-s to i1-s when loading constants #32032

Merged
merged 1 commit into from
Mar 4, 2016

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Mar 3, 2016

Fixes #30891

r? @eddyb

llvm::LLVMGetInitializer(v)
let d = unsafe { llvm::LLVMGetInitializer(v) };
if t.is_bool() {
unsafe { llvm::LLVMConstTrunc(d, Type::i1(cx).to_ref()) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there something similar in base::load_ty, using LLVMGetInitializer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a variant of load_ty that uses the const llvm functions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, load_ty already handles this correctly via to_arg_ty.

@eddyb
Copy link
Member

eddyb commented Mar 3, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Mar 3, 2016

📌 Commit cf29344 has been approved by eddyb

Manishearth added a commit to Manishearth/rust that referenced this pull request Mar 4, 2016
@bors
Copy link
Contributor

bors commented Mar 4, 2016

⌛ Testing commit cf29344 with merge c97524b...

bors added a commit that referenced this pull request Mar 4, 2016
@bors bors merged commit cf29344 into rust-lang:master Mar 4, 2016
@arielb1 arielb1 added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 4, 2016
@arielb1
Copy link
Contributor Author

arielb1 commented Mar 4, 2016

nominating for beta since this fixes a regression.

@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Mar 10, 2016
@brson brson removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants