From 918332bea228e103fd2e81dc719a53e4c3122bac Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 21 Jul 2023 11:23:41 +0200 Subject: [PATCH 1/2] Add support for "ffi_const" function attribute --- src/attributes.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/attributes.rs b/src/attributes.rs index 6195de912d278..35682db9c785b 100644 --- a/src/attributes.rs +++ b/src/attributes.rs @@ -124,6 +124,9 @@ pub fn from_fn_attrs<'gcc, 'tcx>( if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_PURE) { func.add_attribute(FnAttribute::Pure); } + if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::FFI_CONST) { + func.add_attribute(FnAttribute::Const); + } } let function_features = From 136548d3fe9d2c8ac993d7d1b0d2e20256f02750 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 22 Jul 2023 14:44:20 +0200 Subject: [PATCH 2/2] Update gccjit dependency --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 488b51c9366b0..60df0e60988ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ dependencies = [ [[package]] name = "gccjit" version = "1.0.0" -source = "git+https://github.com/antoyo/gccjit.rs#de70a3bdc1908098ae4b10efc530bd695971a67c" +source = "git+https://github.com/antoyo/gccjit.rs#61d8d55c894bd462ee66c096cc31157a44a9f869" dependencies = [ "gccjit_sys", ] @@ -85,7 +85,7 @@ dependencies = [ [[package]] name = "gccjit_sys" version = "0.0.1" -source = "git+https://github.com/antoyo/gccjit.rs#de70a3bdc1908098ae4b10efc530bd695971a67c" +source = "git+https://github.com/antoyo/gccjit.rs#61d8d55c894bd462ee66c096cc31157a44a9f869" dependencies = [ "libc", ]