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
839839 OptMode = unsigned (mode);
840840 }
841841
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+
842851 PerformanceConstraints getPerfConstraints () const { return perfConstraints; }
843852
844853 void setPerfConstraints (PerformanceConstraints perfConstr) {
Original file line number Diff line number Diff line change @@ -281,6 +281,10 @@ OptimizationMode SILFunction::getEffectiveOptimizationMode() const {
281281 return getModule ().getOptions ().OptMode ;
282282}
283283
284+ bool SILFunction::preserveDebugInfo () const {
285+ return getEffectiveOptimizationMode () <= OptimizationMode::NoOptimization;
286+ }
287+
284288bool SILFunction::shouldOptimize () const {
285289 return getEffectiveOptimizationMode () != OptimizationMode::NoOptimization;
286290}
You can’t perform that action at this time.
0 commit comments