зеркало из https://github.com/mozilla/gecko-dev.git
Bug 555573 - [e10s] IPDL generates code which may not compile on Windows, r=cjones
This commit is contained in:
Родитель
667215c7aa
Коммит
f8623be5f3
|
@ -71,6 +71,9 @@ class Visitor:
|
|||
def visitTypedef(self, tdef):
|
||||
tdef.fromtype.accept(self)
|
||||
|
||||
def visitUsing(self, us):
|
||||
us.type.accept(self)
|
||||
|
||||
def visitForwardDecl(self, fd):
|
||||
pass
|
||||
|
||||
|
@ -384,6 +387,11 @@ class Typedef(Node):
|
|||
self.fromtype = fromtype
|
||||
self.totypename = totypename
|
||||
|
||||
class Using(Node):
|
||||
def __init__(self, type):
|
||||
Node.__init__(self)
|
||||
self.type = type
|
||||
|
||||
class ForwardDecl(Node):
|
||||
def __init__(self, pqname, cls=0, struct=0):
|
||||
assert (not cls and struct) or (cls and not struct)
|
||||
|
|
|
@ -115,6 +115,11 @@ class CxxCodeGen(CodePrinter, Visitor):
|
|||
td.fromtype.accept(self)
|
||||
self.println(' '+ td.totypename +';')
|
||||
|
||||
def visitUsing(self, us):
|
||||
self.printdent('using ')
|
||||
us.type.accept(self)
|
||||
self.println(';')
|
||||
|
||||
def visitForwardDecl(self, fd):
|
||||
if fd.cls: self.printdent('class ')
|
||||
elif fd.struct: self.printdent('struct ')
|
||||
|
|
|
@ -2408,6 +2408,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||
self.ns = None
|
||||
self.cls = None
|
||||
self.includedActorTypedefs = [ ]
|
||||
self.includedActorUsings = [ ]
|
||||
self.protocolCxxIncludes = [ ]
|
||||
|
||||
def lower(self, tu, clsname, cxxHeaderFile, cxxFile):
|
||||
|
@ -2513,8 +2514,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||
+ self.protocolCxxIncludes
|
||||
+ [ Whitespace.NL ]
|
||||
+ self.standardTypedefs()
|
||||
+ self.includedActorTypedefs
|
||||
+ tu.protocol.decl.cxxtypedefs
|
||||
+ self.includedActorUsings
|
||||
+ [ Whitespace.NL ]))
|
||||
|
||||
cppns = makeNamespace(self.protocol, cf)
|
||||
|
@ -2543,6 +2544,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
|
|||
self.includedActorTypedefs.append(Typedef(
|
||||
Type(_actorName(ip.decl.fullname, self.prettyside)),
|
||||
_actorName(ip.decl.shortname, self.prettyside)))
|
||||
self.includedActorUsings.append(Using(
|
||||
Type(_actorName(ip.decl.fullname, self.prettyside))))
|
||||
|
||||
|
||||
def visitProtocol(self, p):
|
||||
|
|
Загрузка…
Ссылка в новой задаче