From 8774a9171ed6eb03f8171c271e7deeace86a1093 Mon Sep 17 00:00:00 2001 From: mrs Date: Sun, 13 Feb 2011 10:02:30 +0000 Subject: [PATCH] objcp: * plugin/lex.h: Plugify. cp: * lex.c: Plugify. * Make-lang.in (objcp/plugin/lex.h): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170104 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++---- gcc/cp/Make-lang.in | 10 ++++++++-- gcc/cp/lex.c | 4 ++-- gcc/cp/parser.c | 1 + gcc/objcp/ChangeLog | 4 ++++ gcc/objcp/plugin/lex.h | 32 ++++++++++++++++++++++++++++++++ gcc/objcp/plugin/parser.c | 2 +- gcc/objcp/plugin/parser.h | 2 +- 8 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 gcc/objcp/plugin/lex.h diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d3c7cb7fafc..806c770b5d5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,9 +1,7 @@ -2011-02-13 Tobias Burnus - - * parser.c (cp_parser_declaration): Remove unused variable. - 2011-02-13 Mike Stump + * lex.c: Plugify. + * Make-lang.in (objcp/plugin/lex.h): Likewise. * Make-lang.in (cp/parser.o): Move c-family/c-objc.h dependancy down. diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index e3c157deefb..993c510ac31 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -247,8 +247,7 @@ CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \ CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H) cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \ - $(C_PRAGMA_H) output.h input.h cp/operators.def $(TM_P_H) \ - c-family/c-objc.h + $(C_PRAGMA_H) output.h input.h cp/operators.def $(TM_P_H) cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) debug.h langhooks.h \ $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h gt-cp-cp-lang.h \ cp/cp-objcp-common.h $(EXPR_H) $(TARGET_H) @@ -332,6 +331,8 @@ cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \ cp/parser.o: $(objdir)/objcp/plugin/parser.h $(srcdir)/objcp/plugin/parser.c \ c-family/c-objc.h +cp/lex.o: $(objdir)/objcp/plugin/lex.h c-family/c-objc.h + build/slashify:: $(srcdir)/config/slashify.c $(COMPILER_FOR_BUILD) $(srcdir)/config/slashify.c -o $@ @@ -339,3 +340,8 @@ $(objdir)/objcp/plugin/parser.h: $(srcdir)/objcp/plugin/parser.h | build/slashif test -d objcp || mkdir objcp test -d objcp/plugin || mkdir objcp/plugin build/slashify < $< > $@ + +$(objdir)/objcp/plugin/lex.h: $(srcdir)/objcp/plugin/lex.h | build/slashify + test -d objcp || mkdir objcp + test -d objcp/plugin || mkdir objcp/plugin + build/slashify < $< > $@ diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 852c3a2867a..c8c49f1011b 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "cpplib.h" #include "flags.h" #include "c-family/c-pragma.h" -#include "c-family/c-objc.h" +#include "objcp/plugin/lex.h" #include "output.h" #include "tm_p.h" #include "timevar.h" @@ -449,7 +449,7 @@ unqualified_name_lookup_error (tree name) } else { - if (!objc_diagnose_private_ivar (name)) + if (!PLUGIN_UNQUALIFIED_NAME_LOOKUP_ERROR (name)) { error ("%qD was not declared in this scope", name); suggest_alternatives_for (location_of (name), name); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 42a0a39a32d..ecdc66c9a86 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -9325,6 +9325,7 @@ cp_parser_declaration (cp_parser* parser) cp_token token2; int saved_pedantic; void *p; + tree attributes = NULL_TREE; /* Check for the `__extension__' keyword. */ if (cp_parser_extension_opt (parser, &saved_pedantic)) diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog index d3bae1c95dc..92f6b7d32e1 100644 --- a/gcc/objcp/ChangeLog +++ b/gcc/objcp/ChangeLog @@ -1,3 +1,7 @@ +2011-02-13 Mike Stump + + * plugin/lex.h: Plugify. + 2011-02-12 Mike Stump * Make-lang.in (obj-c++.tags): Plugify Objective-C++. diff --git a/gcc/objcp/plugin/lex.h b/gcc/objcp/plugin/lex.h new file mode 100644 index 00000000000..a13024a5b2d --- /dev/null +++ b/gcc/objcp/plugin/lex.h @@ -0,0 +1,32 @@ +/* Objective-C++ Parser plugin + Copyright (C) 2011 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + + +#ifndef HIDE_OBJC + +#include "c-family/c-objc.h" + +#define PLUGIN_UNQUALIFIED_NAME_LOOKUP_ERROR(name) @( + objc_diagnose_private_ivar (name)@) + +#else + +#define PLUGIN_UNQUALIFIED_NAME_LOOKUP_ERROR(name) 0 + +#endif diff --git a/gcc/objcp/plugin/parser.c b/gcc/objcp/plugin/parser.c index 964c69768de..a2481f1859c 100644 --- a/gcc/objcp/plugin/parser.c +++ b/gcc/objcp/plugin/parser.c @@ -19,7 +19,7 @@ along with GCC; see the file COPYING3. If not see . */ -#ifdef HIDE_OBJC +#ifndef HIDE_OBJC /* Objective-C++ Productions */ diff --git a/gcc/objcp/plugin/parser.h b/gcc/objcp/plugin/parser.h index e18142e0862..e41e30ba67a 100644 --- a/gcc/objcp/plugin/parser.h +++ b/gcc/objcp/plugin/parser.h @@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see /* This isn't defined anywhere, yet, but it could be. This will turn off the entire C++ Objective-C++ plugin. */ -#ifdef HIDE_OBJC +#ifndef HIDE_OBJC #include "c-family/c-objc.h" -- 2.11.0