diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-01-30 17:26:53 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-01-30 17:35:33 +0100 |
| commit | 1b8ea0705e235828e86d85e9707cea14a034fb19 (patch) | |
| tree | d65f2ff199c0b4d4683646f5122046473adefb6d | |
| parent | 3ff158e3ed06f9d16d7a0067952642751eb176e1 (diff) | |
| download | rust-1b8ea0705e235828e86d85e9707cea14a034fb19.tar.gz rust-1b8ea0705e235828e86d85e9707cea14a034fb19.zip | |
Add const_allocate and const_deallocate intrinsics
| -rw-r--r-- | src/intrinsics/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 1756cf78c2d..693b0e21444 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -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); |
