/* Definitions for c-common.c.
Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998,
- 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
*/
/* Reserved identifiers. This is the union of all the keywords for C,
- C++, and Objective C. All the type modifiers have to be in one
+ C++, and Objective-C. All the type modifiers have to be in one
block at the beginning, because they are used as mask bits. There
are 27 type modifiers; if we add many more we will have to redesign
the mask mechanism. */
/* casts */
RID_CONSTCAST, RID_DYNCAST, RID_REINTCAST, RID_STATCAST,
- /* Objective C */
+ /* Objective-C */
RID_ID, RID_AT_ENCODE, RID_AT_END,
RID_AT_CLASS, RID_AT_ALIAS, RID_AT_DEFS,
RID_AT_PRIVATE, RID_AT_PROTECTED, RID_AT_PUBLIC,
/* The elements of `ridpointers' are identifier nodes for the reserved
type names and storage classes. It is indexed by a RID_... value. */
-extern tree *ridpointers;
+extern GTY ((length ("(int)RID_MAX"))) tree *ridpointers;
/* Standard named or nameless data types of the C compiler. */
CTI_SIGNED_WCHAR_TYPE,
CTI_UNSIGNED_WCHAR_TYPE,
CTI_WINT_TYPE,
- CTI_C_SIZE_TYPE, /* The type used for the size_t typedef and the
- result type of sizeof (an ordinary type without
- TYPE_IS_SIZETYPE set, unlike the internal
- sizetype). */
CTI_SIGNED_SIZE_TYPE, /* For format checking only. */
CTI_UNSIGNED_PTRDIFF_TYPE, /* For format checking only. */
CTI_INTMAX_TYPE,
struct c_common_identifier GTY(())
{
struct tree_common common;
- struct cpp_hashnode GTY ((skip (""))) node;
+ struct cpp_hashnode node;
};
#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 wint_type_node c_global_trees[CTI_WINT_TYPE]
-#define c_size_type_node c_global_trees[CTI_C_SIZE_TYPE]
#define signed_size_type_node c_global_trees[CTI_SIGNED_SIZE_TYPE]
#define unsigned_ptrdiff_type_node c_global_trees[CTI_UNSIGNED_PTRDIFF_TYPE]
#define intmax_type_node c_global_trees[CTI_INTMAX_TYPE]
tree x_last_expr_type;
/* The last filename we recorded. */
const char *x_last_expr_filename;
- /* In C++, Non-zero if we should treat statements as full
+ /* In C++, Nonzero if we should treat statements as full
expressions. In particular, this variable is no-zero if at the
end of a statement we should destroy any temporaries created
during that statement. Similarly, if, at the end of a block, we
should destroy any local variables in this block. Normally, this
- variable is non-zero, since those are the normal semantics of
+ variable is nonzero, since those are the normal semantics of
C++.
However, in order to represent aggregate initialization code as
void *));
extern void prep_stmt PARAMS ((tree));
extern void expand_stmt PARAMS ((tree));
-extern void shadow_warning PARAMS ((const char *,
- tree, tree));
extern tree c_begin_if_stmt PARAMS ((void));
extern tree c_begin_while_stmt PARAMS ((void));
extern void c_finish_while_stmt_cond PARAMS ((tree, tree));
+enum sw_kind { SW_PARAM = 0, SW_LOCAL, SW_GLOBAL };
+extern void shadow_warning PARAMS ((enum sw_kind, int,
+ const char *, tree));
/* Extra information associated with a DECL. Other C dialects extend
this structure in various ways. The C front-end only uses this
extern c_language_kind c_language;
+/* Nonzero if we can read a PCH file now. */
+
+extern int allow_pch;
+\f
/* Switches common to the C front ends. */
/* Nonzero if prepreprocessing only. */
+
extern int flag_preprocess_only;
+/* Nonzero means don't output line number information. */
+
+extern char flag_no_line_commands;
+
+/* Nonzero causes -E output not to be done, but directives such as
+ #define that have side effects are still obeyed. */
+
+extern char flag_no_output;
+
+/* Nonzero means dump macros in some fashion; contains the 'D', 'M' or
+ 'N' of the command line switch. */
+
+extern char flag_dump_macros;
+
+/* Nonzero means pass #include lines through to the output. */
+
+extern char flag_dump_includes;
+
+/* The file name to which we should write a precompiled header, or
+ NULL if no header will be written in this compile. */
+
+extern const char *pch_file;
+
/* Nonzero if an ISO standard was selected. It rejects macros in the
user's namespace. */
+
extern int flag_iso;
/* Nonzero whenever Objective-C functionality is being used. */
/* Nonzero if -undef was given. It suppresses target built-in macros
and assertions. */
+
extern int flag_undef;
/* Nonzero means don't recognize the non-ANSI builtin functions. */
extern int warn_redundant_decls;
-/* Warn about testing equality of floating point numbers. */
+/* Warn about testing equality of floating point numbers. */
extern int warn_float_equal;
extern int warn_conversion;
-/* Warn about #pragma directives that are not recognised. */
+/* Warn about #pragma directives that are not recognized. */
extern int warn_unknown_pragmas; /* Tri state variable. */
extern const char *constant_string_class_name;
/* Warn if multiple methods are seen for the same selector, but with
- different argument types. */
+ different argument types. Performs the check on the whole selector
+ table at the end of compilation. */
extern int warn_selector;
+/* Warn if a @selector() is found, and no method with that selector
+ has been previously declared. The check is done on each
+ @selector() as soon as it is found - so it warns about forward
+ declarations. */
+
+extern int warn_undeclared_selector;
+
/* Warn if methods required by a protocol are not implemented in the
class adopting it. When turned off, methods inherited to that
class are also considered implemented. */
extern int flag_enforce_eh_specs;
+/* The version of the C++ ABI in use. The following values are
+ allowed:
+
+ 0: The version of the ABI believed most conformant with the
+ C++ ABI specification. This ABI may change as bugs are
+ discovered and fixed. Therefore, 0 will not necessarily
+ indicate the same ABI in different versions of G++.
+
+ 1: The version of the ABI first used in G++ 3.2.
+
+ Additional positive integers will be assigned as new versions of
+ the ABI become the default version of the ABI. */
+
+extern int flag_abi_version;
+
+/* Nonzero means warn about things that will change when compiling
+ with an ABI-compliant compiler. */
+
+extern int warn_abi;
+
/* Nonzero means warn about implicit declarations. */
extern int warn_implicit;
extern int warn_ctor_dtor_privacy;
-/* Non-zero means warn in function declared in derived class has the
+/* Nonzero means warn in function declared in derived class has the
same name as a virtual in the base class, but fails to match the
type signature of any virtual function in the base class. */
extern int warn_overloaded_virtual;
-/* Non-zero means warn when declaring a class that has a non virtual
+/* Nonzero means warn when declaring a class that has a non virtual
destructor, when it really ought to have a virtual one. */
extern int warn_nonvdtor;
-/* Non-zero means warn when the compiler will reorder code. */
+/* Nonzero means warn when the compiler will reorder code. */
extern int warn_reorder;
-/* Non-zero means warn when synthesis behavior differs from Cfront's. */
+/* Nonzero means warn when synthesis behavior differs from Cfront's. */
extern int warn_synth;
-/* Non-zero means warn when we convert a pointer to member function
+/* Nonzero means warn when we convert a pointer to member function
into a pointer to (void or function). */
extern int warn_pmf2ptr;
extern int max_tinst_depth;
+/* Nonzero means the expression being parsed will never be evaluated.
+ This is a count, since unevaluated expressions can nest. */
+
+extern int skip_evaluation;
+
/* C types are partitioned into three subsets: object, function, and
incomplete types. */
#define C_TYPE_OBJECT_P(type) \
extern tree build_va_arg PARAMS ((tree, tree));
extern void c_common_init_options PARAMS ((enum c_language_kind));
-extern bool c_common_post_options PARAMS ((void));
-extern const char *c_common_init PARAMS ((const char *));
+extern bool c_common_post_options PARAMS ((const char **));
+extern bool c_common_init PARAMS ((void));
extern void c_common_finish PARAMS ((void));
extern void c_common_parse_file PARAMS ((int));
extern HOST_WIDE_INT c_common_get_alias_set PARAMS ((tree));
/* RETURN_STMT accessors. These give the expression associated with a
return statement, and whether it should be ignored when expanding
(as opposed to inlining). */
-#define RETURN_EXPR(NODE) TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
+#define RETURN_STMT_EXPR(NODE) TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
/* EXPR_STMT accessor. This gives the expression associated with an
expression statement. */
/* GOTO_STMT accessor. This gives access to the label associated with
a goto statement. */
#define GOTO_DESTINATION(NODE) TREE_OPERAND (GOTO_STMT_CHECK (NODE), 0)
-/* True for goto created artifically by the compiler. */
+/* True for goto created artificially by the compiler. */
#define GOTO_FAKE_P(NODE) (TREE_LANG_FLAG_0 (GOTO_STMT_CHECK (NODE)))
/* COMPOUND_STMT accessor. This gives access to the TREE_LIST of
#define STMT_LINENO(NODE) \
(TREE_COMPLEXITY ((NODE)))
-/* If non-zero, the STMT_LINENO for NODE is the line at which the
+/* If nonzero, the STMT_LINENO for NODE is the line at which the
function ended. */
#define STMT_LINENO_FOR_FN_P(NODE) \
(TREE_LANG_FLAG_2 ((NODE)))
extern int c_common_unsafe_for_reeval PARAMS ((tree));
-extern const char *init_c_lex PARAMS ((const char *));
+extern void init_c_lex PARAMS ((void));
+
+extern void c_cpp_builtins PARAMS ((cpp_reader *));
-extern void cb_register_builtins PARAMS ((cpp_reader *));
+/* Positive if an implicit `extern "C"' scope has just been entered;
+ negative if such a scope has just been exited. */
+extern int pending_lang_change;
/* Information recorded about each file examined during compilation. */
struct c_fileinfo *get_fileinfo PARAMS ((const char *));
extern void dump_time_statistics PARAMS ((void));
-extern int c_dump_tree PARAMS ((void *, tree));
+extern bool c_dump_tree PARAMS ((void *, tree));
+
+extern void pch_init PARAMS ((void));
+extern int c_common_valid_pch PARAMS ((cpp_reader *pfile,
+ const char *name,
+ int fd));
+extern void c_common_read_pch PARAMS ((cpp_reader *pfile,
+ const char *name,
+ int fd,
+ const char *orig));
+extern void c_common_write_pch PARAMS ((void));
+extern void builtin_define_with_value PARAMS ((const char *,
+ const char *, int));
+extern void c_stddef_cpp_builtins PARAMS ((void));
+extern void fe_file_change PARAMS ((const struct line_map *));
+
+/* In c-ppoutput.c */
+extern void init_pp_output PARAMS ((FILE *));
+extern void preprocess_file PARAMS ((cpp_reader *));
+extern void pp_file_change PARAMS ((const struct line_map *));
#endif /* ! GCC_C_COMMON_H */