diff options
author | David S. Miller <davem@davemloft.net> | 2011-09-26 19:04:35 +0000 |
---|---|---|
committer | David S. Miller <davem@gcc.gnu.org> | 2011-09-26 12:04:35 -0700 |
commit | 8d12174db5a92005143deae74b57e553cfa97266 (patch) | |
tree | 6c047b798984899fe89ec8b5c02c76d52d97768a /gcc/config/sparc/sparc-c.c | |
parent | 6cb1ef51438f731064431977ca56f7db598409d1 (diff) | |
download | gcc-8d12174db5a92005143deae74b57e553cfa97266.zip gcc-8d12174db5a92005143deae74b57e553cfa97266.tar.gz gcc-8d12174db5a92005143deae74b57e553cfa97266.tar.bz2 |
Move target CPP macro handling to C file and add __VIS/__VIS__.
* config/sparc/sparc-c.c: New file implementing sparc_target_macros,
which will now define __VIS and __VIS__ when -mvis is enabled.
* config/sparc/t-sparc: Likewise.
* config.gcc: Add sparc-c.o to c_target_objs and cxx_target_objs,
and add t-sparc to tmake_file for all sparc targets.
* config/sparc/sparc-protos.h (sparc_target_macros): Declare.
* config/sparc/sparc.h (TARGE_CPU_CPP_BUILTINS): Call it.
From-SVN: r179210
Diffstat (limited to 'gcc/config/sparc/sparc-c.c')
-rw-r--r-- | gcc/config/sparc/sparc-c.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gcc/config/sparc/sparc-c.c b/gcc/config/sparc/sparc-c.c new file mode 100644 index 0000000..6e30950 --- /dev/null +++ b/gcc/config/sparc/sparc-c.c @@ -0,0 +1,53 @@ +/* Subroutines used for macro/preprocessor support on SPARC. + Copyright (C) 2011 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "tm_p.h" +#include "flags.h" +#include "c-family/c-common.h" +#include "c-family/c-pragma.h" +#include "cpplib.h" + +void +sparc_target_macros (void) +{ + builtin_define_std ("sparc"); + + if (TARGET_64BIT) + { + cpp_assert (parse_in, "cpu=sparc64"); + cpp_assert (parse_in, "machine=sparc64"); + } + else + { + cpp_assert (parse_in, "cpu=sparc"); + cpp_assert (parse_in, "machine=sparc"); + } + + if (TARGET_VIS) + { + cpp_define (parse_in, "__VIS__=0x100"); + cpp_define (parse_in, "__VIS=0x100"); + } +} |