mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
LangOptions: Refactor feature state and API to account for adoption mode
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user