File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -839,6 +839,15 @@ class SILFunction
839
839
OptMode = unsigned (mode);
840
840
}
841
841
842
+ // / True if debug information must be preserved (-Onone).
843
+ // /
844
+ // / If this is false (-O), then the presence of debug info must not affect the
845
+ // / outcome of any transformations.
846
+ // /
847
+ // / Typically used to determine whether a debug_value is a normal SSA use or
848
+ // / incidental use.
849
+ bool preserveDebugInfo () const ;
850
+
842
851
PerformanceConstraints getPerfConstraints () const { return perfConstraints; }
843
852
844
853
void setPerfConstraints (PerformanceConstraints perfConstr) {
Original file line number Diff line number Diff line change @@ -281,6 +281,10 @@ OptimizationMode SILFunction::getEffectiveOptimizationMode() const {
281
281
return getModule ().getOptions ().OptMode ;
282
282
}
283
283
284
+ bool SILFunction::preserveDebugInfo () const {
285
+ return getEffectiveOptimizationMode () <= OptimizationMode::NoOptimization;
286
+ }
287
+
284
288
bool SILFunction::shouldOptimize () const {
285
289
return getEffectiveOptimizationMode () != OptimizationMode::NoOptimization;
286
290
}
You can’t perform that action at this time.
0 commit comments