summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/lower-to-ir.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp
index c1fa871ba..3f77de446 100644
--- a/source/slang/lower-to-ir.cpp
+++ b/source/slang/lower-to-ir.cpp
@@ -5790,24 +5790,22 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
// body appear before the function itself in the list
// of global values.
irFunc->moveToEnd();
-
return LoweredValInfo::simple(finishOuterGenerics(subBuilder, irFunc));
}
LoweredValInfo visitGenericDecl(GenericDecl * genDecl)
{
// TODO: Should this just always visit/lower the inner decl?
-
if (auto innerFuncDecl = genDecl->inner->As<FunctionDeclBase>())
- return lowerFuncDecl(innerFuncDecl);
+ return ensureDecl(context, innerFuncDecl);
else if (auto innerStructDecl = genDecl->inner->As<StructDecl>())
{
- visitAggTypeDecl(innerStructDecl);
+ ensureDecl(context, innerStructDecl);
return LoweredValInfo();
}
else if( auto extensionDecl = genDecl->inner->As<ExtensionDecl>() )
{
- return visitExtensionDecl(extensionDecl);
+ return ensureDecl(context, extensionDecl);
}
SLANG_RELEASE_ASSERT(false);
UNREACHABLE_RETURN(LoweredValInfo());
@@ -5892,7 +5890,6 @@ LoweredValInfo ensureDecl(
env = env->outer;
}
-
IRBuilder subIRBuilder;
subIRBuilder.sharedBuilder = context->irBuilder->sharedBuilder;
subIRBuilder.setInsertInto(subIRBuilder.sharedBuilder->module->getModuleInst());