h8300.c (TARGET_INSERT_ATTRIBUTES): Define.
authorDhananjay R. Deshpande <dhananjayd@kpit.com>
Thu, 20 Jun 2002 02:43:13 +0000 (02:43 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 20 Jun 2002 02:43:13 +0000 (02:43 +0000)
* config/h8300/h8300.c (TARGET_INSERT_ATTRIBUTES): Define.
(h8300_insert_attributes): New.

From-SVN: r54814

gcc/ChangeLog
gcc/config/h8300/h8300.c

index e4af10f33e96ede36dabf4441822f2bba92a8277..24c7826e32ff6fe5538869bec0f52916d0ee82a0 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-19  Dhananjay R. Deshpande  <dhananjayd@kpit.com>
+
+       * config/h8300/h8300.c (TARGET_INSERT_ATTRIBUTES): Define.
+       (h8300_insert_attributes): New.
+
 2002-06-19  Akim Demaille  <akim@epita.fr>
 
        * c-parse.in (initelt: identifier ':' initval): Add an empty
index 89918ab7c97d3756a795ccbec66190727da10b67..5406c19ab9492287d5bf26d49b07b57b92899a6f 100644 (file)
@@ -61,6 +61,7 @@ static tree h8300_handle_eightbit_data_attribute PARAMS ((tree *, tree, tree, in
 static tree h8300_handle_tiny_data_attribute PARAMS ((tree *, tree, tree, int, bool *));
 static void h8300_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
 static void h8300_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
+static void h8300_insert_attributes PARAMS ((tree, tree *));
 #ifndef OBJECT_FORMAT_ELF
 static void h8300_asm_named_section PARAMS ((const char *, unsigned int));
 #endif
@@ -119,6 +120,9 @@ const char *h8_push_op, *h8_pop_op, *h8_mov_op;
 #undef TARGET_STRIP_NAME_ENCODING
 #define TARGET_STRIP_NAME_ENCODING h8300_strip_name_encoding
 
+#undef TARGET_INSERT_ATTRIBUTES
+#define TARGET_INSERT_ATTRIBUTES h8300_insert_attributes
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Initialize various cpu specific globals at start up.  */
@@ -3409,6 +3413,22 @@ h8300_tiny_data_p (decl)
   return a != NULL_TREE;
 }
 
+/* Generate an 'interrupt_handler' attribute for decls.  */
+
+static void
+h8300_insert_attributes (node, attributes)
+     tree node;
+     tree *attributes;
+{
+  if (!interrupt_handler
+      || TREE_CODE (node) != FUNCTION_DECL)
+    return;
+
+  /* Add an 'interrupt_handler' attribute.  */
+  *attributes = tree_cons (get_identifier ("interrupt_handler"),
+                          NULL, *attributes);
+}
+
 /* Supported attributes:
 
    interrupt_handler: output a prologue and epilogue suitable for an