X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2FTEMPLATE%2FTEMPLATE_emitter.h;h=e5cdef154aa48a82da0b34d6492fd6dbd439136f;hb=fef8dc3eff6468d7d65485af8e1ac9884c504e1a;hp=06ca14a0cec931b8eacade9c1f92667ed12aeed6;hpb=ea64ddabccc512b21b425e4d89fda5e4ffe124a6;p=libfirm diff --git a/ir/be/TEMPLATE/TEMPLATE_emitter.h b/ir/be/TEMPLATE/TEMPLATE_emitter.h index 06ca14a0c..e5cdef154 100644 --- a/ir/be/TEMPLATE/TEMPLATE_emitter.h +++ b/ir/be/TEMPLATE/TEMPLATE_emitter.h @@ -1,28 +1,55 @@ -#ifndef _TEMPLATE_EMITTER_H_ -#define _TEMPLATE_EMITTER_H_ - -#include "irargs_t.h" // this also inlucdes +/* + * Copyright (C) 1995-2008 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. + */ + +/** + * @file + * @brief declarations for emit functions + */ +#ifndef FIRM_BE_TEMPLATE_TEMPLATE_EMITTER_H +#define FIRM_BE_TEMPLATE_TEMPLATE_EMITTER_H + +#include "irargs_t.h" #include "irnode.h" #include "debug.h" -#include "../bearch.h" +#include "bearch.h" +#include "beemitter.h" #include "bearch_TEMPLATE_t.h" -typedef struct _emit_env_t { - FILE *out; - const arch_env_t *arch_env; - const TEMPLATE_code_gen_t *cg; - DEBUG_ONLY(firm_dbg_module_t *mod;) -} emit_env_t; - -const lc_arg_env_t *TEMPLATE_get_arg_env(void); - -void equalize_dest_src(FILE *F, ir_node *n); - -int get_TEMPLATE_reg_nr(ir_node *irn, int posi, int in_out); -const char *get_TEMPLATE_in_reg_name(ir_node *irn, int pos); - -void TEMPLATE_gen_routine(FILE *F, ir_graph *irg, const TEMPLATE_code_gen_t *cg); - -#endif /* _TEMPLATE_EMITTER_H_ */ +/** + * emit assembler instructions with format string. Automatically indents + * instructions and adds debug comments at the end (in verbose-asm mode). + * Format specifiers: + * + * fmt parameter output + * ---- ---------------------- --------------------------------------------- + * %% % + * %r const arch_register_t* register + * %Sx source register x + * %Dx destination register x + * %O shifter operand + * %I immediate + * %L target label + */ +void TEMPLATE_emitf(const ir_node *node, const char *format, ...); + +void TEMPLATE_emit_routine(ir_graph *irg); + +#endif