1117395Skan/* Tree-dumping functionality for C-family languages. 2169689Skan Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. 3117395Skan Written by Mark Mitchell <mark@codesourcery.com> 4117395Skan 5117395SkanThis file is part of GCC. 6117395Skan 7117395SkanGCC is free software; you can redistribute it and/or modify it under 8117395Skanthe terms of the GNU General Public License as published by the Free 9117395SkanSoftware Foundation; either version 2, or (at your option) any later 10117395Skanversion. 11117395Skan 12117395SkanGCC is distributed in the hope that it will be useful, but WITHOUT ANY 13117395SkanWARRANTY; without even the implied warranty of MERCHANTABILITY or 14117395SkanFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15117395Skanfor more details. 16117395Skan 17117395SkanYou should have received a copy of the GNU General Public License 18117395Skanalong with GCC; see the file COPYING. If not, write to the Free 19169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 20169689Skan02110-1301, USA. */ 21117395Skan 22117395Skan#include "config.h" 23117395Skan#include "system.h" 24132718Skan#include "coretypes.h" 25132718Skan#include "tm.h" 26117395Skan#include "tree.h" 27117395Skan#include "c-tree.h" 28117395Skan#include "tree-dump.h" 29117395Skan 30117395Skan/* Dump information common to statements from STMT. */ 31117395Skan 32117395Skanvoid 33132718Skandump_stmt (dump_info_p di, tree t) 34117395Skan{ 35169689Skan if (EXPR_HAS_LOCATION (t)) 36169689Skan dump_int (di, "line", EXPR_LINENO (t)); 37117395Skan} 38117395Skan 39117395Skan/* Dump any C-specific tree codes and attributes of common codes. */ 40117395Skan 41132718Skanbool 42132718Skanc_dump_tree (void *dump_info, tree t) 43117395Skan{ 44117395Skan enum tree_code code; 45117395Skan dump_info_p di = (dump_info_p) dump_info; 46117395Skan 47117395Skan /* Figure out what kind of node this is. */ 48117395Skan code = TREE_CODE (t); 49117395Skan 50117395Skan switch (code) 51117395Skan { 52117395Skan case FIELD_DECL: 53117395Skan if (DECL_C_BIT_FIELD (t)) 54117395Skan dump_string (di, "bitfield"); 55117395Skan break; 56117395Skan 57117395Skan default: 58117395Skan break; 59117395Skan } 60117395Skan 61132718Skan return false; 62117395Skan} 63