Skip to content

Commit 846a9fb

Browse files
committed
Add error for undefined cbuffer handle.
1 parent b562bf1 commit 846a9fb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Target/SPIRV/SPIRVCBufferAccess.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ static bool replaceCBufferAccesses(Module &M) {
5959

6060
for (const hlsl::CBufferMapping &Mapping : *CBufMD) {
6161
Instruction *HandleDef = findHandleDef(Mapping.Handle);
62-
// TODO: Issue error if HandleDef is nullptr.
62+
if (!HandleDef) {
63+
report_fatal_error("Could not find handle definition for cbuffer: " +
64+
Mapping.Handle->getName());
65+
}
6366

6467
// The handle definition should dominate all uses of the cbuffer members.
6568
// We'll insert our getpointer calls right after it.

0 commit comments

Comments
 (0)