Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
View | Details | Raw Unified | Return to bug 114
Collapse All | Expand All

(-)a/gcc/d/d-lang.cc (+62 lines)
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_naked_attribute (tree *, tree, tree, int, bool *);
46
static tree d_handle_noclone_attribute (tree *, tree, tree, int, bool *);
45
47
46
48
47
static char lang_name[6] = "GNU D";
49
static char lang_name[6] = "GNU D";
Lines 56-61 const attribute_spec d_attribute_table[] = Link Here
56
				d_handle_flatten_attribute, false },
58
				d_handle_flatten_attribute, false },
57
    { "target",                 1, -1, true, false, false,
59
    { "target",                 1, -1, true, false, false,
58
				d_handle_target_attribute, false },
60
				d_handle_target_attribute, false },
61
    { "naked",                  0, 0, true, false, false,
62
				d_handle_naked_attribute, false }, 
63
    { "noclone",                0, 0, true, false, false,
64
				d_handle_noclone_attribute, false }, 
59
    { NULL,                     0, 0, false, false, false, NULL, false }
65
    { NULL,                     0, 0, false, false, false, NULL, false }
60
};
66
};
61
67
Lines 1771-1774 d_handle_target_attribute (tree *node, tree name, tree args, int flags, Link Here
1771
  return NULL_TREE;
1777
  return NULL_TREE;
1772
}
1778
}
1773
1779
1780
/* Handle a "naked" attribute.  */
1781
1782
static tree
1783
d_handle_naked_attribute (tree *node, tree name,
1784
				tree ARG_UNUSED (args),
1785
				int ARG_UNUSED (flags),
1786
				bool *no_add_attrs)
1787
{
1788
  Type *t = build_dtype (TREE_TYPE (*node));
1789
1790
  if (t->ty == Tfunction)
1791
    {
1792
      tree attributes = DECL_ATTRIBUTES (*node);
1793
1794
      // Push attribute naked.
1795
      if (! lookup_attribute ("naked", attributes))
1796
	DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("naked"),
1797
					     NULL_TREE, attributes);
1798
    }
1799
  else
1800
    {
1801
      warning (OPT_Wattributes, "%qE attribute ignored", name);
1802
      *no_add_attrs = true;
1803
    }
1804
1805
  return NULL_TREE;
1806
}
1807
1808
/* Handle a "noclone" attribute.  */
1809
1810
static tree
1811
d_handle_noclone_attribute (tree *node, tree name,
1812
				tree ARG_UNUSED (args),
1813
				int ARG_UNUSED (flags),
1814
				bool *no_add_attrs)
1815
{
1816
  Type *t = build_dtype (TREE_TYPE (*node));
1817
1818
  if (t->ty == Tfunction)
1819
    {
1820
      tree attributes = DECL_ATTRIBUTES (*node);
1821
1822
      // Push attribute noclone.
1823
      if (! lookup_attribute ("noclone", attributes))
1824
	DECL_ATTRIBUTES (*node) = tree_cons (get_identifier ("noclone"),
1825
					     NULL_TREE, attributes);
1826
    }
1827
  else
1828
    {
1829
      warning (OPT_Wattributes, "%qE attribute ignored", name);
1830
      *no_add_attrs = true;
1831
    }
1832
1833
  return NULL_TREE;
1834
}
1835
1774
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
1836
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;

Return to bug 114