Page MenuHomePhabricator

Debug Info: Support for DW_AT_export_symbols for anonymous structs

Authored by shafik on Aug 23 2019, 10:54 AM.



This implements the DWARF 5 feature described in:

To support recognizing anonymous structs:

struct A { 
  struct { // Anonymous struct 
      int y;
} a;

This patch adds support in CGDebugInfo::CreateLimitedType(...) for this new flag and an accompanying test to verify this feature.

Diff Detail

Event Timeline

aprantl added inline comments.Aug 23 2019, 11:00 AM
3 ↗(On Diff #216900)

This should just be CHECK: if it stands by itself.

It would be better to match both composite types, establish which one is the inner one, and then verify that only that one has the attribute.

shafik updated this revision to Diff 217271.Aug 26 2019, 4:55 PM
shafik marked an inline comment as done.

Updating test to be more specific

aprantl accepted this revision.Aug 26 2019, 5:10 PM
aprantl added inline comments.
4 ↗(On Diff #217271)

FYI: This is equivalent to the slightly more readable:

// CHECK: !DICompositeType(tag: DW_TAG_structure_type, scope: [[SCOPE]]
// CHECK-SAME:                      flags: DIFlagExportSymbols | DIFlagTypePassByValue
This revision is now accepted and ready to land.Aug 26 2019, 5:10 PM
shafik updated this revision to Diff 217457.Aug 27 2019, 11:44 AM
shafik marked an inline comment as done.

Simplifying test.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 27 2019, 1:19 PM