This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: OMP_CLAUSES with clauses in operand 0


On Wed, Apr 29, 2015 at 04:31:32PM +0200, Thomas Schwinge wrote:
> > So yes, I really prefer OMP_STANDALONE_CLAUSES over OMP_CLAUSES for
> > everything.
> 
> Like this (for trunk)?
> 
> commit 300e28fce192cb56d73cb61f787872643030f0bf
> Author: Thomas Schwinge <thomas@codesourcery.com>
> Date:   Wed Apr 29 16:18:49 2015 +0200
> 
>     Add OMP_STANDALONE_CLAUSES.
>     
>     	gcc/
>     	* tree.h (OACC_CACHE_CLAUSES, OACC_DECLARE_CLAUSES)
>     	(OACC_ENTER_DATA_CLAUSES, OACC_EXIT_DATA_CLAUSES)
>     	(OACC_UPDATE_CLAUSES, OMP_TARGET_UPDATE_CLAUSES): Merge into...
>     	(OMP_STANDALONE_CLAUSES): ... this new macro.  Adjust all users.

I would keep the specific *_CLAUSES macros, just add
OMP_STANDALONE_CLAUSES and change the uses only if you are dealing with
multiple different codes.  That will match OMP_CLAUSES vs. OMP_FOR_CLAUSES,
OMP_PARALLEL_CLAUSES etc.

> --- gcc/c/c-parser.c
> +++ gcc/c/c-parser.c
> @@ -11987,7 +11987,7 @@ c_parser_oacc_cache (location_t loc, c_parser *parser)
>  
>    stmt = make_node (OACC_CACHE);
>    TREE_TYPE (stmt) = void_type_node;
> -  OACC_CACHE_CLAUSES (stmt) = clauses;
> +  OMP_STANDALONE_CLAUSES (stmt) = clauses;
>    SET_EXPR_LOCATION (stmt, loc);
>    add_stmt (stmt);
>  

So, drop hunks like this.

> @@ -12155,10 +12155,7 @@ c_parser_oacc_enter_exit_data (c_parser *parser, bool enter)
>  
>    stmt = enter ? make_node (OACC_ENTER_DATA) : make_node (OACC_EXIT_DATA);
>    TREE_TYPE (stmt) = void_type_node;
> -  if (enter)
> -    OACC_ENTER_DATA_CLAUSES (stmt) = clauses;
> -  else
> -    OACC_EXIT_DATA_CLAUSES (stmt) = clauses;
> +  OMP_STANDALONE_CLAUSES (stmt) = clauses;
>    SET_EXPR_LOCATION (stmt, loc);
>    add_stmt (stmt);
>  }

And just keep ones like this.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]