microsoft / microsoft/DirectXShaderCompiler
IDxcCursor does not support template parameter and template argument querying
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Upstream libclang provides CXCursor functionality to query template parameters and template arguments using clang_Cursor_getNumTemplateArguments, clang_Cursor_getTemplateArgumentKind, clang_Cursor_getTemplateArgumentUnsignedValue and clang_Cursor_getTemplateArgumentValue. (see for example, https://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#ga08dac49044448c022457224e73223eb2).
Until Sept 2022, the functionality above was restricted in libclang to function templates but this was since extended to include class templates and partial specializations. This is the CR in question: https://reviews.llvm.org/D134416.
I made a modest attempt at porting these changes and extending the IDxcCursor interface, but I noticed that the cursor kinds itself doesn't match what I expect so I suspect that the synthesized AST node types have diverged somewhat from upstream LLVM.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the IDxcCursor interface and compare its cursor kinds and template-query behavior with the upstream libclang APIs named in the issue. Inspect how synthesized AST node types map to those cursor kinds; done when template parameter and argument queries work for class templates and partial specializations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100