This fixes crashes in AsmPrinter when using MCNullStreamer
(-filetype=null).
With MCNullStreamer, getTargetStreamer returns null, so this
patch adds some null checks to avoid a crash.
Differential D54614
[WebAssembly] Fix MCNullStreamer support eush on Nov 15 2018, 8:18 PM. Authored by
Details
Diff Detail
Event Timeline
Comment Actions 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?
Comment Actions I opened D54660. I think this way we don't need to use if (WebAssemblyTargetStreamer *TS = getTargetStreamer()) ... every time we use getTargetStreamer(). What do you think? Comment Actions I think that's great! I didn't know about RegisterNullTargetStreamer - it looks to me like the correct way to support MCNullStreamer.
|
Can you simplify this test, drop the trow and remove the exception arguments from llc?