Lines 1-19
Link Here
|
1 |
commit 8d0efe4 |
1 |
--- mozilla/ipc/ipdl/ipdl/cxx/ast.py 2016-05-17 13:29:25.826885000 +0000 |
2 |
Author: Martin Husemann <martin@NetBSD.org> |
2 |
+++ mozilla/ipc/ipdl/ipdl/cxx/ast.py 2016-05-17 13:30:00.779914000 +0000 |
3 |
Date: Wed Jun 18 18:12:22 2014 +0200 |
3 |
@@ -339,12 +339,12 @@ |
4 |
|
|
|
5 |
Bug 1026499 - Use MOZ_ALIGNED_DECL to declare union members in ipdl value declarations. r=bsmedberg |
6 |
--- |
7 |
ipc/ipdl/ipdl/cxx/ast.py | 7 ++++--- |
8 |
ipc/ipdl/ipdl/cxx/cgen.py | 5 ++++- |
9 |
ipc/ipdl/ipdl/lower.py | 2 +- |
10 |
4 files changed, 10 insertions(+), 5 deletions(-) |
11 |
|
12 |
diff --git ipc/ipdl/ipdl/cxx/ast.py ipc/ipdl/ipdl/cxx/ast.py |
13 |
index 3180a65..c2d945b 100644 |
14 |
--- mozilla/ipc/ipdl/ipdl/cxx/ast.py |
15 |
+++ mozilla/ipc/ipdl/ipdl/cxx/ast.py |
16 |
@@ -336,12 +336,13 @@ Type.VOID = Type('void') |
17 |
Type.VOIDPTR = Type('void', ptr=1) |
4 |
Type.VOIDPTR = Type('void', ptr=1) |
18 |
|
5 |
|
19 |
class TypeArray(Node): |
6 |
class TypeArray(Node): |
Lines 23-29
Link Here
|
23 |
+ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type''' |
10 |
+ '''the type |basetype DECLNAME[nmemb]|. |nmemb| is an Expr, |alignType| is a type''' |
24 |
self.basetype = basetype |
11 |
self.basetype = basetype |
25 |
self.nmemb = nmemb |
12 |
self.nmemb = nmemb |
26 |
+ self.alignType = alignType |
|
|
27 |
def __deepcopy__(self, memo): |
13 |
def __deepcopy__(self, memo): |
28 |
- return TypeArray(deepcopy(self.basetype, memo), nmemb) |
14 |
- return TypeArray(deepcopy(self.basetype, memo), nmemb) |
29 |
+ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType) |
15 |
+ return TypeArray(deepcopy(self.basetype, memo), nmemb, alignType) |
Lines 30-40
Link Here
|
30 |
|
16 |
|
31 |
class TypeEnum(Node): |
17 |
class TypeEnum(Node): |
32 |
def __init__(self, name=None): |
18 |
def __init__(self, name=None): |
33 |
diff --git ipc/ipdl/ipdl/cxx/cgen.py ipc/ipdl/ipdl/cxx/cgen.py |
19 |
--- mozilla/ipc/ipdl/ipdl/cxx/cgen.py 2016-05-17 13:30:18.992497000 +0000 |
34 |
index 48b0988..bc914cf 100644 |
20 |
+++ mozilla/ipc/ipdl/ipdl/cxx/cgen.py 2016-05-17 13:31:13.828885000 +0000 |
35 |
--- mozilla/ipc/ipdl/ipdl/cxx/cgen.py |
21 |
@@ -104,6 +104,7 @@ |
36 |
+++ mozilla/ipc/ipdl/ipdl/cxx/cgen.py |
|
|
37 |
@@ -101,6 +101,7 @@ class CxxCodeGen(CodePrinter, Visitor): |
38 |
def visitDecl(self, d): |
22 |
def visitDecl(self, d): |
39 |
# C-syntax arrays make code generation much more annoying |
23 |
# C-syntax arrays make code generation much more annoying |
40 |
if isinstance(d.type, TypeArray): |
24 |
if isinstance(d.type, TypeArray): |
Lines 42-48
Link Here
|
42 |
d.type.basetype.accept(self) |
26 |
d.type.basetype.accept(self) |
43 |
else: |
27 |
else: |
44 |
d.type.accept(self) |
28 |
d.type.accept(self) |
45 |
@@ -111,7 +112,9 @@ class CxxCodeGen(CodePrinter, Visitor): |
29 |
@@ -114,7 +115,9 @@ |
46 |
if isinstance(d.type, TypeArray): |
30 |
if isinstance(d.type, TypeArray): |
47 |
self.write('[') |
31 |
self.write('[') |
48 |
d.type.nmemb.accept(self) |
32 |
d.type.nmemb.accept(self) |
Lines 53-68
Link Here
|
53 |
|
37 |
|
54 |
def visitParam(self, p): |
38 |
def visitParam(self, p): |
55 |
self.visitDecl(p) |
39 |
self.visitDecl(p) |
56 |
diff --git ipc/ipdl/ipdl/lower.py ipc/ipdl/ipdl/lower.py |
|
|
57 |
index e97a34c..9360f3c 100644 |
58 |
--- mozilla/ipc/ipdl/ipdl/lower.py |
59 |
+++ mozilla/ipc/ipdl/ipdl/lower.py |
60 |
@@ -768,7 +768,7 @@ IPDL union type.""" |
61 |
if self.recursive: |
62 |
return self.ptrToType() |
63 |
else: |
64 |
- return TypeArray(Type('char'), ExprSizeof(self.internalType())) |
65 |
+ return TypeArray(Type('char'), ExprSizeof(self.internalType()), self.internalType()) |
66 |
|
67 |
def unionValue(self): |
68 |
# NB: knows that Union's storage C union is named |mValue| |