llvm-gcc-4.2-2.9/gcc/cp/parser.c
/* Normal parsing of a pragma token.  Here we can (and must) use the
   regular lexer.  */
Normal parsing of a pragma token.  Here we can (and must) use the
regular lexer.
Normal parsing of a pragma token . Here we can ( and must ) use the regular lexer .
static bool
cp_parser_pragma (cp_parser *parser, enum pragma_context context)
{
  cp_token *pragma_tok;
  unsigned int id;
  pragma_tok = cp_lexer_consume_token (parser->lexer);
  gcc_assert (pragma_tok->type == CPP_PRAGMA);
  parser->lexer->in_pragma = true;
  id = pragma_tok->pragma_kind;
  switch (id)
    {
    case PRAGMA_GCC_PCH_PREPROCESS:
      error ("%<#pragma GCC pch_preprocess%> must be first");
      break;
    case PRAGMA_OMP_BARRIER:
      switch (context)
	{
	case pragma_compound:
	  cp_parser_omp_barrier (parser, pragma_tok);
	  return false;
	case pragma_stmt:
	  error ("%<#pragma omp barrier%> may only be "
		 "used in compound statements");
	  break;
	default:
	  goto bad_stmt;
	}
      break;
    case PRAGMA_OMP_FLUSH:
      switch (context)
	{
	case pragma_compound:
	  cp_parser_omp_flush (parser, pragma_tok);
	  return false;
	case pragma_stmt:
	  error ("%<#pragma omp flush%> may only be "
		 "used in compound statements");
	  break;
	default:
	  goto bad_stmt;
	}
      break;
    case PRAGMA_OMP_THREADPRIVATE:
      cp_parser_omp_threadprivate (parser, pragma_tok);
      return false;
    case PRAGMA_OMP_ATOMIC:
    case PRAGMA_OMP_CRITICAL:
    case PRAGMA_OMP_FOR:
    case PRAGMA_OMP_MASTER:
    case PRAGMA_OMP_ORDERED:
    case PRAGMA_OMP_PARALLEL:
    case PRAGMA_OMP_SECTIONS:
    case PRAGMA_OMP_SINGLE:
      if (context == pragma_external)
	goto bad_stmt;
      cp_parser_omp_construct (parser, pragma_tok);
      return true;
    case PRAGMA_OMP_SECTION:
      error ("%<#pragma omp section%> may only be used in "
	     "%<#pragma omp sections%> construct");
      break;
    default:
      gcc_assert (id >= PRAGMA_FIRST_EXTERNAL);
      c_invoke_pragma_handler (id);
      break;
    bad_stmt:
      cp_parser_error (parser, "expected declaration specifiers");
      break;
    }
  cp_parser_skip_to_pragma_eol (parser, pragma_tok);
  return false;
}
static bool cp_parser_pragma ( cp_parser * parser , enum pragma_context context ) { cp_token * pragma_tok ; unsigned int id ; pragma_tok = cp_lexer_consume_token ( parser -> lexer ) ; gcc_assert ( pragma_tok -> type == CPP_PRAGMA ) ; parser -> lexer -> in_pragma = true ; id = pragma_tok -> pragma_kind ; switch ( id ) { case PRAGMA_GCC_PCH_PREPROCESS : error ( " " ) ; break ; case PRAGMA_OMP_BARRIER : switch ( context ) { case pragma_compound : cp_parser_omp_barrier ( parser , pragma_tok ) ; return false ; case pragma_stmt : error ( " " " " ) ; break ; default : goto bad_stmt ; } break ; case PRAGMA_OMP_FLUSH : switch ( context ) { case pragma_compound : cp_parser_omp_flush ( parser , pragma_tok ) ; return false ; case pragma_stmt : error ( " " " " ) ; break ; default : goto bad_stmt ; } break ; case PRAGMA_OMP_THREADPRIVATE : cp_parser_omp_threadprivate ( parser , pragma_tok ) ; return false ; case PRAGMA_OMP_ATOMIC : case PRAGMA_OMP_CRITICAL : case PRAGMA_OMP_FOR : case PRAGMA_OMP_MASTER : case PRAGMA_OMP_ORDERED : case PRAGMA_OMP_PARALLEL : case PRAGMA_OMP_SECTIONS : case PRAGMA_OMP_SINGLE : if ( context == pragma_external ) goto bad_stmt ; cp_parser_omp_construct ( parser , pragma_tok ) ; return true ; case PRAGMA_OMP_SECTION : error ( " " " " ) ; break ; default : gcc_assert ( id >= PRAGMA_FIRST_EXTERNAL ) ; c_invoke_pragma_handler ( id ) ; break ; bad_stmt : cp_parser_error ( parser , " " ) ; break ; } cp_parser_skip_to_pragma_eol ( parser , pragma_tok ) ; return false ; }
Normal parsing of a pragma token.
Normal parsing of a pragma token .