Commit e5a002e3 by Ziemowit Laski Committed by Ziemowit Laski

c-common.h: Update comments about ObjC/ObjC++ entry points.

[gcc/ChangeLog]
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.

[gcc/cp/ChangeLog]
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.

[gcc/objc/ChangeLog]
2004-08-28  Ziemowit Laski  <zlaski@apple.com>

	* objc-act.c (objc_is_reserved_word): New function.

From-SVN: r86702
parent 7984a2f0
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> 2004-08-28 Nathan Sidwell <nathan@codesourcery.com>
* system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR * system.h (gcc_assert): Remove __builtin_expect. Evaluate EXPR
......
...@@ -896,21 +896,26 @@ extern void c_stddef_cpp_builtins (void); ...@@ -896,21 +896,26 @@ extern void c_stddef_cpp_builtins (void);
extern void fe_file_change (const struct line_map *); extern void fe_file_change (const struct line_map *);
extern void c_parse_error (const char *, enum cpp_ttype, tree); 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 /* Objective-C / Objective-C++ entry points. */
in the ObjC++ world, too. What is more, stub-objc.c could use a few
prototypes. */ /* 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 lookup_interface (tree);
extern tree is_class_name (tree); extern tree is_class_name (tree);
extern tree objc_is_object_ptr (tree); extern tree objc_is_object_ptr (tree);
extern void objc_check_decl (tree); extern void objc_check_decl (tree);
extern int objc_is_reserved_word (tree);
extern int objc_comptypes (tree, tree, int); extern int objc_comptypes (tree, tree, int);
extern tree objc_message_selector (void); extern tree objc_message_selector (void);
extern tree lookup_objc_ivar (tree); 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 void objc_clear_super_receiver (void);
extern int objc_is_public (tree, tree); 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 */ /* In c-ppoutput.c */
extern void init_pp_output (FILE *); extern void init_pp_output (FILE *);
extern void preprocess_file (cpp_reader *); extern void preprocess_file (cpp_reader *);
......
...@@ -389,8 +389,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags) ...@@ -389,8 +389,7 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
{ {
case CPP_NAME: case CPP_NAME:
val = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node)); val = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
if (C_IS_RESERVED_WORD (val) if (objc_is_reserved_word (val))
&& OBJC_IS_AT_KEYWORD (C_RID_CODE (val)))
{ {
*value = val; *value = val;
return CPP_AT_NAME; return CPP_AT_NAME;
......
...@@ -307,8 +307,6 @@ extern bool c_eh_initialized_p; ...@@ -307,8 +307,6 @@ extern bool c_eh_initialized_p;
/* In c-decl.c */ /* In c-decl.c */
extern void c_finish_incomplete_decl (tree); 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); extern void c_write_global_declarations (void);
/* In order for the format checking to accept the C frontend /* 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> 2004-08-28 Jason Merrill <jason@redhat.com>
* decl.c (expand_static_init): Avoid bogus warnings. * decl.c (expand_static_init): Avoid bogus warnings.
......
...@@ -76,21 +76,23 @@ CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \ ...@@ -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-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \
c-gimplify.o tree-inline.o c-gimplify.o tree-inline.o
# Language-specific object files. # Language-specific object files for C++ and Objective C++.
CXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \ 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/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/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/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/mangle.o cp/name-lookup.o cp/cxx-pretty-print.o \
cp/cp-gimplify.o tree-mudflap.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. # Use strict warnings for this front end.
cp-warn = $(STRICT_WARN) $(WERROR) cp-warn = $(STRICT_WARN) $(WERROR)
cc1plus$(exeext): $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) \ cc1plus$(exeext): $(CXX_OBJS) $(BACKEND) $(LIBDEPS)
$(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
$(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) $(LIBS) $(CXX_OBJS) $(BACKEND) $(LIBS)
# Special build rules. # Special build rules.
$(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf $(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> 2004-08-15 Ziemowit Laski <zlaski@apple.com>
* Make-lang.in (objc/objc-lang.o): Depend on $(C_PRETTY_PRINT_H), * Make-lang.in (objc/objc-lang.o): Depend on $(C_PRETTY_PRINT_H),
......
...@@ -608,6 +608,23 @@ lookup_protocol_in_reflist (tree rproto_list, tree lproto) ...@@ -608,6 +608,23 @@ lookup_protocol_in_reflist (tree rproto_list, tree lproto)
return 0; 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'. */ /* Return true if TYPE is 'id'. */
static bool static bool
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
that are called from within the C and C++ front-ends, that are called from within the C and C++ front-ends,
respectively. respectively.
Copyright (C) 1991, 1995, 1997, 1998, 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. This file is part of GCC.
...@@ -57,6 +57,12 @@ objc_check_decl (tree ARG_UNUSED (decl)) ...@@ -57,6 +57,12 @@ objc_check_decl (tree ARG_UNUSED (decl))
} }
int int
objc_is_reserved_word (tree ARG_UNUSED (ident))
{
return 0;
}
int
objc_comptypes (tree ARG_UNUSED (lhs), tree ARG_UNUSED (rhs), objc_comptypes (tree ARG_UNUSED (lhs), tree ARG_UNUSED (rhs),
int ARG_UNUSED (reflexive)) int ARG_UNUSED (reflexive))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment