When there's an error, also need to flush the stream, otherwise an assertion
is hit (meaning you don't actually see the error neither).
if (!AsmInfo) {
Out << "error: no assembly info for target " << Triple << "\n";
+ Out.flush();
return 0;
}
OwningPtr<const MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
if (!MRI) {
Out << "error: no register info for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}
OwningPtr<const MCInstrInfo> MII(T->createMCInstrInfo());
if (!MII) {
Out << "error: no instruction info for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}
#endif
if (!DisAsm) {
Out << "error: no disassembler for target " << Triple << "\n";
+ Out.flush();
return 0;
}
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
if (!Printer) {
Out << "error: no instruction printer for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}