Commit ae54392b by Zack Weinberg Committed by Zack Weinberg

c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS.

	* c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS.
	(init_pragma): Avoid warning if pfile happens to be unused.
	* c-pragma.h: Never define HANDLE_GENERIC_PRAGMAS.  Never
	define init_pragma to nothing.  Always prototype
	init_pragma.  Prototype dispatch_pragma if !USE_CPPLIB.

	* c-lex.c (process_directive): Always call dispatch_pragma.
	Initialize entering_c_header to 0.

From-SVN: r36277
parent 385c9217
2000-09-08 Zack Weinberg <zack@wolery.cumb.org>
* c-pragma.c: Don't elide entire file if !HANDLE_GENERIC_PRAGMAS.
(init_pragma): Avoid warning if pfile happens to be unused.
* c-pragma.h: Never define HANDLE_GENERIC_PRAGMAS. Never
define init_pragma to nothing. Always prototype
init_pragma. Prototype dispatch_pragma if !USE_CPPLIB.
* c-lex.c (process_directive): Always call dispatch_pragma.
Initialize entering_c_header to 0.
2000-09-08 Stephane Carrez <Stephane.Carrez@worldnet.fr> 2000-09-08 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.md: New file, machine description for * config/m68hc11/m68hc11.md: New file, machine description for
......
...@@ -438,7 +438,7 @@ process_directive () ...@@ -438,7 +438,7 @@ process_directive ()
int action_number, l; int action_number, l;
char *new_file; char *new_file;
#ifndef NO_IMPLICIT_EXTERN_C #ifndef NO_IMPLICIT_EXTERN_C
int entering_c_header; int entering_c_header = 0;
#endif #endif
/* Don't read beyond this line. */ /* Don't read beyond this line. */
...@@ -457,9 +457,7 @@ process_directive () ...@@ -457,9 +457,7 @@ process_directive ()
if (!strcmp (name, "pragma")) if (!strcmp (name, "pragma"))
{ {
#ifdef HANDLE_GENERIC_PRAGMAS
dispatch_pragma (); dispatch_pragma ();
#endif
goto skipline; goto skipline;
} }
else if (!strcmp (name, "define")) else if (!strcmp (name, "define"))
......
...@@ -32,8 +32,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,8 +32,6 @@ Boston, MA 02111-1307, USA. */
#include "c-lex.h" #include "c-lex.h"
#include "tm_p.h" #include "tm_p.h"
#ifdef HANDLE_GENERIC_PRAGMAS
#if USE_CPPLIB #if USE_CPPLIB
extern cpp_reader parse_in; extern cpp_reader parse_in;
#else #else
...@@ -438,10 +436,11 @@ dispatch_pragma () ...@@ -438,10 +436,11 @@ dispatch_pragma ()
void void
init_pragma () init_pragma ()
{ {
cpp_reader *pfile ATTRIBUTE_UNUSED;
#if !USE_CPPLIB #if !USE_CPPLIB
cpp_reader *pfile = 0; pfile = 0;
#else #else
cpp_reader *pfile = &parse_in; pfile = &parse_in;
#endif #endif
#ifdef HANDLE_PRAGMA_PACK #ifdef HANDLE_PRAGMA_PACK
...@@ -450,7 +449,6 @@ init_pragma () ...@@ -450,7 +449,6 @@ init_pragma ()
#ifdef HANDLE_PRAGMA_WEAK #ifdef HANDLE_PRAGMA_WEAK
cpp_register_pragma (pfile, 0, "weak", handle_pragma_weak); cpp_register_pragma (pfile, 0, "weak", handle_pragma_weak);
#endif #endif
#ifdef REGISTER_TARGET_PRAGMAS #ifdef REGISTER_TARGET_PRAGMAS
REGISTER_TARGET_PRAGMAS (pfile); REGISTER_TARGET_PRAGMAS (pfile);
#endif #endif
...@@ -460,5 +458,3 @@ init_pragma () ...@@ -460,5 +458,3 @@ init_pragma ()
mark_align_stack); mark_align_stack);
#endif #endif
} }
#endif /* HANDLE_GENERIC_PRAGMAS */
...@@ -57,25 +57,11 @@ extern struct weak_syms * weak_decls; ...@@ -57,25 +57,11 @@ extern struct weak_syms * weak_decls;
extern int add_weak PARAMS ((const char *, const char *)); extern int add_weak PARAMS ((const char *, const char *));
#endif /* HANDLE_PRAGMA_WEAK */ #endif /* HANDLE_PRAGMA_WEAK */
/* Define HANDLE_GENERIC_PRAGMAS if any kind of front-end pragma
parsing is to be done. The code in GCC's generic C source files
will only look for the definition of this constant. They will
ignore definitions of HANDLE_PRAGMA_PACK and so on. */
#if defined HANDLE_PRAGMA_PACK || defined HANDLE_PRAGMA_WEAK \
|| defined REGISTER_TARGET_PRAGMAS
#define HANDLE_GENERIC_PRAGMAS
#endif
#ifdef HANDLE_GENERIC_PRAGMAS
extern void init_pragma PARAMS ((void)); extern void init_pragma PARAMS ((void));
# if !USE_CPPLIB /* If cpplib is in use, it handles dispatch. */
#if !USE_CPPLIB
extern void dispatch_pragma PARAMS ((void)); extern void dispatch_pragma PARAMS ((void));
# endif
#else
# define init_pragma()
#endif #endif
/* Duplicate prototypes for the register_pragma stuff and the typedef for /* Duplicate prototypes for the register_pragma stuff and the typedef for
......
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