summaryrefslogtreecommitdiffstats
path: root/include/slang.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-08-09 09:43:25 -0700
committerGitHub <noreply@github.com>2025-08-09 16:43:25 +0000
commitdcdebc1a76a0a6ffbfd6a5805354f8f679c60202 (patch)
tree126d60d157e73e401aacf1e13b400b8533ec8828 /include/slang.h
parentfc6aea37483446372425aca8471f0e8bf7c3a910 (diff)
Allow specializing entrypoints with generic value args or variadic types from API (#8119)
Closes #8110. Closes #8011.
Diffstat (limited to 'include/slang.h')
-rw-r--r--include/slang.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/slang.h b/include/slang.h
index 7462644a2..a32cbfd3b 100644
--- a/include/slang.h
+++ b/include/slang.h
@@ -4621,6 +4621,7 @@ struct SpecializationArg
{
Unknown, /**< An invalid specialization argument. */
Type, /**< Specialize to a type. */
+ Expr, /**< An expression representing a type or value */
};
/** The kind of specialization argument. */
@@ -4629,6 +4630,8 @@ struct SpecializationArg
{
/** A type specialization argument, used for `Kind::Type`. */
TypeReflection* type;
+ /** An expression in Slang syntax, used for `Kind::Expr`. */
+ const char* expr;
};
static SpecializationArg fromType(TypeReflection* inType)
@@ -4638,6 +4641,14 @@ struct SpecializationArg
rs.type = inType;
return rs;
}
+
+ static SpecializationArg fromExpr(const char* inExpr)
+ {
+ SpecializationArg rs;
+ rs.kind = Kind::Expr;
+ rs.expr = inExpr;
+ return rs;
+ }
};
} // namespace slang