|
Lines 42-47
static tree d_handle_noinline_attribute (tree *, tree, tree, int, bool *);
Link Here
|
| 42 |
static tree d_handle_forceinline_attribute (tree *, tree, tree, int, bool *); |
42 |
static tree d_handle_forceinline_attribute (tree *, tree, tree, int, bool *); |
| 43 |
static tree d_handle_flatten_attribute (tree *, tree, tree, int, bool *); |
43 |
static tree d_handle_flatten_attribute (tree *, tree, tree, int, bool *); |
| 44 |
static tree d_handle_target_attribute (tree *, tree, tree, int, bool *); |
44 |
static tree d_handle_target_attribute (tree *, tree, tree, int, bool *); |
|
|
45 |
static tree d_handle_noclone_attribute (tree *, tree, tree, int, bool *); |
| 45 |
|
46 |
|
| 46 |
|
47 |
|
| 47 |
static char lang_name[6] = "GNU D"; |
48 |
static char lang_name[6] = "GNU D"; |
|
Lines 56-64
const attribute_spec d_attribute_table[] =
Link Here
|
| 56 |
d_handle_flatten_attribute, false }, |
57 |
d_handle_flatten_attribute, false }, |
| 57 |
{ "target", 1, -1, true, false, false, |
58 |
{ "target", 1, -1, true, false, false, |
| 58 |
d_handle_target_attribute, false }, |
59 |
d_handle_target_attribute, false }, |
|
|
60 |
{ "noclone", 0, 0, true, false, false, |
| 61 |
d_handle_noclone_attribute, false }, |
| 59 |
{ NULL, 0, 0, false, false, false, NULL, false } |
62 |
{ NULL, 0, 0, false, false, false, NULL, false } |
| 60 |
}; |
63 |
}; |
| 61 |
|
64 |
|
|
|
65 |
const char* d_target_attributes[] = |
| 66 |
{ |
| 67 |
"naked", |
| 68 |
NULL |
| 69 |
}; |
| 70 |
|
| 62 |
/* Lang Hooks */ |
71 |
/* Lang Hooks */ |
| 63 |
#undef LANG_HOOKS_NAME |
72 |
#undef LANG_HOOKS_NAME |
| 64 |
#undef LANG_HOOKS_INIT |
73 |
#undef LANG_HOOKS_INIT |
|
Lines 1771-1774
d_handle_target_attribute (tree *node, tree name, tree args, int flags,
Link Here
|
| 1771 |
return NULL_TREE; |
1780 |
return NULL_TREE; |
| 1772 |
} |
1781 |
} |
| 1773 |
|
1782 |
|
|
|
1783 |
/* Handle a "noclone" attribute. */ |
| 1784 |
|
| 1785 |
static tree |
| 1786 |
d_handle_noclone_attribute (tree *node, tree name, |
| 1787 |
tree ARG_UNUSED (args), |
| 1788 |
int ARG_UNUSED (flags), |
| 1789 |
bool *no_add_attrs) |
| 1790 |
{ |
| 1791 |
Type *t = build_dtype (TREE_TYPE (*node)); |
| 1792 |
|
| 1793 |
if (t->ty == Tfunction) |
| 1794 |
{ |
| 1795 |
tree attributes = DECL_ATTRIBUTES (*node); |
| 1796 |
|
| 1797 |
// Push attribute noclone. |
| 1798 |
if (! lookup_attribute ("noclone", attributes)) |
| 1799 |
DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("noclone"), |
| 1800 |
NULL_TREE, attributes); |
| 1801 |
} |
| 1802 |
else |
| 1803 |
{ |
| 1804 |
warning (OPT_Wattributes, "%qE attribute ignored", name); |
| 1805 |
*no_add_attrs = true; |
| 1806 |
} |
| 1807 |
|
| 1808 |
return NULL_TREE; |
| 1809 |
} |
| 1810 |
|
| 1774 |
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; |
1811 |
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; |