diff options
author | Chung-Ju Wu <jasonwucj@gmail.com> | 2014-09-03 08:50:14 +0000 |
---|---|---|
committer | Chung-Ju Wu <jasonwucj@gcc.gnu.org> | 2014-09-03 08:50:14 +0000 |
commit | 126b11c6921e3e0b8eb29b60e5bf5b4dd83797d4 (patch) | |
tree | 09751509cb264dd7b510327dfae263b13113e48e | |
parent | dd1536a7267a0a8abf90aecae8379a1d871cda99 (diff) | |
download | gcc-126b11c6921e3e0b8eb29b60e5bf5b4dd83797d4.zip gcc-126b11c6921e3e0b8eb29b60e5bf5b4dd83797d4.tar.gz gcc-126b11c6921e3e0b8eb29b60e5bf5b4dd83797d4.tar.bz2 |
[NDS32] Add a function to indentify if FUNC is an interrupt service routine.
* 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.
From-SVN: r214855
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/nds32/nds32-isr.c | 24 | ||||
-rw-r--r-- | gcc/config/nds32/nds32-protos.h | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f9c795d..aa65d6a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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 arguments implementation. diff --git a/gcc/config/nds32/nds32-isr.c b/gcc/config/nds32/nds32-isr.c index ef0187c..bb8fcdd 100644 --- a/gcc/config/nds32/nds32-isr.c +++ b/gcc/config/nds32/nds32-isr.c @@ -574,4 +574,28 @@ nds32_asm_file_end_for_isr (void) } } +/* 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)); +} + /* ------------------------------------------------------------------------ */ diff --git a/gcc/config/nds32/nds32-protos.h b/gcc/config/nds32/nds32-protos.h index e281016..e57674a 100644 --- a/gcc/config/nds32/nds32-protos.h +++ b/gcc/config/nds32/nds32-protos.h @@ -136,6 +136,7 @@ extern void nds32_check_isr_attrs_conflict (tree, 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. */ |