diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-08 22:28:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-08 22:28:34 +0000 |
commit | 53b06db6c7d45963be4a0e847a77447c93c1e045 (patch) | |
tree | 33c5978b12cff2de15d6132916de4fe98ca04102 /include/llvm/ADT/SmallVector.h | |
parent | 7138234bafedf3fc3b9099d3d4bb7c062eb49c6a (diff) | |
download | llvm-53b06db6c7d45963be4a0e847a77447c93c1e045.tar.gz llvm-53b06db6c7d45963be4a0e847a77447c93c1e045.tar.bz2 llvm-53b06db6c7d45963be4a0e847a77447c93c1e045.tar.xz |
Fix PR897
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/SmallVector.h')
-rw-r--r-- | include/llvm/ADT/SmallVector.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index e3aec7fec0..d0e898d68b 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. |