File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,9 @@ class SILOptions {
276
276
// / is a single SILModule in a single thread.
277
277
bool checkSILModuleLeaks = false ;
278
278
279
+ // / Are we building in embedded Swift mode?
280
+ bool EmbeddedSwift = false ;
281
+
279
282
// / The name of the file to which the backend should save optimization
280
283
// / records.
281
284
std::string OptRecordFile;
Original file line number Diff line number Diff line change @@ -3118,6 +3118,7 @@ bool CompilerInvocation::parseArgs(
3118
3118
IRGenOpts.InternalizeAtLink = true ;
3119
3119
IRGenOpts.DisableLegacyTypeInfo = true ;
3120
3120
SILOpts.CMOMode = CrossModuleOptimizationMode::Everything;
3121
+ SILOpts.EmbeddedSwift = true ;
3121
3122
}
3122
3123
3123
3124
return false ;
Original file line number Diff line number Diff line change @@ -891,8 +891,12 @@ SILPassPipelinePlan::getIRGenPreparePassPipeline(const SILOptions &Options) {
891
891
// boundaries as required by the ABI.
892
892
P.addLoadableByAddress ();
893
893
894
- // For embedded Swift: Remove all unspecialized functions.
895
- P.addLateDeadFunctionAndGlobalElimination ();
894
+ if (Options.EmbeddedSwift ) {
895
+ // For embedded Swift: Remove all unspecialized functions. This is important
896
+ // to avoid having debuginfo references to these functions that we don't
897
+ // want to emit in IRGen.
898
+ P.addLateDeadFunctionAndGlobalElimination ();
899
+ }
896
900
897
901
if (Options.EnablePackMetadataStackPromotion ) {
898
902
// Insert marker instructions indicating where on-stack pack metadata
You can’t perform that action at this time.
0 commit comments