allocations: set the ->total_size, ->nr_elem and ->elem_size expressions
[smatch.git] / target-nios2.c
blobc57b171984a4188db3255050f14fec78380d6b78
1 #include "symbol.h"
2 #include "target.h"
3 #include "machine.h"
4 #include "builtin.h"
7 static void init_nios2(const struct target *self)
9 fast16_ctype = &int_ctype;
10 ufast16_ctype = &uint_ctype;
11 fast32_ctype = &int_ctype;
12 ufast32_ctype = &uint_ctype;
15 static void predefine_nios2(const struct target *self)
17 predefine("__NIOS2", 1, "1");
18 predefine("__NIOS2__", 1, "1");
19 predefine("__nios2", 1, "1");
20 predefine("__nios2__", 1, "1");
22 if (arch_big_endian) {
23 predefine("__nios2_big_endian", 1, "1");
24 predefine("__nios2_big_endian__", 1, "1");
25 } else {
26 predefine("__nios2_little_endian", 1, "1");
27 predefine("__nios2_little_endian__", 1, "1");
31 static const struct builtin_fn builtins_nios2[] = {
32 { "__builtin_rdctl", &int_ctype, 0, { &int_ctype }},
33 { "__builtin_wrctl", &void_ctype, 0, { &int_ctype, &int_ctype }},
34 { "__builtin_custom_ini", &int_ctype, 0, { &int_ctype }},
35 { }
38 const struct target target_nios2 = {
39 .mach = MACH_NIOS2,
40 .bitness = ARCH_LP32,
42 .bits_in_longdouble = 64,
44 .init = init_nios2,
45 .predefine = predefine_nios2,
46 .builtins = builtins_nios2,