Skip to content

Commit ebdb044

Browse files
committed
[DebugCounter] Move the semicolon out of the DEBUG_COUNTER macro and require it to be placed at the end of each use.
This make it consistent with STATISTIC which it will often appears near. While there move one DEBUG_COUNTER instance out of an anonymous namespace. It's already declaring a static variable so the namespace is unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310637 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 01823a6 commit ebdb044

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

docs/ProgrammersManual.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ Define your DebugCounter like this:
12241224
.. code-block:: c++
12251225

12261226
DEBUG_COUNTER(DeleteAnInstruction, "passname-delete-instruction",
1227-
"Controls which instructions get delete")
1227+
"Controls which instructions get delete");
12281228

12291229
The ``DEBUG_COUNTER`` macro defines a static variable, whose name
12301230
is specified by the first argument. The name of the counter

include/llvm/Support/DebugCounter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class DebugCounter {
159159

160160
#define DEBUG_COUNTER(VARNAME, COUNTERNAME, DESC) \
161161
static const unsigned VARNAME = \
162-
DebugCounter::registerCounter(COUNTERNAME, DESC);
162+
DebugCounter::registerCounter(COUNTERNAME, DESC)
163163

164164
} // namespace llvm
165165
#endif

lib/Transforms/Scalar/NewGVN.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ STATISTIC(NumGVNPHIOfOpsCreated, "Number of PHI of ops created");
118118
STATISTIC(NumGVNPHIOfOpsEliminations,
119119
"Number of things eliminated using PHI of ops");
120120
DEBUG_COUNTER(VNCounter, "newgvn-vn",
121-
"Controls which instructions are value numbered")
121+
"Controls which instructions are value numbered");
122122
DEBUG_COUNTER(PHIOfOpsCounter, "newgvn-phi",
123-
"Controls which instructions we create phi of ops for")
123+
"Controls which instructions we create phi of ops for");
124124
// Currently store defining access refinement is too slow due to basicaa being
125125
// egregiously slow. This flag lets us keep it working while we work on this
126126
// issue.

lib/Transforms/Utils/PredicateInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ INITIALIZE_PASS_END(PredicateInfoPrinterLegacyPass, "print-predicateinfo",
4949
static cl::opt<bool> VerifyPredicateInfo(
5050
"verify-predicateinfo", cl::init(false), cl::Hidden,
5151
cl::desc("Verify PredicateInfo in legacy printer pass."));
52-
namespace {
5352
DEBUG_COUNTER(RenameCounter, "predicateinfo-rename",
54-
"Controls which variables are renamed with predicateinfo")
53+
"Controls which variables are renamed with predicateinfo");
54+
55+
namespace {
5556
// Given a predicate info that is a type of branching terminator, get the
5657
// branching block.
5758
const BasicBlock *getBranchBlock(const PredicateBase *PB) {

0 commit comments

Comments
 (0)