aboutsummaryrefslogtreecommitdiff
path: root/gcc/targhooks.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>2008-07-23 10:28:06 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2008-07-23 10:28:06 +0000
commitab442df7fb453434d80a779844fe1a10c0c802ab (patch)
treeefd8e61a3d2ff9dcff5eb5bf03e25922191f7df5 /gcc/targhooks.c
parent5295185c3150a8d31685dc44248aa058246bbe73 (diff)
downloadgcc-ab442df7fb453434d80a779844fe1a10c0c802ab.zip
gcc-ab442df7fb453434d80a779844fe1a10c0c802ab.tar.gz
gcc-ab442df7fb453434d80a779844fe1a10c0c802ab.tar.bz2
Add ability to set target options (ix86 only) and optimization options on a function specific basis
From-SVN: r138075
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r--gcc/targhooks.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 4064ad47..4e9b9ad 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"