Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 10985 - Compiler doesn't attempt to inline non-templated functions from libraries (even having the full source) #2561

Merged
merged 2 commits into from May 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
25 changes: 9 additions & 16 deletions src/mars.c
Expand Up @@ -1632,26 +1632,19 @@ Language changes listed by -transition=id:\n\
fatal();
if (global.params.useInline)
{
/* The problem with useArrayBounds and useAssert is that the
* module being linked to may not have generated them, so if
* we inline functions from those modules, the symbols for them will
* not be found at link time.
/* Do pass 3 semantic analysis on all imported modules,
* since otherwise functions in them cannot be inlined
* We must do this BEFORE generating the .deps file!
*/
if (!global.params.useArrayBounds && !global.params.useAssert)
for (size_t i = 0; i < Module::amodules.dim; i++)
{
// Do pass 3 semantic analysis on all imported modules,
// since otherwise functions in them cannot be inlined
for (size_t i = 0; i < Module::amodules.dim; i++)
{
Module *m = Module::amodules[i];
if (global.params.verbose)
fprintf(global.stdmsg, "semantic3 %s\n", m->toChars());
m->semantic3();
}
if (global.errors)
fatal();
Module *m = Module::amodules[i];
if (global.params.verbose)
fprintf(global.stdmsg, "semantic3 %s\n", m->toChars());
m->semantic3();
}
if (global.errors)
fatal();
}
Module::runDeferredSemantic3();
if (global.errors)
Expand Down