[PATCH] D156438: [Docs] Fix code-blocks missing colon
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG31747668: [Docs] Fix code-blocks missing a colon and a newline (authored by rogfer01). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156438/new/ 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 = ... ; @@ -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 = ... ; auto = ... ; 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= }]; } @@ -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 [[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)) = x; // warning: 'noderef' can only be used on an array or pointer type -.. code-block: objc +..
[PATCH] D156438: [Docs] Fix code-blocks missing colon
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM, good catch! It'd be nice if we could somehow configure Sphinx to complain about this issue so we'd catch it proactively with the sphinx build bots. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156438/new/ https://reviews.llvm.org/D156438 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D156438: [Docs] Fix code-blocks missing colon
PiotrZSL accepted this revision. PiotrZSL added a comment. This revision is now accepted and ready to land. Thank you. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156438/new/ https://reviews.llvm.org/D156438 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D156438: [Docs] Fix code-blocks missing colon
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 = ... ; @@ -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 = ... ; auto = ... ; 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= }]; } @@ -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 [[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