+2004-08-28 Ziemowit Laski <zlaski@apple.com>
+
+ * c-common.h: Update comments about ObjC/ObjC++ entry points.
+ (objc_is_reserved_word): New prototype.
+ (get_current_scope, objc_mark_locals_volatile): Move prototypes to
+ separate section; these are call-backs.
+ * c-lex.c (c_lex_with_flags): Call objc_is_reserved_word() to detect
+ ObjC/ObjC++ "@" keywords.
+ * c-tree.h (get_current_scope, objc_mark_locals_volatile): Remove
+ prototypes; they already live in c-common.h.
+ * stub-objc.c: Update copyright notice.
+ (objc_is_reserved_word): New stub.
+
2004-08-28 Nathan Sidwell <nathan@codesourcery.com>
* system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR
extern void fe_file_change (const struct line_map *);
extern void c_parse_error (const char *, enum cpp_ttype, tree);
-/* The following have been moved here from c-tree.h, since they're needed
- in the ObjC++ world, too. What is more, stub-objc.c could use a few
- prototypes. */
+/* Objective-C / Objective-C++ entry points. */
+
+/* The following ObjC/ObjC++ functions are called by the C and/or C++
+ front-ends; they all must have corresponding stubs in stub-objc.c. */
extern tree lookup_interface (tree);
extern tree is_class_name (tree);
extern tree objc_is_object_ptr (tree);
extern void objc_check_decl (tree);
+extern int objc_is_reserved_word (tree);
extern int objc_comptypes (tree, tree, int);
extern tree objc_message_selector (void);
extern tree lookup_objc_ivar (tree);
-extern void *get_current_scope (void);
-extern void objc_mark_locals_volatile (void *);
extern void objc_clear_super_receiver (void);
extern int objc_is_public (tree, tree);
+/* The following are provided by the C and C++ front-ends, and called by
+ ObjC/ObjC++. */
+extern void *get_current_scope (void);
+extern void objc_mark_locals_volatile (void *);
+
/* In c-ppoutput.c */
extern void init_pp_output (FILE *);
extern void preprocess_file (cpp_reader *);
{
case CPP_NAME:
val = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
- if (C_IS_RESERVED_WORD (val)
- && OBJC_IS_AT_KEYWORD (C_RID_CODE (val)))
+ if (objc_is_reserved_word (val))
{
*value = val;
return CPP_AT_NAME;
/* In c-decl.c */
extern void c_finish_incomplete_decl (tree);
-extern void *get_current_scope (void);
-extern void objc_mark_locals_volatile (void *);
extern void c_write_global_declarations (void);
/* In order for the format checking to accept the C frontend
+2004-08-28 Ziemowit Laski <zlaski@apple.com>
+
+ * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and
+ CXX_AND_OBJCXX_OBJS.
+ (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing
+ separately on the link line.
+
2004-08-28 Jason Merrill <jason@redhat.com>
* decl.c (expand_static_init): Avoid bogus warnings.
c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \
c-gimplify.o tree-inline.o
-# Language-specific object files.
-CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
+# Language-specific object files for C++ and Objective C++.
+CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o cp/rtti.o \
cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \
- cp/mangle.o cp/cp-lang.o cp/name-lookup.o cp/cxx-pretty-print.o \
- cp/cp-gimplify.o tree-mudflap.o
+ cp/mangle.o cp/name-lookup.o cp/cxx-pretty-print.o \
+ cp/cp-gimplify.o tree-mudflap.o $(CXX_C_OBJS)
+
+# Language-specific object files for C++.
+CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS)
# Use strict warnings for this front end.
cp-warn = $(STRICT_WARN) $(WERROR)
-cc1plus$(exeext): $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) \
- $(LIBDEPS)
+cc1plus$(exeext): $(CXX_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) $(LIBS)
+ $(CXX_OBJS) $(BACKEND) $(LIBS)
# Special build rules.
$(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
+2004-08-28 Ziemowit Laski <zlaski@apple.com>
+
+ * objc-act.c (objc_is_reserved_word): New function.
+
2004-08-15 Ziemowit Laski <zlaski@apple.com>
* Make-lang.in (objc/objc-lang.o): Depend on $(C_PRETTY_PRINT_H),
return 0;
}
+/* Return 1 if IDENT is an ObjC/ObjC++ reserved keyword in the context of
+ an '@'. */
+
+int
+objc_is_reserved_word (tree ident)
+{
+ unsigned char code = C_RID_CODE (ident);
+
+ return (OBJC_IS_AT_KEYWORD (code)
+#ifdef OBJCPLUS
+ || code == RID_CLASS || code == RID_PUBLIC
+ || code == RID_PROTECTED || code == RID_PRIVATE
+ || code == RID_TRY || code == RID_THROW || code == RID_CATCH
+#endif
+ );
+}
+
/* Return true if TYPE is 'id'. */
static bool
that are called from within the C and C++ front-ends,
respectively.
Copyright (C) 1991, 1995, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
{
}
+int
+objc_is_reserved_word (tree ARG_UNUSED (ident))
+{
+ return 0;
+}
+
int
objc_comptypes (tree ARG_UNUSED (lhs), tree ARG_UNUSED (rhs),
int ARG_UNUSED (reflexive))