summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-substitutions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ast-substitutions.cpp')
-rw-r--r--source/slang/slang-ast-substitutions.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/source/slang/slang-ast-substitutions.cpp b/source/slang/slang-ast-substitutions.cpp
index acff8201e..6656f1fa6 100644
--- a/source/slang/slang-ast-substitutions.cpp
+++ b/source/slang/slang-ast-substitutions.cpp
@@ -163,75 +163,4 @@ HashCode ThisTypeSubstitution::_getHashCodeOverride() const
return witness->getHashCode();
}
-// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! GlobalGenericParamSubstitution !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-Substitutions* GlobalGenericParamSubstitution::_applySubstitutionsShallowOverride(ASTBuilder* astBuilder, SubstitutionSet substSet, Substitutions* substOuter, int* ioDiff)
-{
- // if we find a GlobalGenericParamSubstitution in subst that references the same type_param decl
- // return a copy of that GlobalGenericParamSubstitution
- int diff = 0;
-
- if (substOuter != outer) diff++;
-
- auto substActualType = as<Type>(actualType->substituteImpl(astBuilder, substSet, &diff));
-
- List<ConstraintArg> substConstraintArgs;
- for (auto constraintArg : constraintArgs)
- {
- ConstraintArg substConstraintArg;
- substConstraintArg.decl = constraintArg.decl;
- substConstraintArg.val = constraintArg.val->substituteImpl(astBuilder, substSet, &diff);
-
- substConstraintArgs.add(substConstraintArg);
- }
-
- if (!diff)
- return this;
-
- (*ioDiff)++;
-
- GlobalGenericParamSubstitution* substSubst = astBuilder->create<GlobalGenericParamSubstitution>();
- substSubst->paramDecl = paramDecl;
- substSubst->actualType = substActualType;
- substSubst->constraintArgs = substConstraintArgs;
- substSubst->outer = substOuter;
- return substSubst;
-}
-
-bool GlobalGenericParamSubstitution::_equalsOverride(Substitutions* subst)
-{
- if (!subst)
- return false;
- if (subst == this)
- return true;
-
- if (auto genSubst = as<GlobalGenericParamSubstitution>(subst))
- {
- if (paramDecl != genSubst->paramDecl)
- return false;
- if (!actualType->equalsVal(genSubst->actualType))
- return false;
- if (constraintArgs.getCount() != genSubst->constraintArgs.getCount())
- return false;
- for (Index i = 0; i < constraintArgs.getCount(); i++)
- {
- if (!constraintArgs[i].val->equalsVal(genSubst->constraintArgs[i].val))
- return false;
- }
- return true;
- }
- return false;
-}
-
-HashCode GlobalGenericParamSubstitution::_getHashCodeOverride() const
-{
- HashCode rs = actualType->getHashCode();
- for (auto && a : constraintArgs)
- {
- rs = combineHash(rs, a.val->getHashCode());
- }
- return rs;
-}
-
-
} // namespace Slang