Commit 5b2abab8 by Mark Mitchell Committed by Mark Mitchell

c-common.h (c_language_kind): New type.

	* c-common.h (c_language_kind): New type.
	(c_language): New variab.e
	* c-common.c (lang_get_alias_set): Don't put structures in
	non-zero alias sets in C++.
	* c-decl.c (c_language): Define it.
	* c-lex.c (doing_objc_thang): Remove.
	* c-tree.h (doing_objc_thang): Make it a macro.
	* objc/objc-act.c (lang_decode_option): Set c_language, not
	doing_objc_thang.

	* decl2.c (c_language): Define.

From-SVN: r34439
parent f4381d62
2000-06-06 Mark Mitchell <mark@codesourcery.com>
* c-common.h (c_language_kind): New type.
(c_language): New variab.e
* c-common.c (lang_get_alias_set): Don't put structures in
non-zero alias sets in C++.
* c-decl.c (c_language): Define it.
* c-lex.c (doing_objc_thang): Remove.
* c-tree.h (doing_objc_thang): Make it a macro.
* objc/objc-act.c (lang_decode_option): Set c_language, not
doing_objc_thang.
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com> 2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.c (output_maximum_width): Remove. * diagnostic.c (output_maximum_width): Remove.
......
...@@ -3338,6 +3338,10 @@ lang_get_alias_set (t) ...@@ -3338,6 +3338,10 @@ lang_get_alias_set (t)
if (t1 != t) if (t1 != t)
return get_alias_set (t1); return get_alias_set (t1);
} }
/* It's not yet safe to use alias sets for classes in C++ because
the TYPE_FIELDs list for a class doesn't mention base classes. */
else if (c_language == clk_cplusplus && AGGREGATE_TYPE_P (t));
return 0;
return -1; return -1;
} }
......
...@@ -56,6 +56,19 @@ enum c_tree_index ...@@ -56,6 +56,19 @@ enum c_tree_index
extern tree c_global_trees[CTI_MAX]; extern tree c_global_trees[CTI_MAX];
typedef enum c_language_kind
{
clk_c, /* A dialect of C: K&R C, ANSI/ISO C89, C2000,
etc. */
clk_cplusplus, /* ANSI/ISO C++ */
clk_objective_c /* Objective C */
}
c_language_kind;
/* The variant of the C language being processed. Each C language
front-end defines this variable. */
extern c_language_kind c_language;
#define wchar_type_node c_global_trees[CTI_WCHAR_TYPE] #define wchar_type_node c_global_trees[CTI_WCHAR_TYPE]
#define signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE] #define signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE]
#define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE] #define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
......
...@@ -454,6 +454,10 @@ int warn_float_equal = 0; ...@@ -454,6 +454,10 @@ int warn_float_equal = 0;
int warn_multichar = 1; int warn_multichar = 1;
/* The variant of the C language being processed. */
c_language_kind c_language = clk_c;
/* Nonzero means `$' can be in an identifier. */ /* Nonzero means `$' can be in an identifier. */
#ifndef DOLLARS_IN_IDENTIFIERS #ifndef DOLLARS_IN_IDENTIFIERS
......
...@@ -132,10 +132,6 @@ int linemode; ...@@ -132,10 +132,6 @@ int linemode;
used in a context which makes it a reference to a variable. */ used in a context which makes it a reference to a variable. */
tree lastiddecl; tree lastiddecl;
/* Nonzero enables objc features. */
int doing_objc_thang;
extern int yydebug; extern int yydebug;
/* File used for outputting assembler code. */ /* File used for outputting assembler code. */
......
...@@ -446,7 +446,8 @@ extern int system_header_p; ...@@ -446,7 +446,8 @@ extern int system_header_p;
/* Nonzero enables objc features. */ /* Nonzero enables objc features. */
extern int doing_objc_thang; #define doing_objc_thang \
(c_language == clk_objective_c)
/* In c-decl.c */ /* In c-decl.c */
extern void finish_incomplete_decl PARAMS ((tree)); extern void finish_incomplete_decl PARAMS ((tree));
......
2000-06-06 Mark Mitchell <mark@codesourcery.com>
* decl2.c (c_language): Define.
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com> 2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com>
* lex.c (lang_init_options): Tweak. * lex.c (lang_init_options): Tweak.
......
...@@ -501,6 +501,10 @@ int flag_enforce_eh_specs = 1; ...@@ -501,6 +501,10 @@ int flag_enforce_eh_specs = 1;
void (*back_end_hook) PARAMS ((tree)); void (*back_end_hook) PARAMS ((tree));
/* The variant of the C language being processed. */
c_language_kind c_language = clk_cplusplus;
/* Table of language-dependent -f options. /* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable. STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE ON_VALUE is the value to store in VARIABLE
......
...@@ -798,7 +798,7 @@ lang_decode_option (argc, argv) ...@@ -798,7 +798,7 @@ lang_decode_option (argc, argv)
{ {
const char *p = argv[0]; const char *p = argv[0];
if (!strcmp (p, "-lang-objc")) if (!strcmp (p, "-lang-objc"))
doing_objc_thang = 1; c_language = clk_objective_c;
else if (!strcmp (p, "-gen-decls")) else if (!strcmp (p, "-gen-decls"))
flag_gen_declaration = 1; flag_gen_declaration = 1;
else if (!strcmp (p, "-Wselector")) else if (!strcmp (p, "-Wselector"))
......
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