diff options
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f01c15bbe9e..8d58e8f5048 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11406,6 +11406,53 @@ modified_type_die (tree type, int cv_quals, bool reverse, first_quals |= dwarf_qual_info[i].q; } } + 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, + false, + 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, + false, + 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, + false, + context_die); + } else if (code == POINTER_TYPE || code == REFERENCE_TYPE) { dwarf_tag tag = DW_TAG_pointer_type; @@ -18422,6 +18469,12 @@ add_subscript_info (dw_die_ref type_die, tree type, bool collapse_p) 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. */ @@ -21809,6 +21862,10 @@ gen_compile_unit_die (const char *filename) 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) |