summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-07-24 16:37:51 -0700
committerGitHub <noreply@github.com>2020-07-24 16:37:51 -0700
commit261fe7587d7413070a4e0f29e1a1bb7b0d2b5429 (patch)
treeed565454d0cbd7883b575fc746de21fde69b2e0c /source/slang/slang-lower-to-ir.cpp
parent17d0da23ada17e60b037d0d642fa292d194d8d06 (diff)
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 <yhe@nvidia.com> Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp9
1 files changed, 5 insertions, 4 deletions
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;