{
benchmark.benchmark2(
ThreadLocalToolkit.getLocalizationManager().getLocalizedTextString(new BatchTime("start", "")), true);
}
CompilerConfiguration config = (configuration != null) ? configuration.getCompilerConfiguration() : null;
List<Source> targets = new ArrayList<Source>(sources.size());
units.clear();
for (int i = 0, size = sources.size(); i < size; i++)
{
Source s = sources.get(i);
if (s != null && s.isCompiled())
{
units.add(s.getCompilationUnit());
}
else
{
units.add(null);
}
}
if (benchmarkCompilingDetails > 4)
{
benchmark.benchmark2(
ThreadLocalToolkit.getLocalizationManager().getLocalizedTextString(new BatchTime("init units", "")));
}
while (nextSource(sources, igraph, dgraph, targets, symbolTable, configuration) > 0)
{
int postprocessCount = 0;
// 1. targets.size() == sources.size()
// 2. targets.get(i) == sources.get(i) or targets.get(i) == null
for (int i = 0, size = targets.size(); i < size; i++)
{
Source s = targets.get(i);
if (s == null) continue;
int w = getCompilationUnitWorkflow(s);
if ((w & preprocess) == 0)
{
// C: it returns false if it errors. There is no need to catch that. It's okay to
// keep going because findSources() takes into account of errors.
preprocess(sources, compilers, i, i + 1, symbolTable.getSuppressWarningsIncremental());
if (benchmarkCompilingDetails > 4)
{
benchmark.benchmark2(
ThreadLocalToolkit.getLocalizationManager()
.getLocalizedTextString(
new BatchTime("preprocess", s.getNameForReporting())));
}
}
else if ((w & parse1) == 0)
{
parse1(sources, units, igraph, dgraph, compilers, symbolTable, i, i + 1);
resolveInheritance(sources, igraph, dgraph, symbolTable, sourceList, sourcePath, resources, swcContext, i, i + 1);
addGeneratedSources(sources, igraph, dgraph, resources, symbolTable, configuration, i, i + 1);
if (benchmarkCompilingDetails > 4)
{
ThreadLocalToolkit.getBenchmark().benchmark2(
ThreadLocalToolkit.getLocalizationManager().
getLocalizedTextString(
new BatchTime("parse1", s.getNameForReporting())));
}
}
else if ((w & parse2) == 0)
{
parse2(sources, compilers, symbolTable, i, i + 1);
addGeneratedSources(sources, igraph, dgraph, resources, symbolTable, configuration, i, i + 1);
if (benchmarkCompilingDetails > 4)
{
ThreadLocalToolkit.getBenchmark().benchmark2(
ThreadLocalToolkit.getLocalizationManager().
getLocalizedTextString(
new BatchTime("parse2", s.getNameForReporting())));
}
}
else if ((w & analyze1) == 0)
{
// analyze1
analyze(sources, compilers, symbolTable, i, i + 1, 1);
resolveNamespace(sources, igraph, dgraph, symbolTable, sourceList, sourcePath, resources, swcContext, i, i + 1);
addGeneratedSources(sources, igraph, dgraph, resources, symbolTable, configuration, i, i + 1);
if (benchmarkCompilingDetails > 4)
{
ThreadLocalToolkit.getBenchmark().benchmark2(
ThreadLocalToolkit.getLocalizationManager().
getLocalizedTextString(
new BatchTime("analyze1", s.getNameForReporting())));
}
}
else if ((w & analyze2) == 0)
{
// analyze2
analyze(sources, compilers, symbolTable, i, i + 1, 2);
resolveType(sources, units, igraph, dgraph, symbolTable, sourceList, sourcePath, resources, swcContext, i, i + 1);
if (config.strict())
{
resolveImportStatements(sources, units, sourcePath, swcContext, i, i + 1);
}
// C: we don't need this batch1-based memory optimization.