Skip to content

Commit

Permalink
Disable internalizing of nested functions.
Browse files Browse the repository at this point in the history
This works around linking problems such as vibe-d/vibe.d#338,
caused by the frontend appending template instances to the wrong
module.

GitHub: Fixes ldc-developers#558.
  • Loading branch information
dnadlinger committed Dec 26, 2013
1 parent a1ca0de commit be18526
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gen/tollvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ LLGlobalValue::LinkageTypes DtoLinkage(Dsymbol* sym)
llvm_unreachable("not global/function");
}

// The logic here should be sound in theory, but as long as the frontend
// keeps inserting templates into wrong modules, this yields to linking
// errors (see e.g. GitHub issue #558).
#if 0
// Check if sym is a nested function and we can declare it as internal.
//
// Nested naked functions and the implicitly generated __require/__ensure
Expand Down Expand Up @@ -427,7 +431,7 @@ LLGlobalValue::LinkageTypes DtoLinkage(Dsymbol* sym)
}
}
}

#endif
// default to external linkage
return llvm::GlobalValue::ExternalLinkage;
}
Expand Down

0 comments on commit be18526

Please sign in to comment.