diff options
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 16 | ||||
-rw-r--r-- | include/llvm/Support/Allocator.h | 4 |
2 files changed, 5 insertions, 15 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 1d6181a95d..4efd6c7490 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -59,17 +59,11 @@ protected: // something else. An array of char would work great, but might not be // aligned sufficiently. Instead, we either use GCC extensions, or some // number of union instances for the space, which guarantee maximal alignment. - struct U { -#ifdef __GNUC__ - char X __attribute__((aligned(8))); -#else - union { - double D; - long double LD; - long long L; - void *P; - } X; -#endif + union U { + double D; + long double LD; + long long L; + void *P; } FirstEl; // Space after 'FirstEl' is clobbered, do not add any instance vars after it. diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 4a7251fa1e..0b7151a72c 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -221,16 +221,12 @@ public: inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) { struct S { char c; -#ifdef __GNUC__ - char x __attribute__((aligned)); -#else union { double D; long double LD; long long L; void *P; } x; -#endif }; return Allocator.Allocate(Size, std::min((size_t)llvm::NextPowerOf2(Size), offsetof(S, x))); |