-
Notifications
You must be signed in to change notification settings - Fork 745
Store function linkage in the ir #1091
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
Conversation
src/ir/function.rs
Outdated
@@ -49,6 +49,12 @@ impl FunctionKind { | |||
} | |||
} | |||
|
|||
#[derive(Debug, Clone, Copy)] | |||
pub enum Linkage { |
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.
Could you document this enum and the variants, please? Travis is complaining because of that.
src/ir/function.rs
Outdated
@@ -69,6 +75,9 @@ pub struct Function { | |||
|
|||
/// The kind of function this is. | |||
kind: FunctionKind, | |||
|
|||
// The linkage of the function. |
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.
Let's use a doc comment here too for consistency.
@bors-servo delegate+ |
✌️ @jrmuizel can now approve this pull request |
src/codegen/mod.rs
Outdated
@@ -3127,6 +3127,13 @@ impl CodeGenerator for Function { | |||
debug!("<Function as CodeGenerator>::codegen: item = {:?}", item); | |||
debug_assert!(item.is_enabled_for_codegen(ctx)); | |||
|
|||
// We can't currently do anything with Internal functions so just | |||
// them. |
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.
So just avoid generating them?
Also I wonder if it looks nicer to just do self.linkage() != Linkage::Internal
.
This lets us capture 'static inline' functions in the ir and filter them later down the pipeline. This is the first step on the way to handling these functions better.
I just addressed my previous comment too. @bors-servo r+ |
📌 Commit 02dc2bf has been approved by |
Store function linkage in the ir This lets us capture 'static inline' functions in the ir and filter them later down the pipeline. This is the first step on the way to handling these functions better.
☀️ Test successful - status-travis |
This lets us capture 'static inline' functions in the ir and filter them
later down the pipeline. This is the first step on the way to handling
these functions better.