[clang] [llvm] [HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers (PR #114148)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 8 18:08:18 PST 2024


================
@@ -109,22 +116,16 @@ struct BuiltinTypeDeclBuilder {
   }
 
   BuiltinTypeDeclBuilder &
-  addHandleMember(Sema &S, ResourceClass RC, ResourceKind RK, bool IsROV,
-                  bool RawBuffer,
+  addHandleMember(ResourceClass RC, ResourceKind RK, bool IsROV, bool RawBuffer,
                   AccessSpecifier Access = AccessSpecifier::AS_private) {
-    if (Record->isCompleteDefinition())
-      return *this;
+    assert(!Record->isCompleteDefinition() && "record is already complete");
 
     ASTContext &Ctx = S.getASTContext();
     TypeSourceInfo *ElementTypeInfo = nullptr;
 
     QualType ElemTy = Ctx.Char8Ty;
----------------
hekota wrote:

`i8` seems like a good default to me. We can decide if we want to use `void` instead when we implement the `ByteAddressBuffer`. 

https://github.com/llvm/llvm-project/pull/114148


More information about the cfe-commits mailing list