This is an archive of the discontinued LLVM Phabricator instance.

[NFC][COFF] Use COFFSection.MCSection when writeSection
ClosedPublic

Authored by HaohaiWen on May 31 2023, 2:57 AM.

Details

Summary

Each COFFSection bind MCSection when created. No need to iterate
throught MCAssembler when writeSection.

Diff Detail

Event Timeline

HaohaiWen created this revision.May 31 2023, 2:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 2:57 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
HaohaiWen requested review of this revision.May 31 2023, 2:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 2:57 AM
skan added a comment.Jun 2 2023, 3:57 AM

Add a NFC or NFCI in the title?

skan accepted this revision.Jun 2 2023, 4:10 AM

LGTM with minor suggestion

llvm/lib/MC/WinCOFFObjectWriter.cpp
619

From line 620, we can see that Sec is never a NULL pointer. So the [] operator should have no side effect here.

This revision is now accepted and ready to land.Jun 2 2023, 4:10 AM
HaohaiWen retitled this revision from [COFF] Use COFFSection.MCSection when writeSection to [NFC][COFF] Use COFFSection.MCSection when writeSection.Jun 4 2023, 6:33 PM
This revision was automatically updated to reflect the committed changes.