From 261fe7587d7413070a4e0f29e1a1bb7b0d2b5429 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 24 Jul 2020 16:37:51 -0700 Subject: Ensure labels are dumped in `lower-to-ir` (#1459) * Ensure labels are dumped in `lower-to-ir`. There is a `dumpIR` function that accepts a label parameter already in slang-emit.cpp. This change moves it to slang-ir.cpp so it may be called from other files. * update expected test result Co-authored-by: Yong He Co-authored-by: Tim Foley --- source/slang/slang-lower-to-ir.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-lower-to-ir.cpp') diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 322489d89..c72f7aca5 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -7343,9 +7343,10 @@ IRModule* generateIRForTranslationUnit( } #if 0 - fprintf(stderr, "### GENERATED\n"); - dumpIR(module); - fprintf(stderr, "###\n"); + { + DiagnosticSinkWriter writer(compileRequest->getSink()); + dumpIR(module, &writer, "GENERATED"); + } #endif validateIRModuleIfEnabled(compileRequest, module); @@ -7451,7 +7452,7 @@ IRModule* generateIRForTranslationUnit( if(compileRequest->shouldDumpIR) { DiagnosticSinkWriter writer(compileRequest->getSink()); - dumpIR(module, &writer); + dumpIR(module, &writer, "LOWER-TO-IR"); } return module; -- cgit v1.2.3