This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[lto] PATCH: Add driver support


This patch adds basic driver support for the LTO front-end.  Although
the inputs to LTO are just object files, it's convenient (at least for
now) to give them a different extension, so that the driver will pass
them along to the front end, rather than to the linker.  So, ".lto"
files are considered files to be passed to LTO.

With this patch, you can now do:

  gcc -c a.c -o a.lto
  gcc -c b.c -o b.lto 
  gcc --combine a.lto b.lto -o program

(A small disappointment is that there do not exist input files a.c and
b.c for which the last command will succeed...)

Next, I plan to add some testsuite infrastructure so that we can start
building up DejaGNU tests for LTO.  Meanwhile, Sandra is working on
filling in some additional bits of the DWARF reader, with the goal of
being able to construct a FUNCTION_DECL based on DWARF information.
That will give Kenny a place to hang the bodies of functions.

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

2006-08-18  Mark Mitchell  <mark@codesourcery.com>

	* lang-specs.h: New file.

Index: lto/lang-specs.h
===================================================================
--- lto/lang-specs.h	(revision 0)
+++ lto/lang-specs.h	(revision 0)
@@ -0,0 +1,27 @@
+/* LTO driver specs.
+   Copyright 2006 Free Software Foundation, Inc.
+   Contributed by CodeSourcery, 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 2, 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 COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* LTO contributions to the "compilers" array in gcc.c.  */
+  
+  {".lto",  "@lto",
+   /*cpp_spec=*/NULL, /*combinable=*/1, /*needs_preprocessing=*/0},
+  {"@lto", "lto1 %(cc1_options) %i %{!fsyntax-only:%(invoke_as)}", 
+   /*cpp_spec=*/NULL, /*combinable=*/1, /*needs_preprocessing=*/0},


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]