Bug 555573 - [e10s] IPDL generates code which may not compile on Windows, r=cjones

This commit is contained in:
Olli Pettay 2010-03-29 23:29:07 +03:00
Родитель 667215c7aa
Коммит f8623be5f3
3 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -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):