summaryrefslogtreecommitdiffstats
path: root/source/slang/mangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/mangle.cpp')
-rw-r--r--source/slang/mangle.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/mangle.cpp b/source/slang/mangle.cpp
index dca48f671..38c2b29a8 100644
--- a/source/slang/mangle.cpp
+++ b/source/slang/mangle.cpp
@@ -350,6 +350,24 @@ namespace Slang
DeclRef<Decl>(declRef.decl, declRef.substitutions));
}
+ String mangleSpecializedFuncName(String baseName, RefPtr<Substitutions> subst)
+ {
+ ManglingContext context;
+ emitRaw(&context, baseName.Buffer());
+ emitRaw(&context, "_G");
+ while (subst)
+ {
+ if (auto genSubst = subst.As<GenericSubstitution>())
+ {
+ for (auto a : genSubst->args)
+ emitVal(&context, a);
+ break;
+ }
+ subst = subst->outer;
+ }
+ return context.sb.ProduceString();
+ }
+
String getMangledName(Decl* decl)
{
return getMangledName(makeDeclRef(decl));