From f02e4b1925f17186aed5b543e3b02a857da7b14b Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Sat, 12 Jan 2013 01:12:37 +0100 Subject: [PATCH] Fix overly conservative inlining prediction. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- gen/llvmhelpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 6d0151f6..e70ecf37 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -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; }