[PATCH] D47089: CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to dwo output.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 21 13:07:59 PDT 2018


pcc added inline comments.


================
Comment at: llvm/lib/CodeGen/LLVMTargetMachine.cpp:199
                                             raw_pwrite_stream &Out,
+                                            raw_pwrite_stream *DwoOut,
                                             CodeGenFileType FileType,
----------------
echristo wrote:
> 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? :)
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.


https://reviews.llvm.org/D47089





More information about the llvm-commits mailing list