From 53b06db6c7d45963be4a0e847a77447c93c1e045 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 8 Oct 2006 22:28:34 +0000 Subject: [PATCH] Fix PR897 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30820 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallVector.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index e3aec7fec05..d0e898d68bb 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -33,12 +33,17 @@ class SmallVectorImpl { // aligned sufficiently. Instead, we either use GCC extensions, or some // number of union instances for the space, which guarantee maximal alignment. protected: +#ifdef __GNUC__ + typedef char U; + U FirstEl __attribute__((aligned(__alignof__(double)))); +#else union U { double D; long double LD; long long L; void *P; } FirstEl; +#endif // Space after 'FirstEl' is clobbered, do not add any instance vars after it. public: // Default ctor - Initialize to empty.