[SVN-Commit] r1609 - in trunk: mail/thunderbird/files www/firefox-esr/files www/firefox-nightly/files www/firefox/files www/libxul/files www/seamonkey/files
svn-freebsd-gecko at chruetertee.ch
svn-freebsd-gecko at chruetertee.ch
Sun Jun 22 04:24:48 UTC 2014
Author: jbeich
Date: Sun Jun 22 04:24:32 2014
New Revision: 1609
Log:
fix generated code to contain explicit alignment
Added:
trunk/mail/thunderbird/files/patch-bug1026499
trunk/mail/thunderbird/files/patch-bug779713
trunk/www/firefox-esr/files/patch-bug1026499
trunk/www/firefox-esr/files/patch-bug779713
trunk/www/firefox-nightly/files/patch-bug1026499
trunk/www/firefox-nightly/files/patch-bug779713
trunk/www/firefox/files/patch-bug1026499
trunk/www/firefox/files/patch-bug779713
trunk/www/libxul/files/patch-bug1026499
trunk/www/libxul/files/patch-bug779713
trunk/www/seamonkey/files/patch-bug1026499
trunk/www/seamonkey/files/patch-bug779713
Added: trunk/mail/thunderbird/files/patch-bug1026499
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug1026499 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,68 @@
+commit 8d0efe4
+Author: Martin Husemann <martin at NetBSD.org>
+Date: Wed Jun 18 18:12:22 2014 +0200
+
+ Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg
+---
+ ipc/ipdl/ipdl/cxx/ast.py | 7 ++++---
+ ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++-
+ ipc/ipdl/ipdl/lower.py | 2 +-
+ 4 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py
+index 3180a65..c2d945b 100644
+--- mozilla/ipc/ipdl/ipdl/cxx/ast.py
++++ mozilla/ipc/ipdl/ipdl/cxx/ast.py
+@@ -336,12 +336,13 @@ Type.VOID = Type('void')
+ Type.VOIDPTR = Type('void', ptr=1)
+
+ class TypeArray(Node):
+- def __init__(self, basetype, nmemb):
+- '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr'''
++ def __init__(self, basetype, nmemb, alignType):
++ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type'''
+ self.basetype = basetype
+ self.nmemb = nmemb
++ self.alignType = alignType
+ def __deepcopy__(self, memo):
+- return TypeArray(deepcopy(self.basetype, memo), nmemb)
++ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType)
+
+ class TypeEnum(Node):
+ def __init__(self, name=None):
+diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py
+index 48b0988..bc914cf 100644
+--- mozilla/ipc/ipdl/ipdl/cxx/cgen.py
++++ mozilla/ipc/ipdl/ipdl/cxx/cgen.py
+@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor):
+ def visitDecl(self, d):
+ # C-syntax arrays make code generation much more annoying
+ if isinstance(d.type, TypeArray):
++ self.write('MOZ_ALIGNED_DECL(')
+ d.type.basetype.accept(self)
+ else:
+ d.type.accept(self)
+@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor):
+ if isinstance(d.type, TypeArray):
+ self.write('[')
+ d.type.nmemb.accept(self)
+- self.write(']')
++ self.write('], MOZ_ALIGNOF(')
++ d.type.alignType.accept(self)
++ self.write('))')
+
+ def visitParam(self, p):
+ self.visitDecl(p)
+diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py
+index e97a34c..9360f3c 100644
+--- mozilla/ipc/ipdl/ipdl/lower.py
++++ mozilla/ipc/ipdl/ipdl/lower.py
+@@ -768,7 +768,7 @@ IPDL union type."""
+ if self.recursive:
+ return self.ptrToType()
+ else:
+- return TypeArray(Type('char'), ExprSizeof(self.internalType()))
++ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType())
+
+ def unionValue(self):
+ # NB: knows that Union's storage C union is named |mValue|
Added: trunk/mail/thunderbird/files/patch-bug779713
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-bug779713 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,72 @@
+diff --git mfbt/Util.h mfbt/Util.h
+index e0843ca..353ec36 100644
+--- mozilla/mfbt/Util.h
++++ mozilla/mfbt/Util.h
+@@ -19,6 +19,13 @@
+
+ namespace mozilla {
+
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++#define MOZ_ALIGNOF(T) alignof(T)
++#elif defined(__GNUC__)
++#define MOZ_ALIGNOF(T) __alignof__(T)
++#elif defined(_MSC_VER)
++#define MOZ_ALIGNOF(T) __alignof(T)
++#else
+ /*
+ * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many
+ * bytes of alignment a given type needs.
+@@ -37,6 +44,7 @@ class AlignmentFinder
+ };
+
+ #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
++#endif
+
+ /*
+ * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
+@@ -48,7 +56,10 @@ class AlignmentFinder
+ * will declare a two-character array |arr| aligned to 8 bytes.
+ */
+
+-#if defined(__GNUC__)
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++# define MOZ_ALIGNED_DECL(_type, _align) \
++ alignas(_align) _type
++#elif defined(__GNUC__)
+ # define MOZ_ALIGNED_DECL(_type, _align) \
+ _type __attribute__((aligned(_align)))
+ #elif defined(_MSC_VER)
+diff --git mfbt/Attributes.h mfbt/Attributes.h
+index d317766..ddb13da 100644
+--- mozilla/mfbt/Attributes.h
++++ mozilla/mfbt/Attributes.h
+@@ -67,6 +67,9 @@
+ # ifndef __has_extension
+ # define __has_extension __has_feature /* compatibility, for older versions of clang */
+ # endif
++# if __has_extension(cxx_alignas)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if __has_extension(cxx_constexpr)
+ # define MOZ_HAVE_CXX11_CONSTEXPR
+ # endif
+@@ -85,6 +88,9 @@
+ # endif
+ #elif defined(__GNUC__)
+ # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
++# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+ # define MOZ_HAVE_CXX11_OVERRIDE
+ # define MOZ_HAVE_CXX11_FINAL final
+@@ -102,6 +108,9 @@
+ # define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
+ # define MOZ_HAVE_NORETURN __attribute__((noreturn))
+ #elif defined(_MSC_VER)
++# if _MSC_VER >= 1800
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if _MSC_VER >= 1700
+ # define MOZ_HAVE_CXX11_FINAL final
+ # else
Added: trunk/www/firefox-esr/files/patch-bug1026499
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox-esr/files/patch-bug1026499 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,68 @@
+commit 8d0efe4
+Author: Martin Husemann <martin at NetBSD.org>
+Date: Wed Jun 18 18:12:22 2014 +0200
+
+ Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg
+---
+ ipc/ipdl/ipdl/cxx/ast.py | 7 ++++---
+ ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++-
+ ipc/ipdl/ipdl/lower.py | 2 +-
+ 4 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py
+index 3180a65..c2d945b 100644
+--- ipc/ipdl/ipdl/cxx/ast.py
++++ ipc/ipdl/ipdl/cxx/ast.py
+@@ -336,12 +336,13 @@ Type.VOID = Type('void')
+ Type.VOIDPTR = Type('void', ptr=1)
+
+ class TypeArray(Node):
+- def __init__(self, basetype, nmemb):
+- '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr'''
++ def __init__(self, basetype, nmemb, alignType):
++ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type'''
+ self.basetype = basetype
+ self.nmemb = nmemb
++ self.alignType = alignType
+ def __deepcopy__(self, memo):
+- return TypeArray(deepcopy(self.basetype, memo), nmemb)
++ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType)
+
+ class TypeEnum(Node):
+ def __init__(self, name=None):
+diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py
+index 48b0988..bc914cf 100644
+--- ipc/ipdl/ipdl/cxx/cgen.py
++++ ipc/ipdl/ipdl/cxx/cgen.py
+@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor):
+ def visitDecl(self, d):
+ # C-syntax arrays make code generation much more annoying
+ if isinstance(d.type, TypeArray):
++ self.write('MOZ_ALIGNED_DECL(')
+ d.type.basetype.accept(self)
+ else:
+ d.type.accept(self)
+@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor):
+ if isinstance(d.type, TypeArray):
+ self.write('[')
+ d.type.nmemb.accept(self)
+- self.write(']')
++ self.write('], MOZ_ALIGNOF(')
++ d.type.alignType.accept(self)
++ self.write('))')
+
+ def visitParam(self, p):
+ self.visitDecl(p)
+diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py
+index e97a34c..9360f3c 100644
+--- ipc/ipdl/ipdl/lower.py
++++ ipc/ipdl/ipdl/lower.py
+@@ -768,7 +768,7 @@ IPDL union type."""
+ if self.recursive:
+ return self.ptrToType()
+ else:
+- return TypeArray(Type('char'), ExprSizeof(self.internalType()))
++ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType())
+
+ def unionValue(self):
+ # NB: knows that Union's storage C union is named |mValue|
Added: trunk/www/firefox-esr/files/patch-bug779713
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox-esr/files/patch-bug779713 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,72 @@
+diff --git mfbt/Util.h mfbt/Util.h
+index e0843ca..353ec36 100644
+--- mfbt/Util.h
++++ mfbt/Util.h
+@@ -19,6 +19,13 @@
+
+ namespace mozilla {
+
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++#define MOZ_ALIGNOF(T) alignof(T)
++#elif defined(__GNUC__)
++#define MOZ_ALIGNOF(T) __alignof__(T)
++#elif defined(_MSC_VER)
++#define MOZ_ALIGNOF(T) __alignof(T)
++#else
+ /*
+ * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many
+ * bytes of alignment a given type needs.
+@@ -37,6 +44,7 @@ class AlignmentFinder
+ };
+
+ #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
++#endif
+
+ /*
+ * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
+@@ -48,7 +56,10 @@ class AlignmentFinder
+ * will declare a two-character array |arr| aligned to 8 bytes.
+ */
+
+-#if defined(__GNUC__)
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++# define MOZ_ALIGNED_DECL(_type, _align) \
++ alignas(_align) _type
++#elif defined(__GNUC__)
+ # define MOZ_ALIGNED_DECL(_type, _align) \
+ _type __attribute__((aligned(_align)))
+ #elif defined(_MSC_VER)
+diff --git mfbt/Attributes.h mfbt/Attributes.h
+index d317766..ddb13da 100644
+--- mfbt/Attributes.h
++++ mfbt/Attributes.h
+@@ -67,6 +67,9 @@
+ # ifndef __has_extension
+ # define __has_extension __has_feature /* compatibility, for older versions of clang */
+ # endif
++# if __has_extension(cxx_alignas)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if __has_extension(cxx_constexpr)
+ # define MOZ_HAVE_CXX11_CONSTEXPR
+ # endif
+@@ -85,6 +88,9 @@
+ # endif
+ #elif defined(__GNUC__)
+ # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
++# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+ # define MOZ_HAVE_CXX11_OVERRIDE
+ # define MOZ_HAVE_CXX11_FINAL final
+@@ -102,6 +108,9 @@
+ # define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
+ # define MOZ_HAVE_NORETURN __attribute__((noreturn))
+ #elif defined(_MSC_VER)
++# if _MSC_VER >= 1800
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if _MSC_VER >= 1700
+ # define MOZ_HAVE_CXX11_FINAL final
+ # else
Added: trunk/www/firefox-nightly/files/patch-bug1026499
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox-nightly/files/patch-bug1026499 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,68 @@
+commit 8d0efe4
+Author: Martin Husemann <martin at NetBSD.org>
+Date: Wed Jun 18 18:12:22 2014 +0200
+
+ Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg
+---
+ ipc/ipdl/ipdl/cxx/ast.py | 7 ++++---
+ ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++-
+ ipc/ipdl/ipdl/lower.py | 2 +-
+ 4 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py
+index 3180a65..c2d945b 100644
+--- ipc/ipdl/ipdl/cxx/ast.py
++++ ipc/ipdl/ipdl/cxx/ast.py
+@@ -336,12 +336,13 @@ Type.VOID = Type('void')
+ Type.VOIDPTR = Type('void', ptr=1)
+
+ class TypeArray(Node):
+- def __init__(self, basetype, nmemb):
+- '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr'''
++ def __init__(self, basetype, nmemb, alignType):
++ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type'''
+ self.basetype = basetype
+ self.nmemb = nmemb
++ self.alignType = alignType
+ def __deepcopy__(self, memo):
+- return TypeArray(deepcopy(self.basetype, memo), nmemb)
++ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType)
+
+ class TypeEnum(Node):
+ def __init__(self, name=None):
+diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py
+index 48b0988..bc914cf 100644
+--- ipc/ipdl/ipdl/cxx/cgen.py
++++ ipc/ipdl/ipdl/cxx/cgen.py
+@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor):
+ def visitDecl(self, d):
+ # C-syntax arrays make code generation much more annoying
+ if isinstance(d.type, TypeArray):
++ self.write('MOZ_ALIGNED_DECL(')
+ d.type.basetype.accept(self)
+ else:
+ d.type.accept(self)
+@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor):
+ if isinstance(d.type, TypeArray):
+ self.write('[')
+ d.type.nmemb.accept(self)
+- self.write(']')
++ self.write('], MOZ_ALIGNOF(')
++ d.type.alignType.accept(self)
++ self.write('))')
+
+ def visitParam(self, p):
+ self.visitDecl(p)
+diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py
+index e97a34c..9360f3c 100644
+--- ipc/ipdl/ipdl/lower.py
++++ ipc/ipdl/ipdl/lower.py
+@@ -768,7 +768,7 @@ IPDL union type."""
+ if self.recursive:
+ return self.ptrToType()
+ else:
+- return TypeArray(Type('char'), ExprSizeof(self.internalType()))
++ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType())
+
+ def unionValue(self):
+ # NB: knows that Union's storage C union is named |mValue|
Added: trunk/www/firefox-nightly/files/patch-bug779713
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox-nightly/files/patch-bug779713 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,77 @@
+diff --git mfbt/Alignment.h mfbt/Alignment.h
+index e0843ca..353ec36 100644
+--- mfbt/Alignment.h
++++ mfbt/Alignment.h
+@@ -9,11 +9,20 @@
+ #ifndef mozilla_Alignment_h
+ #define mozilla_Alignment_h
+
++#include "mozilla/Attributes.h"
++
+ #include <stddef.h>
+ #include <stdint.h>
+
+ namespace mozilla {
+
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++#define MOZ_ALIGNOF(T) alignof(T)
++#elif defined(__GNUC__)
++#define MOZ_ALIGNOF(T) __alignof__(T)
++#elif defined(_MSC_VER)
++#define MOZ_ALIGNOF(T) __alignof(T)
++#else
+ /*
+ * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
+ * bytes of alignment a given type needs.
+@@ -32,6 +41,7 @@ public:
+ };
+
+ #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
++#endif
+
+ /*
+ * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
+@@ -43,7 +53,10 @@ public:
+ * will declare a two-character array |arr| aligned to 8 bytes.
+ */
+
+-#if defined(__GNUC__)
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++# define MOZ_ALIGNED_DECL(_type, _align) \
++ alignas(_align) _type
++#elif defined(__GNUC__)
+ # define MOZ_ALIGNED_DECL(_type, _align) \
+ _type __attribute__((aligned(_align)))
+ #elif defined(_MSC_VER)
+diff --git mfbt/Attributes.h mfbt/Attributes.h
+index d317766..ddb13da 100644
+--- mfbt/Attributes.h
++++ mfbt/Attributes.h
+@@ -51,6 +51,7 @@
+ * http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug
+ */
+ # if _MSC_VER >= 1800
++# define MOZ_HAVE_CXX11_ALIGNAS
+ # define MOZ_HAVE_CXX11_DELETE
+ # endif
+ # if _MSC_VER >= 1700
+@@ -74,6 +75,9 @@
+ # ifndef __has_extension
+ # define __has_extension __has_feature /* compatibility, for older versions of clang */
+ # endif
++# if __has_extension(cxx_alignas)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if __has_extension(cxx_constexpr)
+ # define MOZ_HAVE_CXX11_CONSTEXPR
+ # endif
+@@ -95,6 +99,9 @@
+ # endif
+ #elif defined(__GNUC__)
+ # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
++# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+ # define MOZ_HAVE_CXX11_OVERRIDE
+ # define MOZ_HAVE_CXX11_FINAL final
Added: trunk/www/firefox/files/patch-bug1026499
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox/files/patch-bug1026499 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,68 @@
+commit 8d0efe4
+Author: Martin Husemann <martin at NetBSD.org>
+Date: Wed Jun 18 18:12:22 2014 +0200
+
+ Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg
+---
+ ipc/ipdl/ipdl/cxx/ast.py | 7 ++++---
+ ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++-
+ ipc/ipdl/ipdl/lower.py | 2 +-
+ 4 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py
+index 3180a65..c2d945b 100644
+--- ipc/ipdl/ipdl/cxx/ast.py
++++ ipc/ipdl/ipdl/cxx/ast.py
+@@ -336,12 +336,13 @@ Type.VOID = Type('void')
+ Type.VOIDPTR = Type('void', ptr=1)
+
+ class TypeArray(Node):
+- def __init__(self, basetype, nmemb):
+- '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr'''
++ def __init__(self, basetype, nmemb, alignType):
++ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type'''
+ self.basetype = basetype
+ self.nmemb = nmemb
++ self.alignType = alignType
+ def __deepcopy__(self, memo):
+- return TypeArray(deepcopy(self.basetype, memo), nmemb)
++ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType)
+
+ class TypeEnum(Node):
+ def __init__(self, name=None):
+diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py
+index 48b0988..bc914cf 100644
+--- ipc/ipdl/ipdl/cxx/cgen.py
++++ ipc/ipdl/ipdl/cxx/cgen.py
+@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor):
+ def visitDecl(self, d):
+ # C-syntax arrays make code generation much more annoying
+ if isinstance(d.type, TypeArray):
++ self.write('MOZ_ALIGNED_DECL(')
+ d.type.basetype.accept(self)
+ else:
+ d.type.accept(self)
+@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor):
+ if isinstance(d.type, TypeArray):
+ self.write('[')
+ d.type.nmemb.accept(self)
+- self.write(']')
++ self.write('], MOZ_ALIGNOF(')
++ d.type.alignType.accept(self)
++ self.write('))')
+
+ def visitParam(self, p):
+ self.visitDecl(p)
+diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py
+index e97a34c..9360f3c 100644
+--- ipc/ipdl/ipdl/lower.py
++++ ipc/ipdl/ipdl/lower.py
+@@ -768,7 +768,7 @@ IPDL union type."""
+ if self.recursive:
+ return self.ptrToType()
+ else:
+- return TypeArray(Type('char'), ExprSizeof(self.internalType()))
++ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType())
+
+ def unionValue(self):
+ # NB: knows that Union's storage C union is named |mValue|
Added: trunk/www/firefox/files/patch-bug779713
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/firefox/files/patch-bug779713 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,77 @@
+diff --git mfbt/Alignment.h mfbt/Alignment.h
+index e0843ca..353ec36 100644
+--- mfbt/Alignment.h
++++ mfbt/Alignment.h
+@@ -9,11 +9,20 @@
+ #ifndef mozilla_Alignment_h
+ #define mozilla_Alignment_h
+
++#include "mozilla/Attributes.h"
++
+ #include <stddef.h>
+ #include <stdint.h>
+
+ namespace mozilla {
+
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++#define MOZ_ALIGNOF(T) alignof(T)
++#elif defined(__GNUC__)
++#define MOZ_ALIGNOF(T) __alignof__(T)
++#elif defined(_MSC_VER)
++#define MOZ_ALIGNOF(T) __alignof(T)
++#else
+ /*
+ * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
+ * bytes of alignment a given type needs.
+@@ -32,6 +41,7 @@ public:
+ };
+
+ #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
++#endif
+
+ /*
+ * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
+@@ -43,7 +53,10 @@ public:
+ * will declare a two-character array |arr| aligned to 8 bytes.
+ */
+
+-#if defined(__GNUC__)
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++# define MOZ_ALIGNED_DECL(_type, _align) \
++ alignas(_align) _type
++#elif defined(__GNUC__)
+ # define MOZ_ALIGNED_DECL(_type, _align) \
+ _type __attribute__((aligned(_align)))
+ #elif defined(_MSC_VER)
+diff --git mfbt/Attributes.h mfbt/Attributes.h
+index d317766..ddb13da 100644
+--- mfbt/Attributes.h
++++ mfbt/Attributes.h
+@@ -54,6 +54,9 @@
+ # ifndef __has_extension
+ # define __has_extension __has_feature /* compatibility, for older versions of clang */
+ # endif
++# if __has_extension(cxx_alignas)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if __has_extension(cxx_constexpr)
+ # define MOZ_HAVE_CXX11_CONSTEXPR
+ # endif
+@@ -75,6 +78,9 @@
+ # endif
+ #elif defined(__GNUC__)
+ # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
++# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+ # define MOZ_HAVE_CXX11_OVERRIDE
+ # define MOZ_HAVE_CXX11_FINAL final
+@@ -96,6 +102,7 @@
+ # define MOZ_HAVE_NORETURN __attribute__((noreturn))
+ #elif defined(_MSC_VER)
+ # if _MSC_VER >= 1800
++# define MOZ_HAVE_CXX11_ALIGNAS
+ # define MOZ_HAVE_CXX11_DELETE
+ # endif
+ # if _MSC_VER >= 1700
Added: trunk/www/libxul/files/patch-bug1026499
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/libxul/files/patch-bug1026499 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,68 @@
+commit 8d0efe4
+Author: Martin Husemann <martin at NetBSD.org>
+Date: Wed Jun 18 18:12:22 2014 +0200
+
+ Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg
+---
+ ipc/ipdl/ipdl/cxx/ast.py | 7 ++++---
+ ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++-
+ ipc/ipdl/ipdl/lower.py | 2 +-
+ 4 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py
+index 3180a65..c2d945b 100644
+--- ipc/ipdl/ipdl/cxx/ast.py
++++ ipc/ipdl/ipdl/cxx/ast.py
+@@ -336,12 +336,13 @@ Type.VOID = Type('void')
+ Type.VOIDPTR = Type('void', ptr=1)
+
+ class TypeArray(Node):
+- def __init__(self, basetype, nmemb):
+- '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr'''
++ def __init__(self, basetype, nmemb, alignType):
++ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type'''
+ self.basetype = basetype
+ self.nmemb = nmemb
++ self.alignType = alignType
+ def __deepcopy__(self, memo):
+- return TypeArray(deepcopy(self.basetype, memo), nmemb)
++ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType)
+
+ class TypeEnum(Node):
+ def __init__(self, name=None):
+diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py
+index 48b0988..bc914cf 100644
+--- ipc/ipdl/ipdl/cxx/cgen.py
++++ ipc/ipdl/ipdl/cxx/cgen.py
+@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor):
+ def visitDecl(self, d):
+ # C-syntax arrays make code generation much more annoying
+ if isinstance(d.type, TypeArray):
++ self.write('MOZ_ALIGNED_DECL(')
+ d.type.basetype.accept(self)
+ else:
+ d.type.accept(self)
+@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor):
+ if isinstance(d.type, TypeArray):
+ self.write('[')
+ d.type.nmemb.accept(self)
+- self.write(']')
++ self.write('], MOZ_ALIGNOF(')
++ d.type.alignType.accept(self)
++ self.write('))')
+
+ def visitParam(self, p):
+ self.visitDecl(p)
+diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py
+index e97a34c..9360f3c 100644
+--- ipc/ipdl/ipdl/lower.py
++++ ipc/ipdl/ipdl/lower.py
+@@ -768,7 +768,7 @@ IPDL union type."""
+ if self.recursive:
+ return self.ptrToType()
+ else:
+- return TypeArray(Type('char'), ExprSizeof(self.internalType()))
++ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType())
+
+ def unionValue(self):
+ # NB: knows that Union's storage C union is named |mValue|
Added: trunk/www/libxul/files/patch-bug779713
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/libxul/files/patch-bug779713 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,72 @@
+diff --git mfbt/Util.h mfbt/Util.h
+index e0843ca..353ec36 100644
+--- mfbt/Util.h
++++ mfbt/Util.h
+@@ -19,6 +19,13 @@
+
+ namespace mozilla {
+
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++#define MOZ_ALIGNOF(T) alignof(T)
++#elif defined(__GNUC__)
++#define MOZ_ALIGNOF(T) __alignof__(T)
++#elif defined(_MSC_VER)
++#define MOZ_ALIGNOF(T) __alignof(T)
++#else
+ /*
+ * This class, and the corresponding macro MOZ_ALIGNOF, figure out how many
+ * bytes of alignment a given type needs.
+@@ -37,6 +44,7 @@ class AlignmentFinder
+ };
+
+ #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
++#endif
+
+ /*
+ * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
+@@ -48,7 +56,10 @@ class AlignmentFinder
+ * will declare a two-character array |arr| aligned to 8 bytes.
+ */
+
+-#if defined(__GNUC__)
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++# define MOZ_ALIGNED_DECL(_type, _align) \
++ alignas(_align) _type
++#elif defined(__GNUC__)
+ # define MOZ_ALIGNED_DECL(_type, _align) \
+ _type __attribute__((aligned(_align)))
+ #elif defined(_MSC_VER)
+diff --git mfbt/Attributes.h mfbt/Attributes.h
+index d317766..ddb13da 100644
+--- mfbt/Attributes.h
++++ mfbt/Attributes.h
+@@ -67,6 +67,9 @@
+ # ifndef __has_extension
+ # define __has_extension __has_feature /* compatibility, for older versions of clang */
+ # endif
++# if __has_extension(cxx_alignas)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if __has_extension(cxx_constexpr)
+ # define MOZ_HAVE_CXX11_CONSTEXPR
+ # endif
+@@ -85,6 +88,9 @@
+ # endif
+ #elif defined(__GNUC__)
+ # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
++# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+ # define MOZ_HAVE_CXX11_OVERRIDE
+ # define MOZ_HAVE_CXX11_FINAL final
+@@ -102,6 +108,9 @@
+ # define MOZ_HAVE_NEVER_INLINE __attribute__((noinline))
+ # define MOZ_HAVE_NORETURN __attribute__((noreturn))
+ #elif defined(_MSC_VER)
++# if _MSC_VER >= 1800
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if _MSC_VER >= 1700
+ # define MOZ_HAVE_CXX11_FINAL final
+ # else
Added: trunk/www/seamonkey/files/patch-bug1026499
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/seamonkey/files/patch-bug1026499 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,68 @@
+commit 8d0efe4
+Author: Martin Husemann <martin at NetBSD.org>
+Date: Wed Jun 18 18:12:22 2014 +0200
+
+ Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg
+---
+ ipc/ipdl/ipdl/cxx/ast.py | 7 ++++---
+ ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++-
+ ipc/ipdl/ipdl/lower.py | 2 +-
+ 4 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py
+index 3180a65..c2d945b 100644
+--- mozilla/ipc/ipdl/ipdl/cxx/ast.py
++++ mozilla/ipc/ipdl/ipdl/cxx/ast.py
+@@ -336,12 +336,13 @@ Type.VOID = Type('void')
+ Type.VOIDPTR = Type('void', ptr=1)
+
+ class TypeArray(Node):
+- def __init__(self, basetype, nmemb):
+- '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr'''
++ def __init__(self, basetype, nmemb, alignType):
++ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type'''
+ self.basetype = basetype
+ self.nmemb = nmemb
++ self.alignType = alignType
+ def __deepcopy__(self, memo):
+- return TypeArray(deepcopy(self.basetype, memo), nmemb)
++ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType)
+
+ class TypeEnum(Node):
+ def __init__(self, name=None):
+diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py
+index 48b0988..bc914cf 100644
+--- mozilla/ipc/ipdl/ipdl/cxx/cgen.py
++++ mozilla/ipc/ipdl/ipdl/cxx/cgen.py
+@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor):
+ def visitDecl(self, d):
+ # C-syntax arrays make code generation much more annoying
+ if isinstance(d.type, TypeArray):
++ self.write('MOZ_ALIGNED_DECL(')
+ d.type.basetype.accept(self)
+ else:
+ d.type.accept(self)
+@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor):
+ if isinstance(d.type, TypeArray):
+ self.write('[')
+ d.type.nmemb.accept(self)
+- self.write(']')
++ self.write('], MOZ_ALIGNOF(')
++ d.type.alignType.accept(self)
++ self.write('))')
+
+ def visitParam(self, p):
+ self.visitDecl(p)
+diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py
+index e97a34c..9360f3c 100644
+--- mozilla/ipc/ipdl/ipdl/lower.py
++++ mozilla/ipc/ipdl/ipdl/lower.py
+@@ -768,7 +768,7 @@ IPDL union type."""
+ if self.recursive:
+ return self.ptrToType()
+ else:
+- return TypeArray(Type('char'), ExprSizeof(self.internalType()))
++ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType())
+
+ def unionValue(self):
+ # NB: knows that Union's storage C union is named |mValue|
Added: trunk/www/seamonkey/files/patch-bug779713
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/www/seamonkey/files/patch-bug779713 Sun Jun 22 04:24:32 2014 (r1609)
@@ -0,0 +1,77 @@
+diff --git mfbt/Alignment.h mfbt/Alignment.h
+index e0843ca..353ec36 100644
+--- mozilla/mfbt/Alignment.h
++++ mozilla/mfbt/Alignment.h
+@@ -9,11 +9,20 @@
+ #ifndef mozilla_Alignment_h
+ #define mozilla_Alignment_h
+
++#include "mozilla/Attributes.h"
++
+ #include <stddef.h>
+ #include <stdint.h>
+
+ namespace mozilla {
+
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++#define MOZ_ALIGNOF(T) alignof(T)
++#elif defined(__GNUC__)
++#define MOZ_ALIGNOF(T) __alignof__(T)
++#elif defined(_MSC_VER)
++#define MOZ_ALIGNOF(T) __alignof(T)
++#else
+ /*
+ * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
+ * bytes of alignment a given type needs.
+@@ -32,6 +41,7 @@ public:
+ };
+
+ #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
++#endif
+
+ /*
+ * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
+@@ -43,7 +53,10 @@ public:
+ * will declare a two-character array |arr| aligned to 8 bytes.
+ */
+
+-#if defined(__GNUC__)
++#if defined(MOZ_HAVE_CXX11_ALIGNAS)
++# define MOZ_ALIGNED_DECL(_type, _align) \
++ alignas(_align) _type
++#elif defined(__GNUC__)
+ # define MOZ_ALIGNED_DECL(_type, _align) \
+ _type __attribute__((aligned(_align)))
+ #elif defined(_MSC_VER)
+diff --git mfbt/Attributes.h mfbt/Attributes.h
+index d317766..ddb13da 100644
+--- mozilla/mfbt/Attributes.h
++++ mozilla/mfbt/Attributes.h
+@@ -54,6 +54,9 @@
+ # ifndef __has_extension
+ # define __has_extension __has_feature /* compatibility, for older versions of clang */
+ # endif
++# if __has_extension(cxx_alignas)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if __has_extension(cxx_constexpr)
+ # define MOZ_HAVE_CXX11_CONSTEXPR
+ # endif
+@@ -75,6 +78,9 @@
+ # endif
+ #elif defined(__GNUC__)
+ # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
++# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
++# define MOZ_HAVE_CXX11_ALIGNAS
++# endif
+ # if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
+ # define MOZ_HAVE_CXX11_OVERRIDE
+ # define MOZ_HAVE_CXX11_FINAL final
+@@ -96,6 +102,7 @@
+ # define MOZ_HAVE_NORETURN __attribute__((noreturn))
+ #elif defined(_MSC_VER)
+ # if _MSC_VER >= 1800
++# define MOZ_HAVE_CXX11_ALIGNAS
+ # define MOZ_HAVE_CXX11_DELETE
+ # endif
+ # if _MSC_VER >= 1700
More information about the freebsd-gecko
mailing list