diff options
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/c-common.h | 15 | ||||
-rw-r--r-- | gcc/c-lex.c | 3 | ||||
-rw-r--r-- | gcc/c-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/Make-lang.in | 16 | ||||
-rw-r--r-- | gcc/objc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 17 | ||||
-rw-r--r-- | gcc/stub-objc.c | 8 |
9 files changed, 68 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eb15ca..f949d31 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +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 diff --git a/gcc/c-common.h b/gcc/c-common.h index b2da85d..86706e6 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -896,21 +896,26 @@ extern void c_stddef_cpp_builtins (void); 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 *); diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 720519f..4b87561 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -389,8 +389,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) { 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; diff --git a/gcc/c-tree.h b/gcc/c-tree.h index f9f06eb..851b3a4 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -307,8 +307,6 @@ extern bool c_eh_initialized_p; /* 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 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index efa79bb..6b4bb47 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index fcea2b8..1d10177 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -76,21 +76,23 @@ CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \ 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 diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index d9f42f9..dc97ef5 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,7 @@ +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), diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index bc5da03..afc22d3 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -608,6 +608,23 @@ lookup_protocol_in_reflist (tree rproto_list, tree lproto) 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 diff --git a/gcc/stub-objc.c b/gcc/stub-objc.c index fc1afe0..abe593d 100644 --- a/gcc/stub-objc.c +++ b/gcc/stub-objc.c @@ -2,7 +2,7 @@ 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. @@ -57,6 +57,12 @@ objc_check_decl (tree ARG_UNUSED (decl)) } 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)) { |