LOGGER: dump ir to string (partly)
(cherry picked from commit 674f32e46c78dac18877497651f6b27e1eed1dcc)
This commit is contained in:
committed by
vvlevchenko
parent
50b2646329
commit
a93b7ab886
+7
-2
@@ -29,13 +29,18 @@ internal class Logger(val generator: CodeGenerator, override val context: Contex
|
||||
|
||||
//-----------------------------------------------------------------------------//
|
||||
|
||||
fun ir2string(ir: IrElement?): String {
|
||||
fun ir2string(ir: IrElement?): String = ir2stringWhole(ir).takeWhile { it != '\n' }
|
||||
|
||||
//-----------------------------------------------------------------------------//
|
||||
|
||||
fun ir2stringWhole(ir: IrElement?): String {
|
||||
val strWriter = StringWriter()
|
||||
|
||||
ir?.accept(DumpIrTreeVisitor(strWriter), "")
|
||||
return strWriter.toString().takeWhile { it != '\n' }
|
||||
return strWriter.toString()
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------//
|
||||
|
||||
fun llvm2string(value: LLVMValueRef?): String {
|
||||
|
||||
Reference in New Issue
Block a user