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 index 8bf5ab17af5c9..24b08da6c5c30 100644 --- 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 @@ Finds ``pthread_kill`` function calls when a thread is terminated by 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 index c1bd8f3c7fdd0..1b5bab2143a2d 100644 --- 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 @@ Finds ``cnd_wait``, ``cnd_timedwait``, ``wait``, ``wait_for``, or 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 index 7f058a89a2c39..11edd001365d1 100644 --- 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 @@ type is set to asynchronous. Asynchronous cancellation type 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 index 2c950231255d7..cd1d298b0a8ff 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -1858,7 +1858,8 @@ The attribute may be applied to the declaration of a class, a typedef, a 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 @@ literal contents) are allowed. If there are redeclarations of the entity with 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 @@ marked with ``[[nodiscard]]`` or a constructor of a type marked ``[[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 @@ accessed. The following are examples of valid expressions where may not be diagn ``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 index 6a0a01e4a981a..a399b63161f89 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -1299,10 +1299,12 @@ like YAML by adding the `-foptimization-record-file=` command-line flag. 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 @@ the token limit, which can be set in three ways: 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 index fbe9eee962a7e..add05e05a80e5 100644 --- a/llvm/docs/ORCv2.rst +++ b/llvm/docs/ORCv2.rst @@ -311,7 +311,7 @@ Absolute symbols are symbols that map directly to addresses without requiring 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 @@ imagine that your JIT standard library needs access to your JIT object to make 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 @@ it would need to be recompiled for each session: 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 @@ We can turn this into a symbolic reference in the JIT standard library: 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 @@ there are two implementations in the JIT standard library: ``log_fast`` and 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 @@ The ``symbolAliases`` function allows you to define aliases within a single 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 = ... ;