From 8b97c5f8ef218afce7499abe8cd3e6eb1f729306 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Thu, 7 Sep 2000 22:24:34 +0000 Subject: c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined. * c-pragma.h: Define HANDLE_GENERIC_PRAGMAS if REGISTER_TARGET_PRAGMAS is defined. Duplicate some definitions from cpplib.h. * cpplib.h: Don't typedef struct cpp_reader if c-pragma.h has already done it. * tm.texi: Document HANDLE_PRAGMA as no longer supported. Add documentation for REGISTER_TARGET_PRAGMAS. * c-lex.c: Include cpplib.h before c-pragma.h. Define a default-pragma callback to implement -Wunknown-pragmas if USE_CPPLIB. * c-parse.in: Move all includes to top of file. * c-pragma.c: Include cpplib.h before c-pragma.h. Include tm_p.h. (dispatch_pragma): Put the namespace in the -Wunknown-pragmas warning. (init_pragma): If REGISTER_TARGET_PRAGMAS is defined, call it. * arm.h, arm-protos.h, arm.c, c4x.h, c4x-protos.h, c4x.c, h8300.h, h8300-protos.h, h8300.c, i370.h, i370-protos.h, i370.c, i960.h, i960-protos.h, i960.c, sh.h, sh-protos.h, sh.c, v850.h, v850-protos.h, v850.c: Convert HANDLE_PRAGMA-based pragmata scheme to use REGISTER_TARGET_PRAGMAS instead. * d30v.h: Don't mention HANDLE_PRAGMA in comment. Add multiple include guard. * i370.md (untyped_call): Use GEN_CALL. (umodsi3): Remove unused variable. * sh/elf.h: Don't undef HANDLE_SYSV_PRAGMA. * v850.c (output_move_single, output_move_double): Constify return value. (print_operand): Constify a char *. * v850.h (struct small_memory_info): Constify name member. From-SVN: r36249 --- gcc/c-pragma.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'gcc/c-pragma.c') diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index 2d6bee8..820720d 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -24,12 +24,13 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "function.h" #include "defaults.h" +#include "cpplib.h" #include "c-pragma.h" #include "flags.h" #include "toplev.h" #include "ggc.h" #include "c-lex.h" -#include "cpplib.h" +#include "tm_p.h" #ifdef HANDLE_GENERIC_PRAGMAS @@ -383,7 +384,7 @@ dispatch_pragma () enum cpp_ttype t; tree x; const struct pragma_entry *p; - const char *name; + const char *name, *space = 0; size_t len; p = pragmas; @@ -407,6 +408,7 @@ dispatch_pragma () { if (p->isnspace) { + space = p->name; p = p->u.space; goto new_space; } @@ -420,10 +422,15 @@ dispatch_pragma () } /* Issue a warning message if we have been asked to do so. Ignore - unknown pragmas in system header file unless an explcit + unknown pragmas in system headers unless an explicit -Wunknown-pragmas has been given. */ if (warn_unknown_pragmas > in_system_header) - warning ("ignoring pragma %s", name); + { + if (space) + warning ("ignoring #pragma %s %s", space, name); + else + warning ("ignoring #pragma %s", name); + } } #endif @@ -444,6 +451,10 @@ init_pragma () cpp_register_pragma (pfile, 0, "weak", handle_pragma_weak); #endif +#ifdef REGISTER_TARGET_PRAGMAS + REGISTER_TARGET_PRAGMAS (pfile); +#endif + #ifdef HANDLE_PRAGMA_PACK_PUSH_POP ggc_add_root (&alignment_stack, 1, sizeof(alignment_stack), mark_align_stack); -- cgit v1.1