This is an archive of the discontinued LLVM Phabricator instance.

[NFC][COFF] Split WinCOFFObjectWriter to WinCOFFWriter
ClosedPublic

Authored by HaohaiWen on Jun 6 2023, 10:40 PM.

Details

Summary

We'd like to support -gsplit-dwarf for Windows COFF. It requires to
write Dwo and NonDwo sections to different output streams.The original
implementation is not designed to do that and there can be only one
MCObjectWriter. This patch split WinCOFFObjectWriter to WinCOFFWriter so
that:

  1. WinCOFFObjectWriter can create multiple WinCOFFWriter.
  2. Each WinCOFFWriter can separately collect sections it is interested.
  3. Each WinCOFFWriter can write to it's own output stream.

Diff Detail