[llvm] r310637 - [DebugCounter] Move the semicolon out of the DEBUG_COUNTER macro and require it to be placed at the end of each use.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 10:48:11 PDT 2017

Author: ctopper
Date: Thu Aug 10 10:48:11 2017
New Revision: 310637

URL: http://llvm.org/viewvc/llvm-project?rev=310637&view=rev
[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.


Modified: llvm/trunk/docs/ProgrammersManual.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=310637&r1=310636&r2=310637&view=diff
--- llvm/trunk/docs/ProgrammersManual.rst (original)
+++ llvm/trunk/docs/ProgrammersManual.rst Thu Aug 10 10:48:11 2017
@@ -1224,7 +1224,7 @@ Define your DebugCounter like this:
 .. code-block:: c++
   DEBUG_COUNTER(DeleteAnInstruction, "passname-delete-instruction",
-		"Controls which instructions get delete")
+		"Controls which instructions get delete");
 The ``DEBUG_COUNTER`` macro defines a static variable, whose name
 is specified by the first argument.  The name of the counter

Modified: llvm/trunk/include/llvm/Support/DebugCounter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DebugCounter.h?rev=310637&r1=310636&r2=310637&view=diff
--- llvm/trunk/include/llvm/Support/DebugCounter.h (original)
+++ llvm/trunk/include/llvm/Support/DebugCounter.h Thu Aug 10 10:48:11 2017
@@ -159,7 +159,7 @@ private:
 #define DEBUG_COUNTER(VARNAME, COUNTERNAME, DESC)                              \
   static const unsigned VARNAME =                                              \
-      DebugCounter::registerCounter(COUNTERNAME, DESC);
+      DebugCounter::registerCounter(COUNTERNAME, DESC)
 } // namespace llvm

Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=310637&r1=310636&r2=310637&view=diff
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Thu Aug 10 10:48:11 2017
@@ -118,9 +118,9 @@ STATISTIC(NumGVNPHIOfOpsCreated, "Number
           "Number of things eliminated using PHI of ops");
 DEBUG_COUNTER(VNCounter, "newgvn-vn",
-              "Controls which instructions are value numbered")
+              "Controls which instructions are value numbered");
 DEBUG_COUNTER(PHIOfOpsCounter, "newgvn-phi",
-              "Controls which instructions we create phi of ops for")
+              "Controls which instructions we create phi of ops for");
 // Currently store defining access refinement is too slow due to basicaa being
 // egregiously slow.  This flag lets us keep it working while we work on this
 // issue.

Modified: llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp?rev=310637&r1=310636&r2=310637&view=diff
--- llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PredicateInfo.cpp Thu Aug 10 10:48:11 2017
@@ -49,9 +49,10 @@ INITIALIZE_PASS_END(PredicateInfoPrinter
 static cl::opt<bool> VerifyPredicateInfo(
     "verify-predicateinfo", cl::init(false), cl::Hidden,
     cl::desc("Verify PredicateInfo in legacy printer pass."));
-namespace {
 DEBUG_COUNTER(RenameCounter, "predicateinfo-rename",
-              "Controls which variables are renamed with predicateinfo")
+              "Controls which variables are renamed with predicateinfo");
+namespace {
 // Given a predicate info that is a type of branching terminator, get the
 // branching block.
 const BasicBlock *getBranchBlock(const PredicateBase *PB) {

More information about the llvm-commits mailing list