From df6eeb93c1718334779ae328db277cdf7a9d7b04 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 12 Jan 2018 14:15:56 -0800 Subject: Refactor substitution representation in DeclRefBase (#363) This commit changes the type of `DeclRefBase::substitutions` from `RefPtr` to `SubstitutionSet`, which is a new type defined as following: ``` struct SubstitutionSet { RefPtr genericSubstitutions; RefPtr thisTypeSubstitution; RefPtr globalGenParamSubstitutions; } ``` This change get rid of most helper functions to retreive the substitution of a certain type, as well as surgery operations to insert a `ThisTypeSubstitution` or `GlobalGenericTypeSubstittuion` at top or bottom of the substitution chain. It also simplies type comparison when certain type of substitution should not be considered as part of type definition. --- source/slang/mangle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/mangle.h') diff --git a/source/slang/mangle.h b/source/slang/mangle.h index 406796951..45b1d4bd1 100644 --- a/source/slang/mangle.h +++ b/source/slang/mangle.h @@ -12,7 +12,7 @@ namespace Slang String getMangledName(DeclRef const & declRef); String getMangledName(DeclRefBase const & declRef); - String mangleSpecializedFuncName(String baseName, RefPtr subst); + String mangleSpecializedFuncName(String baseName, SubstitutionSet subst); String getMangledNameForConformanceWitness( Type* sub, Type* sup); -- cgit v1.2.3