rogfer01 created this revision.
Herald added a reviewer: aaron.ballman.
Herald added subscribers: PiotrZSL, carlosgalvezp.
Herald added a reviewer: njames93.
Herald added a project: All.
rogfer01 requested review of this revision.
Herald added projects: clang, LLVM, clang-tools-extra.
Herald added subscribers: cfe-commits, llvm-commits.

I was reading ORCv2 HTML documentation and I found the text mentioned examples 
that were not present. Turns out there were some syntax issues in the 
reStructuedText file that prevented rendering them.

I did a grep through the rest of the docs and I found a few other instances of 
the problem, including missing newlines.

I was pleased to discover that clang attributes  `nodiscard` / 
`warn_unused_result` had a couple useful example that had never been rendered!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156438

Files:
  
clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst
  
clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst
  
clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst
  clang/include/clang/Basic/AttrDocs.td
  clang/include/clang/Basic/DiagnosticGroups.td
  llvm/docs/ORCv2.rst

Index: llvm/docs/ORCv2.rst
===================================================================
--- llvm/docs/ORCv2.rst
+++ llvm/docs/ORCv2.rst
@@ -311,7 +311,7 @@
 further materialization, for example: "foo" = 0x1234. One use case for
 absolute symbols is allowing resolution of process symbols. E.g.
 
-.. code-block: c++
+.. code-block:: c++
 
   JD.define(absoluteSymbols(SymbolMap({
       { Mangle("printf"),
@@ -334,7 +334,7 @@
 some calls. We could bake the address of your object into the library, but then
 it would need to be recompiled for each session:
 
-.. code-block: c++
+.. code-block:: c++
 
   // From standard library for JIT'd code:
 
@@ -347,7 +347,7 @@
 
 We can turn this into a symbolic reference in the JIT standard library:
 
-.. code-block: c++
+.. code-block:: c++
 
   extern MyJIT *__MyJITInstance;
 
@@ -356,7 +356,7 @@
 And then make our JIT object visible to the JIT standard library with an
 absolute symbol definition when the JIT is started:
 
-.. code-block: c++
+.. code-block:: c++
 
   MyJIT J = ...;
 
@@ -379,7 +379,7 @@
 used when the ``log`` symbol is referenced by setting up an alias at JIT startup
 time:
 
-.. code-block: c++
+.. code-block:: c++
 
   auto &JITStdLibJD = ... ;
 
@@ -397,7 +397,7 @@
 JITDylib. The ``reexports`` function provides the same functionality, but
 operates across JITDylib boundaries. E.g.
 
-.. code-block: c++
+.. code-block:: c++
 
   auto &JD1 = ... ;
   auto &JD2 = ... ;
Index: clang/include/clang/Basic/DiagnosticGroups.td
===================================================================
--- clang/include/clang/Basic/DiagnosticGroups.td
+++ clang/include/clang/Basic/DiagnosticGroups.td
@@ -1299,10 +1299,12 @@
 Results can be filtered by function name by passing
 `-mllvm -filter-print-funcs=foo`, where `foo` is the target function's name.
 
-   .. code-block: console
+   .. code-block:: console
+
       clang -c a.cpp -Rpass-analysis=stack-frame-layout -mllvm -filter-print-funcs=foo
 
-   .. code-block: console
+   .. code-block:: console
+
       clang -c a.cpp -Rpass-analysis=stack-frame-layout -foptimization-record-file=<file>
 }];
 }
@@ -1394,19 +1396,22 @@
 1. As a limit at a specific point in a file, using the ``clang max_tokens_here``
    pragma:
 
-   .. code-block: c++
+   .. code-block:: c++
+
       #pragma clang max_tokens_here 1234
 
 2. As a per-translation unit limit, using the ``-fmax-tokens=`` command-line
    flag:
 
-   .. code-block: console
+   .. code-block:: console
+
       clang -c a.cpp -fmax-tokens=1234
 
 3. As a per-translation unit limit using the ``clang max_tokens_total`` pragma,
    which works like and overrides the ``-fmax-tokens=`` flag:
 
-   .. code-block: c++
+   .. code-block:: c++
+
       #pragma clang max_tokens_total 1234
 
 These limits can be helpful in limiting code growth through included files.
Index: clang/include/clang/Basic/AttrDocs.td
===================================================================
--- clang/include/clang/Basic/AttrDocs.td
+++ clang/include/clang/Basic/AttrDocs.td
@@ -1858,7 +1858,8 @@
 variable, a function or method, a function parameter, an enumeration, an
 enumerator, a non-static data member, or a label.
 
-.. code-block: c++
+.. code-block:: c++
+
   #include <cassert>
 
   [[maybe_unused]] void f([[maybe_unused]] bool thing1,
@@ -1887,7 +1888,8 @@
 differing string literals, it is unspecified which one will be used by Clang
 in any resulting diagnostics.
 
-.. code-block: c++
+.. code-block:: c++
+
   struct [[nodiscard]] error_info { /*...*/ };
   error_info enable_missile_safety_mode();
 
@@ -1904,7 +1906,8 @@
 ``[[nodiscard]]`` will also diagnose. This also applies to type conversions that
 use the annotated ``[[nodiscard]]`` constructor or result in an annotated type.
 
-.. code-block: c++
+.. code-block:: c++
+
   struct [[nodiscard]] marked_type {/*..*/ };
   struct marked_ctor {
     [[nodiscard]] marked_ctor();
@@ -5685,12 +5688,12 @@
 ``noderef`` is currently only supported for pointers and arrays and not usable
 for references or Objective-C object pointers.
 
-.. code-block: c++
+.. code-block:: c++
 
   int x = 2;
   int __attribute__((noderef)) &y = x;  // warning: 'noderef' can only be used on an array or pointer type
 
-.. code-block: objc
+.. code-block:: objc
 
   id __attribute__((noderef)) obj = [NSObject new]; // warning: 'noderef' can only be used on an array or pointer type
 }];
Index: clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst
===================================================================
--- clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst
+++ clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst
@@ -10,7 +10,7 @@
 cancellation, a cancellation point in an asynchronous signal handler may still
 be acted upon and the effect is as if it was an asynchronous cancellation.
 
-.. code-block: c++
+.. code-block:: c++
 
   pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
 
Index: clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst
===================================================================
--- clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst
+++ clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst
@@ -8,13 +8,13 @@
 that checks whether a condition predicate holds or the function has a
 condition parameter.
 
-.. code-block: c++
+.. code-block:: c++
 
     if (condition_predicate) {
         condition.wait(lk);
     }
 
-.. code-block: c
+.. code-block:: c
 
     if (condition_predicate) {
         if (thrd_success != cnd_wait(&condition, &lock)) {
Index: clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst
===================================================================
--- clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst
+++ clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst
@@ -7,7 +7,7 @@
 raising ``SIGTERM`` signal and the signal kills the entire process, not
 just the individual thread. Use any signal except ``SIGTERM``.
 
-.. code-block: c++
+.. code-block:: c++
 
     pthread_kill(thread, SIGTERM);
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to