Skip to content

Conversation

localspook
Copy link
Contributor

  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.

@llvmbot
Copy link
Member

llvmbot commented Oct 8, 2025

@llvm/pr-subscribers-llvm-support

Author: Victor Chernyakin (localspook)

Changes
  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 --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;

@localspook localspook force-pushed the trailing-objects-refactor branch from b796a22 to 01d37fa Compare October 8, 2025 18:43
Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@localspook localspook merged commit ab2c145 into llvm:main Oct 8, 2025
7 of 8 checks passed
@localspook localspook deleted the trailing-objects-refactor branch October 8, 2025 20:32
svkeerthy pushed a commit that referenced this pull request Oct 9, 2025
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.
clingfei pushed a commit to clingfei/llvm-project that referenced this pull request Oct 10, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants