diff --git a/ipc/ipdl/ipdl/cxx/ast.py b/ipc/ipdl/ipdl/cxx/ast.py index 5d95e8249d1..52f937a1fcc 100644 --- a/ipc/ipdl/ipdl/cxx/ast.py +++ b/ipc/ipdl/ipdl/cxx/ast.py @@ -447,7 +447,7 @@ class FriendClassDecl(Node): class MethodDecl(Node): def __init__(self, name, params=[ ], ret=Type('void'), virtual=0, const=0, pure=0, static=0, warn_unused=0, - inline=0, force_inline=0, + inline=0, force_inline=0, never_inline=0, typeop=None, T=None): assert not (virtual and static) @@ -458,6 +458,8 @@ class MethodDecl(Node): assert not isinstance(ret, list) for decl in params: assert not isinstance(decl, str) assert not isinstance(T, int) + assert not (inline and never_inline) + assert not (force_inline and never_inline) if typeop is not None: ret = None @@ -473,6 +475,7 @@ class MethodDecl(Node): self.warn_unused = warn_unused # bool self.force_inline = (force_inline or T) # bool self.inline = inline # bool + self.never_inline = never_inline # bool self.typeop = typeop # Type or None self.T = T # Type or None @@ -488,6 +491,7 @@ class MethodDecl(Node): warn_unused=self.warn_unused, inline=self.inline, force_inline=self.force_inline, + never_inline=self.never_inline, typeop=copy.deepcopy(self.typeop, memo), T=copy.deepcopy(self.T, memo)) diff --git a/ipc/ipdl/ipdl/cxx/cgen.py b/ipc/ipdl/ipdl/cxx/cgen.py index d997a7649bf..ece91807374 100644 --- a/ipc/ipdl/ipdl/cxx/cgen.py +++ b/ipc/ipdl/ipdl/cxx/cgen.py @@ -182,6 +182,8 @@ class CxxCodeGen(CodePrinter, Visitor): if md.inline: self.write('inline ') + if md.inline: + self.write('MOZ_NEVER_INLINE ') if md.static: self.write('static ') if md.virtual: diff --git a/ipc/ipdl/ipdl/lower.py b/ipc/ipdl/ipdl/lower.py index cdf53c493aa..2db346d37c3 100644 --- a/ipc/ipdl/ipdl/lower.py +++ b/ipc/ipdl/ipdl/lower.py @@ -5192,6 +5192,7 @@ def _splitMethodDefn(md, clsname): md.decl.virtual = 0 md.decl.static = 0 md.decl.warn_unused = 0 + md.decl.never_inline = 0 for param in md.decl.params: if isinstance(param, Param): param.default = None