llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Parse all OpenMP clauses.  The set clauses allowed by the directive
   is a bitmask in MASK.  Return the list of clauses found; the result
   of clause default goes in *pdefault.  */
Parse all OpenMP clauses.  The set clauses allowed by the directive
is a bitmask in MASK.  Return the list of clauses found; the result
of clause default goes in *pdefault.
Parse all OpenMP clauses . The set clauses allowed by the directive is a bitmask in MASK . Return the list of clauses found ; the result of clause default goes in * pdefault .
static tree
cp_parser_omp_all_clauses (cp_parser *parser, unsigned int mask,
			   const char *where, cp_token *pragma_tok)
{
  tree clauses = NULL;
  while (cp_lexer_next_token_is_not (parser->lexer, CPP_PRAGMA_EOL))
    {
      pragma_omp_clause c_kind = cp_parser_omp_clause_name (parser);
      const char *c_name;
      tree prev = clauses;
      switch (c_kind)
	{
	case PRAGMA_OMP_CLAUSE_COPYIN:
	  clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_COPYIN, clauses);
	  c_name = "copyin";
	  break;
	case PRAGMA_OMP_CLAUSE_COPYPRIVATE:
	  clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_COPYPRIVATE,
					    clauses);
	  c_name = "copyprivate";
	  break;
	case PRAGMA_OMP_CLAUSE_DEFAULT:
	  clauses = cp_parser_omp_clause_default (parser, clauses);
	  c_name = "default";
	  break;
	case PRAGMA_OMP_CLAUSE_FIRSTPRIVATE:
	  clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_FIRSTPRIVATE,
					    clauses);
	  c_name = "firstprivate";
	  break;
	case PRAGMA_OMP_CLAUSE_IF:
	  clauses = cp_parser_omp_clause_if (parser, clauses);
	  c_name = "if";
	  break;
	case PRAGMA_OMP_CLAUSE_LASTPRIVATE:
	  clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_LASTPRIVATE,
					    clauses);
	  c_name = "lastprivate";
	  break;
	case PRAGMA_OMP_CLAUSE_NOWAIT:
	  clauses = cp_parser_omp_clause_nowait (parser, clauses);
	  c_name = "nowait";
	  break;
	case PRAGMA_OMP_CLAUSE_NUM_THREADS:
	  clauses = cp_parser_omp_clause_num_threads (parser, clauses);
	  c_name = "num_threads";
	  break;
	case PRAGMA_OMP_CLAUSE_ORDERED:
	  clauses = cp_parser_omp_clause_ordered (parser, clauses);
	  c_name = "ordered";
	  break;
	case PRAGMA_OMP_CLAUSE_PRIVATE:
	  clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_PRIVATE,
					    clauses);
	  c_name = "private";
	  break;
	case PRAGMA_OMP_CLAUSE_REDUCTION:
	  clauses = cp_parser_omp_clause_reduction (parser, clauses);
	  c_name = "reduction";
	  break;
	case PRAGMA_OMP_CLAUSE_SCHEDULE:
	  clauses = cp_parser_omp_clause_schedule (parser, clauses);
	  c_name = "schedule";
	  break;
	case PRAGMA_OMP_CLAUSE_SHARED:
	  clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_SHARED,
					    clauses);
	  c_name = "shared";
	  break;
	default:
	  cp_parser_error (parser, "expected %<#pragma omp%> clause");
	  goto saw_error;
	}
      if (((mask >> c_kind) & 1) == 0)
	{
	  clauses = prev;
	  error ("%qs is not valid for %qs", c_name, where);
	}
    }
 saw_error:
  cp_parser_skip_to_pragma_eol (parser, pragma_tok);
  return finish_omp_clauses (clauses);
}
static tree cp_parser_omp_all_clauses ( cp_parser * parser , unsigned int mask , const char * where , cp_token * pragma_tok ) { tree clauses = NULL ; while ( cp_lexer_next_token_is_not ( parser -> lexer , CPP_PRAGMA_EOL ) ) { pragma_omp_clause c_kind = cp_parser_omp_clause_name ( parser ) ; const char * c_name ; tree prev = clauses ; switch ( c_kind ) { case PRAGMA_OMP_CLAUSE_COPYIN : clauses = cp_parser_omp_var_list ( parser , OMP_CLAUSE_COPYIN , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_COPYPRIVATE : clauses = cp_parser_omp_var_list ( parser , OMP_CLAUSE_COPYPRIVATE , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_DEFAULT : clauses = cp_parser_omp_clause_default ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_FIRSTPRIVATE : clauses = cp_parser_omp_var_list ( parser , OMP_CLAUSE_FIRSTPRIVATE , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_IF : clauses = cp_parser_omp_clause_if ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_LASTPRIVATE : clauses = cp_parser_omp_var_list ( parser , OMP_CLAUSE_LASTPRIVATE , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_NOWAIT : clauses = cp_parser_omp_clause_nowait ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_NUM_THREADS : clauses = cp_parser_omp_clause_num_threads ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_ORDERED : clauses = cp_parser_omp_clause_ordered ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_PRIVATE : clauses = cp_parser_omp_var_list ( parser , OMP_CLAUSE_PRIVATE , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_REDUCTION : clauses = cp_parser_omp_clause_reduction ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_SCHEDULE : clauses = cp_parser_omp_clause_schedule ( parser , clauses ) ; c_name = " " ; break ; case PRAGMA_OMP_CLAUSE_SHARED : clauses = cp_parser_omp_var_list ( parser , OMP_CLAUSE_SHARED , clauses ) ; c_name = " " ; break ; default : cp_parser_error ( parser , " " ) ; goto saw_error ; } if ( ( ( mask >> c_kind ) & 1 ) == 0 ) { clauses = prev ; error ( " " , c_name , where ) ; } } saw_error : cp_parser_skip_to_pragma_eol ( parser , pragma_tok ) ; return finish_omp_clauses ( clauses ) ; }
Parse all OpenMP clauses.
Parse all OpenMP clauses .
/* Remove the invalid clause(s) from the list to avoid
	     confusing the rest of the compiler.  */