mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
embedded: allow dead function elimination for de-serialized functions
In embedded swift all de-serialized get public linkage because all the code is generated in the top-level module. This change moves the point where we make de-serialized functions public to the end of the pipeline. This allows dead function elimination to remove unused de-serialized functions. For some stdlib functions (actually one: the Double initializer for a builtin integer) is essential, because codegen for embedded produces an unresolved symbol. rdar://123772098
This commit is contained in:
@@ -940,6 +940,9 @@ bool SILFunction::shouldBePreservedForDebugger() const {
|
||||
if (getEffectiveOptimizationMode() != OptimizationMode::NoOptimization)
|
||||
return false;
|
||||
|
||||
if (isAvailableExternally())
|
||||
return false;
|
||||
|
||||
if (hasSemanticsAttr("no.preserve.debugger"))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user