diff --git a/ipc/ipdl/ipdl/ast.py b/ipc/ipdl/ipdl/ast.py index 0824859c104b..3bb427536c0f 100644 --- a/ipc/ipdl/ipdl/ast.py +++ b/ipc/ipdl/ipdl/ast.py @@ -12,8 +12,8 @@ class Visitor: def visitTranslationUnit(self, tu): for cxxInc in tu.cxxIncludes: cxxInc.accept(self) - for protoInc in tu.protocolIncludes: - protoInc.accept(self) + for inc in tu.includes: + inc.accept(self) for su in tu.structsAndUnions: su.accept(self) for using in tu.using: @@ -23,7 +23,7 @@ class Visitor: def visitCxxInclude(self, inc): pass - def visitProtocolInclude(self, inc): + def visitInclude(self, inc): # Note: we don't visit the child AST here, because that needs delicate # and pass-specific handling pass @@ -153,13 +153,13 @@ class TranslationUnit(Node): Node.__init__(self) self.filename = None self.cxxIncludes = [ ] - self.protocolIncludes = [ ] + self.includes = [ ] self.using = [ ] self.structsAndUnions = [ ] self.protocol = None def addCxxInclude(self, cxxInclude): self.cxxIncludes.append(cxxInclude) - def addProtocolInclude(self, pInc): self.protocolIncludes.append(pInc) + def addInclude(self, inc): self.includes.append(inc) def addStructDecl(self, struct): self.structsAndUnions.append(struct) def addUnionDecl(self, union): self.structsAndUnions.append(union) def addUsingStmt(self, using): self.using.append(using) @@ -171,10 +171,10 @@ class CxxInclude(Node): Node.__init__(self, loc) self.file = cxxFile -class ProtocolInclude(Node): - def __init__(self, loc, protocolName): +class Include(Node): + def __init__(self, loc, name): Node.__init__(self, loc) - self.file = "%s.ipdl" % protocolName + self.file = "%s.ipdl" % name class UsingStmt(Node): def __init__(self, loc, cxxTypeSpec): diff --git a/ipc/ipdl/ipdl/lower.py b/ipc/ipdl/ipdl/lower.py index 8dec5add3b80..317b9e2e01d4 100644 --- a/ipc/ipdl/ipdl/lower.py +++ b/ipc/ipdl/ipdl/lower.py @@ -2359,8 +2359,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor): '"'+ _protocolHeaderName(tu.protocol) +'.h"') ]) - for pinc in tu.protocolIncludes: - pinc.accept(self) + for inc in tu.includes: + inc.accept(self) # this generates the actor's full impl in self.cls tu.protocol.accept(self) @@ -2438,8 +2438,8 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor): ]) - def visitProtocolInclude(self, pi): - ip = pi.tu.protocol + def visitInclude(self, inc): + ip = inc.tu.protocol self.hdrfile.addthings([ _makeForwardDeclForActor(ip.decl.type, self.side), diff --git a/ipc/ipdl/ipdl/parser.py b/ipc/ipdl/ipdl/parser.py index ab90175f0f17..4f6c9e19e744 100644 --- a/ipc/ipdl/ipdl/parser.py +++ b/ipc/ipdl/ipdl/parser.py @@ -185,8 +185,8 @@ def p_TranslationUnit(p): for stmt in p[1]: if isinstance(stmt, CxxInclude): tu.addCxxInclude(stmt) - elif isinstance(stmt, ProtocolInclude): - tu.addProtocolInclude(stmt) + elif isinstance(stmt, Include): + tu.addInclude(stmt) elif isinstance(stmt, UsingStmt): tu.addUsingStmt(stmt) else: @@ -236,7 +236,7 @@ def p_ProtocolIncludeStmt(p): _error(loc, "`include protocol \"P.ipdl\"' syntax is obsolete. Use `include protocol P' instead.") Parser.current.loc = loc - inc = ProtocolInclude(loc, p[3]) + inc = Include(loc, p[3]) path = Parser.current.resolveIncludePath(inc.file) if path is None: diff --git a/ipc/ipdl/ipdl/type.py b/ipc/ipdl/ipdl/type.py index e406d089979d..0618e390ad2b 100644 --- a/ipc/ipdl/ipdl/type.py +++ b/ipc/ipdl/ipdl/type.py @@ -645,7 +645,7 @@ class GatherDecls(TcheckVisitor): p.decl.type._ast = p # make sure we have decls for all dependent protocols - for pinc in tu.protocolIncludes: + for pinc in tu.includes: pinc.accept(self) # declare imported (and builtin) C++ types @@ -689,14 +689,14 @@ class GatherDecls(TcheckVisitor): self.symtab = savedSymtab - def visitProtocolInclude(self, pi): - if pi.tu is None: + def visitInclude(self, inc): + if inc.tu is None: self.error( - pi.loc, + inc.loc, "(type checking here will be unreliable because of an earlier error)") return - pi.tu.accept(self) - self.symtab.declare(pi.tu.protocol.decl) + inc.tu.accept(self) + self.symtab.declare(inc.tu.protocol.decl) def visitStructDecl(self, sd): stype = sd.decl.type @@ -1188,7 +1188,7 @@ class CheckTypes(TcheckVisitor): self.visited = set() self.ptype = None - def visitProtocolInclude(self, inc): + def visitInclude(self, inc): if inc.tu.filename in self.visited: return self.visited.add(inc.tu.filename) @@ -1593,8 +1593,8 @@ class BuildProcessGraph(TcheckVisitor): def visitTranslationUnit(self, tu): TcheckVisitor.visitTranslationUnit(self, tu) - def visitProtocolInclude(self, pi): - pi.tu.protocol.accept(self) + def visitInclude(self, inc): + inc.tu.protocol.accept(self) def visitProtocol(self, p): ptype = p.decl.type @@ -1630,8 +1630,8 @@ class BuildProcessGraph(TcheckVisitor): tu.accept(self.findSpawns(self.errors)) TcheckVisitor.visitTranslationUnit(self, tu) - def visitProtocolInclude(self, pi): - pi.tu.protocol.accept(self) + def visitInclude(self, inc): + inc.tu.protocol.accept(self) def visitProtocol(self, p): ptype = p.decl.type