Bugzilla – Attachment 64 Details for
Bug 114
Add support for the GCC 'naked' attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug creation and email sending has been disabled, file new bugs at
gcc.gnu.org/bugzilla
[patch]
Patch to add @attribute("naked")
naked.patch (text/plain), 2.56 KB, created by
Johannes Pfau
on 2014-04-05 09:17:43 CEST
(
hide
)
Description:
Patch to add @attribute("naked")
Filename:
MIME Type:
Creator:
Johannes Pfau
Created:
2014-04-05 09:17:43 CEST
Size:
2.56 KB
patch
obsolete
>diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc >index ea8549f..ea1339c 100644 >--- a/gcc/d/d-lang.cc >+++ b/gcc/d/d-lang.cc >@@ -42,6 +42,8 @@ static tree d_handle_noinline_attribute (tree *, tree, tree, int, bool *); > static tree d_handle_forceinline_attribute (tree *, tree, tree, int, bool *); > static tree d_handle_flatten_attribute (tree *, tree, tree, int, bool *); > static tree d_handle_target_attribute (tree *, tree, tree, int, bool *); >+static tree d_handle_naked_attribute (tree *, tree, tree, int, bool *); >+static tree d_handle_noclone_attribute (tree *, tree, tree, int, bool *); > > > static char lang_name[6] = "GNU D"; >@@ -56,6 +58,10 @@ const attribute_spec d_attribute_table[] = > d_handle_flatten_attribute, false }, > { "target", 1, -1, true, false, false, > d_handle_target_attribute, false }, >+ { "naked", 0, 0, true, false, false, >+ d_handle_naked_attribute, false }, >+ { "noclone", 0, 0, true, false, false, >+ d_handle_noclone_attribute, false }, > { NULL, 0, 0, false, false, false, NULL, false } > }; > >@@ -1771,4 +1777,60 @@ d_handle_target_attribute (tree *node, tree name, tree args, int flags, > return NULL_TREE; > } > >+/* Handle a "naked" attribute. */ >+ >+static tree >+d_handle_naked_attribute (tree *node, tree name, >+ tree ARG_UNUSED (args), >+ int ARG_UNUSED (flags), >+ bool *no_add_attrs) >+{ >+ Type *t = build_dtype (TREE_TYPE (*node)); >+ >+ if (t->ty == Tfunction) >+ { >+ tree attributes = DECL_ATTRIBUTES (*node); >+ >+ // Push attribute naked. >+ if (! lookup_attribute ("naked", attributes)) >+ DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("naked"), >+ NULL_TREE, attributes); >+ } >+ else >+ { >+ warning (OPT_Wattributes, "%qE attribute ignored", name); >+ *no_add_attrs = true; >+ } >+ >+ return NULL_TREE; >+} >+ >+/* Handle a "noclone" attribute. */ >+ >+static tree >+d_handle_noclone_attribute (tree *node, tree name, >+ tree ARG_UNUSED (args), >+ int ARG_UNUSED (flags), >+ bool *no_add_attrs) >+{ >+ Type *t = build_dtype (TREE_TYPE (*node)); >+ >+ if (t->ty == Tfunction) >+ { >+ tree attributes = DECL_ATTRIBUTES (*node); >+ >+ // Push attribute noclone. >+ if (! lookup_attribute ("noclone", attributes)) >+ DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("noclone"), >+ NULL_TREE, attributes); >+ } >+ else >+ { >+ warning (OPT_Wattributes, "%qE attribute ignored", name); >+ *no_add_attrs = true; >+ } >+ >+ return NULL_TREE; >+} >+ > struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 114
:
64
|
65
|
66