-
Notifications
You must be signed in to change notification settings - Fork 13.6k
incr.comp.: Switch to red/green change tracking, remove legacy system. #44901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a948be8
6db27d9
f0bbf4e
e1994bd
c9a17ef
e6badfd
272c324
171c020
df06a7e
dbab705
c96d0bf
0454a41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,6 +320,10 @@ macro_rules! define_maps { | |
dep_node_index) | ||
} | ||
|
||
debug!("ty::queries::{}::try_get_with(key={:?}) - running try_mark_green", | ||
stringify!($name), | ||
key); | ||
|
||
if let Some(dep_node_index) = tcx.dep_graph.try_mark_green(tcx, &dep_node) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious, why not make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't that mean that we always load the result from the cache, even if it is never asked for? |
||
debug_assert!(tcx.dep_graph.is_green(dep_node_index)); | ||
profq_msg!(tcx, ProfileQueriesMsg::CacheHit); | ||
|
@@ -363,6 +367,10 @@ macro_rules! define_maps { | |
}) | ||
})?; | ||
|
||
if tcx.sess.opts.debugging_opts.query_dep_graph { | ||
tcx.dep_graph.mark_loaded_from_cache(dep_node_index, true); | ||
} | ||
|
||
let value = QueryValue::new(result, dep_node_index, diagnostics); | ||
|
||
Ok((&tcx.maps | ||
|
@@ -394,6 +402,10 @@ macro_rules! define_maps { | |
|
||
let ((result, dep_node_index), diagnostics) = res; | ||
|
||
if tcx.sess.opts.debugging_opts.query_dep_graph { | ||
tcx.dep_graph.mark_loaded_from_cache(dep_node_index, false); | ||
} | ||
|
||
let value = QueryValue::new(result, dep_node_index, diagnostics); | ||
|
||
Ok(((&tcx.maps | ||
|
@@ -406,8 +418,6 @@ macro_rules! define_maps { | |
dep_node_index)) | ||
} | ||
|
||
|
||
|
||
pub fn try_get(tcx: TyCtxt<'a, $tcx, 'lcx>, span: Span, key: $K) | ||
-> Result<$V, DiagnosticBuilder<'a>> { | ||
match Self::try_get_with(tcx, span, key) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,9 +79,7 @@ pub fn provide_local(providers: &mut Providers) { | |
providers.is_exported_symbol = |tcx, id| { | ||
// FIXME(#42293) needs red/green to not break a bunch of incremental | ||
// tests | ||
tcx.dep_graph.with_ignore(|| { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. :D (you can probably delete the FIXME above this as well) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
tcx.exported_symbol_ids(id.krate).contains(&id) | ||
}) | ||
tcx.exported_symbol_ids(id.krate).contains(&id) | ||
}; | ||
|
||
providers.exported_symbols = |tcx, cnum| { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels like it merits a nice comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
:)