diff options
author | Cassandra Beckley <beckl.ds@gmail.com> | 2025-05-27 08:40:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-27 11:40:54 -0400 |
commit | 5a4571133af78e365e6e7b271688b9ceaa653e67 (patch) | |
tree | 5018fb04b5ca4301262735fb16d7d27a20414799 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 58f80536d3ee1a9ca3e8aa62da92d33d4bc9cc8c (diff) | |
download | llvm-5a4571133af78e365e6e7b271688b9ceaa653e67.zip llvm-5a4571133af78e365e6e7b271688b9ceaa653e67.tar.gz llvm-5a4571133af78e365e6e7b271688b9ceaa653e67.tar.bz2 |
[HLSL] Implement `SpirvType` and `SpirvOpaqueType` (#134034)
This implements the design proposed by [Representing SpirvType in
Clang's Type System](https://github.com/llvm/wg-hlsl/pull/181). It
creates `HLSLInlineSpirvType` as a new `Type` subclass, and
`__hlsl_spirv_type` as a new builtin type template to create such a
type.
This new type is lowered to the `spirv.Type` target extension type, as
described in [Target Extension Types for Inline SPIR-V and Decorated
Types](https://github.com/llvm/wg-hlsl/blob/main/proposals/0017-inline-spirv-and-decorated-types.md).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 0356952..e235756 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -283,6 +283,7 @@ TypeEvaluationKind CodeGenFunction::getEvaluationKind(QualType type) { case Type::Pipe: case Type::BitInt: case Type::HLSLAttributedResource: + case Type::HLSLInlineSpirv: return TEK_Scalar; // Complexes. @@ -2473,6 +2474,7 @@ void CodeGenFunction::EmitVariablyModifiedType(QualType type) { case Type::ObjCInterface: case Type::ObjCObjectPointer: case Type::BitInt: + case Type::HLSLInlineSpirv: llvm_unreachable("type class is never variably-modified!"); case Type::Elaborated: |