]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/objcp/objcp-decl.c
Update copyright years in gcc/
[gcc.git] / gcc / objcp / objcp-decl.c
index 8197dbe16c13912e52e6ab9ae94dba9845176c3d..ef293493164e82edc1ec404ef62a164616d51e07 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
@@ -24,27 +24,18 @@ along with GCC; see the file COPYING3.  If not see
 #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
@@ -58,11 +49,12 @@ objcp_start_struct (enum tree_code code ATTRIBUTE_UNUSED, tree name)
   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;
 
@@ -73,6 +65,13 @@ objcp_finish_struct (tree t, tree fieldlist, tree attributes)
     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;
@@ -95,7 +94,7 @@ objcp_xref_tag (enum tree_code code ATTRIBUTE_UNUSED, tree name)
 int
 objcp_comptypes (tree type1, tree type2)
 {     
-  return cp_comptypes (type1, type2, COMPARE_STRICT);
+  return comptypes (type1, type2, COMPARE_STRICT);
 }
 
 tree
This page took 0.030516 seconds and 5 git commands to generate.