Bug 1428984 - Part 3: Remove unused inline flag. r=froydnj
authorChris Peterson <cpeterson@mozilla.com>
Fri, 12 Jan 2018 21:14:53 -0800
changeset 453878 1f3edc2b0da5dd6416764bac9093fc9dd45932f2
parent 453877 18fb324726e7d12021183b3024415682f8754552
child 453879 5a130721f8ea9793e201453caf4bc56d5b3ae53f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1428984
milestone59.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 1428984 - Part 3: Remove unused inline flag. r=froydnj inline is never set so cgen never emits inline. MozReview-Commit-ID: BDL6BV8906t
ipc/ipdl/ipdl/cxx/ast.py
ipc/ipdl/ipdl/cxx/cgen.py
ipc/ipdl/ipdl/lower.py
--- a/ipc/ipdl/ipdl/cxx/ast.py
+++ b/ipc/ipdl/ipdl/cxx/ast.py
@@ -477,18 +477,17 @@ def make_enum(name, members_str):
         member_value += 1
     return type(name, (), members_dict)
 
 MethodSpec = make_enum('MethodSpec', 'NONE VIRTUAL PURE OVERRIDE STATIC')
 
 class MethodDecl(Node):
     def __init__(self, name, params=[ ], ret=Type('void'),
                  methodspec=MethodSpec.NONE, const=0, warn_unused=0,
-                 inline=0, force_inline=0,
-                 typeop=None, T=None):
+                 force_inline=0, typeop=None, T=None):
         assert not (name and typeop)
         assert name is None or isinstance(name, str)
         assert not isinstance(ret, list)
         for decl in params:  assert not isinstance(decl, str)
         assert not isinstance(T, int)
 
         if typeop is not None:
             assert methodspec == MethodSpec.NONE
@@ -497,49 +496,45 @@ class MethodDecl(Node):
         Node.__init__(self)
         self.name = name
         self.params = params            # [ Param ]
         self.ret = ret                  # Type or None
         self.methodspec = methodspec    # enum
         self.const = const              # bool
         self.warn_unused = warn_unused  # bool
         self.force_inline = (force_inline or T) # bool
-        self.inline = inline            # bool
         self.typeop = typeop            # Type or None
         self.T = T                      # Type or None
         self.only_for_definition = False
 
     def __deepcopy__(self, memo):
         return MethodDecl(
             self.name,
             params=copy.deepcopy(self.params, memo),
             ret=copy.deepcopy(self.ret, memo),
             methodspec=self.methodspec,
             const=self.const,
             warn_unused=self.warn_unused,
-            inline=self.inline,
             force_inline=self.force_inline,
             typeop=copy.deepcopy(self.typeop, memo),
             T=copy.deepcopy(self.T, memo))
 
 class MethodDefn(Block):
     def __init__(self, decl):
         Block.__init__(self)
         self.decl = decl
 
 class FunctionDecl(MethodDecl):
     def __init__(self, name, params=[ ], ret=Type('void'),
                  methodspec=MethodSpec.NONE, warn_unused=0,
-                 inline=0, force_inline=0,
-                 T=None):
+                 force_inline=0, T=None):
         assert methodspec == MethodSpec.NONE or methodspec == MethodSpec.STATIC
         MethodDecl.__init__(self, name, params=params, ret=ret,
                             methodspec=methodspec, warn_unused=warn_unused,
-                            inline=inline, force_inline=force_inline,
-                            T=T)
+                            force_inline=force_inline, T=T)
 
 class FunctionDefn(MethodDefn):
     def __init__(self, decl):
         MethodDefn.__init__(self, decl)
 
 class ConstructorDecl(MethodDecl):
     def __init__(self, name, params=[ ], explicit=0, force_inline=0):
         MethodDecl.__init__(self, name, params=params, ret=None,
@@ -552,28 +547,26 @@ class ConstructorDecl(MethodDecl):
                                self.explicit)
 
 class ConstructorDefn(MethodDefn):
     def __init__(self, decl, memberinits=[ ]):
         MethodDefn.__init__(self, decl)
         self.memberinits = memberinits
 
 class DestructorDecl(MethodDecl):
-    def __init__(self, name, methodspec=MethodSpec.NONE, force_inline=0, inline=0):
+    def __init__(self, name, methodspec=MethodSpec.NONE, force_inline=0):
         # C++ allows pure or override destructors, but ipdl cgen does not.
         assert methodspec == MethodSpec.NONE or methodspec == MethodSpec.VIRTUAL
         MethodDecl.__init__(self, name, params=[ ], ret=None,
-                            methodspec=methodspec,
-                            force_inline=force_inline, inline=inline)
+                            methodspec=methodspec, force_inline=force_inline)
 
     def __deepcopy__(self, memo):
         return DestructorDecl(self.name,
                               methodspec=self.methodspec,
-                              force_inline=self.force_inline,
-                              inline=self.inline)
+                              force_inline=self.force_inline)
 
 class DestructorDefn(MethodDefn):
     def __init__(self, decl):  MethodDefn.__init__(self, decl)
 
 ##------------------------------
 # expressions
 class ExprVar(Node):
     def __init__(self, name):
--- a/ipc/ipdl/ipdl/cxx/cgen.py
+++ b/ipc/ipdl/ipdl/cxx/cgen.py
@@ -195,18 +195,16 @@ class CxxCodeGen(CodePrinter, Visitor):
             self.write('template<')
             self.write('typename ')
             md.T.accept(self)
             self.println('>')
             self.printdent()
 
         if md.warn_unused:
             self.write('MOZ_MUST_USE ')
-        if md.inline:
-            self.write('inline ')
 
         if md.methodspec == MethodSpec.STATIC:
             self.write('static ')
         elif md.methodspec == MethodSpec.VIRTUAL or \
              md.methodspec == MethodSpec.PURE:
             self.write('virtual ')
 
         if md.ret:
@@ -280,19 +278,16 @@ class CxxCodeGen(CodePrinter, Visitor):
 
         self.visitBlock(cd)
 
         self.dedent()
         self.printdentln('}')
 
 
     def visitDestructorDecl(self, dd):
-        if dd.inline:
-            self.write('inline ')
-
         if dd.methodspec == MethodSpec.VIRTUAL:
             self.write('virtual ')
 
         # hack alert
         parts = dd.name.split('::')
         parts[-1] = '~'+ parts[-1]
 
         self.write('::'.join(parts) +'()')
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -4903,17 +4903,17 @@ def _splitMethodDefn(md, clsname):
     md.decl.only_for_definition = True
     for param in md.decl.params:
         if isinstance(param, Param):
             param.default = None
     return saveddecl, md
 
 
 def _splitFuncDeclDefn(fun):
-    assert not fun.decl.inline
+    assert not fun.decl.force_inline
     return StmtDecl(fun.decl), fun
 
 
 # XXX this is tantalizingly similar to _splitClassDeclDefn, but just
 # different enough that I don't see the need to define
 # _GenerateSkeleton in terms of that
 class _GenerateSkeletonImpl(Visitor):
     def __init__(self, name, namespaces):