+2014-09-03 Chung-Ju Wu <jasonwucj@gmail.com>
+
+ * config/nds32/nds32-isr.c (nds32_isr_function_p): Define new function
+ to check if FUNC is an interrupt service routine.
+ * config/nds32/nds32-protos.h (nds32_isr_function_p): Declaration.
+
2014-09-03 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.h (machine_function): Add some fields for variadic
}
}
+/* Return true if FUNC is a isr function. */
+bool
+nds32_isr_function_p (tree func)
+{
+ tree t_intr;
+ tree t_excp;
+ tree t_reset;
+
+ tree attrs;
+
+ if (TREE_CODE (func) != FUNCTION_DECL)
+ abort ();
+
+ attrs = DECL_ATTRIBUTES (func);
+
+ t_intr = lookup_attribute ("interrupt", attrs);
+ t_excp = lookup_attribute ("exception", attrs);
+ t_reset = lookup_attribute ("reset", attrs);
+
+ return ((t_intr != NULL_TREE)
+ || (t_excp != NULL_TREE)
+ || (t_reset != NULL_TREE));
+}
+
/* ------------------------------------------------------------------------ */
extern void nds32_construct_isr_vectors_information (tree, const char *);
extern void nds32_asm_file_start_for_isr (void);
extern void nds32_asm_file_end_for_isr (void);
+extern bool nds32_isr_function_p (tree);
/* Auxiliary functions for cost calculation. */