From e54f6c55b7e6c622f8aac0cbb592f4984e6a3390 Mon Sep 17 00:00:00 2001 From: cesare Date: Mon, 23 Nov 2020 08:45:31 +0000 Subject: [PATCH] Updated processor specialisation --- source/modules/soul_core/compiler/soul_ResolutionPass.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/modules/soul_core/compiler/soul_ResolutionPass.h b/source/modules/soul_core/compiler/soul_ResolutionPass.h index c9168ba..f5b3fab 100644 --- a/source/modules/soul_core/compiler/soul_ResolutionPass.h +++ b/source/modules/soul_core/compiler/soul_ResolutionPass.h @@ -1879,7 +1879,6 @@ struct ResolutionPass final return instance; auto specialisationArgs = AST::CommaSeparatedList::getAsExpressionList (instance.specialisationArgs); - auto numArgs = specialisationArgs.size(); auto target = pool_ref (*p); if (! validateSpecialisationArgs (specialisationArgs, target->specialisationParams)) @@ -1898,18 +1897,20 @@ struct ResolutionPass final return instance; } - if (target->owningInstance != nullptr || numArgs != 0) + bool requiresSpecialisation = ! target->specialisationParams.empty(); + + if (target->owningInstance != nullptr || requiresSpecialisation) { auto nameRoot = target->name.toString(); - if (numArgs != 0) + if (requiresSpecialisation) nameRoot = TokenisedPathString::join (nameRoot, "_for_" + makeSafeIdentifierName (choc::text::replace (graph.getFullyQualifiedPath().toString(), ":", "_") + "_" + instance.instanceName->toString())); auto& ns = target->getNamespace(); target = *cast (target->createClone (allocator, ns, ns.makeUniqueName (nameRoot))); - if (numArgs != 0) + if (requiresSpecialisation) { auto oldCloneFn = target->createClone;