[llvm] r297656 - Fix some indenting and line-wrapping issues identified in ProgrammersManual. Make description of debugCounters a little clearer

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 12:09:25 PDT 2017


Author: dannyb
Date: Mon Mar 13 14:09:23 2017
New Revision: 297656

URL: http://llvm.org/viewvc/llvm-project?rev=297656&view=rev
Log:
Fix some indenting and line-wrapping issues identified in ProgrammersManual. Make description of debugCounters a little clearer

Modified:
    llvm/trunk/docs/ProgrammersManual.rst

Modified: llvm/trunk/docs/ProgrammersManual.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=297656&r1=297655&r2=297656&view=diff
==============================================================================
--- llvm/trunk/docs/ProgrammersManual.rst (original)
+++ llvm/trunk/docs/ProgrammersManual.rst Mon Mar 13 14:09:23 2017
@@ -1137,23 +1137,23 @@ uniform manner with the rest of the pass
 There are many examples of ``Statistic`` uses, but the basics of using it are as
 follows:
 
-#. Define your statistic like this:
+Define your statistic like this:
 
-  .. code-block:: c++
+.. code-block:: c++
 
-    #define DEBUG_TYPE "mypassname"   // This goes before any #includes.
-    STATISTIC(NumXForms, "The # of times I did stuff");
+  #define DEBUG_TYPE "mypassname"   // This goes before any #includes.
+  STATISTIC(NumXForms, "The # of times I did stuff");
 
-  The ``STATISTIC`` macro defines a static variable, whose name is specified by
-  the first argument.  The pass name is taken from the ``DEBUG_TYPE`` macro, and
-  the description is taken from the second argument.  The variable defined
-  ("NumXForms" in this case) acts like an unsigned integer.
+The ``STATISTIC`` macro defines a static variable, whose name is specified by
+the first argument.  The pass name is taken from the ``DEBUG_TYPE`` macro, and
+the description is taken from the second argument.  The variable defined
+("NumXForms" in this case) acts like an unsigned integer.
 
-#. Whenever you make a transformation, bump the counter:
+Whenever you make a transformation, bump the counter:
 
-  .. code-block:: c++
+.. code-block:: c++
 
-    ++NumXForms;   // I did stuff!
+  ++NumXForms;   // I did stuff!
 
 That's all you have to do.  To get '``opt``' to print out the statistics
 gathered, use the '``-stats``' option:
@@ -1211,8 +1211,9 @@ is useful to be able to control whether
 happen or not.  For example, there are times the minimization tooling
 can only easily give you large testcases.  You would like to narrow
 your bug down to a specific transformation happening or not happening,
-automatically.  This is where debug counters help.  They provide a framework
-for making parts of your code only execute a certain number of times.
+automatically, using bisection.  This is where debug counters help.
+They provide a framework for making parts of your code only execute a
+certain number of times.
 
 The ``llvm/Support/DebugCounter.h`` (`doxygen
 <http://llvm.org/doxygen/DebugCounter_8h_source.html>`__) file
@@ -1221,23 +1222,23 @@ command line counter options that contro
 
 Define your DebugCounter like this:
 
-  .. code-block:: c++
+.. code-block:: c++
 
-    DEBUG_COUNTER(DeleteAnInstruction, "passname-delete-instruction",
-                  "Controls which instructions get delete").
+  DEBUG_COUNTER(DeleteAnInstruction, "passname-delete-instruction",
+		"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
-  (which is used on the command line) is specified by the second
-  argument, and the description used in the help is specified by the
-  third argument.
+The ``DEBUG_COUNTER`` macro defines a static variable, whose name
+is specified by the first argument.  The name of the counter
+(which is used on the command line) is specified by the second
+argument, and the description used in the help is specified by the
+third argument.
 
 Whatever code you want that control, use ``DebugCounter::shouldExecute`` to control it.
 
-  .. code-block:: c++
+.. code-block:: c++
 
-    if (DebugCounter::shouldExecute(DeleteAnInstruction))
-      I->eraseFromParent();
+  if (DebugCounter::shouldExecute(DeleteAnInstruction))
+    I->eraseFromParent();
 
 That's all you have to do.  Now, using opt, you can control when this code triggers using
 the '``--debug-counter``' option.  There are two counters provided, ``skip`` and ``count``.
@@ -1261,8 +1262,9 @@ So if executed on the following code:
 
 It would delete number ``%2`` and ``%3``.
 
-A utility is provided in `utils/bisect-skip-count` to binary search skip and count arguments. It can be used to automatically minimize
-the skip and count for a debug-counter variable.
+A utility is provided in `utils/bisect-skip-count` to binary search
+skip and count arguments. It can be used to automatically minimize the
+skip and count for a debug-counter variable.
 
 .. _ViewGraph:
 




More information about the llvm-commits mailing list