Repository navigation
Conversation
|
An automated preview of the documentation is available at https://134.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-10-19 21:16:14 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #134 +/- ##
========================================
Coverage 92.56% 92.56%
========================================
Files 29 29
Lines 2314 2314
Branches 699 699
========================================
Hits 2142 2142
Misses 111 111
Partials 61 61 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
dev/ce_link.py turns the tagged region of a doc example into a godbolt.org/clientstate URL that carries the source itself, so nothing is stored on Compiler Explorer until a reader opens the link, and the link is regenerated from the example when the example changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dev/ce_link.py --base opens the example beside another one, with CE's source diff between the two and the example's output: here, the open-method AST against the virtual function version from the motivation page. An example that includes a Boost header gets Boost 1.92 from CE's library list. The tag directives nested in the region are dropped, as Asciidoctor drops them from the include. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The motivation link moves to the listing that adds `postfix` as a virtual function, and opens the complete program, ast_virtual_function_2.cpp. The "Putting it all together" diff now takes that program as its base, and compiles both sides so that it also shows the diff between their disassemblies (Intel syntax). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
performance.adoc gets a link that compiles the virtual function call and the two method calls side by side with clang, each in its own compiler pane. They come from two minimal translation units, dispatch_virtual_function.cpp and dispatch_open_method.cpp: a full program buries the calls under the registration code. The page now includes its three call listings from those files, so the page and the link show the same code; each file ends with an empty main, outside the tagged region, so it still builds as an example. The diff on basics.adoc drops its assembly diff, which compared whole programs, and keeps the source diff and the output. dev/ce_link.py: --beside, --compiler; --base-tag becomes --other-tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
CE's "Library functions" filter hid it: the filter goes by line info, and every instruction of call_via_virtual_ptr is dispatch code inlined from core.hpp. Turn the filter off; the call functions still come first in the clang output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
The Compiler Explorer comparison compiles with clang 23, which folds the last load into the indirect jump: one `mov` fewer in the virtual function call and in both method calls. Update the three listings to match, and say in a note which compiler, options and Boost version they come from. llvm-mca (skylake) gives the same throughputs for the clang 23 code, 1 and 4 cycles, so the text stands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
The "Putting it all together" link now opens ast.cpp and runs it, with no diff against the virtual function version. That leaves --base without a user, so it goes; --other-tag, now used by --beside only, becomes --beside-tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
main() builds the expression and hands it to demo(), which prints it and its value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
The motivation and basics links compiled with gcc 16.2; make clang 23.1, which the performance comparison already used, the default of dev/ce_link.py, and regenerate them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
As ast.cpp does: main() builds the expression and hands it to demo(). Both programs on the page change together, so that the postfix listing still reads as the first one plus postfix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(Written by Claude Code, on behalf of @jll63.)
Adds Compiler Explorer links to three documentation pages, generated from the example sources.
The links
motivation.adocpostfixas a virtual function (ast_virtual_function_2.cpp), with its assembly and output.basics.adoc, "Putting it all together"ast.cpp, the open-method version, with its assembly and output.performance.adoccall_virtual_functionbesidecall_via_refandcall_via_virtual_ptr, each in its own assembly pane.All three use x86-64 clang 23.1.0 with
-std=c++17 -O2. Examples that include Boost use Boost 1.92 from CE's library list, not this tree's headers.dev/ce_link.pyThe script prints a
godbolt.org/clientstate/<base64>URL that carries the source itself. Nothing is stored on Compiler Explorer until a reader opens the link, and the link can be regenerated whenever the example changes:dev/ce_link.py doc/modules/ROOT/examples/ast.cpp dev/ce_link.py doc/modules/ROOT/examples/ast_virtual_function_2.cpp --tag all dev/ce_link.py doc/modules/ROOT/examples/dispatch_open_method.cpp \ --beside doc/modules/ROOT/examples/dispatch_virtual_function.cpptag::/end::lines, as Asciidoctor drops them. The reader gets exactly the code shown on the page.+in the base64 would be taken by AsciiDoc for a passthrough before thelink:macro sees it.--besideturns off CE's "Library functions" filter. CE decides what is library code by line info. Every instruction ofcall_via_virtual_ptris dispatch code inlined fromcore.hpp, so the filter hid the whole function.Nothing checks that a link is still current: if an example changes, its link keeps the old code until it is regenerated.
Examples and pages
dispatch_virtual_function.cppanddispatch_open_method.cpp. A full program buries the call under the registration code. Each file ends with an emptymain, outside the tagged region, so it still builds as an example.performance.adocincludes its three call listings from those files, so the page and the link show the same code.movfewer in all three calls. A note gives the compiler, options and Boost version. llvm-mca (Skylake) gives the same 1 and 4 cycles for the new code, so the text stands.ast.cpp,ast_virtual_function.cppandast_virtual_function_2.cppprint from ademofunction called bymain. The inlinepostfixlisting onmotivation.adocchanges with them.CI
ci.ymlnow also runs on pushes todoc/**branches.Testing
-Wall -Wextra -Werrorunder gcc 13 and clang 22, at-O0and at-O2 -DNDEBUG, and print the expected output. The Boost examples also compile against theboost-1.92.0headers.doc/build_antora.sh, no warnings on the three pages. Each renderedhrefmatches the generated URL byte for byte. Theperformance.adoccode blocks render identically before and after the switch to includes.🤖 Generated with Claude Code
https://claude.ai/code/session_01958YRGfNfb6SfQS9v4hWTr