资源简介
gcc-4.1.2.tar.bz2,管网下载,gcc-4.1.2.tar.bz2
代码片段和文件信息
/* Functions dealing with attribute handling used by most front ends.
Copyright (C) 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001
2002 2003 2004 2005 Free Software Foundation Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 or (at your option) any later
version.
GCC is distributed in the hope that it will be useful but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not write to the Free
Software Foundation 51 Franklin Street Fifth Floor Boston MA
02110-1301 USA. */
#include “config.h“
#include “system.h“
#include “coretypes.h“
#include “tm.h“
#include “tree.h“
#include “flags.h“
#include “toplev.h“
#include “output.h“
#include “rtl.h“
#include “ggc.h“
#include “tm_p.h“
#include “cpplib.h“
#include “target.h“
#include “langhooks.h“
static void init_attributes (void);
/* Table of the tables of attributes (common language format machine)
searched. */
static const struct attribute_spec *attribute_tables[4];
static bool attributes_initialized = false;
/* Default empty table of attributes. */
static const struct attribute_spec empty_attribute_table[] =
{
{ NULL 0 0 false false false NULL }
};
/* Initialize attribute tables and make some sanity checks
if --enable-checking. */
static void
init_attributes (void)
{
size_t i;
attribute_tables[0] = lang_hooks.common_attribute_table;
attribute_tables[1] = lang_hooks.attribute_table;
attribute_tables[2] = lang_hooks.format_attribute_table;
attribute_tables[3] = targetm.attribute_table;
/* Translate NULL pointers to pointers to the empty table. */
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
if (attribute_tables[i] == NULL)
attribute_tables[i] = empty_attribute_table;
#ifdef ENABLE_CHECKING
/* Make some sanity checks on the attribute tables. */
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
{
int j;
for (j = 0; attribute_tables[i][j].name != NULL; j++)
{
/* The name must not begin and end with __. */
const char *name = attribute_tables[i][j].name;
int len = strlen (name);
gcc_assert (!(name[0] == ‘_‘ && name[1] == ‘_‘
&& name[len - 1] == ‘_‘ && name[len - 2] == ‘_‘));
/* The minimum and maximum lengths must be consistent. */
gcc_assert (attribute_tables[i][j].min_length >= 0);
gcc_assert (attribute_tables[i][j].max_length == -1
|| (attribute_tables[i][j].max_length
>= attribute_tables[i][j].min_length));
/* An attribute cannot require both a DECL and a TYPE. */
gcc_assert (!attribute_tables[i][j].decl_required
|| !attribute_tables[i][j].t
评论
共有 条评论