Skip to content

Commit

Permalink
Stop running semantic3 for unittests in non-root modules
Browse files Browse the repository at this point in the history
This is important due to avoid out-of-memory error with `-unittest -inline`. Currently front-end inlining requires running semantic3 for all imported modules to analyze expanded function body code. By this change, we can remove the Phobos unittest analyzing cost in user application compilation.
  • Loading branch information
9rnsr committed May 17, 2014
1 parent d0da51e commit 474e0d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/func.c
Expand Up @@ -5152,10 +5152,14 @@ void UnitTestDeclaration::semantic(Scope *sc)
protection = sc->protection;

if (scope)
{ sc = scope;
{
sc = scope;
scope = NULL;
}

if (!isInstantiated() && inNonRoot())
return;

if (global.params.useUnitTests)
{
if (!type)
Expand Down

0 comments on commit 474e0d2

Please sign in to comment.