Skip to content

Commit 0763b1c

Browse files
committed
[NFC][clang] Quote literal builtin attribute markers in Builtins.def docs
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 33d9ab2 commit 0763b1c

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

clang/include/clang/Basic/Builtins.def

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +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:
70-
// N -> nonnull
69+
// Builtin::Context class. Note: In the descriptions below, {num} is a
70+
// placeholder for an integer. Currently we have:
7171
// n -> nothrow
7272
// r -> noreturn
7373
// U -> pure
@@ -83,23 +83,24 @@
8383
// h -> this function requires a specific header or an explicit declaration.
8484
// i -> this is a runtime library implemented function without the
8585
// '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
86-
// p:N: -> this is a printf-like function whose Nth argument is the format
87-
// string.
88-
// P:N: -> similar to the p:N: attribute, but the function is like vprintf
89-
// in that it accepts its arguments as a va_list rather than
90-
// through an ellipsis
91-
// s:N: -> this is a scanf-like function whose Nth argument is the format
92-
// string.
93-
// S:N: -> similar to the s:N: attribute, but the function is like vscanf
94-
// in that it accepts its arguments as a va_list rather than
95-
// 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
9696
// e -> const, but only when -fno-math-errno and FP exceptions are ignored
9797
// g -> const when FP exceptions are ignored
9898
// j -> returns_twice (like setjmp)
9999
// u -> arguments are not evaluated for their side-effects
100-
// V:N: -> requires vectors of at least N bits to be legal
101-
// C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument
102-
// 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
103+
// N<M_0,...,M_k> -> argument at position M_i should not be null
103104
// z -> this is a function in (possibly-versioned) namespace std
104105
// E -> this function can be constant evaluated by Clang frontend
105106
// G -> this is a C++20 consteval function

0 commit comments

Comments
 (0)