This is an archive of the discontinued LLVM Phabricator instance.

Document several clang-supported builtins
ClosedPublic

Authored by serge-sans-paille on Jan 14 2022, 2:42 AM.

Details

Summary

Namely

builtin_alloca
builtin_alloca_with_align
builtin_call_with_static_chain
builtin_expect
builtin_expect_with_probablity
builtin_prefetch

Diff Detail

Event Timeline

serge-sans-paille requested review of this revision.Jan 14 2022, 2:42 AM
serge-sans-paille created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2022, 2:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks for this new documentation! I'm by no means an expert in these builtins, so I had some questions on places we might want to expand things a bit more.

clang/docs/LanguageExtensions.rst
2183
2569–2570
2588
2617
2620

Should we mention that the probability should be specified as a value between [0.0, 1.0]?

2627–2628
2647–2648

Is there a way to specify both read and write at the same time? Or does write access imply read access? (If so, it'd be good to make that explicit.)

2649–2650

How do users know whether to pick 1 or 2? Should we list the values in table form with some prose describing when to use each value?

serge-sans-paille marked 8 inline comments as done.
aaron.ballman accepted this revision.Jan 14 2022, 12:19 PM

LGTM aside from a minor nit with duplicate punctuation.

clang/docs/LanguageExtensions.rst
2653
This revision is now accepted and ready to land.Jan 14 2022, 12:19 PM
This revision was landed with ongoing or failed builds.Jan 14 2022, 1:04 PM
This revision was automatically updated to reflect the committed changes.