X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firargs.c;h=66bbd7f719d32d7ab876df4556d1c73938612cb0;hb=b597c7fd473086ca6374b2abbdf129f595c156d0;hp=0085968d71b7d90a8744550ded012f600bf10d7a;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/ir/irargs.c b/ir/ir/irargs.c index 0085968d7..66bbd7f71 100644 --- a/ir/ir/irargs.c +++ b/ir/ir/irargs.c @@ -1,26 +1,39 @@ /* - * Project: libFIRM - * File name: ir/ir/irargs.c - * Purpose: Support for libcore IR object output. - * Author: Sebastian Hack - * Modified by: - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2005 Universitaet Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * 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 Support for libcore IR object output. + * @author Sebastian Hack + * @version $Id$ + */ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef WITH_LIBCORE +#include "firm_config.h" #include "bitset.h" #include -#include +#include "lc_printf.h" #include "firm_common.h" #include "irnode_t.h" #include "entity_t.h" @@ -32,16 +45,19 @@ * identify a firm object type */ static int firm_get_arg_type(const lc_arg_occ_t *occ) { + (void) occ; /* Firm objects are always pointer */ return lc_arg_type_ptr; } static int firm_get_arg_type_int(const lc_arg_occ_t *occ) { + (void) occ; return lc_arg_type_int; } static int bitset_get_arg_type(const lc_arg_occ_t *occ) { + (void) occ; return lc_arg_type_ptr; } @@ -233,10 +249,11 @@ static int firm_emit_indent(lc_appendable_t *app, const lc_arg_occ_t *occ, const lc_arg_value_t *arg) { int i; - int amount = arg->v_int * (occ->width > 0 ? occ->width : 1); + int width = occ->width > 0 ? occ->width : 1; + int amount = arg->v_int * width; for(i = 0; i < amount; ++i) - lc_appendable_chadd(app, ' '); + lc_appendable_chadd(app, (i % width) == 0 ? '|' : ' '); return amount; } @@ -255,7 +272,6 @@ static int firm_emit_pnc(lc_appendable_t *app, lc_arg_env_t *firm_get_arg_env(void) { -#define X(name, letter) {"firm:" name, letter} static lc_arg_env_t *env = NULL; @@ -270,6 +286,7 @@ lc_arg_env_t *firm_get_arg_env(void) const char *name; char letter; } args[] = { +#define X(name, letter) {"firm:" name, letter} X("type", 't'), X("entity", 'e'), X("entity_ld", 'E'), @@ -280,9 +297,10 @@ lc_arg_env_t *firm_get_arg_env(void) X("mode", 'm'), X("block", 'B'), X("cg_path", 'P'), +#undef X }; - int i; + size_t i; if(env == NULL) { env = lc_arg_new_env(); @@ -293,7 +311,7 @@ lc_arg_env_t *firm_get_arg_env(void) lc_arg_register(env, args[i].name, args[i].letter, &firm_handler); lc_arg_register(env, "firm:ident", 'I', &ident_handler); - lc_arg_register(env, "firm:indent", '>', &indent_handler); + lc_arg_register(env, "firm:indent", 'D', &indent_handler); lc_arg_register(env, "firm:dbg_info", 'G', &debug_handler); lc_arg_register(env, "firm:bitset", 'B', &bitset_handler); lc_arg_register(env, "firm:pnc", '=', &pnc_handler); @@ -301,5 +319,3 @@ lc_arg_env_t *firm_get_arg_env(void) return env; } - -#endif /* WITH_LIBCORE */