LangOptions: Refactor feature state and API to account for adoption mode

This commit is contained in:
Anthony Latsis
2025-02-21 15:33:04 +00:00
parent 2a88419f5c
commit 2771f36ced
9 changed files with 247 additions and 123 deletions

View File

@@ -41,3 +41,22 @@ void swift::PrintTo(const StrictConcurrency &value, std::ostream *os) {
break;
}
}
void swift::PrintTo(const LangOptions::FeatureState &value, std::ostream *os) {
PrintTo((const LangOptions::FeatureState::Kind &)value, os);
}
void swift::PrintTo(const LangOptions::FeatureState::Kind &value,
std::ostream *os) {
switch (value) {
case LangOptions::FeatureState::Off:
*os << "Off";
break;
case LangOptions::FeatureState::EnabledForAdoption:
*os << "EnabledForAdoption";
break;
case LangOptions::FeatureState::Enabled:
*os << "Enabled";
break;
}
}