diff options
| author | Yong He <yongh@outlook.com> | 2018-01-09 13:26:42 -0800 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2018-01-12 23:55:38 -0500 |
| commit | 4b284daeb0cc3f6df0835befad4326c81abeb374 (patch) | |
| tree | ad8d29e14cc483f2eb66bcae7b0f7ffdfd574b86 /source/slang/mangle.cpp | |
| parent | df6eeb93c1718334779ae328db277cdf7a9d7b04 (diff) | |
Support nested generics
fixes #362
Diffstat (limited to 'source/slang/mangle.cpp')
| -rw-r--r-- | source/slang/mangle.cpp | 16 |
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) { |
