summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2014-05-14 03:23:09 +0200
committerRoland Scheidegger <sroland@vmware.com>2014-05-14 16:23:33 +0200
commit18c6454ad19d5d323af7b3318f18c409b84c7a12 (patch)
treec38d7cf40ccbd633d873df14940dfb2f2f84c6f6 /src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
parentc5828b0599a5c00ebab488b795c63a21f1dc53cd (diff)
downloadexternal_mesa3d-18c6454ad19d5d323af7b3318f18c409b84c7a12.zip
external_mesa3d-18c6454ad19d5d323af7b3318f18c409b84c7a12.tar.gz
external_mesa3d-18c6454ad19d5d323af7b3318f18c409b84c7a12.tar.bz2
gallivm: fix output stream flushing in error case for disassembly.
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).
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_debug.cpp')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_debug.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
index 85953a2..5d6d45d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
@@ -201,6 +201,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
if (!AsmInfo) {
Out << "error: no assembly info for target " << Triple << "\n";
+ Out.flush();
return 0;
}
@@ -209,12 +210,14 @@ disassemble(const void* func, llvm::raw_ostream & Out)
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;
}
@@ -228,6 +231,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
#endif
if (!DisAsm) {
Out << "error: no disassembler for target " << Triple << "\n";
+ Out.flush();
return 0;
}
@@ -236,6 +240,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
if (!Printer) {
Out << "error: no instruction printer for target " << Triple.c_str() << "\n";
+ Out.flush();
return 0;
}