X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fcommon%2Firtools.h;h=a5d7f269796d3c36b9e63d353779e7dd9f6d01f0;hb=f97d80a10cbef9fe07651e831bc72ca350833775;hp=2d9461158db77607950b1efb1586dc9887c4883a;hpb=863d31d7a5c8210432fef88b30fc3e8353131538;p=libfirm diff --git a/ir/common/irtools.h b/ir/common/irtools.h index 2d9461158..a5d7f2697 100644 --- a/ir/common/irtools.h +++ b/ir/common/irtools.h @@ -1,16 +1,30 @@ /* - * Project: libFIRM - * File name: ir/ir/irtools.h - * Purpose: Some often needed tool-functions - * Author: Michael Beck - * Modified by: - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1999-2006 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * 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. */ -#ifndef _FIRM_COMMON_IRTOOLS_H_ -#define _FIRM_COMMON_IRTOOLS_H_ + +/** + * @file + * @brief Some often needed tool-functions + * @author Michael Beck + * @version $Id$ + */ +#ifndef FIRM_COMMON_IRTOOLS_H +#define FIRM_COMMON_IRTOOLS_H #include "firm_config.h" #include "firm_types.h" @@ -27,6 +41,10 @@ lc_opt_entry_t *firm_opt_get_root(void); #define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) +/* calculate the address of the one past last element of an array whose size is + * known statically */ +#define ENDOF(x) ((x) + sizeof(x) / sizeof(*(x))) + /** * Three valued compare as demanded by e.g. qsort(3) * @param c A number. @@ -81,4 +99,4 @@ void copy_irn_to_irg(ir_node *n, ir_graph *irg); */ ir_node *exact_copy(const ir_node *n); -#endif /* _FIRM_COMMON_IRTOOLS_H_ */ +#endif