add (flag_attribute (DW_AT_GNU_vector));
- // http://gcc.gnu.org/wiki/ThreadSafetyAnnotationsInDWARF
-
// xxx these are glass cl_GNU_mutexlistptr. data4 and data8 are
// supposed to have this class. So how do we smuggle this class
// to whatever DW_FORM_data4 and DW_FORM_data8 have in current
// version? For now, just claim it's plain old constant.
+ // http://gcc.gnu.org/wiki/ThreadSafetyAnnotationsInDWARF
add (const_attribute (DW_AT_GNU_guarded_by));
add (const_attribute (DW_AT_GNU_pt_guarded_by));
add (const_attribute (DW_AT_GNU_guarded));
return new dwarf_version_union (source, extension);
}
+global_opt<void_option>
+ nognu ("Don't use GNU extension.", "nognu");
+
+namespace
+{
+ dwarf_version const *get_ext ()
+ {
+ // xxx The GNU toolchain commonly uses DW_AT_MIPS_linkage_name,
+ // which is part of the MIPS extensions. So that's what we
+ // return. I wonder how to solve this "right". We cannot simply
+ // request DW_AT_producer/DW_AT_language values here, since we
+ // need the version to know how to read these attributes in the
+ // first place.
+
+ if (nognu)
+ return dwarf_mips_ext ();
+ else
+ return dwarf_version::extend (dwarf_mips_ext (), dwarf_gnu_ext ());
+ }
+}
+
dwarf_version const *
dwarf_version::get (unsigned version)
{
- // xxx The GNU toolchain commonly uses DW_AT_MIPS_linkage_name,
- // which is part of the MIPS extensions. So that's what we return.
- // I wonder how to solve this "right". We cannot simply request
- // DW_AT_producer/DW_AT_language values here, since we need the
- // version to know how to read these attributes in the first place.
- //
- // Similarly we assume the GNU extension is used.
- static dwarf_version const *ext = extend (dwarf_mips_ext (), dwarf_gnu_ext ());
+ static dwarf_version const *ext = get_ext ();
switch (version)
{
return dw;
}
- default: return NULL;
+ default:
+ return NULL;
};
}