From b40449c0478a32510d9c740a27420f802dd2a0ba Mon Sep 17 00:00:00 2001 From: Ollie Wild Date: Fri, 9 May 2008 20:42:28 +0000 Subject: gcc/lto/ * lang.opt: New file. * lto-lang.c (lto_init_options): New function. (lto_handle_option): New function. (lto_init): Move initialization of flag_unit_at_a_time to lto_init_options. (LANG_HOOKS_INIT_OPTIONS): Define. (LANG_HOOKS_HANDLE_OPTION): Define. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@135127 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/lto/ChangeLog | 10 ++++++++++ gcc/lto/lang.opt | 25 +++++++++++++++++++++++++ gcc/lto/lto-lang.c | 42 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 gcc/lto/lang.opt diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 3d3221aae0c..3cf11c3e680 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,13 @@ +2008-05-09 Ollie Wild + + * lang.opt: New file. + * lto-lang.c (lto_init_options): New function. + (lto_handle_option): New function. + (lto_init): Move initialization of flag_unit_at_a_time to + lto_init_options. + (LANG_HOOKS_INIT_OPTIONS): Define. + (LANG_HOOKS_HANDLE_OPTION): Define. + 2008-04-29 Ollie Wild * lto.c (lto_read_namespace_DIE): New function. diff --git a/gcc/lto/lang.opt b/gcc/lto/lang.opt new file mode 100644 index 00000000000..9c876e26880 --- /dev/null +++ b/gcc/lto/lang.opt @@ -0,0 +1,25 @@ +; Options for the LTO front end. +; Copyright (C) 2008 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 +; . + +; See the GCC internals manual for a description of this file's format. + +; Please try to keep this file in ASCII collating order. + +Language +LTO diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 151e980c1ae..093e5f1f2d7 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -288,6 +288,40 @@ static GTY(()) tree registered_builtin_fndecls; /* Language hooks. */ +static unsigned int +lto_init_options (unsigned int argc ATTRIBUTE_UNUSED, + const char **argv ATTRIBUTE_UNUSED) +{ + /* Always operate in unit-at-time mode so that we can defer + decisions about what to output. */ + flag_unit_at_a_time = 1; + + return CL_LTO; +} + +/* Handle command-line option SCODE. If the option takes an argument, it is + stored in ARG, which is otherwise NULL. VALUE holds either a numerical + argument or a binary value indicating whether the positive or negative form + of the option was supplied. */ + +static int +lto_handle_option (size_t scode, const char *arg, int value) +{ + enum opt_code code = (enum opt_code) scode; + int result; + + switch (code) + { + /* For now, this is a placeholder. We'll populate it later. */ + + default: + result = 0; + break; + } + + return result; +} + static bool lto_mark_addressable (tree t ATTRIBUTE_UNUSED) { @@ -528,10 +562,6 @@ lto_build_c_type_nodes (void) static bool lto_init (void) { - /* Always operate in unit-at-time mode so that we can defer - decisions about what to output. */ - flag_unit_at_a_time = 1; - /* Create the basic integer types. */ build_common_tree_nodes (flag_signed_char, /*signed_sizetype=*/false); @@ -585,6 +615,10 @@ static void lto_init_ts (void) being. */ #undef LANG_HOOKS_NAME #define LANG_HOOKS_NAME "GNU C" +#undef LANG_HOOKS_INIT_OPTIONS +#define LANG_HOOKS_INIT_OPTIONS lto_init_options +#undef LANG_HOOKS_HANDLE_OPTION +#define LANG_HOOKS_HANDLE_OPTION lto_handle_option #define LANG_HOOKS_MARK_ADDRESSABLE lto_mark_addressable #define LANG_HOOKS_TYPE_FOR_MODE lto_type_for_mode #define LANG_HOOKS_TYPE_FOR_SIZE lto_type_for_size -- cgit v1.2.3