mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Fix #318 by making a list of all seen template instances in a module for
singleobj compilation and then making sure they get emitted in their entirety.
This commit is contained in:
@@ -142,6 +142,21 @@ llvm::Module* Module::genLLVMModule(Ir* sir)
|
||||
// emit function bodies
|
||||
sir->emitFunctionBodies();
|
||||
|
||||
// for singleobj-compilation, fully emit all seen template instances
|
||||
if (opts::singleObj)
|
||||
{
|
||||
while (!ir.seenTemplateInstances.empty())
|
||||
{
|
||||
IRState::TemplateInstanceSet::iterator it, end = ir.seenTemplateInstances.end();
|
||||
for (it = ir.seenTemplateInstances.begin(); it != end; ++it)
|
||||
(*it)->codegen(sir);
|
||||
ir.seenTemplateInstances.clear();
|
||||
|
||||
// emit any newly added function bodies
|
||||
sir->emitFunctionBodies();
|
||||
}
|
||||
}
|
||||
|
||||
// generate ModuleInfo
|
||||
genmoduleinfo();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user