c-dump.c revision 267654
11897Swollman/* Tree-dumping functionality for C-family languages. 21897Swollman Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. 31897Swollman Written by Mark Mitchell <mark@codesourcery.com> 41897Swollman 51897SwollmanThis file is part of GCC. 61897Swollman 71897SwollmanGCC is free software; you can redistribute it and/or modify it under 8100441Scharnierthe terms of the GNU General Public License as published by the Free 91897SwollmanSoftware Foundation; either version 2, or (at your option) any later 101897Swollmanversion. 111897Swollman 12100441ScharnierGCC is distributed in the hope that it will be useful, but WITHOUT ANY 131897SwollmanWARRANTY; without even the implied warranty of MERCHANTABILITY or 141897SwollmanFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 151897Swollmanfor more details. 16100441Scharnier 171897SwollmanYou should have received a copy of the GNU General Public License 181897Swollmanalong with GCC; see the file COPYING. If not, write to the Free 191897SwollmanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 20100441Scharnier02110-1301, USA. */ 211897Swollman 221897Swollman#include "config.h" 231897Swollman#include "system.h" 24100441Scharnier#include "coretypes.h" 251897Swollman#include "tm.h" 261897Swollman#include "tree.h" 271897Swollman#include "c-tree.h" 281897Swollman#include "tree-dump.h" 2912798Swpaul 3012798Swpaul/* Dump information common to statements from STMT. */ 3112798Swpaul 32100441Scharniervoid 331897Swollmandump_stmt (dump_info_p di, tree t) 3412798Swpaul{ 351897Swollman if (EXPR_HAS_LOCATION (t)) 3679880Skris dump_int (di, "line", EXPR_LINENO (t)); 371897Swollman} 38100441Scharnier 39100441Scharnier/* Dump any C-specific tree codes and attributes of common codes. */ 40100441Scharnier 411897Swollmanbool 421897Swollmanc_dump_tree (void *dump_info, tree t) 4312798Swpaul{ 441897Swollman enum tree_code code; 451897Swollman dump_info_p di = (dump_info_p) dump_info; 4612798Swpaul 471897Swollman /* Figure out what kind of node this is. */ 481897Swollman code = TREE_CODE (t); 491897Swollman 5099979Salfred switch (code) 5199979Salfred { 521897Swollman case FIELD_DECL: 531897Swollman if (DECL_C_BIT_FIELD (t)) 541897Swollman dump_string (di, "bitfield"); 551897Swollman break; 561897Swollman 5712798Swpaul default: 581897Swollman break; 5912798Swpaul } 6012798Swpaul 6192921Simp return false; 6292921Simp} 6392921Simp