add debug info to dep_graph

This commit is contained in:
Niko Matsakis 2016-05-13 18:48:46 -04:00
parent e4c31de61e
commit eaafe45c08
2 changed files with 5 additions and 1 deletions

View file

@ -28,6 +28,7 @@ use super::DepGraphQuery;
use super::DepNode;
use super::edges::DepGraphEdges;
#[derive(Debug)]
pub enum DepMessage {
Read(DepNode<DefId>),
Write(DepNode<DefId>),
@ -117,6 +118,8 @@ impl DepGraphThreadData {
/// the buffer is full, this may swap.)
#[inline]
pub fn enqueue(&self, message: DepMessage) {
debug!("enqueue: {:?} tasks_pushed={}", message, self.tasks_pushed.get());
// Regardless of whether dep graph construction is enabled, we
// still want to check that we always have a valid task on the
// stack when a read/write/etc event occurs.

View file

@ -42,7 +42,8 @@ pub fn visit_all_items_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let _task = self.tcx.dep_graph.in_task(task_id);
debug!("Started task {:?}", task_id);
self.tcx.dep_graph.read(DepNode::Hir(item_def_id));
self.visitor.visit_item(i)
self.visitor.visit_item(i);
debug!("Ended task {:?}", task_id);
}
}