[2/77] Add an E_ prefix to case statements
[official-gcc.git] / gcc / config / arc / arc-c.c
blobde877a1e856c84585d55af716bd39085b41f8103
1 /* Copyright (C) 2016-2017 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
10 GCC is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING3. If not see
17 <http://www.gnu.org/licenses/>.
20 #include "config.h"
21 #include "system.h"
22 #include "coretypes.h"
23 #include "tm.h"
24 #include "tree.h"
25 #include "memmodel.h"
26 #include "tm_p.h"
27 #include "cpplib.h"
28 #include "c-family/c-common.h"
29 #include "target.h"
31 #define builtin_define(TXT) cpp_define (pfile, TXT)
32 #define builtin_assert(TXT) cpp_assert (pfile, TXT)
34 /* Define or undefine macros based on the current target. */
36 static void
37 def_or_undef_macro (cpp_reader* pfile, const char *name, bool def_p)
39 if (def_p)
40 cpp_define (pfile, name);
41 else
42 cpp_undef (pfile, name);
45 /* Helper for TARGET_CPU_CPP_BUILTINS hook. */
47 void
48 arc_cpu_cpp_builtins (cpp_reader * pfile)
50 builtin_assert ("cpu=arc");
51 builtin_assert ("machine=arc");
53 builtin_define ("__arc__");
55 #undef ARC_C_DEF
56 #define ARC_C_DEF(NAME, CONDITION) \
57 def_or_undef_macro (pfile, NAME, CONDITION);
59 #include "arc-c.def"
60 #undef ARC_C_DEF
62 builtin_define_with_int_value ("__ARC_TLS_REGNO__",
63 arc_tp_regno);
65 builtin_define (TARGET_BIG_ENDIAN
66 ? "__BIG_ENDIAN__" : "__LITTLE_ENDIAN__");
67 if (TARGET_BIG_ENDIAN)
68 builtin_define ("__big_endian__");