summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-04-16 10:34:26 -0700
committerGitHub <noreply@github.com>2021-04-16 10:34:26 -0700
commit79e92395f8ce3d92c446e3bb3250d19ce33decd5 (patch)
tree2ac277fa299200da72cf03a2b5b96338f66aee5d /source/slang/slang-emit.cpp
parentbad484d838590d0a2aaf1b5b8ac820634af2decb (diff)
Update `model-viewer` example and fixing compiler bugs. (#1795)
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index 01b682a39..af870d02b 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -138,11 +138,14 @@ static void dumpIRIfEnabled(
if(compileRequest->shouldDumpIR)
{
DiagnosticSinkWriter writer(compileRequest->getSink());
-
+ //FILE* f = nullptr;
+ //fopen_s(&f, (String("dump-") + label + ".txt").getBuffer(), "wt");
+ //FileWriter writer(f, 0);
IRDumpOptions options;
options.sourceManager = compileRequest->getSourceManager();
dumpIR(irModule, options, label, &writer);
+ //fclose(f);
}
}
@@ -309,8 +312,10 @@ Result linkAndOptimizeIR(
// perform specialization of functions based on parameter
// values that need to be compile-time constants.
//
+ dumpIRIfEnabled(compileRequest, irModule, "BEFORE-SPECIALIZE");
if (!compileRequest->disableSpecialization)
specializeModule(irModule);
+ dumpIRIfEnabled(compileRequest, irModule, "AFTER-SPECIALIZE");
eliminateDeadCode(irModule);
@@ -319,7 +324,7 @@ Result linkAndOptimizeIR(
// function pointers.
dumpIRIfEnabled(compileRequest, irModule, "BEFORE-LOWER-GENERICS");
lowerGenerics(targetRequest, irModule, sink);
- dumpIRIfEnabled(compileRequest, irModule, "LOWER-GENERICS");
+ dumpIRIfEnabled(compileRequest, irModule, "AFTER-LOWER-GENERICS");
if (sink->getErrorCount() != 0)
return SLANG_FAIL;