]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/profile.h
* config/i386/i386.md (@cmp<mode>_1): Rename from cmp<mode>_1.
[thirdparty/gcc.git] / gcc / profile.h
index 811c58a5382e0aac52541fee46bd278b174cf315..e30630de5d10ef1eae22459eabffa1ca5cab985b 100644 (file)
@@ -1,6 +1,6 @@
 /* Header file for minimum-cost maximal flow routines used to smooth basic
    block and edge frequency counts.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2019 Free Software Foundation, Inc.
    Contributed by Paul Yuan (yingbo.com@gmail.com)
        and Vinodha Ramasamy (vinodha@google.com).
 
@@ -37,6 +37,27 @@ struct edge_profile_info
 
 #define EDGE_INFO(e)  ((struct edge_profile_info *) (e)->aux)
 
+/* Helpers annotating edges/basic blocks to GCOV counts.  */
+
+extern vec<gcov_type> bb_gcov_counts;
+extern hash_map<edge,gcov_type> *edge_gcov_counts;
+
+inline gcov_type &
+edge_gcov_count (edge e)
+{
+  bool existed;
+  gcov_type &c = edge_gcov_counts->get_or_insert (e, &existed);
+  if (!existed)
+    c = 0;
+  return c;
+}
+
+inline gcov_type &
+bb_gcov_count (basic_block bb)
+{
+  return bb_gcov_counts[bb->index];
+}
+
 typedef struct gcov_working_set_info gcov_working_set_t;
 extern gcov_working_set_t *find_working_set (unsigned pct_times_10);
 extern void add_working_set (gcov_working_set_t *);
@@ -54,6 +75,6 @@ extern void get_working_sets (void);
 
 /* Counter summary from the last set of coverage counts read by
    profile.c.  */
-extern const struct gcov_ctr_summary *profile_info;
+extern struct gcov_summary *profile_info;
 
 #endif /* PROFILE_H */