[clang] [HLSL][NFC] Add assert to verify implicit binding resource attribute exists (PR #156094)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 29 13:14:13 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: Helena Kotas (hekota)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/156094.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CGHLSLRuntime.cpp (+1) 


``````````diff
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index 12ece217ba563..d0be339f2a671 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -180,6 +180,7 @@ static void createResourceCtorArgs(CodeGenModule &CGM, CXXConstructorDecl *CD,
 
   } else {
     // implicit binding
+    assert(RBA && "missing implicit binding attribute");
     auto *OrderID =
         llvm::ConstantInt::get(CGM.IntTy, RBA->getImplicitBindingOrderID());
     Args.add(RValue::get(Space), AST.UnsignedIntTy);

``````````

</details>


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


More information about the cfe-commits mailing list