Commit be768055 by Jakub Jelinek Committed by Jakub Jelinek

gcc.c (cpp_options): Pass -fno-operator-names.

	* gcc.c (cpp_options): Pass -fno-operator-names.
	* cpplib.h (struct cpp_options): Add operator_names.
	* cppinit.c (cpp_create_reader): Initialize it.
	(initialize_builtins): If -fno-operator-names, don't add
	C++ alternate operator names.
	(COMMAND_LINE_OPTIONS): Add -fno-operator-names.
	(cpp_handle_option): Clear operator_names.

From-SVN: r38288
parent c3e899c1
2000-12-15 Jakub Jelinek <jakub@redhat.com>
* gcc.c (cpp_options): Pass -fno-operator-names.
* cpplib.h (struct cpp_options): Add operator_names.
* cppinit.c (cpp_create_reader): Initialize it.
(initialize_builtins): If -fno-operator-names, don't add
C++ alternate operator names.
(COMMAND_LINE_OPTIONS): Add -fno-operator-names.
(cpp_handle_option): Clear operator_names.
2000-12-15 Jason Merrill <jason@redhat.com> 2000-12-15 Jason Merrill <jason@redhat.com>
* jump.c (jump_optimize_1): Don't delete the line note after the * jump.c (jump_optimize_1): Don't delete the line note after the
......
...@@ -491,6 +491,7 @@ cpp_create_reader (lang) ...@@ -491,6 +491,7 @@ cpp_create_reader (lang)
CPP_OPTION (pfile, discard_comments) = 1; CPP_OPTION (pfile, discard_comments) = 1;
CPP_OPTION (pfile, show_column) = 1; CPP_OPTION (pfile, show_column) = 1;
CPP_OPTION (pfile, tabstop) = 8; CPP_OPTION (pfile, tabstop) = 8;
CPP_OPTION (pfile, operator_names) = 1;
CPP_OPTION (pfile, pending) = CPP_OPTION (pfile, pending) =
(struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending)); (struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending));
...@@ -663,6 +664,7 @@ static const struct builtin builtin_array[] = ...@@ -663,6 +664,7 @@ static const struct builtin builtin_array[] =
#undef B #undef B
#undef C #undef C
#undef X #undef X
#undef O
#define builtin_array_end \ #define builtin_array_end \
builtin_array + sizeof(builtin_array)/sizeof(struct builtin) builtin_array + sizeof(builtin_array)/sizeof(struct builtin)
...@@ -679,6 +681,9 @@ initialize_builtins (pfile) ...@@ -679,6 +681,9 @@ initialize_builtins (pfile)
if ((b->flags & CPLUS) && ! CPP_OPTION (pfile, cplusplus)) if ((b->flags & CPLUS) && ! CPP_OPTION (pfile, cplusplus))
continue; continue;
if ((b->flags & OPERATOR) && ! CPP_OPTION (pfile, operator_names))
continue;
if (b->flags & (OPERATOR | BUILTIN)) if (b->flags & (OPERATOR | BUILTIN))
{ {
cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len); cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len);
...@@ -1091,6 +1096,7 @@ new_pending_directive (pend, text, handler) ...@@ -1091,6 +1096,7 @@ new_pending_directive (pend, text, handler)
DEF_OPT("d", no_arg, OPT_d) \ DEF_OPT("d", no_arg, OPT_d) \
DEF_OPT("fleading-underscore", 0, OPT_fleading_underscore) \ DEF_OPT("fleading-underscore", 0, OPT_fleading_underscore) \
DEF_OPT("fno-leading-underscore", 0, OPT_fno_leading_underscore) \ DEF_OPT("fno-leading-underscore", 0, OPT_fno_leading_underscore) \
DEF_OPT("fno-operator-names", 0, OPT_fno_operator_names) \
DEF_OPT("fno-preprocessed", 0, OPT_fno_preprocessed) \ DEF_OPT("fno-preprocessed", 0, OPT_fno_preprocessed) \
DEF_OPT("fno-show-column", 0, OPT_fno_show_column) \ DEF_OPT("fno-show-column", 0, OPT_fno_show_column) \
DEF_OPT("fpreprocessed", 0, OPT_fpreprocessed) \ DEF_OPT("fpreprocessed", 0, OPT_fpreprocessed) \
...@@ -1287,6 +1293,9 @@ cpp_handle_option (pfile, argc, argv) ...@@ -1287,6 +1293,9 @@ cpp_handle_option (pfile, argc, argv)
case OPT_fno_leading_underscore: case OPT_fno_leading_underscore:
CPP_OPTION (pfile, user_label_prefix) = ""; CPP_OPTION (pfile, user_label_prefix) = "";
break; break;
case OPT_fno_operator_names:
CPP_OPTION (pfile, operator_names) = 0;
break;
case OPT_fpreprocessed: case OPT_fpreprocessed:
CPP_OPTION (pfile, preprocessed) = 1; CPP_OPTION (pfile, preprocessed) = 1;
break; break;
......
...@@ -424,6 +424,9 @@ struct cpp_options ...@@ -424,6 +424,9 @@ struct cpp_options
/* Print column number in error messages. */ /* Print column number in error messages. */
unsigned char show_column; unsigned char show_column;
/* Treat C++ alternate operator names special. */
unsigned char operator_names;
}; };
struct lexer_state struct lexer_state
......
...@@ -594,7 +594,7 @@ static const char *cpp_options = ...@@ -594,7 +594,7 @@ static const char *cpp_options =
%{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}}\ %{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}}\
%{fshow-column} %{fno-show-column}\ %{fshow-column} %{fno-show-column}\
%{fleading-underscore} %{fno-leading-underscore}\ %{fleading-underscore} %{fno-leading-underscore}\
%{ftabstop=*} %{remap}\ %{fno-operator-names} %{ftabstop=*} %{remap}\
%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*&U*&A*} %{i*} %Z %i\ %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*&U*&A*} %{i*} %Z %i\
%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}"; %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}";
......
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