Skip to content

Commit 9d0fc8b

Browse files
committed
embedded: In IRGen, don't force generate code for functions which are imported from other modules.
Only generate code lazily for such functions, i.e. only if such a function is referenced from already generated code. This is achieved by converting the SILLinkage for `public_external` functions to `internal` instead of `public in IRGenPrepare.
1 parent cc308c9 commit 9d0fc8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Mandatory/IRGenPrepare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class IRGenPrepare : public SILFunctionTransform {
9292
// Even de-serialized functions must be code-gen'd.
9393
SILLinkage linkage = F->getLinkage();
9494
if (isAvailableExternally(linkage)) {
95-
F->setLinkage(stripExternalFromLinkage(linkage));
95+
F->setLinkage(SILLinkage::Hidden);
9696
}
9797
}
9898

0 commit comments

Comments
 (0)