summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-impl.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-11-01 08:46:57 -0700
committerGitHub <noreply@github.com>2022-11-01 08:46:57 -0700
commitcbc1eff56057f199183bb7c17d8a360326512367 (patch)
tree487865e928cd2ceecbb509f0bfd06aa8d9584411 /source/slang/slang-check-impl.h
parentb707a07b1de3535cb0a8ccb6fe2ed4afa4a016d1 (diff)
Make `DifferentialPair` able to nest. (#2477)
Diffstat (limited to 'source/slang/slang-check-impl.h')
-rw-r--r--source/slang/slang-check-impl.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/source/slang/slang-check-impl.h b/source/slang/slang-check-impl.h
index 821f785f5..33455e42d 100644
--- a/source/slang/slang-check-impl.h
+++ b/source/slang/slang-check-impl.h
@@ -794,15 +794,12 @@ namespace Slang
bool shouldSkipChecking(Decl* decl, DeclCheckState state);
// Auto-diff convenience functions for translating primal types to differential types.
- Type* _toDifferentialParamType(ASTBuilder* builder, Type* primalType);
+ Type* _toDifferentialParamType(Type* primalType);
+
+ Type* getDifferentialPairType(Type* primalType);
- // Translate a return type to the return type of a forward-mode differentiated
- // function.
- //
- Type* _toJVPReturnType(ASTBuilder* builder, Type* primalType);
-
// Convert a function's original type to it's JVP type.
- Type* processJVPFuncType(ASTBuilder* builder, FuncType* originalType);
+ Type* processJVPFuncType(FuncType* originalType);
// Check and register a type if it is differentiable.
void maybeRegisterDifferentiableType(ASTBuilder* builder, Type* type);
@@ -1038,6 +1035,11 @@ namespace Slang
DeclRef<GenericDecl> requirementGenDecl,
RefPtr<WitnessTable> witnessTable);
+ bool doesTypeSatisfyAssociatedTypeConstraintRequirement(
+ Type* satisfyingType,
+ DeclRef<AssocTypeDecl> requiredAssociatedTypeDeclRef,
+ RefPtr<WitnessTable> witnessTable);
+
bool doesTypeSatisfyAssociatedTypeRequirement(
Type* satisfyingType,
DeclRef<AssocTypeDecl> requiredAssociatedTypeDeclRef,
@@ -1124,7 +1126,7 @@ namespace Slang
/// Otherwise, returns `false`.
bool trySynthesizeDifferentialAssociatedTypeRequirementWitness(
ConformanceCheckingContext* context,
- DeclRef<Decl> requirementDeclRef,
+ DeclRef<AssocTypeDecl> requirementDeclRef,
RefPtr<WitnessTable> witnessTable);
/// Registers a type as differentiable in the currrent semantic context, if the declaration represents
@@ -1989,6 +1991,8 @@ namespace Slang
Expr* visitForwardDifferentiateExpr(ForwardDifferentiateExpr* expr);
+ Expr* visitGetArrayLengthExpr(GetArrayLengthExpr* expr);
+
/// Perform semantic checking on a `modifier` that is being applied to the given `type`
Val* checkTypeModifier(Modifier* modifier, Type* type);