forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#73034 - doctorn:nomangle-inline-linkage, r=…
…matthewjasper Export `#[inline]` fns with extern indicators In ancient history (rust-lang#36280) we stopped `#[inline]` fns being codegened if they weren't used. However, - rust-lang#72944 - rust-lang#72463 observe that when writing something like ```rust #![crate_type = "cdylib"] #[no_mangle] #[inline] pub extern "C" fn foo() { // ... } ``` we really _do_ want `foo` to be codegened. This change makes this the case. Resolves rust-lang#72944, resolves rust-lang#72463 (and maybe some more)
- Loading branch information
Showing
7 changed files
with
132 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// compile-flags: -C no-prepopulate-passes | ||
|
||
#![crate_type = "cdylib"] | ||
|
||
// CHECK: define void @a() | ||
#[no_mangle] | ||
#[inline] | ||
pub extern "C" fn a() {} | ||
|
||
// CHECK: define void @b() | ||
#[export_name = "b"] | ||
#[inline] | ||
pub extern "C" fn b() {} | ||
|
||
// CHECK: define void @c() | ||
#[no_mangle] | ||
#[inline] | ||
extern "C" fn c() {} | ||
|
||
// CHECK: define void @d() | ||
#[export_name = "d"] | ||
#[inline] | ||
extern "C" fn d() {} | ||
|
||
// CHECK: define void @e() | ||
#[no_mangle] | ||
#[inline(always)] | ||
pub extern "C" fn e() {} | ||
|
||
// CHECK: define void @f() | ||
#[export_name = "f"] | ||
#[inline(always)] | ||
pub extern "C" fn f() {} | ||
|
||
// CHECK: define void @g() | ||
#[no_mangle] | ||
#[inline(always)] | ||
extern "C" fn g() {} | ||
|
||
// CHECK: define void @h() | ||
#[export_name = "h"] | ||
#[inline(always)] | ||
extern "C" fn h() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// compile-flags: -C no-prepopulate-passes | ||
|
||
#![crate_type = "staticlib"] | ||
|
||
// CHECK: define void @a() | ||
#[no_mangle] | ||
#[inline] | ||
pub extern "C" fn a() {} | ||
|
||
// CHECK: define void @b() | ||
#[export_name = "b"] | ||
#[inline] | ||
pub extern "C" fn b() {} | ||
|
||
// CHECK: define void @c() | ||
#[no_mangle] | ||
#[inline] | ||
extern "C" fn c() {} | ||
|
||
// CHECK: define void @d() | ||
#[export_name = "d"] | ||
#[inline] | ||
extern "C" fn d() {} | ||
|
||
// CHECK: define void @e() | ||
#[no_mangle] | ||
#[inline(always)] | ||
pub extern "C" fn e() {} | ||
|
||
// CHECK: define void @f() | ||
#[export_name = "f"] | ||
#[inline(always)] | ||
pub extern "C" fn f() {} | ||
|
||
// CHECK: define void @g() | ||
#[no_mangle] | ||
#[inline(always)] | ||
extern "C" fn g() {} | ||
|
||
// CHECK: define void @h() | ||
#[export_name = "h"] | ||
#[inline(always)] | ||
extern "C" fn h() {} |