[clang] [Clang] Reduce the size of Decl and classes derived from it (PR #87361)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 09:05:29 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 5b544b511c7133fcb26a5c563b746a4baefb38d6 b8a626116b0719c1acf75e9e7300df8e2bf82f99 -- clang/include/clang/AST/DeclBase.h clang/lib/AST/DeclBase.cpp clang/lib/Serialization/ASTReaderDecl.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index 172bd581b5..58da2a22c4 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -530,7 +530,9 @@ public:
     return AccessSpecifier(Access);
   }
 
-  bool hasAttrs() const { return DeclCtxWithInvalidDeclAndHasAttrs.getPointer().getInt(); }
+  bool hasAttrs() const {
+    return DeclCtxWithInvalidDeclAndHasAttrs.getPointer().getInt();
+  }
 
   void setAttrs(const AttrVec& Attrs) {
     return setAttrsImpl(Attrs, getASTContext());
@@ -559,7 +561,8 @@ public:
   }
 
   template <typename... Ts> void dropAttrs() {
-    if (!hasAttrs()) return;
+    if (!hasAttrs())
+      return;
 
     AttrVec &Vec = getAttrs();
     llvm::erase_if(Vec, [](Attr *A) { return isa<Ts...>(A); });

``````````

</details>


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


More information about the cfe-commits mailing list