2 * This file is part of cparser.
3 * Copyright (C) 2007-2010 Matthias Braun <matze@braunis.de>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 * GNU builtin or MS intrinsic functions.
28 typedef enum builtin_kind_t {
30 bk_gnu_builtin_alloca,
31 bk_gnu_builtin_huge_val,
32 bk_gnu_builtin_huge_valf,
33 bk_gnu_builtin_huge_vall,
40 bk_gnu_builtin_va_end,
41 bk_gnu_builtin_expect,
42 bk_gnu_builtin_return_address,
43 bk_gnu_builtin_frame_address,
47 bk_gnu_builtin_popcount,
48 bk_gnu_builtin_parity,
49 bk_gnu_builtin_prefetch,
51 bk_gnu_builtin_object_size,
57 bk_gnu_builtin_malloc,
58 bk_gnu_builtin_memcmp,
59 bk_gnu_builtin_memcpy,
60 bk_gnu_builtin___memcpy_chk,
61 bk_gnu_builtin_memmove,
62 bk_gnu_builtin_memset,
63 bk_gnu_builtin_strlen,
64 bk_gnu_builtin_strcmp,
65 bk_gnu_builtin_strcpy,
66 bk_gnu_builtin_strncpy,
67 bk_gnu_builtin_strcat,
68 bk_gnu_builtin_strncat,
74 bk_ms_byteswap_ushort,
76 bk_ms_byteswap_uint64,
80 bk_ms_AddressOfReturnAddress,
93 bk_ms_InterlockedExchange,
94 bk_ms_InterlockedExchange64,
100 * Create predefined gnu builtins.
102 void create_gnu_builtins(void);
105 * Create predefined MS intrinsics.
107 void create_microsoft_intrinsics(void);
110 * Some of the gnu builtins are simply more elaborate declarations of
111 * library functions. Return the library function name so we can simply
112 * replace the builtins with these during code generation
114 entity_t *get_builtin_replacement(const entity_t *builtin_entity);
116 int get_builtin_chk_arg_pos(builtin_kind_t kind);