diff options
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 7a29aae..b16883f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -10391,6 +10391,7 @@ is_base_type (tree type) case FIXED_POINT_TYPE: case COMPLEX_TYPE: case BOOLEAN_TYPE: + case POINTER_BOUNDS_TYPE: return 1; case ARRAY_TYPE: @@ -17813,18 +17814,21 @@ gen_formal_types_die (tree function_or_method_type, dw_die_ref context_die) break; /* Output a (nameless) DIE to represent the formal parameter itself. */ - parm_die = gen_formal_parameter_die (formal_type, NULL, - true /* Emit name attribute. */, - context_die); - if (TREE_CODE (function_or_method_type) == METHOD_TYPE - && link == first_parm_type) + if (!POINTER_BOUNDS_TYPE_P (formal_type)) { - add_AT_flag (parm_die, DW_AT_artificial, 1); - if (dwarf_version >= 3 || !dwarf_strict) - add_AT_die_ref (context_die, DW_AT_object_pointer, parm_die); + parm_die = gen_formal_parameter_die (formal_type, NULL, + true /* Emit name attribute. */, + context_die); + if (TREE_CODE (function_or_method_type) == METHOD_TYPE + && link == first_parm_type) + { + add_AT_flag (parm_die, DW_AT_artificial, 1); + if (dwarf_version >= 3 || !dwarf_strict) + add_AT_die_ref (context_die, DW_AT_object_pointer, parm_die); + } + else if (arg && DECL_ARTIFICIAL (arg)) + add_AT_flag (parm_die, DW_AT_artificial, 1); } - else if (arg && DECL_ARTIFICIAL (arg)) - add_AT_flag (parm_die, DW_AT_artificial, 1); link = TREE_CHAIN (link); if (arg) @@ -18598,7 +18602,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) gen_formal_parameter_pack_die (generic_decl_parm, parm, subr_die, &parm); - else if (parm) + else if (parm && !POINTER_BOUNDS_P (parm)) { dw_die_ref parm_die = gen_decl_die (parm, NULL, subr_die); @@ -18610,6 +18614,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) parm = DECL_CHAIN (parm); } + else if (parm) + parm = DECL_CHAIN (parm); if (generic_decl_parm) generic_decl_parm = DECL_CHAIN (generic_decl_parm); @@ -20103,6 +20109,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die, case FIXED_POINT_TYPE: case COMPLEX_TYPE: case BOOLEAN_TYPE: + case POINTER_BOUNDS_TYPE: /* No DIEs needed for fundamental types. */ break; @@ -20584,6 +20591,12 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die) if (DECL_P (decl_or_origin) && DECL_IGNORED_P (decl_or_origin)) return NULL; + /* Ignore pointer bounds decls. */ + if (DECL_P (decl_or_origin) + && TREE_TYPE (decl_or_origin) + && POINTER_BOUNDS_P (decl_or_origin)) + return NULL; + switch (TREE_CODE (decl_or_origin)) { case ERROR_MARK: @@ -20791,7 +20804,8 @@ dwarf2out_global_decl (tree decl) declarations, file-scope (extern) function declarations (which had no corresponding body) and file-scope tagged type declarations and definitions which have not yet been forced out. */ - if (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)) + if ((TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)) + && !POINTER_BOUNDS_P (decl)) dwarf2out_decl (decl); } |