diff mbox

Plugify lex.c

Message ID D521B283-9A05-472B-9671-991FC502B073@comcast.net
State New
Headers show

Commit Message

Mike Stump Feb. 13, 2011, 10:05 a.m. UTC
objcp:
	* plugin/lex.h: Plugify.
cp:
	* lex.c: Plugify.
	* Make-lang.in (objcp/plugin/lex.h): Likewise.
objcp:
	* plugin/lex.h: Plugify.
cp:
	* lex.c: Plugify.
	* Make-lang.in (objcp/plugin/lex.h): Likewise.
diff mbox

Patch

Index: objcp/plugin/parser.h
===================================================================
--- objcp/plugin/parser.h	(revision 170101)
+++ objcp/plugin/parser.h	(working copy)
@@ -21,7 +21,7 @@ 
 
 /* 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"
 
Index: objcp/plugin/parser.c
===================================================================
--- objcp/plugin/parser.c	(revision 170101)
+++ objcp/plugin/parser.c	(working copy)
@@ -19,7 +19,7 @@ 
 <http://www.gnu.org/licenses/>.  */
 
 
-#ifdef HIDE_OBJC
+#ifndef HIDE_OBJC
 
 /* Objective-C++ Productions */
 
Index: objcp/plugin/lex.h
===================================================================
--- objcp/plugin/lex.h	(revision 0)
+++ objcp/plugin/lex.h	(revision 0)
@@ -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
+<http://www.gnu.org/licenses/>.  */
+
+
+#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
Index: cp/Make-lang.in
===================================================================
--- cp/Make-lang.in	(revision 170102)
+++ cp/Make-lang.in	(working copy)
@@ -247,8 +247,7 @@ 
 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/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 @@ 
 	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 < $< > $@
Index: cp/lex.c
===================================================================
--- cp/lex.c	(revision 170100)
+++ cp/lex.c	(working copy)
@@ -33,7 +33,7 @@ 
 #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 @@ 
     }
   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);