diff options
| author | Yong He <yonghe@outlook.com> | 2024-09-30 12:50:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-30 12:50:30 -0700 |
| commit | 15d1c6c51c5f24663d2567d7e56da62a2bca1c22 (patch) | |
| tree | 78733e327dca1421f39ecff4073463d74500c14c /source/compiler-core/slang-artifact-associated-impl.cpp | |
| parent | bc11579dd998224bcb429d88aeb07d49e2217a35 (diff) | |
Add COM API for querying metadata. (#5168)
* Add COM API for querying metadata.
* Fix tests.
* fix test.
Diffstat (limited to 'source/compiler-core/slang-artifact-associated-impl.cpp')
| -rw-r--r-- | source/compiler-core/slang-artifact-associated-impl.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
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<String> ArtifactPostEmitMetadata::getExportedFunctionMangledNames() return Slice<String>(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 |
