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

Projects
None yet
5 participants
@arielb1
Copy link
Contributor

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()) }

This comment has been minimized.

@eddyb

eddyb Mar 3, 2016

Member

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

This comment has been minimized.

@arielb1

arielb1 Mar 3, 2016

Author Contributor

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

This comment has been minimized.

@eddyb

eddyb Mar 3, 2016

Member

Nevermind, load_ty already handles this correctly via to_arg_ty.

@@ -0,0 +1,9 @@
const ERROR_CONST: bool = true;

This comment has been minimized.

@eddyb

eddyb Mar 3, 2016

Member

Does this work without a license header?

This comment has been minimized.

@arielb1

arielb1 Mar 3, 2016

Author Contributor

Fixing that.

@arielb1 arielb1 force-pushed the arielb1:load-const branch from 9ee4b30 to cf29344 Mar 3, 2016

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Mar 3, 2016

@bors r+

@bors

This comment has been minimized.

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 added a commit that referenced this pull request Mar 4, 2016

bors added a commit that referenced this pull request Mar 4, 2016

@bors

This comment has been minimized.

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@arielb1

This comment has been minimized.

Copy link
Contributor Author

arielb1 commented Mar 4, 2016

nominating for beta since this fixes a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.