@@ -179,21 +179,10 @@ void EnumRawTypeRequest::diagnoseCycle(DiagnosticEngine &diags) const {
179
179
diags.diagnose (enumDecl, diag::circular_enum_inheritance, enumDecl->getName ());
180
180
}
181
181
182
- bool EnumRawTypeRequest::isCached () const {
183
- return std::get<1 >(getStorage ()) == TypeResolutionStage::Interface;
184
- }
185
-
186
- Optional<Type> EnumRawTypeRequest::getCachedResult () const {
187
- auto enumDecl = std::get<0 >(getStorage ());
188
- if (enumDecl->LazySemanticInfo .hasRawType ())
189
- return enumDecl->LazySemanticInfo .RawTypeAndFlags .getPointer ();
190
-
191
- return None;
192
- }
193
-
194
- void EnumRawTypeRequest::cacheResult (Type value) const {
195
- auto enumDecl = std::get<0 >(getStorage ());
196
- enumDecl->LazySemanticInfo .cacheRawType (value);
182
+ void EnumRawTypeRequest::noteCycleStep (DiagnosticEngine &diags) const {
183
+ auto *decl = std::get<0 >(getStorage ());
184
+ diags.diagnose (decl, diag::kind_declname_declared_here,
185
+ decl->getDescriptiveKind (), decl->getName ());
197
186
}
198
187
199
188
// ----------------------------------------------------------------------------//
@@ -854,17 +843,15 @@ bool EnumRawValuesRequest::isCached() const {
854
843
855
844
Optional<evaluator::SideEffect> EnumRawValuesRequest::getCachedResult () const {
856
845
auto *ED = std::get<0 >(getStorage ());
857
- if (ED->LazySemanticInfo . hasCheckedRawValues ( ))
846
+ if (ED->SemanticFlags . contains (EnumDecl::HasFixedRawValuesAndTypes ))
858
847
return std::make_tuple<>();
859
848
return None;
860
849
}
861
850
862
851
void EnumRawValuesRequest::cacheResult (evaluator::SideEffect) const {
863
852
auto *ED = std::get<0 >(getStorage ());
864
- auto flags = ED->LazySemanticInfo .RawTypeAndFlags .getInt () |
865
- EnumDecl::HasFixedRawValues |
866
- EnumDecl::HasFixedRawValuesAndTypes;
867
- ED->LazySemanticInfo .RawTypeAndFlags .setInt (flags);
853
+ ED->SemanticFlags |= OptionSet<EnumDecl::SemanticInfoFlags>{
854
+ EnumDecl::HasFixedRawValues | EnumDecl::HasFixedRawValuesAndTypes};
868
855
}
869
856
870
857
void EnumRawValuesRequest::diagnoseCycle (DiagnosticEngine &diags) const {
0 commit comments