Bug 1522599 - make the logic for cxxTypeNeedsMove more straightforward; r=Alex_Gaynor
authorNathan Froyd <froydnj@mozilla.com>
Thu, 24 Jan 2019 16:31:59 -0500
changeset 515376 a3b8503e6109c7e6e81cee27af25b9ec1b01d74d
parent 515375 ab592ce5d5ae37bd2d5008600d8c566ed30becae
child 515377 005a8fce14e71875a1e784d7adf3ec73fe5e694b
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersAlex_Gaynor
bugs1522599
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1522599 - make the logic for cxxTypeNeedsMove more straightforward; r=Alex_Gaynor Nested conditionals are hard to read; separating things out should make the flow somewhat more obvious.
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -562,22 +562,29 @@ def _cxxConstRefType(ipdltype, side):
     return t
 
 
 def _cxxTypeCanMoveSend(ipdltype):
     return ipdltype.isUniquePtr()
 
 
 def _cxxTypeNeedsMove(ipdltype):
-    return ((ipdltype.isIPDL() and (ipdltype.isArray() or
-                                    ipdltype.isShmem() or
-                                    ipdltype.isByteBuf() or
-                                    ipdltype.isEndpoint())) or
-            (ipdltype.isCxx() and ipdltype.isMoveonly())
-            or ipdltype.isUniquePtr())
+    if ipdltype.isUniquePtr():
+        return True
+
+    if ipdltype.isCxx():
+        return ipdltype.isMoveonly()
+
+    if ipdltype.isIPDL():
+        return (ipdltype.isArray() or
+                ipdltype.isShmem() or
+                ipdltype.isByteBuf() or
+                ipdltype.isEndpoint())
+
+    return False
 
 
 def _cxxTypeCanMove(ipdltype):
     return not (ipdltype.isIPDL() and ipdltype.isActor())
 
 
 def _cxxMoveRefType(ipdltype, side):
     t = _cxxBareType(ipdltype, side)