xref: /dflybsd-src/contrib/gcc-8.0/gcc/c-family/c-dump.c (revision 38fd149817dfbff97799f62fcb70be98c4e32523)
1*38fd1498Szrj /* Tree-dumping functionality for C-family languages.
2*38fd1498Szrj    Copyright (C) 2002-2018 Free Software Foundation, Inc.
3*38fd1498Szrj    Written by Mark Mitchell <mark@codesourcery.com>
4*38fd1498Szrj 
5*38fd1498Szrj This file is part of GCC.
6*38fd1498Szrj 
7*38fd1498Szrj GCC is free software; you can redistribute it and/or modify it under
8*38fd1498Szrj the terms of the GNU General Public License as published by the Free
9*38fd1498Szrj Software Foundation; either version 3, or (at your option) any later
10*38fd1498Szrj version.
11*38fd1498Szrj 
12*38fd1498Szrj GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13*38fd1498Szrj WARRANTY; without even the implied warranty of MERCHANTABILITY or
14*38fd1498Szrj FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15*38fd1498Szrj for more details.
16*38fd1498Szrj 
17*38fd1498Szrj You should have received a copy of the GNU General Public License
18*38fd1498Szrj along with GCC; see the file COPYING3.  If not see
19*38fd1498Szrj <http://www.gnu.org/licenses/>.  */
20*38fd1498Szrj 
21*38fd1498Szrj #include "config.h"
22*38fd1498Szrj #include "system.h"
23*38fd1498Szrj #include "coretypes.h"
24*38fd1498Szrj #include "c-common.h"
25*38fd1498Szrj #include "tree-dump.h"
26*38fd1498Szrj 
27*38fd1498Szrj /* Dump any C-specific tree codes and attributes of common codes.  */
28*38fd1498Szrj 
29*38fd1498Szrj bool
c_dump_tree(void * dump_info,tree t)30*38fd1498Szrj c_dump_tree (void *dump_info, tree t)
31*38fd1498Szrj {
32*38fd1498Szrj   enum tree_code code;
33*38fd1498Szrj   dump_info_p di = (dump_info_p) dump_info;
34*38fd1498Szrj 
35*38fd1498Szrj   /* Figure out what kind of node this is.  */
36*38fd1498Szrj   code = TREE_CODE (t);
37*38fd1498Szrj 
38*38fd1498Szrj   switch (code)
39*38fd1498Szrj     {
40*38fd1498Szrj     case FIELD_DECL:
41*38fd1498Szrj       if (DECL_C_BIT_FIELD (t))
42*38fd1498Szrj 	dump_string (di, "bitfield");
43*38fd1498Szrj       break;
44*38fd1498Szrj 
45*38fd1498Szrj     default:
46*38fd1498Szrj       break;
47*38fd1498Szrj     }
48*38fd1498Szrj 
49*38fd1498Szrj   return false;
50*38fd1498Szrj }
51