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/emit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index e60941e50..41ae819d9 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -3054,7 +3054,7 @@ struct EmitVisitor return; } - GenericSubstitution* subst = declRef.substitutions.As().Ptr(); + GenericSubstitution* subst = declRef.substitutions.genericSubstitutions; if (!subst) return; -- cgit v1.2.3