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)
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/>.
22 #include "coretypes.h"
28 #include "c-family/c-common.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. */
37 def_or_undef_macro (cpp_reader
* pfile
, const char *name
, bool def_p
)
40 cpp_define (pfile
, name
);
42 cpp_undef (pfile
, name
);
45 /* Helper for TARGET_CPU_CPP_BUILTINS hook. */
48 arc_cpu_cpp_builtins (cpp_reader
* pfile
)
50 builtin_assert ("cpu=arc");
51 builtin_assert ("machine=arc");
53 builtin_define ("__arc__");
56 #define ARC_C_DEF(NAME, CONDITION) \
57 def_or_undef_macro (pfile, NAME, CONDITION);
62 builtin_define_with_int_value ("__ARC_TLS_REGNO__",
65 builtin_define (TARGET_BIG_ENDIAN
66 ? "__BIG_ENDIAN__" : "__LITTLE_ENDIAN__");
67 if (TARGET_BIG_ENDIAN
)
68 builtin_define ("__big_endian__");