Skip to content

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

Merged
merged 1 commit into from
Oct 24, 2017
Merged

Conversation

jrmuizel
Copy link
Contributor

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.

@@ -49,6 +49,12 @@ impl FunctionKind {
}
}

#[derive(Debug, Clone, Copy)]
pub enum Linkage {
Copy link
Contributor

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.

@@ -69,6 +75,9 @@ pub struct Function {

/// The kind of function this is.
kind: FunctionKind,

// The linkage of the function.
Copy link
Contributor

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.

@emilio
Copy link
Contributor

emilio commented Oct 23, 2017

@bors-servo delegate+

@bors-servo
Copy link

✌️ @jrmuizel can now approve this pull request

@@ -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.
Copy link
Contributor

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.
@emilio
Copy link
Contributor

emilio commented Oct 24, 2017

I just addressed my previous comment too.

@bors-servo r+

@bors-servo
Copy link

📌 Commit 02dc2bf has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 02dc2bf with merge 36aa5f4...

bors-servo pushed a commit that referenced this pull request Oct 24, 2017
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.
@bors-servo
Copy link

☀️ Test successful - status-travis
Approved by: emilio
Pushing 36aa5f4 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants