diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-03-31 17:12:03 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-03-31 17:12:06 +0200 |
| commit | f3dde45d2a963c32994a78f3ea0119a2da973c14 (patch) | |
| tree | 7c18512a32e80075161f4fed061ecc06fc95e686 /compiler/rustc_query_system | |
| parent | 8ee9322c1041bcbaee408961727c4418bd792979 (diff) | |
| download | rust-f3dde45d2a963c32994a78f3ea0119a2da973c14.tar.gz rust-f3dde45d2a963c32994a78f3ea0119a2da973c14.zip | |
Enable debugging the dep-graph without debug-assertions.
It may also be useful in these cases, and some CI configurations test without debug assertions.
Diffstat (limited to 'compiler/rustc_query_system')
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/serialized.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_query_system/src/dep_graph/serialized.rs b/compiler/rustc_query_system/src/dep_graph/serialized.rs index 1e34b14d906..6f3d1fb7199 100644 --- a/compiler/rustc_query_system/src/dep_graph/serialized.rs +++ b/compiler/rustc_query_system/src/dep_graph/serialized.rs @@ -157,11 +157,11 @@ impl<K: DepKind> EncoderState<K> { } } - #[instrument(skip(self, _record_graph))] + #[instrument(skip(self, record_graph))] fn encode_node( &mut self, node: &NodeInfo<K>, - _record_graph: &Option<Lock<DepGraphQuery<K>>>, + record_graph: &Option<Lock<DepGraphQuery<K>>>, ) -> DepNodeIndex { let index = DepNodeIndex::new(self.total_node_count); self.total_node_count += 1; @@ -169,8 +169,7 @@ impl<K: DepKind> EncoderState<K> { let edge_count = node.edges.len(); self.total_edge_count += edge_count; - #[cfg(debug_assertions)] - if let Some(record_graph) = &_record_graph { + if let Some(record_graph) = &record_graph { // Do not ICE when a query is called from within `with_query`. if let Some(record_graph) = &mut record_graph.try_lock() { record_graph.push(index, node.node, &node.edges); @@ -222,11 +221,8 @@ impl<K: DepKind + Encodable<FileEncoder>> GraphEncoder<K> { record_graph: bool, record_stats: bool, ) -> Self { - let record_graph = if cfg!(debug_assertions) && record_graph { - Some(Lock::new(DepGraphQuery::new(prev_node_count))) - } else { - None - }; + let record_graph = + if record_graph { Some(Lock::new(DepGraphQuery::new(prev_node_count))) } else { None }; let status = Lock::new(EncoderState::new(encoder, record_stats)); GraphEncoder { status, record_graph } } |
