aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>2000-12-16 23:41:44 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>2000-12-16 23:41:44 +0000
commit9f416fac8f180c78e6be63131494c1f1b5161d46 (patch)
tree71b87136b9f8dce383b0758a078566ac1bcc48a2 /gcc
parent94eebed99ae75af66b357e96c5492de01ff4df7b (diff)
downloadgcc-9f416fac8f180c78e6be63131494c1f1b5161d46.zip
gcc-9f416fac8f180c78e6be63131494c1f1b5161d46.tar.gz
gcc-9f416fac8f180c78e6be63131494c1f1b5161d46.tar.bz2
c4x.h (REGISTER_TARGET_PRAGMAS): Call c4x_init_pragma.
* config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Call c4x_init_pragma. * config/c4x/c4x-protos.h (c4x_init_pragma): New prototype. * config/c4x/c4x.c (c4x_init_pragma): New function. (c_lex_func): New variable. (c4x_parse_pragma): Use c_lex_func. Co-Authored-By: Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> From-SVN: r38317
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/c4x/c4x-protos.h1
-rw-r--r--gcc/config/c4x/c4x.c22
-rw-r--r--gcc/config/c4x/c4x.h1
4 files changed, 29 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1cc24d5..1de2a26 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,17 @@
2000-12-17 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+ * config/c4x/c4x.h (REGISTER_TARGET_PRAGMAS): Call c4x_init_pragma.
+
+ * config/c4x/c4x-protos.h (c4x_init_pragma): New prototype.
+
+ * config/c4x/c4x.c (c4x_init_pragma): New function.
+ (c_lex_func): New variable.
+ (c4x_parse_pragma): Use c_lex_func.
+
+2000-12-17 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
+ Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
* config/c4x/c4x.h (MD_INIT_BUILTINS): Add void_list_node argument
to c4x_init_builtins.
diff --git a/gcc/config/c4x/c4x-protos.h b/gcc/config/c4x/c4x-protos.h
index 57df4f3..8c8b770 100644
--- a/gcc/config/c4x/c4x-protos.h
+++ b/gcc/config/c4x/c4x-protos.h
@@ -308,6 +308,7 @@ extern void c4x_pr_FUNC_IS_PURE PARAMS ((cpp_reader *));
extern void c4x_pr_FUNC_NEVER_RETURNS PARAMS ((cpp_reader *));
extern void c4x_pr_INTERRUPT PARAMS ((cpp_reader *));
extern void c4x_pr_ignored PARAMS ((cpp_reader *));
+extern void c4x_init_pragma PARAMS ((int (*) (tree *)));
#endif
#endif
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 7127749..775c7b6 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -4391,6 +4391,16 @@ c4x_operand_subword (op, i, validate_address, mode)
-1 for a malformed pragma. */
#define BAD(msgid, arg) do { warning (msgid, arg); return -1; } while (0)
+static int (*c_lex_func) (tree *);
+
+void
+c4x_init_pragma (get_token)
+ int (*get_token) PARAMS ((tree *));
+{
+ c_lex_func = get_token;
+}
+
+
static int
c4x_parse_pragma (name, func, sect)
const char *name;
@@ -4399,25 +4409,25 @@ c4x_parse_pragma (name, func, sect)
{
tree f, s, x;
- if (c_lex (&x) != CPP_OPEN_PAREN)
+ if (c_lex_func (&x) != CPP_OPEN_PAREN)
BAD ("missing '(' after '#pragma %s' - ignored", name);
- if (c_lex (&f) != CPP_NAME)
+ if (c_lex_func (&f) != CPP_NAME)
BAD ("missing function name in '#pragma %s' - ignored", name);
if (sect)
{
- if (c_lex (&x) != CPP_COMMA)
+ if (c_lex_func (&x) != CPP_COMMA)
BAD ("malformed '#pragma %s' - ignored", name);
- if (c_lex (&s) != CPP_STRING)
+ if (c_lex_func (&s) != CPP_STRING)
BAD ("missing section name in '#pragma %s' - ignored", name);
*sect = s;
}
- if (c_lex (&x) != CPP_CLOSE_PAREN)
+ if (c_lex_func (&x) != CPP_CLOSE_PAREN)
BAD ("missing ')' for '#pragma %s' - ignored", name);
- if (c_lex (&x) != CPP_EOF)
+ if (c_lex_func (&x) != CPP_EOF)
warning ("junk at end of '#pragma %s'", name);
*func = f;
diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h
index 2b3fe74..4834531 100644
--- a/gcc/config/c4x/c4x.h
+++ b/gcc/config/c4x/c4x.h
@@ -2385,6 +2385,7 @@ asm_fprintf (FILE, "%s%d:\n", PREFIX, NUM)
cpp_register_pragma (PFILE, 0, "FUNC_NO_GLOBAL_ASG", c4x_pr_ignored); \
cpp_register_pragma (PFILE, 0, "FUNC_NO_IND_ASG", c4x_pr_ignored); \
cpp_register_pragma (PFILE, 0, "INTERRUPT", c4x_pr_INTERRUPT); \
+ c4x_init_pragma (&c_lex); \
} while (0)
#define SET_DEFAULT_DECL_ATTRIBUTES(DECL, ATTRIBUTES) \