diff mbox

[UPC,13/22] C++ changes

Message ID 20151201060240.GA31235@intrepid.com
State New
Headers show

Commit Message

Gary Funck Dec. 1, 2015, 6:02 a.m. UTC
Background
----------

An overview email, describing the UPC-related changes is here:
  https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00005.html

The GUPC branch is described here:
  http://gcc.gnu.org/projects/gupc.html

The UPC-related source code differences are summarized here:
  http://gccupc.org/gupc-changes

All languages (c, c++, fortran, go, lto, objc, obj-c++) have been
bootstrapped; no test suite regressions were introduced,
relative to the GCC trunk.

If you are on the cc-list, your name was chosen either
because you are listed as a maintainer for the area that
applies to the patches described in this email, or you
were a frequent contributor of patches made to files listed
in this email.

In the change log entries included in each patch, the directory
containing the affected files is listed, followed by the files.
When the patches are applied, the change log entries will be
distributed to the appropriate ChangeLog file.

Overview
--------

Although UPC is an extension to "C" and not "C++", these changes
are needed to accommodate changes to the common tree-related
code that handles qualified types, and to accommodate UPC's
"layout qualifier" (blocking factor).

In tree.h, check_qualified_type() was changed to accept an
extra argument, block_factor.

    /* Check whether CAND is suitable to be returned from get_qualified_type
       (BASE, TYPE_QUALS, BLOCK_FACTOR).  */

    extern bool check_qualified_type (const_tree cand, const_tree base,
				      int type_quals, tree block_factor);

and the c_build_qualified_type() procedure was renamed to
c_build_qualified_type_1().  c_build_qualified_type was changed
into a macro.

    /* Return a version of the TYPE, qualified as indicated by the
       TYPE_QUALS and BLOCK_FACTOR, if one exists.
       If no qualified version exists yet, return NULL_TREE.  */

    extern tree get_qualified_type_1 (tree type, int type_quals,
                                      tree block_factor);
    #define get_qualified_type(TYPE, QUALS) \
	      get_qualified_type_1 (TYPE, QUALS, 0)

This patch adjusts the C++ front-end so that it works with
the changes described above.

2015-11-30  Gary Funck  <gary@intrepid.com>

	gcc/cp/
	* lex.c (init_reswords): Disable UPC keywords.
	* tree.c (c_build_qualified_type_1): Rename.
	Was: c_build_qualified_type.  
	(cp_check_qualified_type): Adjust call to check_qualified_type
	to pass a null UPC blocking factor.

Comments

Jason Merrill Dec. 7, 2015, 9:48 p.m. UTC | #1
OK.

Jason
diff mbox

Patch

Index: gcc/cp/lex.c
===================================================================
--- gcc/cp/lex.c	(.../trunk)	(revision 231059)
+++ gcc/cp/lex.c	(.../branches/gupc)	(revision 231080)
@@ -179,6 +179,9 @@  init_reswords (void)
   /* The Objective-C keywords are all context-dependent.  */
   mask |= D_OBJC;
 
+  /* UPC constructs are not supported in C++.  */
+  mask |= D_UPC;
+
   ridpointers = ggc_cleared_vec_alloc<tree> ((int) RID_MAX);
   for (i = 0; i < num_c_common_reswords; i++)
     {
Index: gcc/cp/tree.c
===================================================================
--- gcc/cp/tree.c	(.../trunk)	(revision 231059)
+++ gcc/cp/tree.c	(.../branches/gupc)	(revision 231080)
@@ -995,7 +995,8 @@  move (tree expr)
    the C version of this function does not properly maintain canonical
    types (which are not used in C).  */
 tree
-c_build_qualified_type (tree type, int type_quals)
+c_build_qualified_type_1 (tree type, int type_quals,
+			  tree ARG_UNUSED (layout_qualifier))
 {
   return cp_build_qualified_type (type, type_quals);
 }
@@ -1867,7 +1868,7 @@  static bool
 cp_check_qualified_type (const_tree cand, const_tree base, int type_quals,
 			 cp_ref_qualifier rqual, tree raises)
 {
-  return (check_qualified_type (cand, base, type_quals)
+  return (check_qualified_type (cand, base, type_quals, NULL_TREE)
 	  && comp_except_specs (raises, TYPE_RAISES_EXCEPTIONS (cand),
 				ce_exact)
 	  && type_memfn_rqual (cand) == rqual);