Commit 75ce3d48 by Richard Henderson Committed by Richard Henderson

c-lex.c (pragma_lex): Rename from c_lex.

        * c-lex.c (pragma_lex): Rename from c_lex.
        * c-pch.c: Update for pragma_lex rename.
        * c-pragma.c, c-pragma.h, config/ia64/ia64-c.c: Likewise.
        * config/m32c/m32c-pragma.c, config/darwin-c.c: Likewise.
        * config/rs6000/rs6000-c.c, config/c4x/c4x-c.c: Likewise.
        * config/sol2-c.c, config/v850/v850-c.c: Likewise.
        * doc/tm.texi: Likewise.
cp/
        * lex.c: Update for pragma_lex rename.
        * parser.c: Likewise.

From-SVN: r107544
parent 37d3243d
2005-11-26 Richard Henderson <rth@redhat.com>
* c-lex.c (pragma_lex): Rename from c_lex.
* c-pch.c: Update for pragma_lex rename.
* c-pragma.c, c-pragma.h, config/ia64/ia64-c.c: Likewise.
* config/m32c/m32c-pragma.c, config/darwin-c.c: Likewise.
* config/rs6000/rs6000-c.c, config/c4x/c4x-c.c: Likewise.
* config/sol2-c.c, config/v850/v850-c.c: Likewise.
* doc/tm.texi: Likewise.
2005-11-26 Andrew Pinski <pinskia@physics.uc.edu> 2005-11-26 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/23669 PR middle-end/23669
......
...@@ -486,7 +486,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags) ...@@ -486,7 +486,7 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags)
} }
enum cpp_ttype enum cpp_ttype
c_lex (tree *value) pragma_lex (tree *value)
{ {
location_t loc; location_t loc;
return c_lex_with_flags (value, &loc, NULL); return c_lex_with_flags (value, &loc, NULL);
......
...@@ -447,7 +447,7 @@ c_common_pch_pragma (cpp_reader *pfile) ...@@ -447,7 +447,7 @@ c_common_pch_pragma (cpp_reader *pfile)
const char *name; const char *name;
int fd; int fd;
if (c_lex (&name_t) != CPP_STRING) if (pragma_lex (&name_t) != CPP_STRING)
{ {
error ("malformed #pragma GCC pch_preprocess, ignored"); error ("malformed #pragma GCC pch_preprocess, ignored");
return; return;
......
...@@ -147,10 +147,10 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) ...@@ -147,10 +147,10 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
enum cpp_ttype token; enum cpp_ttype token;
enum { set, push, pop } action; enum { set, push, pop } action;
if (c_lex (&x) != CPP_OPEN_PAREN) if (pragma_lex (&x) != CPP_OPEN_PAREN)
GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored"); GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
token = c_lex (&x); token = pragma_lex (&x);
if (token == CPP_CLOSE_PAREN) if (token == CPP_CLOSE_PAREN)
{ {
action = set; action = set;
...@@ -160,7 +160,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) ...@@ -160,7 +160,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
{ {
align = TREE_INT_CST_LOW (x); align = TREE_INT_CST_LOW (x);
action = set; action = set;
if (c_lex (&x) != CPP_CLOSE_PAREN) if (pragma_lex (&x) != CPP_CLOSE_PAREN)
GCC_BAD ("malformed %<#pragma pack%> - ignored"); GCC_BAD ("malformed %<#pragma pack%> - ignored");
} }
else if (token == CPP_NAME) else if (token == CPP_NAME)
...@@ -179,9 +179,9 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) ...@@ -179,9 +179,9 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
else else
GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op); GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op);
while ((token = c_lex (&x)) == CPP_COMMA) while ((token = pragma_lex (&x)) == CPP_COMMA)
{ {
token = c_lex (&x); token = pragma_lex (&x);
if (token == CPP_NAME && id == 0) if (token == CPP_NAME && id == 0)
{ {
id = x; id = x;
...@@ -203,7 +203,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) ...@@ -203,7 +203,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
else else
GCC_BAD ("malformed %<#pragma pack%> - ignored"); GCC_BAD ("malformed %<#pragma pack%> - ignored");
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of %<#pragma pack%>"); warning (OPT_Wpragmas, "junk at end of %<#pragma pack%>");
if (flag_pack_struct) if (flag_pack_struct)
...@@ -333,14 +333,14 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy)) ...@@ -333,14 +333,14 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
value = 0; value = 0;
if (c_lex (&name) != CPP_NAME) if (pragma_lex (&name) != CPP_NAME)
GCC_BAD ("malformed #pragma weak, ignored"); GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x); t = pragma_lex (&x);
if (t == CPP_EQ) if (t == CPP_EQ)
{ {
if (c_lex (&value) != CPP_NAME) if (pragma_lex (&value) != CPP_NAME)
GCC_BAD ("malformed #pragma weak, ignored"); GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x); t = pragma_lex (&x);
} }
if (t != CPP_EOF) if (t != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma weak"); warning (OPT_Wpragmas, "junk at end of #pragma weak");
...@@ -410,11 +410,11 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy)) ...@@ -410,11 +410,11 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
tree oldname, newname, decl, x; tree oldname, newname, decl, x;
enum cpp_ttype t; enum cpp_ttype t;
if (c_lex (&oldname) != CPP_NAME) if (pragma_lex (&oldname) != CPP_NAME)
GCC_BAD ("malformed #pragma redefine_extname, ignored"); GCC_BAD ("malformed #pragma redefine_extname, ignored");
if (c_lex (&newname) != CPP_NAME) if (pragma_lex (&newname) != CPP_NAME)
GCC_BAD ("malformed #pragma redefine_extname, ignored"); GCC_BAD ("malformed #pragma redefine_extname, ignored");
t = c_lex (&x); t = pragma_lex (&x);
if (t != CPP_EOF) if (t != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma redefine_extname"); warning (OPT_Wpragmas, "junk at end of #pragma redefine_extname");
...@@ -480,9 +480,9 @@ handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy)) ...@@ -480,9 +480,9 @@ handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
tree prefix, x; tree prefix, x;
enum cpp_ttype t; enum cpp_ttype t;
if (c_lex (&prefix) != CPP_STRING) if (pragma_lex (&prefix) != CPP_STRING)
GCC_BAD ("malformed #pragma extern_prefix, ignored"); GCC_BAD ("malformed #pragma extern_prefix, ignored");
t = c_lex (&x); t = pragma_lex (&x);
if (t != CPP_EOF) if (t != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma extern_prefix"); warning (OPT_Wpragmas, "junk at end of #pragma extern_prefix");
...@@ -603,7 +603,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) ...@@ -603,7 +603,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
enum { bad, push, pop } action = bad; enum { bad, push, pop } action = bad;
static VEC (visibility, heap) *visstack; static VEC (visibility, heap) *visstack;
token = c_lex (&x); token = pragma_lex (&x);
if (token == CPP_NAME) if (token == CPP_NAME)
{ {
const char *op = IDENTIFIER_POINTER (x); const char *op = IDENTIFIER_POINTER (x);
...@@ -631,9 +631,9 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) ...@@ -631,9 +631,9 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
} }
else else
{ {
if (c_lex (&x) != CPP_OPEN_PAREN) if (pragma_lex (&x) != CPP_OPEN_PAREN)
GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored"); GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
token = c_lex (&x); token = pragma_lex (&x);
if (token != CPP_NAME) if (token != CPP_NAME)
{ {
GCC_BAD ("malformed #pragma GCC visibility push"); GCC_BAD ("malformed #pragma GCC visibility push");
...@@ -657,11 +657,11 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) ...@@ -657,11 +657,11 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
} }
visibility_options.inpragma = 1; visibility_options.inpragma = 1;
} }
if (c_lex (&x) != CPP_CLOSE_PAREN) if (pragma_lex (&x) != CPP_CLOSE_PAREN)
GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored"); GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
} }
} }
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of %<#pragma GCC visibility%>"); warning (OPT_Wpragmas, "junk at end of %<#pragma GCC visibility%>");
} }
......
...@@ -64,7 +64,7 @@ extern void maybe_apply_pending_pragma_weaks (void); ...@@ -64,7 +64,7 @@ extern void maybe_apply_pending_pragma_weaks (void);
extern tree maybe_apply_renaming_pragma (tree, tree); extern tree maybe_apply_renaming_pragma (tree, tree);
extern void add_to_renaming_pragma_list (tree, tree); extern void add_to_renaming_pragma_list (tree, tree);
extern enum cpp_ttype c_lex (tree *); extern enum cpp_ttype pragma_lex (tree *);
extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *); extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *);
/* If 1, then lex strings into the execution character set. /* If 1, then lex strings into the execution character set.
......
...@@ -68,25 +68,25 @@ c4x_parse_pragma (name, func, sect) ...@@ -68,25 +68,25 @@ c4x_parse_pragma (name, func, sect)
{ {
tree f, s, x; tree f, s, x;
if (c_lex (&x) != CPP_OPEN_PAREN) if (pragma_lex (&x) != CPP_OPEN_PAREN)
BAD ("missing '(' after '#pragma %s' - ignored", name); BAD ("missing '(' after '#pragma %s' - ignored", name);
if (c_lex (&f) != CPP_NAME) if (pragma_lex (&f) != CPP_NAME)
BAD ("missing function name in '#pragma %s' - ignored", name); BAD ("missing function name in '#pragma %s' - ignored", name);
if (sect) if (sect)
{ {
if (c_lex (&x) != CPP_COMMA) if (pragma_lex (&x) != CPP_COMMA)
BAD ("malformed '#pragma %s' - ignored", name); BAD ("malformed '#pragma %s' - ignored", name);
if (c_lex (&s) != CPP_STRING) if (pragma_lex (&s) != CPP_STRING)
BAD ("missing section name in '#pragma %s' - ignored", name); BAD ("missing section name in '#pragma %s' - ignored", name);
*sect = s; *sect = s;
} }
if (c_lex (&x) != CPP_CLOSE_PAREN) if (pragma_lex (&x) != CPP_CLOSE_PAREN)
BAD ("missing ')' for '#pragma %s' - ignored", name); BAD ("missing ')' for '#pragma %s' - ignored", name);
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of '#pragma %s'", name); warning (OPT_Wpragmas, "junk at end of '#pragma %s'", name);
*func = f; *func = f;
......
...@@ -102,17 +102,17 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -102,17 +102,17 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED)
const char *arg; const char *arg;
tree t, x; tree t, x;
if (c_lex (&t) != CPP_NAME) if (pragma_lex (&t) != CPP_NAME)
BAD ("malformed '#pragma options', ignoring"); BAD ("malformed '#pragma options', ignoring");
arg = IDENTIFIER_POINTER (t); arg = IDENTIFIER_POINTER (t);
if (strcmp (arg, "align")) if (strcmp (arg, "align"))
BAD ("malformed '#pragma options', ignoring"); BAD ("malformed '#pragma options', ignoring");
if (c_lex (&t) != CPP_EQ) if (pragma_lex (&t) != CPP_EQ)
BAD ("malformed '#pragma options', ignoring"); BAD ("malformed '#pragma options', ignoring");
if (c_lex (&t) != CPP_NAME) if (pragma_lex (&t) != CPP_NAME)
BAD ("malformed '#pragma options', ignoring"); BAD ("malformed '#pragma options', ignoring");
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (0, "junk at end of '#pragma options'"); warning (0, "junk at end of '#pragma options'");
arg = IDENTIFIER_POINTER (t); arg = IDENTIFIER_POINTER (t);
...@@ -134,19 +134,19 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -134,19 +134,19 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree decl, x; tree decl, x;
int tok; int tok;
if (c_lex (&x) != CPP_OPEN_PAREN) if (pragma_lex (&x) != CPP_OPEN_PAREN)
BAD ("missing '(' after '#pragma unused', ignoring"); BAD ("missing '(' after '#pragma unused', ignoring");
while (1) while (1)
{ {
tok = c_lex (&decl); tok = pragma_lex (&decl);
if (tok == CPP_NAME && decl) if (tok == CPP_NAME && decl)
{ {
tree local = lookup_name (decl); tree local = lookup_name (decl);
if (local && (TREE_CODE (local) == PARM_DECL if (local && (TREE_CODE (local) == PARM_DECL
|| TREE_CODE (local) == VAR_DECL)) || TREE_CODE (local) == VAR_DECL))
TREE_USED (local) = 1; TREE_USED (local) = 1;
tok = c_lex (&x); tok = pragma_lex (&x);
if (tok != CPP_COMMA) if (tok != CPP_COMMA)
break; break;
} }
...@@ -155,7 +155,7 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -155,7 +155,7 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
if (tok != CPP_CLOSE_PAREN) if (tok != CPP_CLOSE_PAREN)
BAD ("missing ')' after '#pragma unused', ignoring"); BAD ("missing ')' after '#pragma unused', ignoring");
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (0, "junk at end of '#pragma unused'"); warning (0, "junk at end of '#pragma unused'");
} }
......
...@@ -40,13 +40,13 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -40,13 +40,13 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED)
enum cpp_ttype type; enum cpp_ttype type;
tree x; tree x;
type = c_lex (&x); type = pragma_lex (&x);
while (type == CPP_NAME) while (type == CPP_NAME)
{ {
ia64_hpux_add_pragma_builtin (x); ia64_hpux_add_pragma_builtin (x);
type = c_lex (&x); type = pragma_lex (&x);
if (type == CPP_COMMA) if (type == CPP_COMMA)
type = c_lex (&x); type = pragma_lex (&x);
} }
if (type != CPP_EOF) if (type != CPP_EOF)
warning (OPT_Wpragmas, "malformed #pragma builtin"); warning (OPT_Wpragmas, "malformed #pragma builtin");
......
...@@ -52,14 +52,14 @@ m32c_pragma_memregs (cpp_reader * reader ATTRIBUTE_UNUSED) ...@@ -52,14 +52,14 @@ m32c_pragma_memregs (cpp_reader * reader ATTRIBUTE_UNUSED)
HOST_WIDE_INT i; HOST_WIDE_INT i;
static char new_number[3]; static char new_number[3];
type = c_lex (&val); type = pragma_lex (&val);
if (type == CPP_NUMBER) if (type == CPP_NUMBER)
{ {
if (host_integerp (val, 1)) if (host_integerp (val, 1))
{ {
i = tree_low_cst (val, 1); i = tree_low_cst (val, 1);
type = c_lex (&val); type = pragma_lex (&val);
if (type != CPP_EOF) if (type != CPP_EOF)
warning (0, "junk at end of #pragma GCC memregs [0..16]"); warning (0, "junk at end of #pragma GCC memregs [0..16]");
......
...@@ -62,17 +62,17 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -62,17 +62,17 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED)
/* If we get here, generic code has already scanned the directive /* If we get here, generic code has already scanned the directive
leader and the word "longcall". */ leader and the word "longcall". */
if (c_lex (&x) != CPP_OPEN_PAREN) if (pragma_lex (&x) != CPP_OPEN_PAREN)
SYNTAX_ERROR ("missing open paren"); SYNTAX_ERROR ("missing open paren");
if (c_lex (&n) != CPP_NUMBER) if (pragma_lex (&n) != CPP_NUMBER)
SYNTAX_ERROR ("missing number"); SYNTAX_ERROR ("missing number");
if (c_lex (&x) != CPP_CLOSE_PAREN) if (pragma_lex (&x) != CPP_CLOSE_PAREN)
SYNTAX_ERROR ("missing close paren"); SYNTAX_ERROR ("missing close paren");
if (n != integer_zero_node && n != integer_one_node) if (n != integer_zero_node && n != integer_one_node)
SYNTAX_ERROR ("number must be 0 or 1"); SYNTAX_ERROR ("number must be 0 or 1");
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma longcall"); warning (OPT_Wpragmas, "junk at end of #pragma longcall");
rs6000_default_long_calls = (n == integer_one_node); rs6000_default_long_calls = (n == integer_one_node);
......
...@@ -88,8 +88,8 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -88,8 +88,8 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
enum cpp_ttype ttype; enum cpp_ttype ttype;
HOST_WIDE_INT low; HOST_WIDE_INT low;
if (c_lex (&x) != CPP_NUMBER if (pragma_lex (&x) != CPP_NUMBER
|| c_lex (&t) != CPP_OPEN_PAREN) || pragma_lex (&t) != CPP_OPEN_PAREN)
{ {
warning (0, "malformed %<#pragma align%>, ignoring"); warning (0, "malformed %<#pragma align%>, ignoring");
return; return;
...@@ -104,7 +104,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -104,7 +104,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
return; return;
} }
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype != CPP_NAME) if (ttype != CPP_NAME)
{ {
warning (0, "malformed %<#pragma align%>, ignoring"); warning (0, "malformed %<#pragma align%>, ignoring");
...@@ -121,10 +121,10 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -121,10 +121,10 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x), solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x),
solaris_pending_aligns); solaris_pending_aligns);
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype == CPP_COMMA) if (ttype == CPP_COMMA)
{ {
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype != CPP_NAME) if (ttype != CPP_NAME)
{ {
warning (0, "malformed %<#pragma align%>"); warning (0, "malformed %<#pragma align%>");
...@@ -133,7 +133,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -133,7 +133,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED)
} }
else if (ttype == CPP_CLOSE_PAREN) else if (ttype == CPP_CLOSE_PAREN)
{ {
if (c_lex (&t) != CPP_EOF) if (pragma_lex (&t) != CPP_EOF)
warning (0, "junk at end of %<#pragma align%>"); warning (0, "junk at end of %<#pragma align%>");
return; return;
} }
...@@ -153,13 +153,13 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -153,13 +153,13 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree t; tree t;
enum cpp_ttype ttype; enum cpp_ttype ttype;
if (c_lex (&t) != CPP_OPEN_PAREN) if (pragma_lex (&t) != CPP_OPEN_PAREN)
{ {
warning (0, "malformed %<#pragma init%>, ignoring"); warning (0, "malformed %<#pragma init%>, ignoring");
return; return;
} }
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype != CPP_NAME) if (ttype != CPP_NAME)
{ {
warning (0, "malformed %<#pragma init%>, ignoring"); warning (0, "malformed %<#pragma init%>, ignoring");
...@@ -179,10 +179,10 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -179,10 +179,10 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
else else
solaris_pending_inits = tree_cons (t, NULL, solaris_pending_inits); solaris_pending_inits = tree_cons (t, NULL, solaris_pending_inits);
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype == CPP_COMMA) if (ttype == CPP_COMMA)
{ {
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype != CPP_NAME) if (ttype != CPP_NAME)
{ {
warning (0, "malformed %<#pragma init%>"); warning (0, "malformed %<#pragma init%>");
...@@ -191,7 +191,7 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -191,7 +191,7 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
} }
else if (ttype == CPP_CLOSE_PAREN) else if (ttype == CPP_CLOSE_PAREN)
{ {
if (c_lex (&t) != CPP_EOF) if (pragma_lex (&t) != CPP_EOF)
warning (0, "junk at end of %<#pragma init%>"); warning (0, "junk at end of %<#pragma init%>");
return; return;
} }
...@@ -211,13 +211,13 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -211,13 +211,13 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
tree t; tree t;
enum cpp_ttype ttype; enum cpp_ttype ttype;
if (c_lex (&t) != CPP_OPEN_PAREN) if (pragma_lex (&t) != CPP_OPEN_PAREN)
{ {
warning (0, "malformed %<#pragma fini%>, ignoring"); warning (0, "malformed %<#pragma fini%>, ignoring");
return; return;
} }
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype != CPP_NAME) if (ttype != CPP_NAME)
{ {
warning (0, "malformed %<#pragma fini%>, ignoring"); warning (0, "malformed %<#pragma fini%>, ignoring");
...@@ -237,10 +237,10 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -237,10 +237,10 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
else else
solaris_pending_finis = tree_cons (t, NULL, solaris_pending_finis); solaris_pending_finis = tree_cons (t, NULL, solaris_pending_finis);
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype == CPP_COMMA) if (ttype == CPP_COMMA)
{ {
ttype = c_lex (&t); ttype = pragma_lex (&t);
if (ttype != CPP_NAME) if (ttype != CPP_NAME)
{ {
warning (0, "malformed %<#pragma fini%>"); warning (0, "malformed %<#pragma fini%>");
...@@ -249,7 +249,7 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED) ...@@ -249,7 +249,7 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
} }
else if (ttype == CPP_CLOSE_PAREN) else if (ttype == CPP_CLOSE_PAREN)
{ {
if (c_lex (&t) != CPP_EOF) if (pragma_lex (&t) != CPP_EOF)
warning (0, "junk at end of %<#pragma fini%>"); warning (0, "junk at end of %<#pragma fini%>");
return; return;
} }
......
...@@ -125,7 +125,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -125,7 +125,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
const char *sect, *alias; const char *sect, *alias;
enum GHS_section_kind kind; enum GHS_section_kind kind;
type = c_lex (&x); type = pragma_lex (&x);
if (type == CPP_EOF && !repeat) if (type == CPP_EOF && !repeat)
goto reset; goto reset;
...@@ -135,14 +135,14 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -135,14 +135,14 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
goto bad; goto bad;
repeat = 0; repeat = 0;
if (c_lex (&x) != CPP_EQ) if (pragma_lex (&x) != CPP_EQ)
goto bad; goto bad;
if (c_lex (&x) != CPP_NAME) if (pragma_lex (&x) != CPP_NAME)
goto bad; goto bad;
alias = IDENTIFIER_POINTER (x); alias = IDENTIFIER_POINTER (x);
type = c_lex (&x); type = pragma_lex (&x);
if (type == CPP_COMMA) if (type == CPP_COMMA)
repeat = 1; repeat = 1;
else if (type != CPP_EOF) else if (type != CPP_EOF)
...@@ -196,7 +196,7 @@ ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -196,7 +196,7 @@ ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs interrupt"); warning (OPT_Wpragmas, "junk at end of #pragma ghs interrupt");
mark_current_function_as_interrupt (); mark_current_function_as_interrupt ();
...@@ -207,7 +207,7 @@ ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -207,7 +207,7 @@ ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs starttda"); warning (OPT_Wpragmas, "junk at end of #pragma ghs starttda");
push_data_area (DATA_AREA_TDA); push_data_area (DATA_AREA_TDA);
...@@ -218,7 +218,7 @@ ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -218,7 +218,7 @@ ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs startsda"); warning (OPT_Wpragmas, "junk at end of #pragma ghs startsda");
push_data_area (DATA_AREA_SDA); push_data_area (DATA_AREA_SDA);
...@@ -229,7 +229,7 @@ ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -229,7 +229,7 @@ ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs startzda"); warning (OPT_Wpragmas, "junk at end of #pragma ghs startzda");
push_data_area (DATA_AREA_ZDA); push_data_area (DATA_AREA_ZDA);
...@@ -240,7 +240,7 @@ ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -240,7 +240,7 @@ ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs endtda"); warning (OPT_Wpragmas, "junk at end of #pragma ghs endtda");
pop_data_area (DATA_AREA_TDA); pop_data_area (DATA_AREA_TDA);
...@@ -251,7 +251,7 @@ ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -251,7 +251,7 @@ ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs endsda"); warning (OPT_Wpragmas, "junk at end of #pragma ghs endsda");
pop_data_area (DATA_AREA_SDA); pop_data_area (DATA_AREA_SDA);
...@@ -262,7 +262,7 @@ ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED) ...@@ -262,7 +262,7 @@ ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (OPT_Wpragmas, "junk at end of #pragma ghs endzda"); warning (OPT_Wpragmas, "junk at end of #pragma ghs endzda");
pop_data_area (DATA_AREA_ZDA); pop_data_area (DATA_AREA_ZDA);
......
2005-11-26 Richard Henderson <rth@redhat.com>
* lex.c: Update for pragma_lex rename.
* parser.c: Likewise.
2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2005-11-25 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/9278 PR c++/9278
......
...@@ -460,11 +460,11 @@ parse_strconst_pragma (const char* name, int opt) ...@@ -460,11 +460,11 @@ parse_strconst_pragma (const char* name, int opt)
tree result, x; tree result, x;
enum cpp_ttype t; enum cpp_ttype t;
t = c_lex (&x); t = pragma_lex (&x);
if (t == CPP_STRING) if (t == CPP_STRING)
{ {
result = x; result = x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (0, "junk at end of #pragma %s", name); warning (0, "junk at end of #pragma %s", name);
return result; return result;
} }
...@@ -583,7 +583,7 @@ static void ...@@ -583,7 +583,7 @@ static void
handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED ) handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED )
{ {
tree x; tree x;
if (c_lex (&x) != CPP_EOF) if (pragma_lex (&x) != CPP_EOF)
warning (0, "junk at end of #pragma GCC java_exceptions"); warning (0, "junk at end of #pragma GCC java_exceptions");
choose_personality_routine (lang_java); choose_personality_routine (lang_java);
......
...@@ -254,7 +254,7 @@ cp_lexer_new_main (void) ...@@ -254,7 +254,7 @@ cp_lexer_new_main (void)
/* Tell cpplib we want CPP_PRAGMA tokens. */ /* Tell cpplib we want CPP_PRAGMA tokens. */
cpp_get_options (parse_in)->defer_pragmas = true; cpp_get_options (parse_in)->defer_pragmas = true;
/* Tell c_lex not to merge string constants. */ /* Tell pragma_lex not to merge string constants. */
c_lex_return_raw_strings = true; c_lex_return_raw_strings = true;
c_common_no_more_pch (); c_common_no_more_pch ();
...@@ -297,8 +297,8 @@ cp_lexer_new_main (void) ...@@ -297,8 +297,8 @@ cp_lexer_new_main (void)
lexer->next_token = lexer->buffer_length ? buffer : (cp_token *)&eof_token; lexer->next_token = lexer->buffer_length ? buffer : (cp_token *)&eof_token;
/* Pragma processing (via cpp_handle_deferred_pragma) may result in /* Pragma processing (via cpp_handle_deferred_pragma) may result in
direct calls to c_lex. Those callers all expect c_lex to do direct calls to pragma_lex. Those callers all expect pragma_lex
string constant concatenation. */ to do string constant concatenation. */
c_lex_return_raw_strings = false; c_lex_return_raw_strings = false;
/* Subsequent preprocessor diagnostics should use compiler /* Subsequent preprocessor diagnostics should use compiler
......
...@@ -9160,7 +9160,7 @@ pragma of the form ...@@ -9160,7 +9160,7 @@ pragma of the form
@code{NULL} to put the pragma in the global namespace. The callback @code{NULL} to put the pragma in the global namespace. The callback
routine receives @var{pfile} as its first argument, which can be passed routine receives @var{pfile} as its first argument, which can be passed
on to cpplib's functions if necessary. You can lex tokens after the on to cpplib's functions if necessary. You can lex tokens after the
@var{name} by calling @code{c_lex}. Tokens that are not read by the @var{name} by calling @code{pragma_lex}. Tokens that are not read by the
callback will be silently ignored. The end of the line is indicated by callback will be silently ignored. The end of the line is indicated by
a token of type @code{CPP_EOF}. Macro expansion occurs on the a token of type @code{CPP_EOF}. Macro expansion occurs on the
arguments of pragmas registered with arguments of pragmas registered with
...@@ -9170,15 +9170,15 @@ pragmas registered with @code{c_register_pragma}. ...@@ -9170,15 +9170,15 @@ pragmas registered with @code{c_register_pragma}.
For an example use of this routine, see @file{c4x.h} and the callback For an example use of this routine, see @file{c4x.h} and the callback
routines defined in @file{c4x-c.c}. routines defined in @file{c4x-c.c}.
Note that the use of @code{c_lex} is specific to the C and C++ Note that the use of @code{pragma_lex} is specific to the C and C++
compilers. It will not work in the Java or Fortran compilers, or any compilers. It will not work in the Java or Fortran compilers, or any
other language compilers for that matter. Thus if @code{c_lex} is going other language compilers for that matter. Thus if @code{pragma_lex} is going
to be called from target-specific code, it must only be done so when to be called from target-specific code, it must only be done so when
building the C and C++ compilers. This can be done by defining the building the C and C++ compilers. This can be done by defining the
variables @code{c_target_objs} and @code{cxx_target_objs} in the variables @code{c_target_objs} and @code{cxx_target_objs} in the
target entry in the @file{config.gcc} file. These variables should name target entry in the @file{config.gcc} file. These variables should name
the target-specific, language-specific object file which contains the the target-specific, language-specific object file which contains the
code that uses @code{c_lex}. Note it will also be necessary to add a code that uses @code{pragma_lex}. Note it will also be necessary to add a
rule to the makefile fragment pointed to by @code{tmake_file} that shows rule to the makefile fragment pointed to by @code{tmake_file} that shows
how to build this object file. how to build this object file.
@end deftypefun @end deftypefun
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment