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
backend: handle no_mangle attribute #1149
Conversation
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.
You already spotted the mangle code piece so lets fix that as part of this PR. Otherwise great job again.
9ce1fbc
to
f4db42d
Compare
|
||
namespace Rust { | ||
namespace Compile { | ||
|
||
bool inline should_mangle_item (const tree fndecl) | ||
{ | ||
return lookup_attribute ("no_mangle", DECL_ATTRIBUTES (fndecl)) == NULL_TREE; |
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.
I really like how you did this to split up the logic.
I guess the GCC idiom would be that this should be a macro called SHOULD_MANGLE_ITEM_P and put it over in rust-tree.h not sure what design I want in the code-generation part at the moment so lets stick with this for now.
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.
I really like how you did this to split up the logic.
I guess the GCC idiom would be that this should be a macro called SHOULD_MANGLE_ITEM_P and put it over in rust-tree.h not sure what design I want in the code-generation part at the moment so lets stick with this for now.
Noted. I will keep this in mind in the near future.
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.
LGTM
f4db42d
to
a969ab6
Compare
bors r+ |
Build succeeded: |
no_mangle
attribute