From 15d1c6c51c5f24663d2567d7e56da62a2bca1c22 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 30 Sep 2024 12:50:30 -0700 Subject: Add COM API for querying metadata. (#5168) * Add COM API for querying metadata. * Fix tests. * fix test. --- .../compiler-core/slang-artifact-associated-impl.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/compiler-core/slang-artifact-associated-impl.cpp') diff --git a/source/compiler-core/slang-artifact-associated-impl.cpp b/source/compiler-core/slang-artifact-associated-impl.cpp index f29c0f596..07d69bf8e 100644 --- a/source/compiler-core/slang-artifact-associated-impl.cpp +++ b/source/compiler-core/slang-artifact-associated-impl.cpp @@ -313,4 +313,24 @@ Slice ArtifactPostEmitMetadata::getExportedFunctionMangledNames() return Slice(m_exportedFunctionMangledNames.getBuffer(), m_exportedFunctionMangledNames.getCount()); } +SlangResult ArtifactPostEmitMetadata::isParameterLocationUsed( + SlangParameterCategory category, + SlangUInt spaceIndex, + SlangUInt registerIndex, + bool& outUsed) +{ + for (const auto& range : getUsedBindingRanges()) + { + if (range.containsBinding((slang::ParameterCategory)category, spaceIndex, registerIndex)) + { + outUsed = true; + return SLANG_OK; + } + } + + outUsed = false; + return SLANG_OK; +} + + } // namespace Slang -- cgit v1.2.3