Bug 1334720 - Remove some unused IPDL code generator methods. r=jld draft
authorAndrew McCreight <continuation@gmail.com>
Thu, 26 Jan 2017 17:05:10 -0800
changeset 467553 48967e544346fc5490c21bfb6e61607464c865b3
parent 467535 23d599a789e73de11668b1d91138595dcf89ee51
child 467554 2539bf5dbfb64ff48955fe0b59d2c8366b8caf76
push id43218
push userbmo:continuation@gmail.com
push dateSat, 28 Jan 2017 00:54:33 +0000
reviewersjld
bugs1334720
milestone54.0a1
Bug 1334720 - Remove some unused IPDL code generator methods. r=jld MozReview-Commit-ID: 4PRMjdjyFM8
ipc/ipdl/ipdl/lower.py
ipc/ipdl/ipdl/type.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -414,20 +414,16 @@ def _unionTypeReadError(unionname):
 def _killProcess(pid):
     return ExprCall(
         ExprVar('base::KillProcess'),
         args=[ pid,
                # XXX this is meaningless on POSIX
                ExprVar('base::PROCESS_END_KILLED_BY_USER'),
                ExprLiteral.FALSE ])
 
-def _badTransition():
-    # FIXME: make this a FatalError()
-    return [ _printWarningMessage('bad state transition!') ]
-
 # Results that IPDL-generated code returns back to *Channel code.
 # Users never see these
 class _Result:
     @staticmethod
     def Type():
         return Type('Result')
 
     Processed = ExprVar('MsgProcessed')
--- a/ipc/ipdl/ipdl/type.py
+++ b/ipc/ipdl/ipdl/type.py
@@ -434,43 +434,27 @@ def iteractortypes(t, visited=None):
         for actor in iteractortypes(t.basetype, visited):
             yield actor
     elif t.isCompound() and t not in visited:
         visited.add(t)
         for c in t.itercomponents():
             for actor in iteractortypes(c, visited):
                 yield actor
 
-def hasactor(type):
-    """Return true iff |type| is an actor or has one buried within."""
-    for _ in iteractortypes(type): return True
-    return False
-
 def hasshmem(type):
     """Return true iff |type| is shmem or has it buried within."""
     class found: pass
     class findShmem(TypeVisitor):
         def visitShmemType(self, s):  raise found()
     try:
         type.accept(findShmem())
     except found:
         return True
     return False
 
-def hasfd(type):
-    """Return true iff |type| is fd or has it buried within."""
-    class found: pass
-    class findFD(TypeVisitor):
-        def visitFDType(self, s):  raise found()
-    try:
-        type.accept(findFD())
-    except found:
-        return True
-    return False
-
 ##--------------------
 _builtinloc = Loc('<builtin>', 0)
 def makeBuiltinUsing(tname):
     quals = tname.split('::')
     base = quals.pop()
     quals = quals[0:]
     return UsingStmt(_builtinloc,
                      TypeSpec(_builtinloc,