diff --git a/gccjit_sys/src/lib.rs b/gccjit_sys/src/lib.rs index 0588c8a..fbd8f97 100644 --- a/gccjit_sys/src/lib.rs +++ b/gccjit_sys/src/lib.rs @@ -265,6 +265,7 @@ pub enum gcc_jit_fn_attribute GCC_JIT_FN_ATTRIBUTE_VISIBILITY, GCC_JIT_FN_ATTRIBUTE_COLD, GCC_JIT_FN_ATTRIBUTE_RETURNS_TWICE, + GCC_JIT_FN_ATTRIBUTE_PURE, } #[cfg(feature="master")] diff --git a/src/function.rs b/src/function.rs index e03baf4..7eb7a26 100644 --- a/src/function.rs +++ b/src/function.rs @@ -57,6 +57,7 @@ pub enum FnAttribute<'a> { Visibility(Visibility), Cold, ReturnsTwice, + Pure, } #[cfg(feature="master")] @@ -70,7 +71,8 @@ impl<'a> FnAttribute<'a> { | FnAttribute::NoInline | FnAttribute::Used | FnAttribute::Cold - | FnAttribute::ReturnsTwice => AttributeValue::None, + | FnAttribute::ReturnsTwice + | FnAttribute::Pure => AttributeValue::None, } } @@ -84,6 +86,7 @@ impl<'a> FnAttribute<'a> { FnAttribute::Visibility(_) => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_VISIBILITY, FnAttribute::Cold => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_COLD, FnAttribute::ReturnsTwice => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_RETURNS_TWICE, + FnAttribute::Pure => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_PURE, } } }