+/*
+ * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
/**
- * Dumps global variables and constants as gas assembler.
- * @author Christian Wuerdig, Matthias Braun
- * @date 04.11.2005
- * @version $Id$
+ * @file
+ * @brief Dumps global variables and constants as gas assembler.
+ * @author Christian Wuerdig, Matthias Braun
+ * @date 04.11.2005
+ * @version $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
/** by default, we generate assembler code for the Linux gas */
be_gas_flavour_t be_gas_flavour = GAS_FLAVOUR_NORMAL;
-static const char* get_section_name(be_gas_section_t section) {
+/**
+ * Return the pseudo-instruction to be issued for a section switch
+ * depending on the current flavour.
+ *
+ * @param section the section to switch to
+ *
+ * @return the pseudo-instruction
+ */
+static const char *get_section_name(be_gas_section_t section) {
static const char *text[GAS_FLAVOUR_MAX][GAS_SECTION_MAX] = {
{
".section\t.text",
return text[be_gas_flavour][section];
}
+/**
+ * Emit necessary code to switch to a section.
+ *
+ * @param env the emitter environment
+ * @param section the section to switch to
+ */
void be_gas_emit_switch_section(be_emit_env_t *env, be_gas_section_t section) {
be_emit_char(env, '\t');
be_emit_string(env, get_section_name(section));