Merge mozilla-central to autoland on a CLOSED TREE

This commit is contained in:
Andreea Pavel 2020-02-27 23:42:01 +02:00
Родитель 2e07e8ca83 bd0fadcba6
Коммит 2b4d91ded6
1 изменённых файлов: 20 добавлений и 8 удалений

Просмотреть файл

@ -85,11 +85,13 @@ class CompileDBBackend(CommonBackend):
db = []
for (directory, filename), cmd in self._db.iteritems():
for (directory, filename, unified), cmd in self._db.iteritems():
env = self._envs[directory]
cmd = list(cmd)
cmd.append(filename)
if unified is None:
cmd.append(filename)
else:
cmd.append(unified)
variables = {
'DIST': mozpath.join(env.topobjdir, 'dist'),
'DEPTH': env.topobjdir,
@ -141,10 +143,20 @@ class CompileDBBackend(CommonBackend):
json.dump(db, jsonout, indent=0)
def _process_unified_sources(self, obj):
for f in list(sorted(obj.files)):
self._build_db_line(obj.objdir, obj.relsrcdir, obj.config, f,
if not obj.have_unified_mapping:
for f in list(sorted(obj.files)):
self._build_db_line(obj.objdir, obj.relsrcdir, obj.config, f,
obj.canonical_suffix)
return
# For unified sources, only include the unified source file.
# Note that unified sources are never used for host sources.
for f in obj.unified_source_mapping:
self._build_db_line(obj.objdir, obj.relsrcdir, obj.config, f[0],
obj.canonical_suffix)
return
for entry in f[1]:
self._build_db_line(obj.objdir, obj.relsrcdir, obj.config,
entry, obj.canonical_suffix, unified=f[0])
def _handle_idl_manager(self, idl_manager):
pass
@ -177,10 +189,10 @@ class CompileDBBackend(CommonBackend):
}
def _build_db_line(self, objdir, reldir, cenv, filename,
canonical_suffix):
canonical_suffix, unified=None):
if canonical_suffix not in self.COMPILERS:
return
db = self._db.setdefault((objdir, filename),
db = self._db.setdefault((objdir, filename, unified),
cenv.substs[self.COMPILERS[canonical_suffix]].split() +
['-o', '/dev/null', '-c'])
reldir = reldir or mozpath.relpath(objdir, cenv.topobjdir)