summaryrefslogtreecommitdiff
path: root/source/slang/slang-emit.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-01-06 15:36:11 -0500
committerGitHub <noreply@github.com>2020-01-06 15:36:11 -0500
commit0c87001d7fb9dabaa17f9784e99d7438592d2373 (patch)
tree0cd893463a0734928a45e63850c1fabb8e4d4129 /source/slang/slang-emit.cpp
parent79b52bb8ac2a6059f5bbdc17be22725400b74aad (diff)
Fix scoping issue around use of IRTypeSet (#1160)
* WIP use IRTypeSet in CPPSourceEmitter - doesn't work because of a cloning issue, causing a crash on exit. * Fix destruction of module issue for IRTypeSet usage in CPPEmitter. * Fix out definition emitting ordering that was removed. * Disable cuda output test.
Diffstat (limited to 'source/slang/slang-emit.cpp')
-rw-r--r--source/slang/slang-emit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp
index 19c3cad68..66e5714c3 100644
--- a/source/slang/slang-emit.cpp
+++ b/source/slang/slang-emit.cpp
@@ -466,6 +466,10 @@ String emitEntryPointSourceFromIR(
desc.effectiveProfile = getEffectiveProfile(entryPoint, targetRequest);
desc.sourceWriter = &sourceWriter;
+ // Define here, because must be in scope longer than the sourceEmitter, as sourceEmitter might reference
+ // items in the linkedIR module
+ LinkedIR linkedIR;
+
RefPtr<CLikeSourceEmitter> sourceEmitter;
typedef CLikeSourceEmitter::SourceStyle SourceStyle;
@@ -502,8 +506,6 @@ String emitEntryPointSourceFromIR(
return String();
}
- // Outside because we want to keep IR in scope whilst we are processing emits
- LinkedIR linkedIR;
{
LinkingAndOptimizationOptions linkingAndOptimizationOptions;