[llvm-branch-commits] [clang] [HLSL] Add RWBuffer::Load(Index) (PR #117018)

Helena Kotas via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Nov 21 12:08:58 PST 2024


================
@@ -189,12 +189,28 @@ struct BuiltinTypeDeclBuilder {
   BuiltinTypeDeclBuilder &addArraySubscriptOperators(Sema &S) {
     if (Record->isCompleteDefinition())
       return *this;
-    addArraySubscriptOperator(S, true);
-    addArraySubscriptOperator(S, false);
+    ASTContext &AST = Record->getASTContext();
+    DeclarationName Subscript =
+        AST.DeclarationNames.getCXXOperatorName(OO_Subscript);
+    addHandleAccessFunction(S, Subscript, /*IsConst=*/true, /*IsRef=*/true);
+    addHandleAccessFunction(S, Subscript, /*IsConst=*/false, /*IsRef=*/true);
+    return *this;
+  }
+
+  BuiltinTypeDeclBuilder &addLoadMethods(Sema &S) {
----------------
hekota wrote:

1. The name `addLoadMethods` implies that it will add multiple methods yet it is adding a single one.
2. What about Load with the `out uint status` parameter?
3. There are many other `Load` methods for different kinds of buffers/textures. Should the name reflect that?

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


More information about the llvm-branch-commits mailing list