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