diff options
author | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-23 10:28:06 +0000 |
---|---|---|
committer | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-23 10:28:06 +0000 |
commit | 46f8e3b0dc1cbb88c7dde984d0f0c2ce8935011d (patch) | |
tree | efd8e61a3d2ff9dcff5eb5bf03e25922191f7df5 /gcc/targhooks.c | |
parent | e22d2ad745ca3d2ac08936833a802ffc161fc89b (diff) |
Add ability to set target options (ix86 only) and optimization options on a function specific basis
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138075 138bc75d-0d04-0410-961f-82ee72b054a4
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" |