]> git.ipfire.org Git - thirdparty/gcc.git/commit
inline-asm: Improve documentation of "asm constexpr".
authorSandra Loosemore <sloosemore@baylibre.com>
Sat, 8 Mar 2025 16:25:09 +0000 (16:25 +0000)
committerSandra Loosemore <sloosemore@baylibre.com>
Sat, 8 Mar 2025 17:03:42 +0000 (17:03 +0000)
commitdff059294511b4f42a531d0a91bf185ee1bc7b0a
tree18b0964cb04ebecf3b9f94276f01e540b276ac3a
parentb360d4aafc1356386313c7392f7444b3fc356681
inline-asm: Improve documentation of "asm constexpr".

While working on an adjacent documentation fix, I noticed that the
documentation for the gnu++11 "asm constexpr" feature was very
confusing, in some cases being attached to parts of the asm syntax
that are not otherwise required to be string literals, and missing from
other parts of the syntax that are.  I've checked what the C++ parser
actually does and fixed the documentation to match, also improving it
to use correct markup and to be more explicit and less implementor-speaky.

gcc/cp/ChangeLog
* parser.cc (cp_parser_asm_definition): Make comment more explicit.
(cp_parser_asm_operand_list): Likewise.  Also correct the comment
block at the top of the function to reflect reality.

gcc/ChangeLog
* doc/extend.texi (Basic Asm): Document that AssemblerInstructions
can be an asm constexpr.
(Extended Asm): Move the notes about asm constexprs for
AssemblerTemplate and Clobbers to the corresponding subsections.
Remove the notes for OutputOperands and InputOperands and reword
misleading descriptions of the list item syntax.  Note that
constraint strings can be asm constexprs.
(Asm constexprs): Use "title case" for subsection name.  Be
explicit about what parts of the asm syntax this applies to and
that the parentheses are required.  Correct markup and terminology.
gcc/cp/parser.cc
gcc/doc/extend.texi