[clang] [HLSL] Implement TransformHLSLAttributedResourceType (PR #106673)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 23:59:07 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 b65fc7e91a20904a08e28a51fbf98137e94ae262 f060654648707f3bf7ecf68b01db8d7c0a8b2bf6 --extensions h -- clang/include/clang/AST/TypeLoc.h clang/lib/Sema/TreeTransform.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h
index 2826bedd12..03fbdcf601 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/include/clang/AST/TypeLoc.h
@@ -952,7 +952,7 @@ class HLSLAttributedResourceTypeLoc
 public:
   TypeLoc getWrappedLoc() const { return getInnerTypeLoc(); }
 
-  TypeLoc getContainedLoc() const { 
+  TypeLoc getContainedLoc() const {
     return TypeLoc(getTypePtr()->getContainedType(), getNonLocalData());
   }
 
@@ -962,7 +962,9 @@ public:
     setSourceRange(SourceRange());
   }
   QualType getInnerType() const { return getTypePtr()->getWrappedType(); }
-  unsigned getLocalDataSize() const { return sizeof(HLSLAttributedResourceLocInfo); }
+  unsigned getLocalDataSize() const {
+    return sizeof(HLSLAttributedResourceLocInfo);
+  }
 };
 
 struct ObjCObjectTypeLocInfo {
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index feb0481ccd..0513e7b13b 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -7474,8 +7474,7 @@ QualType TreeTransform<Derived>::TransformHLSLAttributedResourceType(
     ContainedTy = getDerived().TransformType(TLB, TL.getContainedLoc());
 
   QualType Result = TL.getType();
-  if (getDerived().AlwaysRebuild() ||
-      WrappedTy != oldType->getWrappedType() || 
+  if (getDerived().AlwaysRebuild() || WrappedTy != oldType->getWrappedType() ||
       ContainedTy != oldType->getContainedType()) {
     Result = SemaRef.Context.getHLSLAttributedResourceType(
         WrappedTy, ContainedTy, oldType->getAttrs());

``````````

</details>


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


More information about the cfe-commits mailing list