Fix Constants Analyses bug inserted by #2302 (#2306)

Need to also remove Constants from the valid_analyses set when
invalidated, otherwise Constants is not reinitialized before used.
This commit is contained in:
greg-lunarg 2019-01-21 10:34:12 -07:00 committed by Steven Perron
parent eab06d669e
commit a64c651e18

View File

@ -89,6 +89,11 @@ void IRContext::InvalidateAnalysesExceptFor(
}
void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) {
// The ConstantManager contains Type pointers. If the TypeManager goes
// away, the ConstantManager has to go away.
if (analyses_to_invalidate & kAnalysisTypes) {
analyses_to_invalidate |= kAnalysisConstants;
}
if (analyses_to_invalidate & kAnalysisDefUse) {
def_use_mgr_.reset(nullptr);
}
@ -127,9 +132,6 @@ void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) {
constant_mgr_.reset(nullptr);
}
if (analyses_to_invalidate & kAnalysisTypes) {
// The ConstantManager contains Type pointers. If the TypeManager goes
// away, the ConstantManager has to go away.
constant_mgr_.reset(nullptr);
type_mgr_.reset(nullptr);
}