Skip to content

Commit

Permalink
Ensure that codegen is performed for modules where codegen is forced.
Browse files Browse the repository at this point in the history
  • Loading branch information
just-harry committed May 4, 2024
1 parent 1e2ab0a commit 1985895
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions compiler/src/dmd/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,22 @@ private int tryMain(size_t argc, const(char)** argv, ref Param params)
}
}
Module.runDeferredSemantic3();

// Ensure codegen is performed for modules where codegen is forced
for (size_t i = 0; i < Module.amodules.length; ++i)
{
auto m = Module.amodules[i];
if (m.forceCodegen && m.semanticRun != PASS.semantic3done)
{
assert(m.isRoot());
if (params.v.verbose)
message("semantic3 %s", m.toChars());
m.semantic3(null);
modules.push(m);

Check warning on line 591 in compiler/src/dmd/main.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/main.d#L587-L591

Added lines #L587 - L591 were not covered by tests
}
}
Module.runDeferredSemantic3();

if (global.errors)
removeHdrFilesAndFail(params, modules);

Expand Down

0 comments on commit 1985895

Please sign in to comment.