public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P
@ 2009-07-09  2:19 DJ Delorie
  2009-07-09  4:29 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: DJ Delorie @ 2009-07-09  2:19 UTC (permalink / raw)
  To: gcc


The documentation says:

@deftypefn {Target Hook} bool TARGET_CAN_INLINE_P (tree @var{caller}, tree @var{callee})

But the code says:

#ifndef TARGET_OPTION_CAN_INLINE_P
#define TARGET_OPTION_CAN_INLINE_P default_target_option_can_inline_p
#endif

#define TARGET_OPTION_HOOKS			\
  {						\
    . . .
    TARGET_OPTION_CAN_INLINE_P,			\


This hook really has nothing to do with command line options.  Which
spelling is correct?  The code, or the documentation?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P
  2009-07-09  2:19 TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P DJ Delorie
@ 2009-07-09  4:29 ` Ian Lance Taylor
  2009-07-10  0:45   ` DJ Delorie
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2009-07-09  4:29 UTC (permalink / raw)
  To: DJ Delorie; +Cc: gcc

DJ Delorie <dj@redhat.com> writes:

> The documentation says:
>
> @deftypefn {Target Hook} bool TARGET_CAN_INLINE_P (tree @var{caller}, tree @var{callee})
>
> But the code says:
>
> #ifndef TARGET_OPTION_CAN_INLINE_P
> #define TARGET_OPTION_CAN_INLINE_P default_target_option_can_inline_p
> #endif
>
> #define TARGET_OPTION_HOOKS			\
>   {						\
>     . . .
>     TARGET_OPTION_CAN_INLINE_P,			\
>
>
> This hook really has nothing to do with command line options.  Which
> spelling is correct?  The code, or the documentation?

The OPTION is there because this was introduced for the option
attribute.  But the entry in the target structure is named can_inline_p,
and the macro should be TARGET_CAN_INLINE_P.  So the doc is the desired
state, and the code is not.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P
  2009-07-09  4:29 ` Ian Lance Taylor
@ 2009-07-10  0:45   ` DJ Delorie
  2009-07-10  4:56     ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: DJ Delorie @ 2009-07-10  0:45 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc


> The OPTION is there because this was introduced for the option
> attribute.  But the entry in the target structure is named
> can_inline_p, and the macro should be TARGET_CAN_INLINE_P.  So the
> doc is the desired state, and the code is not.

How's this?

	* targhooks.c (default_target_can_inline_p): Rename from
	default_target_option_can_inline_p.
	* targhooks.h (default_target_can_inline_p): Likewise.
	* target-def.h (TARGET_CAN_INLINE_P): Rename from
	TARGET_OPTION_CAN_INLINE_P.
	* config/i386/i386.c (TARGET_CAN_INLINE_P): Likewise.
	* config/mep/mep.c (TARGET_CAN_INLINE_P): Likewise.
	(mep_target_can_inline_p): Rename from
	mep_target_option_can_inline_p.

Index: targhooks.c
===================================================================
--- targhooks.c	(revision 149452)
+++ targhooks.c	(working copy)
@@ -768,13 +768,13 @@ default_target_option_pragma_parse (tree
 	   "#pragma GCC target is not supported for this machine");
 
   return false;
 }
 
 bool
-default_target_option_can_inline_p (tree caller, tree callee)
+default_target_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 */
Index: targhooks.h
===================================================================
--- targhooks.h	(revision 149452)
+++ targhooks.h	(working copy)
@@ -104,8 +104,8 @@ extern int default_reloc_rw_mask (void);
 extern tree default_mangle_decl_assembler_name (tree, tree);
 extern tree default_emutls_var_fields (tree, tree *);
 extern tree default_emutls_var_init (tree, tree, tree);
 extern bool default_hard_regno_scratch_ok (unsigned int);
 extern bool default_target_option_valid_attribute_p (tree, tree, tree, int);
 extern bool default_target_option_pragma_parse (tree, tree);
-extern bool default_target_option_can_inline_p (tree, tree);
+extern bool default_target_can_inline_p (tree, tree);
 extern unsigned int default_case_values_threshold (void);
Index: target-def.h
===================================================================
--- target-def.h	(revision 149452)
+++ target-def.h	(working copy)
@@ -824,24 +824,24 @@
 #endif
 
 #ifndef TARGET_OPTION_PRAGMA_PARSE
 #define TARGET_OPTION_PRAGMA_PARSE default_target_option_pragma_parse
 #endif
 
-#ifndef TARGET_OPTION_CAN_INLINE_P
-#define TARGET_OPTION_CAN_INLINE_P default_target_option_can_inline_p
+#ifndef TARGET_CAN_INLINE_P
+#define TARGET_CAN_INLINE_P default_target_can_inline_p
 #endif
 
 #define TARGET_OPTION_HOOKS			\
   {						\
     TARGET_OPTION_VALID_ATTRIBUTE_P,		\
     TARGET_OPTION_SAVE,				\
     TARGET_OPTION_RESTORE,			\
     TARGET_OPTION_PRINT,			\
     TARGET_OPTION_PRAGMA_PARSE,			\
-    TARGET_OPTION_CAN_INLINE_P,			\
+    TARGET_CAN_INLINE_P,			\
   }
 
 /* The whole shebang.  */
 #define TARGET_INITIALIZER			\
 {						\
   TARGET_ASM_OUT,				\
Index: config/mep/mep.c
===================================================================
--- config/mep/mep.c	(revision 149453)
+++ config/mep/mep.c	(working copy)
@@ -167,13 +167,13 @@ static tree mep_validate_based_tiny (tre
 static tree mep_validate_near_far (tree *, tree, tree, int, bool *);
 static tree mep_validate_disinterrupt (tree *, tree, tree, int, bool *);
 static tree mep_validate_interrupt (tree *, tree, tree, int, bool *);
 static tree mep_validate_io_cb (tree *, tree, tree, int, bool *);
 static tree mep_validate_vliw (tree *, tree, tree, int, bool *);
 static bool mep_function_attribute_inlinable_p (const_tree);
-static bool mep_option_can_inline_p (tree, tree);
+static bool mep_can_inline_p (tree, tree);
 static bool mep_lookup_pragma_disinterrupt (const char *);
 static int mep_multiple_address_regions (tree, bool);
 static int mep_attrlist_to_encoding (tree, tree);
 static void mep_insert_attributes (tree, tree *);
 static void mep_encode_section_info (tree, rtx, int);
 static section * mep_select_section (tree, int, unsigned HOST_WIDE_INT);
@@ -233,14 +233,14 @@ static tree mep_gimplify_va_arg_expr (tr
 #undef  TARGET_COMP_TYPE_ATTRIBUTES
 #define TARGET_COMP_TYPE_ATTRIBUTES	mep_comp_type_attributes
 #undef  TARGET_INSERT_ATTRIBUTES
 #define TARGET_INSERT_ATTRIBUTES	mep_insert_attributes
 #undef  TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P
 #define TARGET_FUNCTION_ATTRIBUTE_INLINABLE_P	mep_function_attribute_inlinable_p
-#undef  TARGET_OPTION_CAN_INLINE_P
-#define TARGET_OPTION_CAN_INLINE_P		mep_option_can_inline_p
+#undef  TARGET_CAN_INLINE_P
+#define TARGET_CAN_INLINE_P		mep_can_inline_p
 #undef  TARGET_SECTION_TYPE_FLAGS
 #define TARGET_SECTION_TYPE_FLAGS	mep_section_type_flags
 #undef  TARGET_ASM_NAMED_SECTION
 #define TARGET_ASM_NAMED_SECTION	mep_asm_named_section
 #undef  TARGET_INIT_BUILTINS
 #define TARGET_INIT_BUILTINS		mep_init_builtins
@@ -4107,13 +4107,13 @@ mep_function_attribute_inlinable_p (cons
   if (!attrs) attrs = DECL_ATTRIBUTES (callee);
   return (lookup_attribute ("disinterrupt", attrs) == 0
 	  && lookup_attribute ("interrupt", attrs) == 0);
 }
 
 static bool
-mep_option_can_inline_p (tree caller, tree callee)
+mep_can_inline_p (tree caller, tree callee)
 {
   if (TREE_CODE (callee) == ADDR_EXPR)
     callee = TREE_OPERAND (callee, 0);
  
   if (TREE_CODE (callee) == FUNCTION_DECL
       && DECL_DECLARED_INLINE_P (callee)
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 149452)
+++ config/i386/i386.c	(working copy)
@@ -30586,14 +30586,14 @@ ix86_enum_va_list (int idx, const char *
 #undef TARGET_OPTION_RESTORE
 #define TARGET_OPTION_RESTORE ix86_function_specific_restore
 
 #undef TARGET_OPTION_PRINT
 #define TARGET_OPTION_PRINT ix86_function_specific_print
 
-#undef TARGET_OPTION_CAN_INLINE_P
-#define TARGET_OPTION_CAN_INLINE_P ix86_can_inline_p
+#undef TARGET_CAN_INLINE_P
+#define TARGET_CAN_INLINE_P ix86_can_inline_p
 
 #undef TARGET_EXPAND_TO_RTL_HOOK
 #define TARGET_EXPAND_TO_RTL_HOOK ix86_maybe_switch_abi
 
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P
  2009-07-10  0:45   ` DJ Delorie
@ 2009-07-10  4:56     ` Ian Lance Taylor
  2009-07-10  5:03       ` DJ Delorie
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2009-07-10  4:56 UTC (permalink / raw)
  To: DJ Delorie; +Cc: gcc

DJ Delorie <dj@redhat.com> writes:

> 	* targhooks.c (default_target_can_inline_p): Rename from
> 	default_target_option_can_inline_p.
> 	* targhooks.h (default_target_can_inline_p): Likewise.
> 	* target-def.h (TARGET_CAN_INLINE_P): Rename from
> 	TARGET_OPTION_CAN_INLINE_P.
> 	* config/i386/i386.c (TARGET_CAN_INLINE_P): Likewise.
> 	* config/mep/mep.c (TARGET_CAN_INLINE_P): Likewise.
> 	(mep_target_can_inline_p): Rename from
> 	mep_target_option_can_inline_p.

This is OK.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P
  2009-07-10  4:56     ` Ian Lance Taylor
@ 2009-07-10  5:03       ` DJ Delorie
  0 siblings, 0 replies; 5+ messages in thread
From: DJ Delorie @ 2009-07-10  5:03 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc


Thanks, committed.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-10  5:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-09  2:19 TARGET_OPTION_CAN_INLINE_P vs TARGET_CAN_INLINE_P DJ Delorie
2009-07-09  4:29 ` Ian Lance Taylor
2009-07-10  0:45   ` DJ Delorie
2009-07-10  4:56     ` Ian Lance Taylor
2009-07-10  5:03       ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).