b796cef9fc0d8ead61bb2bcb57af708197a69223
[libfirm] / ir / be / begnuas.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Dumps global variables and constants as gas assembler.
23  * @author      Christian Wuerdig, Matthias Braun
24  * @date        04.11.2005
25  * @version     $Id$
26  */
27 #ifndef FIRM_BE_BEGNUAS_H
28 #define FIRM_BE_BEGNUAS_H
29
30 #include "be.h"
31 #include "beemitter.h"
32
33 /**
34  * Sections.
35  */
36 typedef enum section_t {
37         GAS_SECTION_TEXT   = 0,   /**< text section */
38         GAS_SECTION_DATA   = 1,   /**< data section */
39         GAS_SECTION_RODATA = 2,   /**< rodata section */
40         GAS_SECTION_COMMON = 3,   /**< common section */
41         GAS_SECTION_TLS    = 4,   /**< thread local storage section */
42         GAS_SECTION_CTOR   = 5,   /**< ctor section for instrumentation code init */
43         GAS_SECTION_MAX    = 6
44 } be_gas_section_t;
45
46 typedef enum asm_flavour_t {
47         GAS_FLAVOUR_NORMAL = 0,  /**< normal gas */
48         GAS_FLAVOUR_MINGW  = 1,  /**< MinGW variant */
49         GAS_FLAVOUR_MAX    = 2
50 } be_gas_flavour_t;
51
52 extern be_gas_flavour_t be_gas_flavour;
53
54
55 /**
56  * Generate all entities.
57  */
58 void be_gas_emit_decls(be_emit_env_t *env, const be_main_env_t *main_env,
59                        int only_emit_marked_entities);
60
61 void be_gas_emit_switch_section(be_emit_env_t *env, be_gas_section_t section);
62
63 #endif /* FIRM_BE_BEGNUAS_H */