aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@cygnus.com>1998-06-10 10:12:36 +0000
committerDave Brolley <brolley@gcc.gnu.org>1998-06-10 06:12:36 -0400
commita0d85b7572a80c023a0eef537a8c94e6af280c51 (patch)
tree34e222e6636a47fccb9290f46b926d67612b47a9 /gcc/toplev.c
parent0875c2f39b0d864b3dcd220b4f594b58d48e82f1 (diff)
downloadgcc-a0d85b7572a80c023a0eef537a8c94e6af280c51.zip
gcc-a0d85b7572a80c023a0eef537a8c94e6af280c51.tar.gz
gcc-a0d85b7572a80c023a0eef537a8c94e6af280c51.tar.bz2
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. From-SVN: r20407
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index f68c9ad..d4c57cb 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -894,6 +894,19 @@ char *lang_options[] =
"-Wno-protocol",
"-print-objc-runtime-info",
+ /* These are for languages with USE_CPPLIB. */
+ "-A",
+ "-D",
+ "-I",
+ "-iprefix",
+ "-isystem",
+ "-lang-c",
+ "-lang-c89",
+ "-lang-c++",
+ "-nostdinc++",
+ "-U",
+ "-undef",
+
#include "options.h"
0
};
@@ -3853,9 +3866,13 @@ main (argc, argv, envp)
strlen (lang_options[j])))
break;
if (lang_options[j] != 0)
- /* If the option is valid for *some* language,
- treat it as valid even if this language doesn't understand it. */
- lang_decode_option (argv[i]);
+ {
+ /* If the option is valid for *some* language,
+ treat it as valid even if this language doesn't understand it. */
+ int strings_processed = lang_decode_option (argc - i, argv + i);
+ if (strings_processed != 0)
+ i += strings_processed - 1;
+ }
else if (argv[i][0] == '-' && argv[i][1] != 0)
{
register char *str = argv[i] + 1;