[clang] Attach resource attributes to handle within record, instead of record (PR #101433)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 31 17:11:57 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 7583c484c81218ab4c8c2fba2774cb518d8bbd43 b17ddcc6f2081135125d6178b22d033bcf7c0998 --extensions cpp -- clang/lib/CodeGen/CGHLSLRuntime.cpp clang/lib/Sema/HLSLExternalSemaSource.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index a475d46966..defc79683e 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -280,7 +280,7 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) {
const auto *RD = Ty->getAsCXXRecordDecl();
if (!RD)
return;
- // the resource related attributes are on the handle member
+ // the resource related attributes are on the handle member
// inside the record decl
for (auto *FD : RD->fields()) {
const auto *HLSLResAttr = FD->getAttr<HLSLResourceAttr>();
@@ -295,7 +295,7 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) {
BufferResBinding Binding(D->getAttr<HLSLResourceBindingAttr>());
addBufferResourceAnnotation(GV, RC, RK, IsROV, ET, Binding);
- }
+ }
}
CGHLSLRuntime::BufferResBinding::BufferResBinding(
diff --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp
index e651f9cd96..2f3aaa0bb2 100644
--- a/clang/lib/Sema/HLSLExternalSemaSource.cpp
+++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp
@@ -101,9 +101,9 @@ struct BuiltinTypeDeclBuilder {
return *this;
}
- BuiltinTypeDeclBuilder &addHandleMember(
- ResourceClass RC, ResourceKind RK,
- bool IsROV, AccessSpecifier Access = AccessSpecifier::AS_private) {
+ BuiltinTypeDeclBuilder &
+ addHandleMember(ResourceClass RC, ResourceKind RK, bool IsROV,
+ AccessSpecifier Access = AccessSpecifier::AS_private) {
if (Record->isCompleteDefinition())
return *this;
QualType Ty = Record->getASTContext().VoidPtrTy;
``````````
</details>
https://github.com/llvm/llvm-project/pull/101433
More information about the cfe-commits
mailing list