diff options
Diffstat (limited to 'source/slang/slang-mangle.cpp')
| -rw-r--r-- | source/slang/slang-mangle.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/slang/slang-mangle.cpp b/source/slang/slang-mangle.cpp index ee34358ab..de1b58999 100644 --- a/source/slang/slang-mangle.cpp +++ b/source/slang/slang-mangle.cpp @@ -423,7 +423,7 @@ namespace Slang // There are two cases here: either we have specializations // in place for the parent generic declaration, or we don't. - auto subst = findInnerMostGenericSubstitution(declRef.substitutions); + auto subst = findInnerMostGenericSubstitution(declRef.getSubst()); if( subst && subst->genericDecl == parentGenericDeclRef.getDecl() ) { // This is the case where we *do* have substitutions. @@ -484,7 +484,7 @@ namespace Slang for (auto type : constraint.value) { emitRaw(context, "C"); - emitQualifiedName(context, context->astBuilder->getSpecializedDeclRef(constraint.key, nullptr)); + emitQualifiedName(context, makeDeclRef(constraint.key)); emitType(context, type); } } @@ -531,6 +531,7 @@ namespace Slang // are asked to mangle the name of a `typedef`? auto decl = declRef.getDecl(); + if (!decl) return; // Handle `__extern_cpp` modifier by simply emitting // the given name. @@ -568,11 +569,11 @@ namespace Slang // mangling the generic and the inner entity emitRaw(context, "G"); - SLANG_ASSERT(genericDecl.substitutions == nullptr); + SLANG_ASSERT(genericDecl.getSubst() == nullptr); - auto innerDecl = makeDeclRef(getInner(genericDecl)); + auto innerDecl = getInner(genericDecl); - emitQualifiedName(context, innerDecl); + emitQualifiedName(context, makeDeclRef(innerDecl)); return; } else if (as<ForwardDerivativeRequirementDecl>(decl)) @@ -588,17 +589,16 @@ namespace Slang emitQualifiedName(context, declRef); } - String getMangledName(ASTBuilder* astBuilder, DeclRef<Decl> const& declRef) + static String getMangledName(ASTBuilder* astBuilder, DeclRef<Decl> const& declRef) { ManglingContext context(astBuilder); mangleName(&context, declRef); return context.sb.produceString(); } - String getMangledName(ASTBuilder* astBuilder, DeclRefBase const & declRef) + String getMangledName(ASTBuilder* astBuilder, DeclRefBase* declRef) { - return getMangledName(astBuilder, - astBuilder->getSpecializedDeclRef<Decl>(declRef.decl, declRef.substitutions)); + return getMangledName(astBuilder, DeclRef<Decl>(declRef)); } String getMangledName(ASTBuilder* astBuilder, Decl* decl) |
