From: Chris Lattner Date: Sun, 8 Oct 2006 22:28:34 +0000 (+0000) Subject: Fix PR897 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=53b06db6c7d45963be4a0e847a77447c93c1e045;p=oota-llvm.git Fix PR897 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30820 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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.