mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-11 09:23:13 +01:00
[svn r21] * Fixed local instances of imported templates
This commit is contained in:
@@ -630,7 +630,7 @@ void FuncDeclaration::toObjFile()
|
||||
const llvm::FunctionType* functype = llvm::cast<llvm::FunctionType>(llvmValue->getType()->getContainedType(0));
|
||||
|
||||
// only members of the current module maybe be defined
|
||||
if (getModule() == gIR->dmodule)
|
||||
if (getModule() == gIR->dmodule || parent->isTemplateInstance())
|
||||
{
|
||||
llvmDModule = gIR->dmodule;
|
||||
|
||||
@@ -730,5 +730,10 @@ void FuncDeclaration::toObjFile()
|
||||
|
||||
gIR->funcdecls.pop_back();
|
||||
}
|
||||
|
||||
// template instances should have weak linkage
|
||||
if (parent->isTemplateInstance()) {
|
||||
func->setLinkage(llvm::GlobalValue::WeakLinkage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
lib/llvmdcore.bc
BIN
lib/llvmdcore.bc
Binary file not shown.
BIN
lib/lphobos.bc
BIN
lib/lphobos.bc
Binary file not shown.
@@ -1,6 +1,8 @@
|
||||
module test;
|
||||
module imports2;
|
||||
import std.stdio;
|
||||
|
||||
void main() {
|
||||
writefln("Hello world!"[]);
|
||||
print(42);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user