xref: /dflybsd-src/contrib/gcc-8.0/gcc/lto/lto.h (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj /* LTO declarations.
2*38fd1498Szrj    Copyright (C) 2009-2018 Free Software Foundation, Inc.
3*38fd1498Szrj    Contributed by CodeSourcery, Inc.
4*38fd1498Szrj 
5*38fd1498Szrj This file is part of GCC.
6*38fd1498Szrj 
7*38fd1498Szrj GCC is free software; you can redistribute it and/or modify it under
8*38fd1498Szrj the terms of the GNU General Public License as published by the Free
9*38fd1498Szrj Software Foundation; either version 3, or (at your option) any later
10*38fd1498Szrj version.
11*38fd1498Szrj 
12*38fd1498Szrj GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13*38fd1498Szrj WARRANTY; without even the implied warranty of MERCHANTABILITY or
14*38fd1498Szrj FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15*38fd1498Szrj for more details.
16*38fd1498Szrj 
17*38fd1498Szrj You should have received a copy of the GNU General Public License
18*38fd1498Szrj along with GCC; see the file COPYING3.  If not see
19*38fd1498Szrj <http://www.gnu.org/licenses/>.  */
20*38fd1498Szrj 
21*38fd1498Szrj #ifndef LTO_H
22*38fd1498Szrj #define LTO_H
23*38fd1498Szrj 
24*38fd1498Szrj 
25*38fd1498Szrj /* A file.  */
26*38fd1498Szrj struct lto_file
27*38fd1498Szrj {
28*38fd1498Szrj   /* The name of the file.  */
29*38fd1498Szrj   const char *filename;
30*38fd1498Szrj   /* The offset for the object inside an ar archive file (or zero).  */
31*38fd1498Szrj   off_t offset;
32*38fd1498Szrj };
33*38fd1498Szrj 
34*38fd1498Szrj /* In lto-lang.c  */
35*38fd1498Szrj extern const char *resolution_file_name;
36*38fd1498Szrj 
37*38fd1498Szrj /* In lto.c  */
38*38fd1498Szrj extern tree lto_eh_personality (void);
39*38fd1498Szrj extern void lto_main (void);
40*38fd1498Szrj extern void lto_read_all_file_options (void);
41*38fd1498Szrj 
42*38fd1498Szrj /* In lto-elf.c or lto-coff.c  */
43*38fd1498Szrj extern lto_file *lto_obj_file_open (const char *filename, bool writable);
44*38fd1498Szrj extern void lto_obj_file_close (lto_file *file);
45*38fd1498Szrj struct lto_section_list;
46*38fd1498Szrj extern htab_t lto_obj_build_section_table (lto_file *file, struct lto_section_list *list);
47*38fd1498Szrj extern htab_t lto_obj_create_section_hash_table (void);
48*38fd1498Szrj extern void lto_obj_begin_section (const char *name);
49*38fd1498Szrj extern void lto_obj_append_data (const void *data, size_t len, void *block);
50*38fd1498Szrj extern void lto_obj_end_section (void);
51*38fd1498Szrj extern lto_file *lto_set_current_out_file (lto_file *file);
52*38fd1498Szrj extern lto_file *lto_get_current_out_file (void);
53*38fd1498Szrj 
54*38fd1498Szrj /* Hash table entry to hold the start offset and length of an LTO
55*38fd1498Szrj    section in a .o file.  */
56*38fd1498Szrj struct lto_section_slot
57*38fd1498Szrj {
58*38fd1498Szrj   const char *name;
59*38fd1498Szrj   intptr_t start;
60*38fd1498Szrj   size_t len;
61*38fd1498Szrj   struct lto_section_slot *next;
62*38fd1498Szrj };
63*38fd1498Szrj 
64*38fd1498Szrj /* A list of section slots */
65*38fd1498Szrj struct lto_section_list
66*38fd1498Szrj {
67*38fd1498Szrj   struct lto_section_slot *first, *last;
68*38fd1498Szrj };
69*38fd1498Szrj 
70*38fd1498Szrj #endif /* LTO_H */
71