Uh oh!
There was an error while loading. Please reload this page.
Fix handling of FFI arguments - #33872
Conversation
nagisa
commented
May 25, 2016
Hmm, it clashes with debuginfo. |
| // FIXME: hacky lol? | ||
| datum::Datum::new(lltmp, arg_ty, | ||
| datum::Lvalue::new("datum::lvalue_scratch_datum")) |
There was a problem hiding this comment.
This won't work with debuginfo, which wants an alloca with no casts on top.
I would suggest giving it the alloca before the cast and hope that it doesn't care about the type (debuginfo metadata should describe the actual value in the alloca all by itself).
cc @michaelwoerister
alexcrichton
commented
May 26, 2016
Thanks for the quick fix @nagisa! |
ae8fc5c to
0d2a84cComparenagisa
commented
May 26, 2016
Added a check for debuginfo thing. All should work now. If there’s any hard-pressing nits, feel to fork and make another PR as I’m likely to be in bed for a while now. |
eddyb
commented
May 26, 2016
@bors r+ p=100 |
bors
commented
May 26, 2016
📌 Commit e0e50a4 has been approved by |
bors
commented
May 26, 2016
⌛ Testing commit e0e50a4 with merge 73fdf78... |
bors
commented
May 26, 2016
💔 Test failed - auto-linux-64-debug-opt |
eddyb
commented
May 26, 2016
Miscompiling the compiler, resulting in this for stage2 @alexcrichton Serious question: why is |
alexcrichton
commented
May 26, 2016
No particular reason, it just hasn't been done yet. We'd probably benefit from just setting it in the build system directly. |
nagisa
commented
May 26, 2016
@bors r=eddyb 2f0da79 |
nagisa
commented
May 26, 2016
bors
commented
May 26, 2016
Fix handling of FFI arguments r? @eddyb@nikomatsakis or whoever else. cc @alexcrichton @rust-lang/core The strategy employed here was to essentially change code we generate from ```llvm %s = alloca %S ; potentially smaller than argument, but never larger %1 = bitcast %S* %s to { i64, i64 }* store { i64, i64 } %0, { i64, i64 }* %1, align 4 ``` to ```llvm %1 = alloca { i64, i64 } ; the copy of argument itself store { i64, i64 } %0, { i64, i64 }* %1, align 4 %s = bitcast { i64, i64 }* %1 to %S* ; potentially truncate by casting to a pointer of smaller type. ```
bors
commented
May 26, 2016
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
nagisa
commented
May 26, 2016
@bors retry force |
bors
commented
May 26, 2016
sanxiyn
commented
May 26, 2016
Another case of #33844. |
bors
commented
May 26, 2016
alexcrichton
commented
May 26, 2016
Discussed on IRC and accepted for a beta backport |
r? @eddyb@nikomatsakis or whoever else.
cc @alexcrichton @rust-lang/core
The strategy employed here was to essentially change code we generate from
to