Skip to content

Commit 65ac9f5

Browse files
committed
Support more calling convention attributes
1 parent 6d8fffe commit 65ac9f5

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ master = ["gccjit/master"]
2222
default = ["master"]
2323

2424
[dependencies]
25-
gccjit = "2.5"
25+
gccjit = "2.6"
2626
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs" }
2727

2828
# Local copy.

libgccjit.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0ea98a1365b81f7488073512c850e8ee951a4afd
1+
8b194529188f9d3a98cc211caa805a5355bfa8f0

src/abi.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -251,27 +251,26 @@ pub fn conv_to_fn_attribute<'gcc>(conv: Conv, arch: &str) -> Option<FnAttribute<
251251
Conv::PreserveMost => return None,
252252
Conv::PreserveAll => return None,
253253
Conv::GpuKernel => {
254-
// TODO(antoyo): remove clippy allow attribute when this is implemented.
255-
#[allow(clippy::if_same_then_else)]
256254
if arch == "amdgpu" {
257-
return None;
255+
FnAttribute::GcnAmdGpuHsaKernel
258256
} else if arch == "nvptx64" {
259-
return None;
257+
FnAttribute::NvptxKernel
260258
} else {
261259
panic!("Architecture {} does not support GpuKernel calling convention", arch);
262260
}
263261
}
264-
Conv::AvrInterrupt => return None,
265-
Conv::AvrNonBlockingInterrupt => return None,
266-
Conv::ArmAapcs => return None,
267-
Conv::Msp430Intr => return None,
268-
Conv::X86Fastcall => return None,
269-
Conv::X86Intr => return None,
270-
Conv::X86Stdcall => return None,
271-
Conv::X86ThisCall => return None,
262+
// TODO(antoyo): check if those AVR attributes are mapped correctly.
263+
Conv::AvrInterrupt => FnAttribute::AvrSignal,
264+
Conv::AvrNonBlockingInterrupt => FnAttribute::AvrInterrupt,
265+
Conv::ArmAapcs => FnAttribute::ArmPcs("aapcs"),
266+
Conv::Msp430Intr => FnAttribute::Msp430Interrupt,
267+
Conv::X86Fastcall => FnAttribute::X86FastCall,
268+
Conv::X86Intr => FnAttribute::X86Interrupt,
269+
Conv::X86Stdcall => FnAttribute::X86Stdcall,
270+
Conv::X86ThisCall => FnAttribute::X86ThisCall,
272271
Conv::X86VectorCall => return None,
273-
Conv::X86_64SysV => FnAttribute::SysvAbi,
274-
Conv::X86_64Win64 => FnAttribute::MsAbi,
272+
Conv::X86_64SysV => FnAttribute::X86SysvAbi,
273+
Conv::X86_64Win64 => FnAttribute::X86MsAbi,
275274
};
276275
Some(attribute)
277276
}

0 commit comments

Comments
 (0)