Skip to content

Conversation

hekota
Copy link
Member

@hekota hekota commented Aug 29, 2025

Adds assert as requested in #152454 (comment).

@hekota hekota requested review from llvm-beanz and shafik August 29, 2025 20:12
@hekota hekota changed the title [HLSL][NFC] Add assert to verify the implicit binding resource attribute exists [HLSL][NFC] Add assert to verify implicit binding resource attribute exists Aug 29, 2025
@hekota hekota marked this pull request as ready for review August 29, 2025 20:13
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. HLSL HLSL Language Support labels Aug 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 29, 2025

@llvm/pr-subscribers-hlsl

@llvm/pr-subscribers-clang-codegen

Author: Helena Kotas (hekota)

Changes

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

1 Files Affected:

  • (modified) clang/lib/CodeGen/CGHLSLRuntime.cpp (+1)
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);

Copy link
Collaborator

@shafik shafik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hekota hekota merged commit a953219 into llvm:main Sep 3, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category HLSL HLSL Language Support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants