[llvm] [llvm][NFC] A couple cleanups in `TrailingObjects` (PR #162521)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 11:22:10 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Victor Chernyakin (localspook)

<details>
<summary>Changes</summary>

1. `verifyTrailingObjectsAlignment` is unused.
2. To spell out the name of a templated base class, we don't need to repeat all of its template arguments.

---
Full diff: https://github.com/llvm/llvm-project/pull/162521.diff


1 Files Affected:

- (modified) llvm/include/llvm/Support/TrailingObjects.h (+1-6) 


``````````diff
diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h
index dc03285c4994b..133ca4ad63836 100644
--- a/llvm/include/llvm/Support/TrailingObjects.h
+++ b/llvm/include/llvm/Support/TrailingObjects.h
@@ -182,8 +182,6 @@ class alignas(Align) TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy>
   static constexpr size_t additionalSizeToAllocImpl(size_t SizeSoFar) {
     return SizeSoFar;
   }
-
-  template <bool CheckAlignment> static void verifyTrailingObjectsAlignment() {}
 };
 
 } // end namespace trailing_objects_internal
@@ -203,10 +201,7 @@ class TrailingObjects
 
   template <typename... Tys> class Foo {};
 
-  typedef trailing_objects_internal::TrailingObjectsImpl<
-      trailing_objects_internal::MaxAlignment<TrailingTys...>, BaseTy,
-      TrailingObjects<BaseTy, TrailingTys...>, BaseTy, TrailingTys...>
-      ParentType;
+  using ParentType = TrailingObjects::TrailingObjectsImpl;
   using TrailingObjectsBase = trailing_objects_internal::TrailingObjectsBase;
 
   using ParentType::getTrailingObjectsImpl;

``````````

</details>


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


More information about the llvm-commits mailing list