================
@@ -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) {
----------------
bogner wrote:

It's named `addLoadMethods` because I intend it to add the rest of the load 
methods (notably, the one with the `status` parameter). That method will look 
differently to the one we're adding here though, as it will need to call a 
builtin that does the load directly and also returns the status bit.

I hope that we can add the other load methods here too, but if not we can 
change the naming as needed.

https://github.com/llvm/llvm-project/pull/117018
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to