diff options
| author | brolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-10 10:12:36 +0000 | 
|---|---|---|
| committer | brolley <brolley@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-10 10:12:36 +0000 | 
| commit | 11ce684d779b50cf49fa1a9216e55c2dca06b4fc (patch) | |
| tree | 34e222e6636a47fccb9290f46b926d67612b47a9 /gcc/c-decl.c | |
| parent | 8af6f9d5e7604c51eb73a577fd40f5a9c441e454 (diff) | |
| download | ppe42-gcc-11ce684d779b50cf49fa1a9216e55c2dca06b4fc.tar.gz ppe42-gcc-11ce684d779b50cf49fa1a9216e55c2dca06b4fc.zip | |
 Integrate cpplib into the C and C++ front ends.
Wed Jun 10 13:07:02 1998  Dave Brolley  <brolley@cygnus.com>
	* objc/objc-act.c: Add cpplib declarations.
	(lang_decode_option): Initialize cpplib if necessary.
	(lang_decode_option): New argc/argv interface.
	* tree.h (lang_decode_option): New argc/argv interface.
	* toplev.c (lang_options): Add cpp options.
	(main): New interface for lang_decode_option.
	* gcc.c (default_compilers): Don't call cpp for a cpplib-enabled C compiler
	unless -E, -M or -MM is specified.
	* cpplib.h (cpp_handle_option): New function.
	* cpplib.c (cpp_handle_option): New function.
	(cpp_handle_options): Now calls cpp_handle_option.
	* c-tree.h (c_decode_option): New argc/argv interface.
	* c-lex.c (init_parse): cpplib now initialized in c_decode_option.
	* c-lang.c (lang_decode_option): New argc/argv interface.
	* c-decl.c: Add cpplib declarations.
	(c_decode_option): New argc/argv interface.
	(c_decode_option): Call cpp_handle_option.
	(c_decode_option): Now returns number of strings processed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
| -rw-r--r-- | gcc/c-decl.c | 32 | 
1 files changed, 27 insertions, 5 deletions
| diff --git a/gcc/c-decl.c b/gcc/c-decl.c index bc8f61773f9..0f2a3f2ccac 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -35,6 +35,13 @@ Boston, MA 02111-1307, USA.  */  #include "c-lex.h"  #include "toplev.h" +#if USE_CPPLIB +#include "cpplib.h" +extern cpp_reader  parse_in; +extern cpp_options parse_options; +static int cpp_initialized; +#endif +  /* In grokdeclarator, distinguish syntactic contexts of declarators.  */  enum decl_context  { NORMAL,			/* Ordinary declaration */ @@ -578,13 +585,28 @@ int warn_sign_compare = -1;  int dollars_in_ident = DOLLARS_IN_IDENTIFIERS;  /* Decode the string P as a language-specific option for C. -   Return 1 if it is recognized (and handle it); -   return 0 if not recognized.  */ +   Return the number of strings consumed.  */  int -c_decode_option (p) -     char *p; +c_decode_option (argc, argv) +     int argc; +     char **argv;  { +  int strings_processed; +  char *p = argv[0]; +#if USE_CPPLIB +  if (! cpp_initialized) +    { +      cpp_reader_init (&parse_in); +      parse_in.data = &parse_options; +      cpp_options_init (&parse_options); +      cpp_initialized = 1; +    } +  strings_processed = cpp_handle_option (&parse_in, argc, argv); +#else +  strings_processed = 0; +#endif /* ! USE_CPPLIB */ +    if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))      {        flag_traditional = 1; @@ -799,7 +821,7 @@ c_decode_option (p)        warn_unknown_pragmas = 1;      }    else -    return 0; +    return strings_processed;    return 1;  } | 

