From bdcae02bc40594b8e41e7aff7a4b309d41be59c0 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 17 May 2002 19:37:43 +0000 Subject: [PATCH] c-common.c (c_common_init_options): Use C89 for Objective-C, and set the options flag. * c-common.c (c_common_init_options): Use C89 for Objective-C, and set the options flag. * cppinit.c (lang_flags): Remove objc. (lang_defaults): Remove OBJC and OBJCXX. (set_lang): Update. (COMMAND_LINE_OPTIONS): Remove -+ and -lang-objc++. (cpp_handle_option): Remove -+ and -lang-objc++. For ObjC, just set a flag. (print_help): Update. * cpplib.h (enum c_lang): Remove CLK_OBJC and CLK_OBJCXX. From-SVN: r53566 --- gcc/ChangeLog | 13 +++++++++++++ gcc/c-common.c | 6 ++++-- gcc/cppinit.c | 35 ++++++++++------------------------- gcc/cpplib.h | 5 +++-- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db21a4c57ae..42c8f168d4c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2002-05-17 Neil Booth + + * c-common.c (c_common_init_options): Use C89 for Objective-C, + and set the options flag. + * cppinit.c (lang_flags): Remove objc. + (lang_defaults): Remove OBJC and OBJCXX. + (set_lang): Update. + (COMMAND_LINE_OPTIONS): Remove -+ and -lang-objc++. + (cpp_handle_option): Remove -+ and -lang-objc++. + For ObjC, just set a flag. + (print_help): Update. + * cpplib.h (enum c_lang): Remove CLK_OBJC and CLK_OBJCXX. + 2002-05-17 Rainer Orth * doc/install.texi (Specific, mips-sgi-irix6): Document need to diff --git a/gcc/c-common.c b/gcc/c-common.c index c799e95886d..5a878991345 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4271,8 +4271,10 @@ c_common_init_options (lang) enum c_language_kind lang; { c_language = lang; - parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89: - lang == clk_cplusplus ? CLK_GNUCXX: CLK_OBJC); + parse_in = cpp_create_reader (lang == clk_c || lang == clk_objective_c + ? CLK_GNUC89 : CLK_GNUCXX); + if (lang == clk_objective_c) + cpp_get_options (parse_in)->objc = 1; /* Mark as "unspecified" (see c_common_post_options). */ flag_bounds_check = -1; diff --git a/gcc/cppinit.c b/gcc/cppinit.c index a03450c27fc..cb3f483d550 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -391,7 +391,6 @@ merge_include_chains (pfile) struct lang_flags { char c99; - char objc; char cplusplus; char extended_numbers; char trigraphs; @@ -402,17 +401,15 @@ struct lang_flags /* ??? Enable $ in identifiers in assembly? */ static const struct lang_flags lang_defaults[] = -{ /* c99 objc c++ xnum trig dollar c++comm digr */ - /* GNUC89 */ { 0, 0, 0, 1, 0, 1, 1, 1 }, - /* GNUC99 */ { 1, 0, 0, 1, 0, 1, 1, 1 }, - /* STDC89 */ { 0, 0, 0, 0, 1, 0, 0, 0 }, - /* STDC94 */ { 0, 0, 0, 0, 1, 0, 0, 1 }, - /* STDC99 */ { 1, 0, 0, 1, 1, 0, 1, 1 }, - /* GNUCXX */ { 0, 0, 1, 1, 0, 1, 1, 1 }, - /* CXX98 */ { 0, 0, 1, 1, 1, 0, 1, 1 }, - /* OBJC */ { 0, 1, 0, 1, 0, 1, 1, 1 }, - /* OBJCXX */ { 0, 1, 1, 1, 0, 1, 1, 1 }, - /* ASM */ { 0, 0, 0, 1, 0, 0, 1, 0 } +{ /* c99 c++ xnum trig dollar c++comm digr */ + /* GNUC89 */ { 0, 0, 1, 0, 1, 1, 1 }, + /* GNUC99 */ { 1, 0, 1, 0, 1, 1, 1 }, + /* STDC89 */ { 0, 0, 0, 1, 0, 0, 0 }, + /* STDC94 */ { 0, 0, 0, 1, 0, 0, 1 }, + /* STDC99 */ { 1, 0, 1, 1, 0, 1, 1 }, + /* GNUCXX */ { 0, 1, 1, 0, 1, 1, 1 }, + /* CXX98 */ { 0, 1, 1, 1, 0, 1, 1 }, + /* ASM */ { 0, 0, 1, 0, 0, 1, 0 } }; /* Sets internal flags correctly for a given language. */ @@ -426,7 +423,6 @@ set_lang (pfile, lang) CPP_OPTION (pfile, lang) = lang; CPP_OPTION (pfile, c99) = l->c99; - CPP_OPTION (pfile, objc) = l->objc; CPP_OPTION (pfile, cplusplus) = l->cplusplus; CPP_OPTION (pfile, extended_numbers) = l->extended_numbers; CPP_OPTION (pfile, trigraphs) = l->trigraphs; @@ -1139,7 +1135,6 @@ new_pending_directive (pend, text, handler) "-" removed. It must be sorted in ASCII collating order. */ #define COMMAND_LINE_OPTIONS \ DEF_OPT("$", 0, OPT_dollar) \ - DEF_OPT("+", 0, OPT_plus) \ DEF_OPT("-help", 0, OPT__help) \ DEF_OPT("-target-help", 0, OPT_target__help) \ DEF_OPT("-version", 0, OPT__version) \ @@ -1183,7 +1178,6 @@ new_pending_directive (pend, text, handler) DEF_OPT("lang-c++", 0, OPT_lang_cplusplus) \ DEF_OPT("lang-c89", 0, OPT_lang_c89) \ DEF_OPT("lang-objc", 0, OPT_lang_objc) \ - DEF_OPT("lang-objc++", 0, OPT_lang_objcplusplus) \ DEF_OPT("nostdinc", 0, OPT_nostdinc) \ DEF_OPT("nostdinc++", 0, OPT_nostdincplusplus) \ DEF_OPT("o", no_fil, OPT_o) \ @@ -1447,10 +1441,6 @@ cpp_handle_option (pfile, argc, argv, ignore) case OPT_trigraphs: CPP_OPTION (pfile, trigraphs) = 1; break; - case OPT_plus: - CPP_OPTION (pfile, cplusplus) = 1; - CPP_OPTION (pfile, cplusplus_comments) = 1; - break; case OPT_remap: CPP_OPTION (pfile, remap) = 1; break; @@ -1465,10 +1455,7 @@ cpp_handle_option (pfile, argc, argv, ignore) set_lang (pfile, CLK_GNUCXX); break; case OPT_lang_objc: - set_lang (pfile, CLK_OBJC); - break; - case OPT_lang_objcplusplus: - set_lang (pfile, CLK_OBJCXX); + CPP_OPTION (pfile, objc) = 1; break; case OPT_lang_asm: set_lang (pfile, CLK_ASM); @@ -1909,14 +1896,12 @@ Switches:\n\ fputs (_("\ -lang-c++ Assume that the input sources are in C++\n\ -lang-objc Assume that the input sources are in ObjectiveC\n\ - -lang-objc++ Assume that the input sources are in ObjectiveC++\n\ -lang-asm Assume that the input sources are in assembler\n\ "), stdout); fputs (_("\ -std= Specify the conformance standard; one of:\n\ gnu89, gnu99, c89, c99, iso9899:1990,\n\ iso9899:199409, iso9899:1999\n\ - -+ Allow parsing of C++ style features\n\ -w Inhibit warning messages\n\ -Wtrigraphs Warn if trigraphs are encountered\n\ -Wno-trigraphs Do not warn about trigraphs\n\ diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 9bccda31bc7..378fa7e2e54 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -153,7 +153,7 @@ enum cpp_ttype /* C language kind, used when calling cpp_reader_init. */ enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, CLK_STDC99, - CLK_GNUCXX, CLK_CXX98, CLK_OBJC, CLK_OBJCXX, CLK_ASM}; + CLK_GNUCXX, CLK_CXX98, CLK_ASM}; /* Payload of a NUMBER, STRING, CHAR or COMMENT token. */ struct cpp_string @@ -260,7 +260,8 @@ struct cpp_options /* Nonzero means handle cplusplus style comments */ unsigned char cplusplus_comments; - /* Nonzero means handle #import, for objective C. */ + /* Nonzero means define __OBJC__, treat @ as a special token, and + use the OBJC[PLUS]_INCLUDE_PATH environment variable. */ unsigned char objc; /* Nonzero means don't copy comments into the output file. */ -- 2.30.2