Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libc / config / gpu / api.td
blobdbd212be56a3f10ddd48bed780516ca6ff408b17
1 include "config/public_api.td"
3 include "spec/stdc.td"
4 include "spec/posix.td"
5 include "spec/gpu_ext.td"
6 include "spec/gnu_ext.td"
7 include "spec/llvm_libc_ext.td"
9 def AssertMacro : MacroDef<"assert"> {
10   let Defn = [{
11     #undef assert
13     #ifdef NDEBUG
14     #define assert(e) (void)0
15     #else
17     #define assert(e)  \
18       ((e) ? (void)0 : __assert_fail(#e, __FILE__, __LINE__, __PRETTY_FUNCTION__))
19     #endif
20   }];
23 def StaticAssertMacro : MacroDef<"static_assert"> {
24   let Defn = [{
25     #ifndef __cplusplus
26     #undef static_assert
27     #define static_assert _Static_assert
28     #endif
29   }];
32 def AssertAPI : PublicAPI<"assert.h"> {
33   let Macros = [
34     AssertMacro,
35     StaticAssertMacro,
36   ];
39 def StringAPI : PublicAPI<"string.h"> {
40   let Types = ["size_t"];
43 def StdlibAPI : PublicAPI<"stdlib.h"> {
44   let Types = [
45     "div_t",
46     "ldiv_t",
47     "lldiv_t",
48     "size_t",
49     "__bsearchcompare_t",
50     "__qsortcompare_t",
51     "__qsortrcompare_t",
52     "__atexithandler_t",
53   ];
56 def FenvAPI: PublicAPI<"fenv.h"> {
57   let Types = ["fenv_t"];
60 def StdIOAPI : PublicAPI<"stdio.h"> {
61   let Macros = [
62     SimpleMacroDef<"_IOFBF", "0">,
63     SimpleMacroDef<"_IOLBF", "1">,
64     SimpleMacroDef<"_IONBF", "2">,
65     SimpleMacroDef<"EOF", "-1">,
66   ];
67   let Types = ["size_t", "FILE"];
70 def IntTypesAPI : PublicAPI<"inttypes.h"> {
71   let Types = ["imaxdiv_t"];
74 def TimeAPI : PublicAPI<"time.h"> {
75   let Types = [
76     "clock_t",
77     "time_t",
78     "struct timespec",
79   ];