summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-emit.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-emit.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-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index b08f26137..7d8a4074e 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -126,29 +126,6 @@ StructTypeLayout* getGlobalStructLayout(
return getScopeStructLayout(programLayout);
}
-static void dumpIR(
- BackEndCompileRequest* compileRequest,
- IRModule* irModule,
- char const* label)
-{
- DiagnosticSinkWriter writerImpl(compileRequest->getSink());
- WriterHelper writer(&writerImpl);
-
- if(label)
- {
- writer.put("### ");
- writer.put(label);
- writer.put(":\n");
- }
-
- dumpIR(irModule, writer.getWriter());
-
- if( label )
- {
- writer.put("###\n");
- }
-}
-
static void dumpIRIfEnabled(
BackEndCompileRequest* compileRequest,
IRModule* irModule,
@@ -156,7 +133,8 @@ static void dumpIRIfEnabled(
{
if(compileRequest->shouldDumpIR)
{
- dumpIR(compileRequest, irModule, label);
+ DiagnosticSinkWriter writer(compileRequest->getSink());
+ dumpIR(irModule, &writer, label);
}
}