From d866c0b9dfc0fdc8ad8cede4d7a8593f7ddf4716 Mon Sep 17 00:00:00 2001 From: Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:04:45 -0400 Subject: Add API method to specialize function reference with argument types (#4966) * Add `FunctionReflection::specializeWithArgTypes()` * Update slang.cpp * Use a shared semantics context on linkage Improve performance on reflection queries * Try to fix linux/mac compile errors --- include/slang.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/slang.h b/include/slang.h index 777cd406b..632bcbcbc 100644 --- a/include/slang.h +++ b/include/slang.h @@ -2589,6 +2589,7 @@ extern "C" SLANG_API SlangReflectionType* spReflectionFunction_GetResultType(SlangReflectionFunction* func); SLANG_API SlangReflectionGeneric* spReflectionFunction_GetGenericContainer(SlangReflectionFunction* func); SLANG_API SlangReflectionFunction* spReflectionFunction_applySpecializations(SlangReflectionFunction* func, SlangReflectionGeneric* generic); + SLANG_API SlangReflectionFunction* spReflectionFunction_specializeWithArgTypes(SlangReflectionFunction* func, SlangInt argTypeCount, SlangReflectionType* const* argTypes); // Abstract Decl Reflection @@ -3587,6 +3588,11 @@ namespace slang { return (FunctionReflection*)spReflectionFunction_applySpecializations((SlangReflectionFunction*)this, (SlangReflectionGeneric*)generic); } + + FunctionReflection* specializeWithArgTypes(unsigned int argCount, TypeReflection* const* types) + { + return (FunctionReflection*)spReflectionFunction_specializeWithArgTypes((SlangReflectionFunction*)this, argCount, (SlangReflectionType* const*)types); + } }; struct GenericReflection -- cgit v1.2.3