Skip to content

Commit d57a079

Browse files
authored
Merge pull request #49 from rust-lang/feature/even-more-calling-conv-attributes
Support more calling conv attributes
2 parents dd5bee6 + 3696123 commit d57a079

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gccjit"
3-
version = "2.6.0"
3+
version = "2.7.0"
44
authors = ["Sean Gillespie <[email protected]>", "Antoni Boucher <[email protected]>"]
55
description = "Higher-level Rust bindings for libgccjit."
66
keywords = ["compiler", "jit", "gcc"]
@@ -13,7 +13,7 @@ readme = "README.md"
1313
master = ["gccjit_sys/master"]
1414

1515
[dependencies]
16-
gccjit_sys = { version = "0.7.0", path = "gccjit_sys" }
16+
gccjit_sys = { version = "0.8.0", path = "gccjit_sys" }
1717

1818
[package.metadata.docs.rs]
1919
features = ["master"]

gccjit_sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gccjit_sys"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
authors = ["Sean Gillespie <[email protected]>", "Antoni Boucher <[email protected]>"]
55
#links = "gccjit"
66
description = "Raw bindings to libgccjit. Companion to the gccjit crate."

gccjit_sys/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,16 @@ pub enum gcc_jit_fn_attribute
276276
GCC_JIT_FN_ATTRIBUTE_CONST,
277277
GCC_JIT_FN_ATTRIBUTE_WEAK,
278278
GCC_JIT_FN_ATTRIBUTE_NONNULL,
279+
GCC_JIT_FN_ATTRIBUTE_ARM_CMSE_NONSECURE_CALL,
280+
GCC_JIT_FN_ATTRIBUTE_ARM_CMSE_NONSECURE_ENTRY,
279281
GCC_JIT_FN_ATTRIBUTE_ARM_PCS,
280282
GCC_JIT_FN_ATTRIBUTE_AVR_INTERRUPT,
281283
GCC_JIT_FN_ATTRIBUTE_AVR_NOBLOCK,
282284
GCC_JIT_FN_ATTRIBUTE_AVR_SIGNAL,
283285
GCC_JIT_FN_ATTRIBUTE_GCN_AMDGPU_HSA_KERNEL,
284286
GCC_JIT_FN_ATTRIBUTE_MSP430_INTERRUPT,
285287
GCC_JIT_FN_ATTRIBUTE_NVPTX_KERNEL,
288+
GCC_JIT_FN_ATTRIBUTE_RISCV_INTERRUPT,
286289
GCC_JIT_FN_ATTRIBUTE_X86_FAST_CALL,
287290
GCC_JIT_FN_ATTRIBUTE_X86_INTERRUPT,
288291
GCC_JIT_FN_ATTRIBUTE_X86_MS_ABI,

src/function.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ pub enum FnAttribute<'a> {
6060
Const,
6161
Weak,
6262
NonNull(Vec<std::ffi::c_int>),
63+
ArmCmseNonsecureCall,
64+
ArmCmseNonsecureEntry,
6365
ArmPcs(&'a str),
6466
AvrInterrupt,
6567
AvrNoblock,
6668
AvrSignal,
6769
GcnAmdGpuHsaKernel,
6870
Msp430Interrupt,
6971
NvptxKernel,
72+
RiscvInterrupt(&'a str),
7073
X86FastCall,
7174
X86Interrupt,
7275
X86MsAbi,
@@ -79,8 +82,8 @@ pub enum FnAttribute<'a> {
7982
impl<'a> FnAttribute<'a> {
8083
fn get_value(&self) -> AttributeValue {
8184
match *self {
82-
FnAttribute::Alias(value) | FnAttribute::ArmPcs(value) | FnAttribute::Target(value) =>
83-
AttributeValue::String(value),
85+
FnAttribute::Alias(value) | FnAttribute::ArmPcs(value)| FnAttribute::RiscvInterrupt(value)
86+
| FnAttribute::Target(value) => AttributeValue::String(value),
8487
FnAttribute::Visibility(visibility) => AttributeValue::String(visibility.as_str()),
8588
FnAttribute::AlwaysInline
8689
| FnAttribute::Inline
@@ -91,6 +94,8 @@ impl<'a> FnAttribute<'a> {
9194
| FnAttribute::Pure
9295
| FnAttribute::Const
9396
| FnAttribute::Weak
97+
| FnAttribute::ArmCmseNonsecureCall
98+
| FnAttribute::ArmCmseNonsecureEntry
9499
| FnAttribute::AvrInterrupt
95100
| FnAttribute::AvrNoblock
96101
| FnAttribute::AvrSignal
@@ -128,13 +133,16 @@ impl<'a> FnAttribute<'a> {
128133
FnAttribute::Const => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_CONST,
129134
FnAttribute::Weak => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_WEAK,
130135
FnAttribute::NonNull(_) => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_NONNULL,
136+
FnAttribute::ArmCmseNonsecureCall => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_ARM_CMSE_NONSECURE_CALL,
137+
FnAttribute::ArmCmseNonsecureEntry => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_ARM_CMSE_NONSECURE_ENTRY,
131138
FnAttribute::ArmPcs(_) => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_ARM_PCS,
132139
FnAttribute::AvrInterrupt => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_AVR_INTERRUPT,
133140
FnAttribute::AvrNoblock => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_AVR_NOBLOCK,
134141
FnAttribute::AvrSignal => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_AVR_SIGNAL,
135142
FnAttribute::GcnAmdGpuHsaKernel => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_GCN_AMDGPU_HSA_KERNEL,
136143
FnAttribute::Msp430Interrupt => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_MSP430_INTERRUPT,
137144
FnAttribute::NvptxKernel => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_NVPTX_KERNEL,
145+
FnAttribute::RiscvInterrupt(_) => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_RISCV_INTERRUPT,
138146
FnAttribute::X86FastCall => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_X86_FAST_CALL,
139147
FnAttribute::X86Interrupt => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_X86_INTERRUPT,
140148
FnAttribute::X86MsAbi => gccjit_sys::gcc_jit_fn_attribute::GCC_JIT_FN_ATTRIBUTE_X86_MS_ABI,

0 commit comments

Comments
 (0)