* 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
+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>
* diagnostic.c (output_maximum_width): Remove.
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.c (output_maximum_width): Remove.
if (t1 != t)
return get_alias_set (t1);
}
if (t1 != t)
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;
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 signed_wchar_type_node c_global_trees[CTI_SIGNED_WCHAR_TYPE]
#define unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_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 unsigned_wchar_type_node c_global_trees[CTI_UNSIGNED_WCHAR_TYPE]
+/* The variant of the C language being processed. */
+
+c_language_kind c_language = clk_c;
+
/* Nonzero means `$' can be in an identifier. */
#ifndef DOLLARS_IN_IDENTIFIERS
/* Nonzero means `$' can be in an identifier. */
#ifndef DOLLARS_IN_IDENTIFIERS
used in a context which makes it a reference to a variable. */
tree lastiddecl;
used in a context which makes it a reference to a variable. */
tree lastiddecl;
-/* Nonzero enables objc features. */
-
-int doing_objc_thang;
-
extern int yydebug;
/* File used for outputting assembler code. */
extern int yydebug;
/* File used for outputting assembler code. */
/* 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 */
extern void finish_incomplete_decl PARAMS ((tree));
/* In c-decl.c */
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>
* lex.c (lang_init_options): Tweak.
2000-06-06 Gabriel Dos Reis <gdr@codesourcery.com>
* lex.c (lang_init_options): Tweak.
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.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
/* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
{
const char *p = argv[0];
if (!strcmp (p, "-lang-objc"))
{
const char *p = argv[0];
if (!strcmp (p, "-lang-objc"))
+ c_language = clk_objective_c;
else if (!strcmp (p, "-gen-decls"))
flag_gen_declaration = 1;
else if (!strcmp (p, "-Wselector"))
else if (!strcmp (p, "-gen-decls"))
flag_gen_declaration = 1;
else if (!strcmp (p, "-Wselector"))