From e5a002e3537c91307b395d94b9292ce735d5d1c1 Mon Sep 17 00:00:00 2001 From: Ziemowit Laski Date: Sat, 28 Aug 2004 20:58:56 +0000 Subject: [PATCH] c-common.h: Update comments about ObjC/ObjC++ entry points. [gcc/ChangeLog] 2004-08-28 Ziemowit Laski * 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. [gcc/cp/ChangeLog] 2004-08-28 Ziemowit Laski * 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. [gcc/objc/ChangeLog] 2004-08-28 Ziemowit Laski * objc-act.c (objc_is_reserved_word): New function. From-SVN: r86702 --- gcc/ChangeLog | 13 +++++++++++++ gcc/c-common.h | 15 ++++++++++----- gcc/c-lex.c | 3 +-- gcc/c-tree.h | 2 -- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/Make-lang.in | 16 +++++++++------- gcc/objc/ChangeLog | 4 ++++ gcc/objc/objc-act.c | 17 +++++++++++++++++ gcc/stub-objc.c | 8 +++++++- 9 files changed, 68 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6eb15ca7570..f949d31e392 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2004-08-28 Ziemowit Laski + + * 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 * system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR diff --git a/gcc/c-common.h b/gcc/c-common.h index b2da85d8188..86706e6e817 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 720519f52d5..4b875618420 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 f9f06eb517c..851b3a4beb9 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 efa79bb6c1a..6b4bb4739f1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2004-08-28 Ziemowit Laski + + * 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 * decl.c (expand_static_init): Avoid bogus warnings. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index fcea2b8606a..1d1017776a6 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 d9f42f9df90..dc97ef5b5b8 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,7 @@ +2004-08-28 Ziemowit Laski + + * objc-act.c (objc_is_reserved_word): New function. + 2004-08-15 Ziemowit Laski * 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 bc5da033e25..afc22d39c45 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 fc1afe0eff6..abe593da37a 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. @@ -56,6 +56,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)) -- 2.30.2