diff options
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 4064ad47411..4e9b9ad0675 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -709,4 +709,38 @@ default_hard_regno_scratch_ok (unsigned int regno ATTRIBUTE_UNUSED) return true; } +bool +default_target_option_valid_attribute_p (tree ARG_UNUSED (fndecl), + tree ARG_UNUSED (name), + tree ARG_UNUSED (args), + int ARG_UNUSED (flags)) +{ + return false; +} + +bool +default_target_option_can_inline_p (tree caller, tree callee) +{ + bool ret = false; + tree callee_opts = DECL_FUNCTION_SPECIFIC_TARGET (callee); + tree caller_opts = DECL_FUNCTION_SPECIFIC_TARGET (caller); + + /* If callee has no option attributes, then it is ok to inline */ + if (!callee_opts) + ret = true; + + /* If caller has no option attributes, but callee does then it is not ok to + inline */ + else if (!caller_opts) + ret = false; + + /* If both caller and callee have attributes, assume that if the pointer is + different, the the two functions have different target options since + build_target_option_node uses a hash table for the options. */ + else + ret = (callee_opts == caller_opts); + + return ret; +} + #include "gt-targhooks.h" |