Start support for HLSL `RWBuffer`
Most of the change here is fleshing out the HLSLExternalSemaSource with builder implementations to build the builtin types. Eventually, I may move some of this code into tablegen or a more managable declarative file but I want to get the AST generation logic ready first. This code adds two new types into the HLSL AST, `hlsl::Resource` and `hlsl::RWBuffer`. The `Resource` type is just a wrapper around a handle identifier, and is largely unused in source. It will morph a bit over time as I work on getting the source compatability correct, but for now it is a reasonable stand-in. The `RWBuffer` type is not ready for use. I'm posting this change for review because it adds a lot of infrastructure code and is testable. There is one change to clang code outside the HLSL-specific logic here, which addresses a behavior change introduced a long time ago in 967d4384. That change resulted in unintentionally breaking situations where an incomplete template declaration was provided from an AST source, and needed to be completed later by the external AST. That situation doesn't happen in the normal AST importer flow, but can happen when an AST source provides incomplete declarations of templates. The solution is to annotate template specializations of incomplete types with the HasExternalLexicalSource bit from the base template. Depends on D128012. Differential Revision: https://reviews.llvm.org/D128569
Loading
Please sign in to comment