diff mbox

[committed] internal documentation for TARGET_OPTION_PRAGMA_PARSE

Message ID 5133B0F1.4070300@codesourcery.com
State New
Headers show

Commit Message

Sandra Loosemore March 3, 2013, 8:22 p.m. UTC
I was finding the internal documentation for TARGET_OPTION_PRAGMA_PARSE 
and friends confusing until I realized that it had never been updated 
after #pragma gcc option was renamed to #pragma gcc target, back in 2008:

http://gcc.gnu.org/ml/gcc-patches/2008-08/msg02394.html

I've checked in this patch to make that change to tm.texi, plus a little 
copy-editing to improve readability.   I also updated the comments in 
target.def similarly.  I think this qualifies as "obvious" as well as 
being appropriate for the current trunk stage....  at least it's an 
incremental improvement over the current docs.  ;-)

-Sandra
diff mbox

Patch

Index: gcc/target.def
===================================================================
--- gcc/target.def	(revision 196416)
+++ gcc/target.def	(working copy)
@@ -2774,9 +2774,9 @@  HOOK_VECTOR_END (emutls)
 #define HOOK_PREFIX "TARGET_OPTION_"
 HOOK_VECTOR (TARGET_OPTION_HOOKS, target_option_hooks)
 
-/* Function to validate the attribute((option(...))) strings or NULL.  If
-   the option is validated, it is assumed that DECL_FUNCTION_SPECIFIC will
-   be filled in in the function decl node.  */
+/* Function to validate the attribute((target(...))) strings.  If
+   the option is validated, the hook should also fill in
+   DECL_FUNCTION_SPECIFIC_TARGET in the function decl node.  */
 DEFHOOK
 (valid_attribute_p,
  "",
@@ -2803,11 +2803,10 @@  DEFHOOK
  "",
  void, (FILE *file, int indent, struct cl_target_option *ptr), NULL)
 
-/* Function to parse arguments to be validated for #pragma option, and to
+/* Function to parse arguments to be validated for #pragma target, and to
    change the state if the options are valid.  If the first argument is
    NULL, the second argument specifies the default options to use.  Return
    true if the options are valid, and set the current state.  */
-/* ??? The documentation in tm.texi is incomplete.  */
 DEFHOOK
 (pragma_parse,
  "",
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	(revision 196416)
+++ gcc/doc/tm.texi.in	(working copy)
@@ -9709,40 +9709,40 @@  target specific attribute attached to it
 @end deftypefn
 
 @hook TARGET_OPTION_VALID_ATTRIBUTE_P
-This hook is called to parse the @code{attribute(option("..."))}, and
-it allows the function to set different target machine compile time
-options for the current function that might be different than the
-options specified on the command line.  The hook should return
+This hook is called to parse @code{attribute(target("..."))}, which
+allows setting target-specific options on individual functions.
+These function-specific options may differ
+from the options specified on the command line.  The hook should return
 @code{true} if the options are valid.
 
-The hook should set the @var{DECL_FUNCTION_SPECIFIC_TARGET} field in
-the function declaration to hold a pointer to a target specific
-@var{struct cl_target_option} structure.
+The hook should set the @code{DECL_FUNCTION_SPECIFIC_TARGET} field in
+the function declaration to hold a pointer to a target-specific
+@code{struct cl_target_option} structure.
 @end deftypefn
 
 @hook TARGET_OPTION_SAVE
-This hook is called to save any additional target specific information
-in the @var{struct cl_target_option} structure for function specific
+This hook is called to save any additional target-specific information
+in the @code{struct cl_target_option} structure for function-specific
 options.
 @xref{Option file format}.
 @end deftypefn
 
 @hook TARGET_OPTION_RESTORE
-This hook is called to restore any additional target specific
-information in the @var{struct cl_target_option} structure for
-function specific options.
+This hook is called to restore any additional target-specific
+information in the @code{struct cl_target_option} structure for
+function-specific options.
 @end deftypefn
 
 @hook TARGET_OPTION_PRINT
-This hook is called to print any additional target specific
-information in the @var{struct cl_target_option} structure for
-function specific options.
+This hook is called to print any additional target-specific
+information in the @code{struct cl_target_option} structure for
+function-specific options.
 @end deftypefn
 
 @hook TARGET_OPTION_PRAGMA_PARSE
-This target hook parses the options for @code{#pragma GCC option} to
-set the machine specific options for functions that occur later in the
-input stream.  The options should be the same as handled by the
+This target hook parses the options for @code{#pragma GCC target}, which
+sets the target-specific options for functions that occur later in the
+input stream.  The options accepted should be the same as those handled by the
 @code{TARGET_OPTION_VALID_ATTRIBUTE_P} hook.
 @end deftypefn