Skip to content

Commit a90b37a

Browse files
committed
Copy enabled warning groups into child sinks from their parent
The parent-sink constructor forwarded flags/color/unicode but not the enabled warning-group bitmask, so a child sink lost the group configuration. Add get/setEnabledWarningLevels (mirroring getFlags/setFlags) and copy it too.
1 parent 0f8c787 commit a90b37a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

source/compiler-core/slang-diagnostic-sink.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ class DiagnosticSink
330330
return bit < 32 && (m_enabledWarningLevels & (uint32_t(1) << bit)) != 0;
331331
}
332332

333+
/// Get/set the raw enabled-warning-group bitmask. Used to copy this settings-shaped state
334+
/// between sinks (e.g. from a parent sink), mirroring getFlags/setFlags.
335+
uint32_t getEnabledWarningLevels() const { return m_enabledWarningLevels; }
336+
void setEnabledWarningLevels(uint32_t levels) { m_enabledWarningLevels = levels; }
337+
333338
/// Get the (optional) diagnostic sink lexer. This is used to
334339
/// improve quality of highlighting a locations token. If not set, will just have a single
335340
/// character caret at location
@@ -415,6 +420,7 @@ class DiagnosticSink
415420
setFlags(parentSink->getFlags());
416421
setDiagnosticColorMode(parentSink->getDiagnosticColorMode());
417422
setEnableUnicode(parentSink->getEnableUnicode());
423+
setEnabledWarningLevels(parentSink->getEnabledWarningLevels());
418424
}
419425
}
420426
/// Default Ctor

0 commit comments

Comments
 (0)