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