[llvm] [HLSL] Diagnose overlapping resource bindings (PR #140982)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 13:59:41 PDT 2025


================
@@ -50,15 +51,55 @@ static void reportInvalidDirection(Module &M, DXILResourceMap &DRM) {
   }
 }
 
-} // namespace
+static void reportOverlappingError(Module &M, ResourceInfo R1,
+                                   ResourceInfo R2) {
+  SmallString<64> Message;
+  raw_svector_ostream OS(Message);
+  OS << "resource " << R1.getName() << " at register "
+     << R1.getBinding().LowerBound << " overlaps with resource " << R2.getName()
+     << " at register " << R2.getBinding().LowerBound << ", space "
+     << R2.getBinding().Space;
----------------
bogner wrote:

It makes sense to only mention the space once, but I think using the `N, space M` syntax for just one of the bindings reads a little funny. Maybe " in space M" would be better?
```suggestion
     << " at register " << R2.getBinding().LowerBound << " in space "
     << R2.getBinding().Space;
```

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


More information about the llvm-commits mailing list