[llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h

Chris Lattner sabre at nondot.org
Sun Oct 8 17:28:48 CDT 2006



Changes in directory llvm/include/llvm/ADT:

SmallVector.h updated: 1.18 -> 1.19
---
Log message:

Fix PR897: http://llvm.org/PR897 


---
Diffs of the changes:  (+5 -0)

 SmallVector.h |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/ADT/SmallVector.h
diff -u llvm/include/llvm/ADT/SmallVector.h:1.18 llvm/include/llvm/ADT/SmallVector.h:1.19
--- llvm/include/llvm/ADT/SmallVector.h:1.18	Fri Sep  1 01:08:16 2006
+++ llvm/include/llvm/ADT/SmallVector.h	Sun Oct  8 17:28:34 2006
@@ -33,12 +33,17 @@
   // 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.






More information about the llvm-commits mailing list