Fix overly conservative inlining prediction.

A "statementsToo" flag was added to DMD, which disables inlining
of pretty much any functions that actually return a value – set it
to false for our purposes.

The other parts of the diff are just cosmetic.
This commit is contained in:
David Nadlinger
2013-01-12 01:12:37 +01:00
parent 6ddb524b91
commit f02e4b1925

View File

@@ -1635,7 +1635,7 @@ bool mustDefineSymbol(Dsymbol* s)
{
// we can't (and probably shouldn't?) define functions
// that weren't semantic3'ed
if (fd->semanticRun < 4)
if (fd->semanticRun < PASSsemantic3)
return false;
if (fd->isArrayOp == 1)
@@ -1659,7 +1659,7 @@ bool mustDefineSymbol(Dsymbol* s)
if ( !fd->isStaticCtorDeclaration()
&& !fd->isStaticDtorDeclaration()
&& !fd->isUnitTestDeclaration()
&& fd->canInline(true))
&& fd->canInline(true, false, false))
{
return true;
}