===================================================================
@@ -10899,6 +10899,50 @@ modified_type_die (tree type, int cv_qua
mod_type_die = d;
}
}
+ else if (use_upc_dwarf2_extensions
+ && (cv_quals & TYPE_QUAL_SHARED))
+ {
+ HOST_WIDE_INT block_factor = 1;
+
+ /* Inside the compiler,
+ "shared int x;" TYPE_BLOCK_FACTOR is null.
+ "shared [] int *p;" TYPE_BLOCK_FACTOR is zero.
+ "shared [10] int x[50];" TYPE_BLOCK_FACTOR is 10 * bitsize(int)
+ The DWARF2 encoding is as follows:
+ "shared int x;" DW_AT_count: 1
+ "shared [] int *p;" <no DW_AT_count attribute>
+ "shared [10] int x[50];" DW_AT_count: 10
+ The logic below handles thse various contingencies. */
+
+ mod_type_die = new_die (DW_TAG_upc_shared_type,
+ comp_unit_die (), type);
+
+ if (TYPE_HAS_BLOCK_FACTOR (type))
+ block_factor = TREE_INT_CST_LOW (TYPE_BLOCK_FACTOR (type));
+
+ if (block_factor != 0)
+ add_AT_unsigned (mod_type_die, DW_AT_count, block_factor);
+
+ sub_die = modified_type_die (type,
+ cv_quals & ~TYPE_QUAL_SHARED,
+ context_die);
+ }
+ else if (use_upc_dwarf2_extensions && cv_quals & TYPE_QUAL_STRICT)
+ {
+ mod_type_die = new_die (DW_TAG_upc_strict_type,
+ comp_unit_die (), type);
+ sub_die = modified_type_die (type,
+ cv_quals & ~TYPE_QUAL_STRICT,
+ context_die);
+ }
+ else if (use_upc_dwarf2_extensions && cv_quals & TYPE_QUAL_RELAXED)
+ {
+ mod_type_die = new_die (DW_TAG_upc_relaxed_type,
+ comp_unit_die (), type);
+ sub_die = modified_type_die (type,
+ cv_quals & ~TYPE_QUAL_RELAXED,
+ context_die);
+ }
else if (code == POINTER_TYPE || code == REFERENCE_TYPE)
{
dwarf_tag tag = DW_TAG_pointer_type;
@@ -16992,6 +17036,12 @@ add_subscript_info (dw_die_ref type_die,
if (!subrange_die)
subrange_die = new_die (DW_TAG_subrange_type, type_die, NULL);
+
+ if (use_upc_dwarf2_extensions && TYPE_HAS_THREADS_FACTOR (type))
+ {
+ add_AT_flag (subrange_die, DW_AT_upc_threads_scaled, 1);
+ }
+
if (domain)
{
/* We have an array type with specified bounds. */
@@ -20279,6 +20329,10 @@ gen_compile_unit_die (const char *filena
if (dwarf_version >= 5 /* || !dwarf_strict */)
if (strcmp (language_string, "GNU C11") == 0)
language = DW_LANG_C11;
+
+ if (use_upc_dwarf2_extensions && flag_upc)
+ language = DW_LANG_Upc;
+
}
}
else if (strncmp (language_string, "GNU C++", 7) == 0)