annotate gcc/config/arc/arc-c.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1 /* Copyright (C) 2016-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 This file is part of GCC.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
6 under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
7 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
8 any later version.
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
13 License for more details.
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
16 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
17 <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
18 */
kono
parents:
diff changeset
19
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
20 #define IN_TARGET_CODE 1
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21
111
kono
parents:
diff changeset
22 #include "config.h"
kono
parents:
diff changeset
23 #include "system.h"
kono
parents:
diff changeset
24 #include "coretypes.h"
kono
parents:
diff changeset
25 #include "tm.h"
kono
parents:
diff changeset
26 #include "tree.h"
kono
parents:
diff changeset
27 #include "memmodel.h"
kono
parents:
diff changeset
28 #include "tm_p.h"
kono
parents:
diff changeset
29 #include "cpplib.h"
kono
parents:
diff changeset
30 #include "c-family/c-common.h"
kono
parents:
diff changeset
31 #include "target.h"
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 #define builtin_define(TXT) cpp_define (pfile, TXT)
kono
parents:
diff changeset
34 #define builtin_assert(TXT) cpp_assert (pfile, TXT)
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 /* Define or undefine macros based on the current target. */
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 static void
kono
parents:
diff changeset
39 def_or_undef_macro (cpp_reader* pfile, const char *name, bool def_p)
kono
parents:
diff changeset
40 {
kono
parents:
diff changeset
41 if (def_p)
kono
parents:
diff changeset
42 cpp_define (pfile, name);
kono
parents:
diff changeset
43 else
kono
parents:
diff changeset
44 cpp_undef (pfile, name);
kono
parents:
diff changeset
45 }
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 /* Helper for TARGET_CPU_CPP_BUILTINS hook. */
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 void
kono
parents:
diff changeset
50 arc_cpu_cpp_builtins (cpp_reader * pfile)
kono
parents:
diff changeset
51 {
kono
parents:
diff changeset
52 builtin_assert ("cpu=arc");
kono
parents:
diff changeset
53 builtin_assert ("machine=arc");
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 builtin_define ("__arc__");
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 #undef ARC_C_DEF
kono
parents:
diff changeset
58 #define ARC_C_DEF(NAME, CONDITION) \
kono
parents:
diff changeset
59 def_or_undef_macro (pfile, NAME, CONDITION);
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 #include "arc-c.def"
kono
parents:
diff changeset
62 #undef ARC_C_DEF
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 builtin_define_with_int_value ("__ARC_TLS_REGNO__",
kono
parents:
diff changeset
65 arc_tp_regno);
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 builtin_define_with_int_value ("__ARC_LPC_WIDTH__", arc_lpcwidth);
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 builtin_define (TARGET_BIG_ENDIAN
kono
parents:
diff changeset
70 ? "__BIG_ENDIAN__" : "__LITTLE_ENDIAN__");
kono
parents:
diff changeset
71 if (TARGET_BIG_ENDIAN)
kono
parents:
diff changeset
72 builtin_define ("__big_endian__");
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 }