Commit dd2e44f0 by Iain Sandoe Committed by Mike Stump

Revert r170108, r170107, r170105, r170104, r170103, r170102, r170101, r170097.

From-SVN: r170111
parent 975b975b
2011-02-13 Mike Stump <mikestump@comcast.net>
* config/t-darwin (build/slashify1): Harden against rebuilds.
(config/darwin.h.rebuild): Harden against parallel builds.
* config/slashify.c: Nix parms to quite the build.
2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
2011-02-12 Mike Stump <mikestump@comcast.net>
* config/t-darwin (build/slashify): Allow others to reuse easier.
2011-02-12 Mike Stump <mikestump@comcast.net>
* config/darwin.h: Make pretty.
* config/t-darwin (config/darwin.h.rebuild): Add.
(build/slashify): Add.
* config/slashify.c: Add.
2011-02-12 Joseph Myers <joseph@codesourcery.com>
PR driver/45731
......@@ -67,7 +50,7 @@
2011-02-12 Iain Sandoe <iains@gcc.gnu.org>
* config/darwin.c (darwin_override_options): Add a hunk missed
from the commit of r168571. Trim comment line lengths and
from the commit of r168571. Trim comment line lengths and
correct indents of the preceding block.
2011-02-12 Iain Sandoe <iains@gcc.gnu.org>
......
/* Generate a slashified version of the input
Copyright (C) 2011
Free Software Foundation, Inc.
Contributed by Mike Stump <mikestump@comcast.net>
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/>. */
/* This is a small utility to slashify a source file so that one never
needs to stare at backslashes. */
#include <stdio.h>
extern int main (void);
int main (void) {
int c,c1;
int saw_start = 0;
while ((c=getchar ()) != EOF) {
if (c != '@') {
if (saw_start && c == '\n') {
putchar ('\\');
}
putchar (c);
continue;
}
c1=getchar();
if (c1 == EOF) {
putchar (c);
return 0;
}
if (!saw_start && c1 == '(') {
saw_start = 1;
} else if (saw_start && c1 == ')') {
saw_start = 0;
} else {
putchar (c);
putchar (c1);
}
}
return 0;
}
......@@ -17,20 +17,6 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
build/slashify1: $(srcdir)/config/slashify.c
$(COMPILER_FOR_BUILD) $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) $(srcdir)/config/slashify.c -o $@
$(srcdir)/config/darwin.h: config/darwin.h.rebuild
config/darwin.h.rebuild: build/slashify1
@$(mkinstalldirs) config
@if [ ! -e $(srcdir)/config/darwin.h \
-o $(srcdir)/config/darwin.h -nt config/darwin.h ]; then \
cp $(srcdir)/config/darwin-sections.def \
config/darwin-sections.def && \
build/slashify1 < $(srcdir)/config/darwin.h >config/darwin.h; \
fi
darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(REAL_H) insn-config.h \
conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h \
......
2011-02-13 Mike Stump <mikestump@comcast.net>
* parser.c (cp_parser_primary_expression): Add arguments to all the plugins.
* lex.c: Plugify.
* Make-lang.in (objcp/plugin/lex.h): Likewise.
(build/slashify): Harden against rebuilds.
(objcp/plugin/parser.h): Harden against parallel builds.
* Make-lang.in (cp/parser.o): Move c-family/c-objc.h dependancy
down.
2011-02-12 Mike Stump <mikestump@comcast.net>
* Make-lang.in (build/slashify): Plugify Objective-C++.
(cp/parser.o): Likewise.
(objcp/plugin/parser.h): Likewise.
* parser.c (cp_parser_token_starts_cast_expression): Likewise.
2011-02-09 Jason Merrill <jason@redhat.com>
* decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.
......
......@@ -247,7 +247,8 @@ 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_PRAGMA_H) output.h input.h cp/operators.def $(TM_P_H) \
c-family/c-objc.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)
......@@ -314,7 +315,8 @@ cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) \
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) $(REAL_H) \
gt-cp-mangle.h $(TARGET_H) $(TM_P_H) $(CGRAPH_H)
cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_CORE_H) \
gt-cp-parser.h output.h $(TARGET_H) $(PLUGIN_H) intl.h
gt-cp-parser.h output.h $(TARGET_H) $(PLUGIN_H) intl.h \
c-family/c-objc.h
cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) $(C_COMMON_H) \
$(TM_H) coretypes.h pointer-set.h tree-iterator.h
......@@ -324,24 +326,3 @@ cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \
$(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H) tree-pretty-print.h
# Objective-C++ related rules:
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
# Would like to get rid of the #, but we always rebuild the checksum
# if we do
build/slashify: # $(srcdir)/config/slashify.c
$(COMPILER_FOR_BUILD) $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) $(srcdir)/config/slashify.c -o $@
$(objdir)/objcp/plugin/parser.h: $(srcdir)/objcp/plugin/parser.h build/slashify
$(mkinstalldirs) objcp/plugin
build/slashify < $< > $@
$(objdir)/objcp/plugin/lex.h: $(srcdir)/objcp/plugin/lex.h build/slashify
$(mkinstalldirs) objcp/plugin
build/slashify < $< > $@
......@@ -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 "objcp/plugin/lex.h"
#include "c-family/c-objc.h"
#include "output.h"
#include "tm_p.h"
#include "timevar.h"
......@@ -449,7 +449,7 @@ unqualified_name_lookup_error (tree name)
}
else
{
if (!PLUGIN_UNQUALIFIED_NAME_LOOKUP_ERROR (name))
if (!objc_diagnose_private_ivar (name))
{
error ("%qD was not declared in this scope", name);
suggest_alternatives_for (location_of (name), name);
......
2011-02-13 Mike Stump <mikestump@comcast.net>
* plugin/parser.h: Add arguments to all plugins.
* plugin/lex.h: Plugify.
2011-02-12 Mike Stump <mikestump@comcast.net>
* Make-lang.in (obj-c++.tags): Plugify Objective-C++.
* plugin/parser.h: Likewise.
* plugin/parser.c: Likewise.
2011-02-07 Mike Stump <mikestump@comcast.net>
* Make-lang.in (obj-c++.tags): Don't include *.y.
......
......@@ -110,7 +110,7 @@ obj-c++.man:
obj-c++.install-plugin:
obj-c++.tags: force
cd $(srcdir)/objcp; etags -o TAGS.sub *.c *.h plugin/*.h plugin/*.c; \
cd $(srcdir)/objcp; etags -o TAGS.sub *.c *.h; \
etags --include TAGS.sub --include ../TAGS.sub
lang_checks += check-obj-c++
......
/* 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
/* Objective-C++ Parser plugin
Copyright (C) 2000, 2001, 2002, 2003, 2004,
2005, 2007, 2008, 2009, 2010, 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/>. */
/* This isn't defined anywhere, yet, but it could be. This will turn off
the entire C++ Objective-C++ plugin. */
#ifndef HIDE_OBJC
#include "c-family/c-objc.h"
/* Objective-C++ Productions */
static tree cp_parser_objc_message_receiver
(cp_parser *);
static tree cp_parser_objc_message_args
(cp_parser *);
static tree cp_parser_objc_message_expression
(cp_parser *);
static tree cp_parser_objc_encode_expression
(cp_parser *);
static tree cp_parser_objc_defs_expression
(cp_parser *);
static tree cp_parser_objc_protocol_expression
(cp_parser *);
static tree cp_parser_objc_selector_expression
(cp_parser *);
static tree cp_parser_objc_expression
(cp_parser *);
static bool cp_parser_objc_selector_p
(enum cpp_ttype);
static tree cp_parser_objc_selector
(cp_parser *);
static tree cp_parser_objc_protocol_refs_opt
(cp_parser *);
static void cp_parser_objc_declaration
(cp_parser *, tree);
static tree cp_parser_objc_statement
(cp_parser *);
static bool cp_parser_objc_valid_prefix_attributes
(cp_parser *, tree *);
static void cp_parser_objc_at_property_declaration
(cp_parser *) ;
static void cp_parser_objc_at_synthesize_declaration
(cp_parser *) ;
static void cp_parser_objc_at_dynamic_declaration
(cp_parser *) ;
static tree cp_parser_objc_struct_declaration
(cp_parser *) ;
#define PLUGIN_PRIMARY_EXPRESSION_3(parser) @(
do {
if (c_dialect_objc ())
/* We have an Objective-C++ message. */
return cp_parser_objc_expression (parser);
} while (0)@)
#define PLUGIN_PRIMARY_EXPRESSION_2(parser, cp_parser_error) @(
case CPP_OBJC_STRING:
if (c_dialect_objc ())
/* We have an Objective-C++ string literal. */
return cp_parser_objc_expression (parser);
cp_parser_error (parser, "expected primary-expression");
return error_mark_node;@)
#define PLUGIN_PRIMARY_EXPRESSION_1(parser) @(
/* Objective-C++ expressions. */
case RID_AT_ENCODE:
case RID_AT_PROTOCOL:
case RID_AT_SELECTOR:
return cp_parser_objc_expression (parser);@)
#define PLUGIN_PRIMARY_EXPRESSION(parser, decl, cp_lexer_consume_token, cp_lexer_peek_token) @(
do {
/* In Objective-C++, we may have an Objective-C 2.0
dot-syntax for classes here. */
if (c_dialect_objc ()
&& cp_lexer_peek_token (parser->lexer)->type == CPP_DOT
&& TREE_CODE (decl) == TYPE_DECL
&& objc_is_class_name (decl))
{
tree component;
cp_lexer_consume_token (parser->lexer);
component = cp_parser_identifier (parser);
if (component == error_mark_node)
return error_mark_node;
return objc_build_class_component_ref (id_expression, component);
}
/* In Objective-C++, an instance variable (ivar) may be preferred
to whatever cp_parser_lookup_name() found. */
decl = objc_lookup_ivar (decl, id_expression);
} while (0)@)
#define PLUGIN_TOKEN_STARTS_CAST_EXPR @(
do {
/* '[' may start a primary-expression in obj-c++. */
return c_dialect_objc ();
} while (0)@)
#define PLUGIN_STATEMENT @(
/* Objective-C++ exception-handling constructs. */
case RID_AT_TRY:
case RID_AT_CATCH:
case RID_AT_FINALLY:
case RID_AT_SYNCHRONIZED:
case RID_AT_THROW:
statement = cp_parser_objc_statement (parser);
break;@)
#define PLUGIN_DECLARATION(token1, attributes) @(
/* Objective-C++ declaration/definition. */
else if (c_dialect_objc () && OBJC_IS_AT_KEYWORD (token1.keyword))
cp_parser_objc_declaration (parser, NULL_TREE);
else if (c_dialect_objc ()
&& token1.keyword == RID_ATTRIBUTE
&& cp_parser_objc_valid_prefix_attributes (parser, &attributes))
cp_parser_objc_declaration (parser, attributes);@)
#define PLUGIN_SIMPLE_TYPE_SPECIFIER(parser, type, decl_specs) @(
do {
/* See if TYPE is an Objective-C type, and if so, parse and
accept any protocol references following it. Do this before
the cp_parser_check_for_invalid_template_id() call, because
Objective-C types can be followed by '<...>' which would
enclose protocol names rather than template arguments, and so
everything is fine. */
if (c_dialect_objc () && !parser->scope
&& (objc_is_id (type) || objc_is_class_name (type)))
{
tree protos = cp_parser_objc_protocol_refs_opt (parser);
tree qual_type = objc_get_protocol_qualified_type (type, protos);
/* Clobber the "unqualified" type previously entered into
DECL_SPECS with the new, improved protocol-qualified version. */
if (decl_specs)
decl_specs->type = qual_type;
return qual_type;
}
} while (0)@)
#define PLUGIN_NONCLASS_NAME1(parser, type_decl, identifier) @(
do {
if (TREE_CODE (type_decl) != TYPE_DECL
&& (objc_is_id (identifier) || objc_is_class_name (identifier)))
{
/* See if this is an Objective-C type. */
tree protos = cp_parser_objc_protocol_refs_opt (parser);
tree type = objc_get_protocol_qualified_type (identifier, protos);
if (type)
type_decl = TYPE_NAME (type);
}
} while (0)@)
#define PLUGIN_NONCLASS_NAME(parser, type_decl, cp_lexer_peek_token) @(
/* In Objective-C, we have the complication that class names are
normally type names and start declarations (eg, the
"NSObject" in "NSObject *object;"), but can be used in an
Objective-C 2.0 dot-syntax (as in "NSObject.version") which
is an expression. So, a classname followed by a dot is not a
valid type-name. */
|| (objc_is_class_name (TREE_TYPE (type_decl))
&& cp_lexer_peek_token (parser->lexer)->type == CPP_DOT)@)
#define PLUGIN_CLASS_NAME(parser, cp_lexer_peek_token, CPP_DOT) @(
/* In Objective-C 2.0, a classname followed by '.' starts a
dot-syntax expression, and it's not a type-name. */
|| (c_dialect_objc ()
&& cp_lexer_peek_token (parser->lexer)->type == CPP_DOT
&& objc_is_class_name (decl))@)
#define PLUGIN_MEMBER_DECLARATION(parser, cp_lexer_next_token_is_keyword, finish_member_declaration) @(
do {
/* Check for @defs. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_AT_DEFS))
{
tree ivar, member;
tree ivar_chains = cp_parser_objc_defs_expression (parser);
ivar = ivar_chains;
while (ivar)
{
member = ivar;
ivar = TREE_CHAIN (member);
TREE_CHAIN (member) = NULL_TREE;
finish_member_declaration (member);
}
return;
}
} while (0)@)
#else
#define PLUGIN_PRIMARY_EXPRESSION_3(parser)
#define PLUGIN_PRIMARY_EXPRESSION_2(parser, cp_parser_error)
#define PLUGIN_PRIMARY_EXPRESSION_1(parser)
#define PLUGIN_PRIMARY_EXPRESSION(parser, decl, cp_lexer_consume_token, cp_lexer_peek_token)
#define PLUGIN_TOKEN_STARTS_CAST_EXPR
#define PLUGIN_STATEMENT
#define PLUGIN_DECLARATION(token1, attributes)
#define PLUGIN_SIMPLE_TYPE_SPECIFIER(parser, type, decl_specs)
#define PLUGIN_NONCLASS_NAME1(parser, type_decl, identifier)
#define PLUGIN_NONCLASS_NAME(parser, type_decl, cp_lexer_peek_token)
#define PLUGIN_CLASS_NAME(parser, cp_lexer_peek_token, CPP_DOT)
#define PLUGIN_MEMBER_DECLARATION(parser, cp_lexer_next_token_is_keyword, finish_member_declaration)
#endif
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