summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.h')
-rw-r--r--gcc/c-common.h123
1 files changed, 82 insertions, 41 deletions
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 900b77c97e2..7b4912cb03b 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -19,6 +19,9 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef GCC_C_COMMON_H
+#define GCC_C_COMMON_H
+
/* Usage of TREE_LANG_FLAG_?:
0: COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
TREE_NEGATED_INT (in INTEGER_CST).
@@ -33,52 +36,72 @@ Boston, MA 02111-1307, USA. */
4: SCOPE_PARTIAL_P (in SCOPE_STMT)
*/
-/* Reserved identifiers. */
+/* 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
+ 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. */
enum rid
{
- RID_UNUSED,
- RID_INT,
- RID_CHAR,
- RID_FLOAT,
- RID_DOUBLE,
- RID_VOID,
- RID_UNUSED1,
-
- /* The first seven are in the order of most frequently used,
- as emiprically determined. */
- RID_FIRST_MODIFIER,
- RID_EXTERN = RID_FIRST_MODIFIER,
- RID_CONST,
- RID_LONG,
- RID_TYPEDEF,
- RID_UNSIGNED,
- RID_SHORT,
- RID_INLINE,
- RID_AUTO,
- RID_STATIC,
- RID_REGISTER,
- RID_SIGNED,
- RID_RESTRICT,
- RID_VOLATILE,
- RID_BOUNDED,
- RID_UNBOUNDED,
- RID_NOALIAS,
- RID_COMPLEX,
-
- RID_IN,
- RID_OUT,
- RID_INOUT,
- RID_BYCOPY,
- RID_BYREF,
- RID_ONEWAY,
- RID_ID,
-
- RID_MAX
+ /* Modifiers: */
+ /* C, in empirical order of frequency. */
+ RID_STATIC = 0,
+ RID_UNSIGNED, RID_LONG, RID_CONST, RID_EXTERN,
+ RID_REGISTER, RID_TYPEDEF, RID_SHORT, RID_INLINE,
+ RID_VOLATILE, RID_SIGNED, RID_AUTO, RID_RESTRICT,
+
+ /* C extensions */
+ RID_BOUNDED, RID_UNBOUNDED, RID_COMPLEX,
+
+ /* C++ */
+ RID_FRIEND, RID_VIRTUAL, RID_EXPLICIT, RID_EXPORT, RID_MUTABLE,
+
+ /* ObjC */
+ RID_IN, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF, RID_ONEWAY,
+
+ /* C */
+ RID_INT, RID_CHAR, RID_FLOAT, RID_DOUBLE, RID_VOID,
+ RID_ENUM, RID_STRUCT, RID_UNION, RID_IF, RID_ELSE,
+ RID_WHILE, RID_DO, RID_FOR, RID_SWITCH, RID_CASE,
+ RID_DEFAULT, RID_BREAK, RID_CONTINUE, RID_RETURN, RID_GOTO,
+ RID_SIZEOF,
+
+ /* C extensions */
+ RID_ASM, RID_TYPEOF, RID_ALIGNOF, RID_ATTRIBUTE, RID_VA_ARG,
+ RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL, RID_PTRBASE,
+ RID_PTREXTENT, RID_PTRVALUE,
+
+ /* C++ */
+ RID_BOOL, RID_WCHAR, RID_CLASS,
+ RID_PUBLIC, RID_PRIVATE, RID_PROTECTED,
+ RID_TEMPLATE, RID_NULL, RID_CATCH,
+ RID_DELETE, RID_FALSE, RID_NAMESPACE,
+ RID_NEW, RID_OPERATOR, RID_THIS,
+ RID_THROW, RID_TRUE, RID_TRY,
+ RID_TYPENAME, RID_TYPEID, RID_USING,
+
+ /* casts */
+ RID_CONSTCAST, RID_DYNCAST, RID_REINTCAST, RID_STATCAST,
+
+ /* alternate spellings */
+ RID_AND, RID_AND_EQ, RID_NOT, RID_NOT_EQ,
+ RID_OR, RID_OR_EQ, RID_XOR, RID_XOR_EQ,
+ RID_BITAND, RID_BITOR, RID_COMPL,
+
+ /* 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,
+ RID_AT_PROTOCOL, RID_AT_SELECTOR, RID_AT_INTERFACE,
+ RID_AT_IMPLEMENTATION,
+
+ RID_MAX,
+
+ RID_FIRST_MODIFIER = RID_STATIC,
+ RID_LAST_MODIFIER = RID_ONEWAY
};
-#define NORID RID_UNUSED
-
/* 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;
@@ -523,3 +546,21 @@ extern tree default_conversion PARAMS ((tree));
extern tree common_type PARAMS ((tree, tree));
extern tree expand_tree_builtin PARAMS ((tree, tree, tree));
+
+/* Hook currently used only by the C++ front end to reset internal state
+ after entering or leaving a header file. */
+extern void extract_interface_info PARAMS ((void));
+
+/* Information recorded about each file examined during compilation. */
+
+struct c_fileinfo
+{
+ int time; /* Time spent in the file. */
+ short interface_only; /* Flags - used only by C++ */
+ short interface_unknown;
+};
+
+struct c_fileinfo *get_fileinfo PARAMS ((const char *));
+extern void dump_time_statistics PARAMS ((void));
+
+#endif
OpenPOWER on IntegriCloud