Skip to content

Commit f3f5d8b

Browse files
authored
[NFC][clang] Quote literal builtin attribute markers in Builtins.def docs (#160080)
Clarify the documentation in Builtins.def by quoting literal attribute markers (e.g. 'n', 'r', 'U', 'N') to distinguish them from placeholders such as N in C<N,...>. This avoids confusion and makes the attribute docs clearer.
1 parent 09bdbfd commit f3f5d8b

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

clang/include/clang/Basic/Builtins.def

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666

6767
// The third value provided to the macro specifies information about attributes
6868
// of the function. These must be kept in sync with the predicates in the
69-
// Builtin::Context class. Currently we have:
69+
// Builtin::Context class. Note: In the descriptions below, {num} is a
70+
// placeholder for an integer. Currently we have:
7071
// n -> nothrow
7172
// r -> noreturn
7273
// U -> pure
@@ -82,23 +83,23 @@
8283
// h -> this function requires a specific header or an explicit declaration.
8384
// i -> this is a runtime library implemented function without the
8485
// '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
85-
// p:N: -> this is a printf-like function whose Nth argument is the format
86-
// string.
87-
// P:N: -> similar to the p:N: attribute, but the function is like vprintf
88-
// in that it accepts its arguments as a va_list rather than
89-
// through an ellipsis
90-
// s:N: -> this is a scanf-like function whose Nth argument is the format
91-
// string.
92-
// S:N: -> similar to the s:N: attribute, but the function is like vscanf
93-
// in that it accepts its arguments as a va_list rather than
94-
// through an ellipsis
86+
// p:{num}: -> this is a printf-like function whose {num}th argument is the
87+
// format string.
88+
// P:{num}: -> similar to the p:{num}: attribute, but the function is like
89+
// vprintf in that it accepts its arguments as a va_list rather than
90+
// through an ellipsis
91+
// s:{num}: -> this is a scanf-like function whose {num}th argument is the
92+
// format string.
93+
// S:{num}: -> similar to the s:{num}: attribute, but the function is like
94+
// vscanf in that it accepts its arguments as a va_list rather than
95+
// through an ellipsis
9596
// e -> const, but only when -fno-math-errno and FP exceptions are ignored
9697
// g -> const when FP exceptions are ignored
9798
// j -> returns_twice (like setjmp)
9899
// u -> arguments are not evaluated for their side-effects
99-
// V:N: -> requires vectors of at least N bits to be legal
100-
// C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument
101-
// M_0, ..., M_k as payload
100+
// V:{num}: -> requires vectors of at least {num} bits to be legal
101+
// C<{num},M_0,...,M_k> -> callback behavior: argument {num} is called with
102+
// argument M_0, ..., M_k as payload
102103
// z -> this is a function in (possibly-versioned) namespace std
103104
// E -> this function can be constant evaluated by Clang frontend
104105
// G -> this is a C++20 consteval function

0 commit comments

Comments
 (0)