Skip to content

Commit

Permalink
promising vector element reconstruction
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Sep 11, 2024
1 parent 068a918 commit b94280a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/cpp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,7 @@ impl<'a, 'b> Bindgen for FunctionBindgen<'a, 'b> {
results.push(result);
}
abi::Instruction::ListLift { element, .. } => {
// let body = self.blocks.pop().unwrap();
let body = self.blocks.pop().unwrap();
let tmp = self.tmp();
let size = self.gen.sizes.size(element);
let _align = self.gen.sizes.align(element);
Expand Down Expand Up @@ -2940,7 +2940,8 @@ impl<'a, 'b> Bindgen for FunctionBindgen<'a, 'b> {
"auto base = {base} + i * {size};",
size = size.format(POINTER_SIZE_EXPRESSION)
);
uwriteln!(self.src, "auto e{tmp} = todo();");
uwrite!(self.src, "{}", body.0);
uwriteln!(self.src, "auto e{tmp} = {};", body.1[0]);
// inplace construct
uwriteln!(self.src, "{result}.initialize(i, std::move(e{tmp}));");
uwriteln!(self.src, "}}");
Expand Down

0 comments on commit b94280a

Please sign in to comment.