mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
[support] Add a macro wrapper for alignas and simplify some code.
We wrap __attribute((aligned)) for GCC 4.7 and __declspec(align) for MSVC. The latter behaves weird in some contexts so this should be used carefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -39,24 +39,10 @@ namespace {
|
||||
#endif
|
||||
|
||||
// Define some fixed alignment types to use in these tests.
|
||||
#if __has_feature(cxx_alignas)
|
||||
struct alignas(1) A1 { };
|
||||
struct alignas(2) A2 { };
|
||||
struct alignas(4) A4 { };
|
||||
struct alignas(8) A8 { };
|
||||
#elif defined(__GNUC__)
|
||||
struct A1 { } __attribute__((aligned(1)));
|
||||
struct A2 { } __attribute__((aligned(2)));
|
||||
struct A4 { } __attribute__((aligned(4)));
|
||||
struct A8 { } __attribute__((aligned(8)));
|
||||
#elif defined(_MSC_VER)
|
||||
__declspec(align(1)) struct A1 { };
|
||||
__declspec(align(2)) struct A2 { };
|
||||
__declspec(align(4)) struct A4 { };
|
||||
__declspec(align(8)) struct A8 { };
|
||||
#else
|
||||
# error No supported align as directive.
|
||||
#endif
|
||||
struct LLVM_ALIGNAS(1) A1 {};
|
||||
struct LLVM_ALIGNAS(2) A2 {};
|
||||
struct LLVM_ALIGNAS(4) A4 {};
|
||||
struct LLVM_ALIGNAS(8) A8 {};
|
||||
|
||||
struct S1 {};
|
||||
struct S2 { char a; };
|
||||
|
Reference in New Issue
Block a user