Bug 918651 - part 2 - don't munge the translation unit's headers; r=ehsan
authorNathan Froyd <froydnj@mozilla.com>
Tue, 01 Oct 2013 11:42:50 -0400
changeset 153254 777dc725fc7f0a77dbc83ffba7d729e91c94b36c
parent 153253 5a9ea9a327c59ff9ea7988398c17de74d7d8153e
child 153255 3e7995ac289c8a5bd7213904beaac94a1efdd391
push id25578
push userphilringnalda@gmail.com
push dateSun, 03 Nov 2013 21:05:48 +0000
treeherdermozilla-central@fc3414dda755 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs918651
milestone28.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 918651 - part 2 - don't munge the translation unit's headers; r=ehsan Keep the builtin headers separate from the translation unit's headers. We do this so when we start twiddling with the translation unit's headers, we don't have to handle cases where those headers are actually builtin headers.
ipc/ipdl/ipdl/lower.py
ipc/ipdl/ipdl/type.py
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -3,17 +3,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os, re, sys
 from copy import deepcopy
 
 import ipdl.ast
 import ipdl.builtin
 from ipdl.cxx.ast import *
-from ipdl.type import Actor, ActorType, ProcessGraph, TypeVisitor
+from ipdl.type import Actor, ActorType, ProcessGraph, TypeVisitor, builtinHeaderIncludes
 
 # FIXME/cjones: the chromium Message logging code doesn't work on
 # gcc/POSIX, because it wprintf()s across the chromium/mozilla
 # boundary. one side builds with -fshort-wchar, the other doesn't.
 # this code will remain off until the chromium base lib is replaced
 EMIT_LOGGING_CODE = ('win32' == sys.platform)
 
 ##-----------------------------------------------------------------------------
@@ -1413,16 +1413,18 @@ class _GenerateProtocolCode(ipdl.ast.Vis
 
     def visitTranslationUnit(self, tu):
         hf = self.hdrfile
 
         hf.addthing(_DISCLAIMER)
         hf.addthings(_includeGuardStart(hf))
         hf.addthing(Whitespace.NL)
 
+        for inc in builtinHeaderIncludes:
+            self.visitCxxInclude(inc)
         ipdl.ast.Visitor.visitTranslationUnit(self, tu)
         if tu.filetype == 'header':
             self.cppIncludeHeaders.append(_ipdlhHeaderName(tu))
 
         hf.addthing(Whitespace.NL)
         hf.addthings(_includeGuardEnd(hf))
 
         cf = self.cppfile
--- a/ipc/ipdl/ipdl/type.py
+++ b/ipc/ipdl/ipdl/type.py
@@ -592,18 +592,16 @@ With this information, it finally type c
     def check(self, tu, errout=sys.stderr):
         def runpass(tcheckpass):
             tu.accept(tcheckpass)
             if len(self.errors):
                 self.reportErrors(errout)
                 return False
             return True
 
-        tu.cxxIncludes = builtinHeaderIncludes + tu.cxxIncludes
-
         # tag each relevant node with "decl" information, giving type, name,
         # and location of declaration
         if not runpass(GatherDecls(builtinUsing, self.errors)):
             return False
 
         # now that the nodes have decls, type checking is much easier.
         if not runpass(CheckTypes(self.errors)):
             return False