1238106Sdes/* Tree-dumping functionality for C-family languages.
2238106Sdes   Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
3238106Sdes   Written by Mark Mitchell <mark@codesourcery.com>
4238106Sdes
5238106SdesThis file is part of GCC.
6238106Sdes
7238106SdesGCC is free software; you can redistribute it and/or modify it under
8238106Sdesthe terms of the GNU General Public License as published by the Free
9238106SdesSoftware Foundation; either version 2, or (at your option) any later
10238106Sdesversion.
11238106Sdes
12238106SdesGCC is distributed in the hope that it will be useful, but WITHOUT ANY
13238106SdesWARRANTY; without even the implied warranty of MERCHANTABILITY or
14238106SdesFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15238106Sdesfor more details.
16238106Sdes
17238106SdesYou should have received a copy of the GNU General Public License
18238106Sdesalong with GCC; see the file COPYING.  If not, write to the Free
19238106SdesSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20238106Sdes02110-1301, USA.  */
21238106Sdes
22238106Sdes#include "config.h"
23238106Sdes#include "system.h"
24266114Sdes#include "coretypes.h"
25266114Sdes#include "tm.h"
26266114Sdes#include "tree.h"
27266114Sdes#include "c-tree.h"
28266114Sdes#include "tree-dump.h"
29266114Sdes
30266114Sdes/* Dump information common to statements from STMT.  */
31266114Sdes
32266114Sdesvoid
33266114Sdesdump_stmt (dump_info_p di, tree t)
34238106Sdes{
35238106Sdes  if (EXPR_HAS_LOCATION (t))
36238106Sdes    dump_int (di, "line", EXPR_LINENO (t));
37238106Sdes}
38238106Sdes
39238106Sdes/* Dump any C-specific tree codes and attributes of common codes.  */
40238106Sdes
41238106Sdesbool
42238106Sdesc_dump_tree (void *dump_info, tree t)
43238106Sdes{
44238106Sdes  enum tree_code code;
45238106Sdes  dump_info_p di = (dump_info_p) dump_info;
46238106Sdes
47238106Sdes  /* Figure out what kind of node this is.  */
48238106Sdes  code = TREE_CODE (t);
49238106Sdes
50238106Sdes  switch (code)
51238106Sdes    {
52238106Sdes    case FIELD_DECL:
53238106Sdes      if (DECL_C_BIT_FIELD (t))
54238106Sdes	dump_string (di, "bitfield");
55238106Sdes      break;
56238106Sdes
57238106Sdes    default:
58238106Sdes      break;
59238106Sdes    }
60238106Sdes
61238106Sdes  return false;
62238106Sdes}
63238106Sdes