/* Process the ObjC-specific declarations and variables for
the Objective-C++ compiler.
- Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "rtl.h"
-#include "expr.h"
#include "cp-tree.h"
-#include "c-common.h"
-#include "flags.h"
-#include "input.h"
-#include "except.h"
-#include "output.h"
-#include "toplev.h"
-#include "cpplib.h"
-#include "debug.h"
-#include "target.h"
-#include "varray.h"
+#include "hashtab.h"
+#include "c-family/c-objc.h"
#include "objc-act.h"
#include "objcp-decl.h"
/* Hacks to simulate start_struct() and finish_struct(). */
tree
-objcp_start_struct (enum tree_code code ATTRIBUTE_UNUSED, tree name)
+objcp_start_struct (location_t loc ATTRIBUTE_UNUSED,
+ enum tree_code code ATTRIBUTE_UNUSED, tree name)
{
tree s;
/* The idea here is to mimic the actions that the C++ parser takes when
CLASSTYPE_DECLARED_CLASS (s) = 0; /* this is a 'struct', not a 'class'. */
xref_basetypes (s, NULL_TREE); /* no base classes here! */
- return begin_class_definition (s, NULL_TREE);
+ return begin_class_definition (s);
}
tree
-objcp_finish_struct (tree t, tree fieldlist, tree attributes)
+objcp_finish_struct (location_t loc ATTRIBUTE_UNUSED,
+ tree t, tree fieldlist, tree attributes)
{
tree field, next_field;
finish_member_declaration (field);
}
t = finish_struct (t, attributes);
+
+ /* If we are inside an @interface and are generating the list of
+ ivars, we need to check for duplicate ivars.
+ */
+ if (fieldlist)
+ objc_detect_field_duplicates (true);
+
pop_lang_context ();
return t;
int
objcp_comptypes (tree type1, tree type2)
{
- return cp_comptypes (type1, type2, COMPARE_STRICT);
+ return comptypes (type1, type2, COMPARE_STRICT);
}
tree