aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/Builtins.def
blob: 97431da9512fbaeb8789786cfb59d32f223ffe4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//===--- Builtins.def - Builtin function info database ----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the standard builtin function database.  Users of this file
// must define the BUILTIN macro to make use of this information.
//
//===----------------------------------------------------------------------===//

// FIXME: this needs to be the full list supported by GCC.  Right now, I'm just
// adding stuff on demand.
//
// FIXME: This should really be a .td file, but that requires modifying tblgen.
// Perhaps tblgen should have plugins.

// The first value provided to the macro specifies the function name of the
// builtin, and results in a clang::builtin::BIXX enum value for XX.

// The second value provided to the macro specifies the type of the function
// (result value, then each argument) as follows:
//  v -> void
//  c -> char
//  s -> short
//  i -> int
//  f -> float
//  d -> double
//  . -> "...".  This may only occur at the end of the function list.
//
// Types maybe prefixed with the following modifiers:
//  L  -> long (e.g. Li for 'long int')
//  LL -> long long
//  S  -> signed
//  U  -> unsigned

// The third value provided to the macro specifies information about attributes
// of the function.  Currently we have:
//  n -> nothrow
//  c -> const

BUILTIN(__builtin_inf  , "d"   , "nc")
BUILTIN(__builtin_inff , "f"   , "nc")
BUILTIN(__builtin_infl , "Ld"  , "nc")
BUILTIN(__builtin_fabs , "dd"  , "nc")
BUILTIN(__builtin_fabsf, "ff"  , "nc")
BUILTIN(__builtin_fabsl, "LdLd", "nc")
BUILTIN(__builtin_constant_p, "UsUs", "nc")

#undef BUILTIN