[clang] [HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (PR #117017)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 20 09:57:49 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 012dd8be4b5a4c00deb22345c630990f160b3aa3 a4e932c29bddb78bd287cabca2e9ea0da6c96337 --extensions cpp -- clang/lib/AST/Type.cpp clang/lib/CodeGen/CGBuiltin.cpp clang/lib/Sema/HLSLExternalSemaSource.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaHLSL.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp
index 4df2893473..2f6d749408 100644
--- a/clang/lib/Sema/HLSLExternalSemaSource.cpp
+++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp
@@ -257,9 +257,9 @@ struct BuiltinTypeDeclBuilder {
         lookupBuiltinFunction(AST, S, "__builtin_hlsl_resource_getpointer");
     // TODO: Map to an hlsl_device address space.
     QualType ElemPtrTy = AST.getPointerType(ElemTy);
-    Expr *Call = CallExpr::Create(AST, Builtin, {HandleExpr, IndexExpr},
-                                  ElemPtrTy, VK_PRValue,
-                                  SourceLocation(), FPOptionsOverride());
+    Expr *Call =
+        CallExpr::Create(AST, Builtin, {HandleExpr, IndexExpr}, ElemPtrTy,
+                         VK_PRValue, SourceLocation(), FPOptionsOverride());
     Expr *Deref = UnaryOperator::Create(
         AST, Call, UO_Deref, ElemTy, VK_PRValue, OK_Ordinary, SourceLocation(),
         /*CanOverflow=*/false, FPOptionsOverride());

``````````

</details>


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


More information about the cfe-commits mailing list