From dcdebc1a76a0a6ffbfd6a5805354f8f679c60202 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 9 Aug 2025 09:43:25 -0700 Subject: Allow specializing entrypoints with generic value args or variadic types from API (#8119) Closes #8110. Closes #8011. --- include/slang.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/slang.h') 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 -- cgit v1.2.3