[DebugCounters] Keep track of total counts
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 23 Jul 2018 21:49:36 +0000 (21:49 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Mon, 23 Jul 2018 21:49:36 +0000 (21:49 +0000)
commitb00fb46479a3f9217408e007b02bb2200e7d6a19
treec95676d9b91ee4d21db4b3995ac91e28a94f0098
parentd9c254771dcdb8bd5e39aada5b8336a4bff52195
[DebugCounters] Keep track of total counts

This patch makes debug counters keep track of the total number of times
we've called `shouldExecute` for each counter, so it's easier to build
automated tooling on top of these.

A patch to print these counts is coming soon.

Patch by Zhizhou Yang!

Differential Revision: https://reviews.llvm.org/D49560

llvm-svn: 337748
llvm/include/llvm/Support/DebugCounter.h
llvm/lib/Support/DebugCounter.cpp
llvm/lib/Transforms/Scalar/NewGVN.cpp
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Support/DebugCounterTest.cpp [new file with mode: 0644]