Skip to content

Commit c0f2177

Browse files
committed
Revert "[NFC] Remove unnecessary 'Builtins.def' file."
This reverts commit 5a95378. It was pointed out that this serves as documentation for the targets where the builtin files have yet to be converted, so this should be left in place. Reverting!
1 parent 8bed754 commit c0f2177

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
//===--- Builtins.def - Builtin function info database ----------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
// This is only documentation for the database layout. This will be removed once
10+
// all builtin databases are converted to tablegen files
11+
12+
// The second value provided to the macro specifies the type of the function
13+
// (result value, then each argument) as follows:
14+
// v -> void
15+
// b -> boolean
16+
// c -> char
17+
// s -> short
18+
// i -> int
19+
// h -> half (__fp16, OpenCL)
20+
// x -> half (_Float16)
21+
// y -> half (__bf16)
22+
// f -> float
23+
// d -> double
24+
// z -> size_t
25+
// w -> wchar_t
26+
// F -> constant CFString
27+
// G -> id
28+
// H -> SEL
29+
// M -> struct objc_super
30+
// a -> __builtin_va_list
31+
// A -> "reference" to __builtin_va_list
32+
// V -> Vector, followed by the number of elements and the base type.
33+
// q -> Scalable vector, followed by the number of elements and the base type.
34+
// Q -> target builtin type, followed by a character to distinguish the builtin type
35+
// Qa -> AArch64 svcount_t builtin type.
36+
// E -> ext_vector, followed by the number of elements and the base type.
37+
// X -> _Complex, followed by the base type.
38+
// Y -> ptrdiff_t
39+
// P -> FILE
40+
// J -> jmp_buf
41+
// SJ -> sigjmp_buf
42+
// K -> ucontext_t
43+
// p -> pid_t
44+
// . -> "...". This may only occur at the end of the function list.
45+
//
46+
// Types may be prefixed with the following modifiers:
47+
// L -> long (e.g. Li for 'long int', Ld for 'long double')
48+
// LL -> long long (e.g. LLi for 'long long int', LLd for __float128)
49+
// LLL -> __int128_t (e.g. LLLi)
50+
// Z -> int32_t (require a native 32-bit integer type on the target)
51+
// W -> int64_t (require a native 64-bit integer type on the target)
52+
// N -> 'int' size if target is LP64, 'L' otherwise.
53+
// O -> long for OpenCL targets, long long otherwise.
54+
// S -> signed
55+
// U -> unsigned
56+
// I -> Required to constant fold to an integer constant expression.
57+
//
58+
// Types may be postfixed with the following modifiers:
59+
// * -> pointer (optionally followed by an address space number, if no address
60+
// space is specified than any address space will be accepted)
61+
// & -> reference (optionally followed by an address space number)
62+
// C -> const
63+
// D -> volatile
64+
// R -> restrict
65+
66+
// The third value provided to the macro specifies information about attributes
67+
// of the function. These must be kept in sync with the predicates in the
68+
// Builtin::Context class. Currently we have:
69+
// n -> nothrow
70+
// r -> noreturn
71+
// U -> pure
72+
// c -> const
73+
// t -> signature is meaningless, use custom typechecking
74+
// T -> type is not important to semantic analysis and codegen; recognize as
75+
// builtin even if type doesn't match signature, and don't warn if we
76+
// can't be sure the type is right
77+
// F -> this is a libc/libm function with a '__builtin_' prefix added.
78+
// f -> this is a libc/libm function without a '__builtin_' prefix, or with
79+
// 'z', a C++ standard library function in namespace std::. This builtin
80+
// is disableable by '-fno-builtin-foo' / '-fno-builtin-std-foo'.
81+
// h -> this function requires a specific header or an explicit declaration.
82+
// i -> this is a runtime library implemented function without the
83+
// '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
84+
// p:N: -> this is a printf-like function whose Nth argument is the format
85+
// string.
86+
// P:N: -> similar to the p:N: attribute, but the function is like vprintf
87+
// in that it accepts its arguments as a va_list rather than
88+
// through an ellipsis
89+
// s:N: -> this is a scanf-like function whose Nth argument is the format
90+
// string.
91+
// S:N: -> similar to the s:N: attribute, but the function is like vscanf
92+
// in that it accepts its arguments as a va_list rather than
93+
// through an ellipsis
94+
// e -> const, but only when -fno-math-errno and FP exceptions are ignored
95+
// g -> const when FP exceptions are ignored
96+
// j -> returns_twice (like setjmp)
97+
// u -> arguments are not evaluated for their side-effects
98+
// V:N: -> requires vectors of at least N bits to be legal
99+
// C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument
100+
// M_0, ..., M_k as payload
101+
// z -> this is a function in (possibly-versioned) namespace std
102+
// E -> this function can be constant evaluated by Clang frontend

0 commit comments

Comments
 (0)