Page MenuHomePhabricator

Debug Info: Support for DW_AT_export_symbols for anonymous structs
ClosedPublic

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

Details

Summary

This implements the DWARF 5 feature described in:

http://dwarfstd.org/ShowIssue.php?issue=141212.1

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
test/CodeGenCXX/debug-info-export_symbols.cpp
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.
test/CodeGenCXX/debug-info-export_symbols.cpp
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