]> granicus.if.org Git - llvm/commitdiff
[NFC] Remove LLVM_ALIGNAS
authorJF Bastien <jfbastien@apple.com>
Wed, 31 Jul 2019 03:22:08 +0000 (03:22 +0000)
committerJF Bastien <jfbastien@apple.com>
Wed, 31 Jul 2019 03:22:08 +0000 (03:22 +0000)
Summary: The minimum compilers support all have alignas, and we don't use LLVM_ALIGNAS anywhere anymore. This also removes an MSVC diagnostic which, according to the comment above, isn't relevant anymore.

Reviewers: rnk

Subscribers: mgorny, jkorous, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D65458

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367383 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake
docs/doxygen.cfg.in
include/llvm/Support/Compiler.h
unittests/Support/AlignOfTest.cpp

index a243507791a65f0708f44df3fa4a488808409a8d..f9cb5d31021fee56cfad4047b48fed91e95f6515 100644 (file)
@@ -530,14 +530,6 @@ if (MSVC)
           # is fixed.
       -wd4709 # Suppress comma operator within array index expression
 
-      # Ideally, we'd like this warning to be enabled, but MSVC 2013 doesn't
-      # support the 'aligned' attribute in the way that clang sources requires (for
-      # any code that uses the LLVM_ALIGNAS macro), so this is must be disabled to
-      # avoid unwanted alignment warnings.
-      # When we switch to requiring a version of MSVC that supports the 'alignas'
-      # specifier (MSVC 2015?) this warning can be re-enabled.
-      -wd4324 # Suppress 'structure was padded due to __declspec(align())'
-
       # Promoted warnings.
       -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.
 
index a8e84a31276257e8918c00edf0e4eef56274d515..fe74edc0866f96a0de4a712db9cef9513f4bc782 100644 (file)
@@ -1926,7 +1926,7 @@ INCLUDE_FILE_PATTERNS  =
 # recursively expanded use the := operator instead of the = operator.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-PREDEFINED             = LLVM_ALIGNAS(x)=
+PREDEFINED             =
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
index 3f4f465f39606bfbaaa35d42dce239fe5820d51b..356ff6f04861e4f8a06b5c9d95fa86f409f5cda1 100644 (file)
 # define LLVM_ASSUME_ALIGNED(p, a) (p)
 #endif
 
-/// \macro LLVM_ALIGNAS
-/// Used to specify a minimum alignment for a structure or variable.
-#if __GNUC__ && !__has_feature(cxx_alignas) && !LLVM_GNUC_PREREQ(4, 8, 1)
-# define LLVM_ALIGNAS(x) __attribute__((aligned(x)))
-#else
-# define LLVM_ALIGNAS(x) alignas(x)
-#endif
-
 /// \macro LLVM_PACKED
 /// Used to specify a packed structure.
 /// LLVM_PACKED(
 
 /// \macro LLVM_PTR_SIZE
 /// A constant integer equivalent to the value of sizeof(void*).
-/// Generally used in combination with LLVM_ALIGNAS or when doing computation in
-/// the preprocessor.
+/// Generally used in combination with alignas or when doing computation in the
+/// preprocessor.
 #ifdef __SIZEOF_POINTER__
 # define LLVM_PTR_SIZE __SIZEOF_POINTER__
 #elif defined(_WIN64)
index 780af95e2ab54c79e4496e9255f0f4da5385c7a1..d8cabde6c727ae4da90f25e6fa4b534a3a19c513 100644 (file)
@@ -38,10 +38,10 @@ namespace {
 #endif
 
 // Define some fixed alignment types to use in these tests.
-struct LLVM_ALIGNAS(1) A1 {};
-struct LLVM_ALIGNAS(2) A2 {};
-struct LLVM_ALIGNAS(4) A4 {};
-struct LLVM_ALIGNAS(8) A8 {};
+struct alignas(1) A1 {};
+struct alignas(2) A2 {};
+struct alignas(4) A4 {};
+struct alignas(8) A8 {};
 
 struct S1 {};
 struct S2 { char a; };