diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/bad-signal-to-kill-thread.rst +++ b/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); diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/spuriously-wake-up-functions.rst +++ b/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)) { diff --git a/clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst b/clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst --- a/clang-tools-extra/docs/clang-tidy/checks/concurrency/thread-canceltype-asynchronous.rst +++ b/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); diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td --- a/clang/include/clang/Basic/AttrDocs.td +++ b/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 [[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 }]; diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/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= }]; } @@ -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. diff --git a/llvm/docs/ORCv2.rst b/llvm/docs/ORCv2.rst --- a/llvm/docs/ORCv2.rst +++ b/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 = ... ;