This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] COMDAT-fold block descriptors

Authored by DHowett-MSFT on Feb 28 2019, 6:09 PM.



Without this change, linking multiple objects containing block
descriptors together on Windows will generate duplicate symbol errors.

Diff Detail


Event Timeline

DHowett-MSFT created this revision.Feb 28 2019, 6:09 PM
theraven accepted this revision.Mar 1 2019, 12:34 AM
theraven added a subscriber: theraven.

Looks good to me. On ELF and Mach-O, I think we get the equivalent behaviour automatically from the ODR linkage type. I'd really like to see linkage type and COMDAT made orthogonal, but that's a bigger change.

This revision is now accepted and ready to land.Mar 1 2019, 12:34 AM

It would probably benefit from a test so that we don't regress.

This change caused a test to fail, so I took the opportunity to augment the test with COMDAT entry.

Fixed corrupted patch. I know that the -str test case is not the _ideal_ location for the comdat test, but it is the only test whose invariants failed (the IR for the descriptor definition now contains comdat, align 4).

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2019, 4:21 AM