[clang] Implement resource binding type prefix mismatch errors (PR #87578)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 10 09:28:14 PDT 2024
================
@@ -482,15 +484,18 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S,
bool IsROV) {
return BuiltinTypeDeclBuilder(Decl)
.addHandleMember()
- .addDefaultHandleConstructor(S, RC)
- .annotateResourceClass(RC, RK, IsROV);
+ .addDefaultHandleConstructor(S, RC);
}
void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
CXXRecordDecl *Decl;
- Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RWBuffer")
- .addSimpleTemplateParams({"element_type"})
- .Record;
+ Decl =
+ BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RWBuffer")
+ .addSimpleTemplateParams({"element_type"})
+ .annotateResourceClass(ResourceClass::UAV, ResourceKind::TypedBuffer,
+ /*IsROV=*/false)
+ .Record;
+
----------------
bogner wrote:
Do we actually need to move the `annotateResourceClass` call to the forward declaration here, or can we get away with leaving it on the `onCompletion` callback? It's unfortunate that we need to repeat the resource class if we have to do it this way.
Further, if we do need to move this, `setupBufferType` should be updated to remove the extra parameters, or maybe even removed completely since it really doesn't do much anymore.
https://github.com/llvm/llvm-project/pull/87578
More information about the cfe-commits
mailing list