]> git.lizzy.rs Git - rust.git/commitdiff
Fix more missed query data
authorWesley Wiser <wwiser@gmail.com>
Wed, 6 Jun 2018 01:37:31 +0000 (21:37 -0400)
committerWesley Wiser <wwiser@gmail.com>
Thu, 2 Aug 2018 22:57:24 +0000 (18:57 -0400)
src/librustc/ty/query/plumbing.rs

index 2b0cdccd51afc2e7ac31a9f64f478a08fa3f94af..0fa643d796e0e1c7a3451ad84c35b9f133bcd78e 100644 (file)
@@ -369,6 +369,7 @@ fn try_get_with<Q: QueryDescription<'gcx>>(
             TryGetJob::NotYetStarted(job) => job,
             TryGetJob::JobCompleted(result) => {
                 return result.map(|(v, index)| {
+                    self.sess.profiler(|p| p.record_query_hit(Q::CATEGORY));
                     self.dep_graph.read_index(index);
                     v
                 })
@@ -592,7 +593,15 @@ pub(super) fn ensure_query<Q: QueryDescription<'gcx>>(self, key: Q::Key) -> () {
             // DepNodeIndex. We must invoke the query itself. The performance cost
             // this introduces should be negligible as we'll immediately hit the
             // in-memory cache, or another query down the line will.
+
+            self.sess.profiler(|p| {
+                p.start_activity(Q::CATEGORY);
+                p.record_query(Q::CATEGORY);
+            });
+
             let _ = self.get_query::<Q>(DUMMY_SP, key);
+
+            self.sess.profiler(|p| p.end_activity(Q::CATEGORY));
         }
     }