From 8286737741474a866c8c804070da11cb91710801 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 30 Jan 2019 14:35:07 -0800 Subject: Fixing IR-lowering not properly registering func decl --- source/slang/lower-to-ir.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source') 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 // 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()) - return lowerFuncDecl(innerFuncDecl); + return ensureDecl(context, innerFuncDecl); else if (auto innerStructDecl = genDecl->inner->As()) { - visitAggTypeDecl(innerStructDecl); + ensureDecl(context, innerStructDecl); return LoweredValInfo(); } else if( auto extensionDecl = genDecl->inner->As() ) { - 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()); -- cgit v1.2.3