This fixes crashes in AsmPrinter when using MCNullStreamer
With MCNullStreamer, getTargetStreamer returns null, so this
patch adds some null checks to avoid a crash.
eush on Nov 15 2018, 8:18 PM.Authored by
Thanks for doing this! By the way, every time we use getTargetStreamer(), are we required do this? I checked some other *AsmPrinter.cpp files for other targets and it seems they are not doing this, but they can run -filetype=null with no problem. I wonder what makes the difference?
I think that's great! I didn't know about RegisterNullTargetStreamer - it looks to me like the correct way to support MCNullStreamer.