Skip to content

Commit

Permalink
Add const_allocate and const_deallocate intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jan 30, 2022
1 parent 3ff158e commit 1b8ea07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,16 @@ fn codegen_regular_intrinsic_call<'tcx>(
ret.write_cvalue(fx, CValue::by_val(is_eq_value, ret.layout()));
};

const_allocate, (c _size, c _align) {
// returns a null pointer at runtime.
let null = fx.bcx.ins().iconst(fx.pointer_type, 0);
ret.write_cvalue(fx, CValue::by_val(null, ret.layout()));
};

const_deallocate, (c _ptr, c _size, c _align) {
// nop at runtime.
};

black_box, (c a) {
// FIXME implement black_box semantics
ret.write_cvalue(fx, a);
Expand Down

0 comments on commit 1b8ea07

Please sign in to comment.