Skip to content

Commit 5d6a06d

Browse files
committed
Improve doc formatting
1 parent eb5557a commit 5d6a06d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/include/clang/Basic/AttrDocs.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9312,11 +9312,14 @@ flow as):
93129312
}
93139313

93149314
The benefits of this attribute are:
9315+
93159316
- **Avoid heap allocations for coro frames**: Allocating short-circuiting
93169317
coros on the stack makes code more predictable under memory pressure.
93179318
Without this attribute, LLVM cannot elide heap allocation even when all
93189319
awaiters are short-circuiting.
9320+
93199321
- **Performance**: Significantly faster execution and smaller code size.
9322+
93209323
- **Build time**: Faster compilation due to less IR being generated.
93219324

93229325
Marking your ``await_suspend_destroy`` method as ``noexcept`` can sometimes
@@ -9343,11 +9346,13 @@ Here is a toy example of a portable short-circuiting awaiter:
93439346

93449347
If all suspension points use (i) trivial or (ii) short-circuiting awaiters,
93459348
then the coroutine optimizes more like a plain function, with 2 caveats:
9349+
93469350
- **Behavior:** The coroutine promise provides an implicit exception boundary
93479351
(as if wrapping the function in ``try {} catch { unhandled_exception(); }``).
93489352
This exception handling behavior is usually desirable in robust,
93499353
return-value-oriented programs that need short-circuiting coroutines.
93509354
Otherwise, the promise can always re-throw.
9355+
93519356
- **Speed:** As of 2025, there is still an optimization gap between a
93529357
realistic short-circuiting coro, and the equivalent (but much more verbose)
93539358
function. For a guesstimate, expect 4-5ns per call on x86. One idea for

0 commit comments

Comments
 (0)