This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to dwo output.
ClosedPublic

Authored by pcc on May 18 2018, 3:06 PM.

Event Timeline

pcc created this revision.May 18 2018, 3:06 PM
echristo accepted this revision.May 20 2018, 9:46 PM

One inline comment for discussion and LGTM.

-eric

llvm/lib/CodeGen/LLVMTargetMachine.cpp
199

I think the general output stream here at all is pretty awkward, but this isn't necessarily making it worse. Any ideas on where/how to clean this particular one up since you're in there right now? :)

This revision is now accepted and ready to land.May 20 2018, 9:46 PM
pcc added inline comments.May 21 2018, 1:07 PM
llvm/lib/CodeGen/LLVMTargetMachine.cpp
199

One approach that I was thinking about was to move the MCObjectWriter creation into the TargetMachine client and have it be passed in as a parameter here. We could then also have things like MCAsmWriter and MCNullWriter which would let us drop the FileType enum as well. But for that to work we'd probably want to split the initialization of MCObjectWriter in two to allow the MCAsmBackend to set the MCObjectTargetWriter once it's created, which doesn't seem great but probably the lesser of two evils.

The MCObjectWriter part of this seems easy but getting it to work for the other output formats seemed a little trickier so I decided to leave it for now.

This revision was automatically updated to reflect the committed changes.