On 10/30/2015 10:05 AM, Jakub Jelinek wrote: > On Fri, Oct 30, 2015 at 07:42:39AM -0700, Cesar Philippidis wrote: >>> Another thing is what Jason as C++ maintainer wants, it is nice to get rid >>> of some code redundancies, on the other side the fact that there is one >>> function per non-terminal in the grammar is also quite nice property. >>> I know I've violated this a few times too. > >> That name had some legacy from the c FE in gomp-4_0-branch which the >> function was inherited from. On one hand, it doesn't make sense to allow >> negative integer values for those clauses, but at the same time, those >> values aren't checked during scanning. Maybe it should be renamed >> cp_parser_oacc_single_int_clause instead? > > That is better. > >> If you like, I could make a more general >> cp_parser_omp_generic_expression that has a scan_list argument so that >> it can be used for both general expressions and assignment-expressions. >> That way it can be used for both omp and oacc clauses of the form 'foo ( >> expression )'. > > No, that will only confuse readers of the parser. After all, the code to > parse an expression argument of a clause is not that large. > So, either cp_parser_oacc_single_int_clause or just keeping the old separate > parsing functions, just remove the cruft from those (testing the type, > using cp_parser_condition instead of cp_parser_assignment_expression) is ok > with me. Please ping Jason on what he prefers from those two. Jason, what's your preference here? Should I create a single function to parser num_gangs, num_workers and vector_length since they all accept the same type of argument or should I just correct the existing functions as I did in the attached patch? Either one would be specific to openacc. This patch has been bootstrapped and regression tested on trunk. Cesar