summaryrefslogtreecommitdiffstats
path: root/source/slang/mangle.cpp
diff options
context:
space:
mode:
authorYong He <yongh@outlook.com>2018-01-09 13:26:42 -0800
committerYong He <yonghe@outlook.com>2018-01-12 23:55:38 -0500
commit4b284daeb0cc3f6df0835befad4326c81abeb374 (patch)
treead8d29e14cc483f2eb66bcae7b0f7ffdfd574b86 /source/slang/mangle.cpp
parentdf6eeb93c1718334779ae328db277cdf7a9d7b04 (diff)
Support nested generics
fixes #362
Diffstat (limited to 'source/slang/mangle.cpp')
-rw-r--r--source/slang/mangle.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/slang/mangle.cpp b/source/slang/mangle.cpp
index 070c2b172..1a412d041 100644
--- a/source/slang/mangle.cpp
+++ b/source/slang/mangle.cpp
@@ -408,6 +408,22 @@ namespace Slang
}
String getMangledNameForConformanceWitness(
+ DeclRef<Decl> sub,
+ Type* sup)
+ {
+ // The mangled form for a witness that `sub`
+ // conforms to `sup` will be named:
+ //
+ // {Conforms(sub,sup)} => _SW{sub}{sup}
+ //
+ ManglingContext context;
+ emitRaw(&context, "_SW");
+ emitQualifiedName(&context, sub);
+ emitType(&context, sup);
+ return context.sb.ProduceString();
+ }
+
+ String getMangledNameForConformanceWitness(
Type* sub,
Type* sup)
{