-
Notifications
You must be signed in to change notification settings - Fork 13.4k
add extern "custom"
functions
#140770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
add extern "custom"
functions
#140770
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,11 @@ pub(crate) fn conv_to_call_conv( | |
CanonAbi::Rust | CanonAbi::C => default_call_conv, | ||
CanonAbi::RustCold => CallConv::Cold, | ||
|
||
// Functions with this calling convention can only be called from assembly, but it is | ||
// possible to declare an `extern "custom"` block, so the backend still needs a calling | ||
// convention for declaring foreign functions. | ||
CanonAbi::Custom => default_call_conv, | ||
Comment on lines
+54
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems reasonable but I wonder if down the line clif (or the other backends) might want to have some kind of calling convention representation that can be |
||
|
||
CanonAbi::X86(x86_call) => match x86_call { | ||
X86Call::SysV64 => CallConv::SystemV, | ||
X86Call::Win64 => CallConv::WindowsFastcall, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
hir_analysis_abi_custom_clothed_function = | ||
functions with the `"custom"` ABI must be naked | ||
.suggestion = add the `#[unsafe(naked)]` attribute to this function | ||
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth hinting at the other way to have a
|
||
|
||
hir_analysis_ambiguous_assoc_item = ambiguous associated {$assoc_kind} `{$assoc_ident}` in bounds of `{$qself}` | ||
.label = ambiguous associated {$assoc_kind} `{$assoc_ident}` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Return a span encompassing the header, or none if all options are default.
Or similar