[Lldb-commits] [clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)
Helena Kotas via lldb-commits
lldb-commits at lists.llvm.org
Wed Jul 3 19:46:35 PDT 2024
hekota wrote:
> I see many places where extra cases have been added for the intangible types but no corresponding tests. Is that ok? How did you know to update these places?
I looked at similar types in other languages, such as the `image*` types in [OpenCL](https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/OpenCLImageTypes.def) or `__externref_t` in [WebAssembly](https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/WebAssemblyReferenceTypes.def). I used the same implementation style and defaults as these types (except `__externref_t` is a typedef and not a language keyword). Some of the cases are tested when the two `builtin_hlsl_resource_t.hlsl` files are parsed and AST dumped, but it is not possible to test all case until we can actually use the type (llvm/llvm-project#84824).
> I also don't see anywhere that actually successfully uses `__builtin_hlsl_resource_t`. Am I missing it, or should I not expect to see it?
You are correct - the type cannot be directly declared in user code, so the tests only check for errors and that the type shows up properly in AST. It is possible to use this type internally in Clang or in implicit headers though, which are two ways how we could define `RWBuffer` and other builtin types that will internally use `__builtin_hlsl_resource_t` handle. That will come alive in (llvm/llvm-project#84824).
https://github.com/llvm/llvm-project/pull/97362
More information about the lldb-commits
mailing list