Author: Benjamin Chetioui Date: 2025-08-12T16:38:16+02:00 New Revision: b9e3a814ee9387ab02640d7b34261830782ea598
URL: https://github.com/llvm/llvm-project/commit/b9e3a814ee9387ab02640d7b34261830782ea598 DIFF: https://github.com/llvm/llvm-project/commit/b9e3a814ee9387ab02640d7b34261830782ea598.diff LOG: Revert "[ADT] Simplify getFirstEl (NFC) (#153127)" This reverts commit 478aa0270915d9866bd3fe6fa2a4d156c6b473a8. Added: Modified: llvm/include/llvm/ADT/SmallVector.h Removed: ################################################################################ diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h index 6da519adcee6f..80f7734b86907 100644 --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -128,8 +128,8 @@ class SmallVectorTemplateCommon /// SmallVectorStorage is properly-aligned even for small-size of 0. void *getFirstEl() const { return const_cast<void *>(reinterpret_cast<const void *>( - reinterpret_cast<const SmallVectorAlignmentAndSize<T> *>(this) - ->FirstEl)); + reinterpret_cast<const char *>(this) + + offsetof(SmallVectorAlignmentAndSize<T>, FirstEl))); } // Space after 'FirstEl' is clobbered, do not add any instance vars after it. _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
