[PATCH] D77823: scudo: Replace ALIGNED macro with standard alignas specifier.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 14:43:46 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG9c86b83ffc8f: scudo: Replace ALIGNED macro with standard alignas specifier. (authored by pcc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77823/new/

https://reviews.llvm.org/D77823

Files:
  compiler-rt/lib/scudo/standalone/atomic_helpers.h
  compiler-rt/lib/scudo/standalone/internal_defs.h
  compiler-rt/lib/scudo/standalone/primary32.h
  compiler-rt/lib/scudo/standalone/primary64.h
  compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
  compiler-rt/lib/scudo/standalone/tsd.h


Index: compiler-rt/lib/scudo/standalone/tsd.h
===================================================================
--- compiler-rt/lib/scudo/standalone/tsd.h
+++ compiler-rt/lib/scudo/standalone/tsd.h
@@ -23,7 +23,7 @@
 
 namespace scudo {
 
-template <class Allocator> struct ALIGNED(SCUDO_CACHE_LINE_SIZE) TSD {
+template <class Allocator> struct alignas(SCUDO_CACHE_LINE_SIZE) TSD {
   typename Allocator::CacheT Cache;
   typename Allocator::QuarantineCacheT QuarantineCache;
   u8 DestructorIterations;
Index: compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
@@ -52,7 +52,7 @@
   static const scudo::u32 Size = 64U;
   typedef scudo::u64 T;
   scudo::HybridMutex &Mutex;
-  ALIGNED(SCUDO_CACHE_LINE_SIZE) T Data[Size];
+  alignas(SCUDO_CACHE_LINE_SIZE) T Data[Size];
 };
 
 const scudo::u32 NumberOfThreads = 8;
Index: compiler-rt/lib/scudo/standalone/primary64.h
===================================================================
--- compiler-rt/lib/scudo/standalone/primary64.h
+++ compiler-rt/lib/scudo/standalone/primary64.h
@@ -231,7 +231,7 @@
     u64 LastReleaseAtNs;
   };
 
-  struct ALIGNED(SCUDO_CACHE_LINE_SIZE) RegionInfo {
+  struct alignas(SCUDO_CACHE_LINE_SIZE) RegionInfo {
     HybridMutex Mutex;
     SinglyLinkedList<TransferBatch> FreeList;
     RegionStats Stats;
Index: compiler-rt/lib/scudo/standalone/primary32.h
===================================================================
--- compiler-rt/lib/scudo/standalone/primary32.h
+++ compiler-rt/lib/scudo/standalone/primary32.h
@@ -225,7 +225,7 @@
     u64 LastReleaseAtNs;
   };
 
-  struct ALIGNED(SCUDO_CACHE_LINE_SIZE) SizeClassInfo {
+  struct alignas(SCUDO_CACHE_LINE_SIZE) SizeClassInfo {
     HybridMutex Mutex;
     SinglyLinkedList<TransferBatch> FreeList;
     uptr CurrentRegion;
Index: compiler-rt/lib/scudo/standalone/internal_defs.h
===================================================================
--- compiler-rt/lib/scudo/standalone/internal_defs.h
+++ compiler-rt/lib/scudo/standalone/internal_defs.h
@@ -33,9 +33,6 @@
 #define WEAK __attribute__((weak))
 #define ALWAYS_INLINE inline __attribute__((always_inline))
 #define ALIAS(X) __attribute__((alias(X)))
-// Please only use the ALIGNED macro before the type. Using ALIGNED after the
-// variable declaration is not portable.
-#define ALIGNED(X) __attribute__((aligned(X)))
 #define FORMAT(F, A) __attribute__((format(printf, F, A)))
 #define NOINLINE __attribute__((noinline))
 #define NORETURN __attribute__((noreturn))
Index: compiler-rt/lib/scudo/standalone/atomic_helpers.h
===================================================================
--- compiler-rt/lib/scudo/standalone/atomic_helpers.h
+++ compiler-rt/lib/scudo/standalone/atomic_helpers.h
@@ -51,7 +51,7 @@
 struct atomic_u64 {
   typedef u64 Type;
   // On 32-bit platforms u64 is not necessarily aligned on 8 bytes.
-  ALIGNED(8) volatile Type ValDoNotUse;
+  alignas(8) volatile Type ValDoNotUse;
 };
 
 struct atomic_uptr {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77823.256417.patch
Type: text/x-patch
Size: 3140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200409/9c736cfc/attachment.bin>


More information about the llvm-commits mailing list