Warning, /include/clang/Basic/Builtins.def is written in an unsupported language. File is not indexed.
0001 //===--- Builtins.def - Builtin function info database ----------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008
0009 // This is only documentation for the database layout. This will be removed once
0010 // all builtin databases are converted to tablegen files
0011
0012 // The second value provided to the macro specifies the type of the function
0013 // (result value, then each argument) as follows:
0014 // v -> void
0015 // b -> boolean
0016 // c -> char
0017 // s -> short
0018 // i -> int
0019 // h -> half (__fp16, OpenCL)
0020 // x -> half (_Float16)
0021 // y -> half (__bf16)
0022 // f -> float
0023 // d -> double
0024 // z -> size_t
0025 // w -> wchar_t
0026 // F -> constant CFString
0027 // G -> id
0028 // H -> SEL
0029 // M -> struct objc_super
0030 // a -> __builtin_va_list
0031 // A -> "reference" to __builtin_va_list
0032 // V -> Vector, followed by the number of elements and the base type.
0033 // q -> Scalable vector, followed by the number of elements and the base type.
0034 // Q -> target builtin type, followed by a character to distinguish the builtin type
0035 // Qa -> AArch64 svcount_t builtin type.
0036 // Qb -> AMDGPU __amdgpu_buffer_rsrc_t builtin type.
0037 // E -> ext_vector, followed by the number of elements and the base type.
0038 // X -> _Complex, followed by the base type.
0039 // Y -> ptrdiff_t
0040 // P -> FILE
0041 // J -> jmp_buf
0042 // SJ -> sigjmp_buf
0043 // K -> ucontext_t
0044 // p -> pid_t
0045 // . -> "...". This may only occur at the end of the function list.
0046 //
0047 // Types may be prefixed with the following modifiers:
0048 // L -> long (e.g. Li for 'long int', Ld for 'long double')
0049 // LL -> long long (e.g. LLi for 'long long int', LLd for __float128)
0050 // LLL -> __int128_t (e.g. LLLi)
0051 // Z -> int32_t (require a native 32-bit integer type on the target)
0052 // W -> int64_t (require a native 64-bit integer type on the target)
0053 // N -> 'int' size if target is LP64, 'L' otherwise.
0054 // O -> long for OpenCL targets, long long otherwise.
0055 // S -> signed
0056 // U -> unsigned
0057 // I -> Required to constant fold to an integer constant expression.
0058 //
0059 // Types may be postfixed with the following modifiers:
0060 // * -> pointer (optionally followed by an address space number, if no address
0061 // space is specified than any address space will be accepted)
0062 // & -> reference (optionally followed by an address space number)
0063 // C -> const
0064 // D -> volatile
0065 // R -> restrict
0066
0067 // The third value provided to the macro specifies information about attributes
0068 // of the function. These must be kept in sync with the predicates in the
0069 // Builtin::Context class. Currently we have:
0070 // n -> nothrow
0071 // r -> noreturn
0072 // U -> pure
0073 // c -> const
0074 // t -> signature is meaningless, use custom typechecking
0075 // T -> type is not important to semantic analysis and codegen; recognize as
0076 // builtin even if type doesn't match signature, and don't warn if we
0077 // can't be sure the type is right
0078 // F -> this is a libc/libm function with a '__builtin_' prefix added.
0079 // f -> this is a libc/libm function without a '__builtin_' prefix, or with
0080 // 'z', a C++ standard library function in namespace std::. This builtin
0081 // is disableable by '-fno-builtin-foo' / '-fno-builtin-std-foo'.
0082 // h -> this function requires a specific header or an explicit declaration.
0083 // i -> this is a runtime library implemented function without the
0084 // '__builtin_' prefix. It will be implemented in compiler-rt or libgcc.
0085 // p:N: -> this is a printf-like function whose Nth argument is the format
0086 // string.
0087 // P:N: -> similar to the p:N: attribute, but the function is like vprintf
0088 // in that it accepts its arguments as a va_list rather than
0089 // through an ellipsis
0090 // s:N: -> this is a scanf-like function whose Nth argument is the format
0091 // string.
0092 // S:N: -> similar to the s:N: attribute, but the function is like vscanf
0093 // in that it accepts its arguments as a va_list rather than
0094 // through an ellipsis
0095 // e -> const, but only when -fno-math-errno and FP exceptions are ignored
0096 // g -> const when FP exceptions are ignored
0097 // j -> returns_twice (like setjmp)
0098 // u -> arguments are not evaluated for their side-effects
0099 // V:N: -> requires vectors of at least N bits to be legal
0100 // C<N,M_0,...,M_k> -> callback behavior: argument N is called with argument
0101 // M_0, ..., M_k as payload
0102 // z -> this is a function in (possibly-versioned) namespace std
0103 // E -> this function can be constant evaluated by Clang frontend
0104 // G -> this is a C++20 consteval function