tree-browser.c File Reference

#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "tree-inline.h"
#include "diagnostic.h"
#include "hashtab.h"
#include "tree-browser.def"
#include "tree.def"

Include dependency graph for tree-browser.c:

Go to the source code of this file.

Data Structures

struct  tb_command
struct  tb_tree_code

Defines

#define TB_OUT_FILE   stdout
#define TB_IN_FILE   stdin
#define TB_NIY   fprintf (TB_OUT_FILE, "Sorry this command is not yet implemented.\n")
#define TB_WF   fprintf (TB_OUT_FILE, "Warning, this command failed.\n")
#define DEFTBCODE(COMMAND, STRING, HELP)   COMMAND,
#define DEFTBCODE(code, str, help)   { help, str, sizeof(str) - 1, code },
#define TB_COMMAND_LEN(N)   (tb_commands[N].comm_len)
#define TB_COMMAND_TEXT(N)   (tb_commands[N].comm_text)
#define TB_COMMAND_CODE(N)   (tb_commands[N].comm_code)
#define TB_COMMAND_HELP(N)   (tb_commands[N].help_msg)
#define DEFTREECODE(SYM, STRING, TYPE, NARGS)   { SYM, STRING, sizeof (STRING) - 1 },
#define TB_TREE_CODE(N)   (tb_tree_codes[N].code)
#define TB_TREE_CODE_TEXT(N)   (tb_tree_codes[N].code_string)
#define TB_TREE_CODE_LEN(N)   (tb_tree_codes[N].code_string_len)
#define TB_SET_HEAD(N)
#define TB_MOVE_HEAD(FCT)
#define STORE_CHILD(N)
#define TEST_CHILD(N)
#define MAX_CANON   256

Typedefs

typedef enum TB_Comm_code TB_CODE

Enumerations

enum  TB_Comm_code {
  TB_VERBOSE, verbose, TB_HPREV, hpr,
  TB_UNUSED_COMMAND
}

Functions

static long TB_getline (char **, long *, FILE *)
static TB_CODE TB_get_command (char *)
static enum tree_code TB_get_tree_code (char *)
static tree find_node_with_code (tree *, int *, void *)
static tree store_child_info (tree *, int *, void *)
static void TB_update_up (tree)
static tree TB_current_chain_node (tree)
static tree TB_prev_expr (tree)
static tree TB_next_expr (tree)
static tree TB_up_expr (tree)
static tree TB_first_in_bind (tree)
static tree TB_last_in_bind (tree)
static int TB_parent_eq (const void *, const void *)
static tree TB_history_prev (void)
void browse_tree (tree)
void browse_tree ()
static tree TB_first_in_bind ()
static tree TB_last_in_bind ()
static tree TB_up_expr ()
static tree TB_prev_expr ()
static tree TB_next_expr ()
static tree TB_current_chain_node ()
static int TB_parent_eq ()
static void TB_update_up ()
static TB_CODE TB_get_command ()
static enum tree_code TB_get_tree_code ()
static long TB_getline ()

Variables

static const struct tb_command tb_commands []
static const struct tb_tree_code tb_tree_codes []
static htab_t TB_up_ht
static tree TB_history_stack = NULL_TREE
static int TB_verbose = 1


Define Documentation

#define DEFTBCODE code,
str,
help   )     { help, str, sizeof(str) - 1, code },
 

Structures for handling Tree Browser's commands.   

Definition at line 54 of file tree-browser.c.

#define DEFTBCODE COMMAND,
STRING,
HELP   )     COMMAND,
 

Structures for handling Tree Browser's commands.   

Definition at line 54 of file tree-browser.c.

#define DEFTREECODE SYM,
STRING,
TYPE,
NARGS   )     { SYM, STRING, sizeof (STRING) - 1 },
 

Definition at line 173 of file tree-browser.c.

#define MAX_CANON   256
 

#define STORE_CHILD  ) 
 

Value:

do {                                                \
  tree op = TREE_OPERAND (node, N);                                        \
  slot = htab_find_slot (TB_up_ht, op, INSERT);                               \
  *slot = (void *) node;                                                   \
} while (0)

#define TB_COMMAND_CODE  )     (tb_commands[N].comm_code)
 

Definition at line 162 of file tree-browser.c.

#define TB_COMMAND_HELP  )     (tb_commands[N].help_msg)
 

Definition at line 163 of file tree-browser.c.

#define TB_COMMAND_LEN  )     (tb_commands[N].comm_len)
 

Definition at line 160 of file tree-browser.c.

#define TB_COMMAND_TEXT  )     (tb_commands[N].comm_text)
 

Definition at line 161 of file tree-browser.c.

#define TB_IN_FILE   stdin
 

Definition at line 33 of file tree-browser.c.

#define TB_MOVE_HEAD FCT   ) 
 

Value:

do {       \
  if (head)                          \
    {                                \
      tree t;                        \
      t = FCT (head);                \
      if (t)                         \
        TB_SET_HEAD (t);             \
      else                           \
        TB_WF;                       \
    }                                \
  else                               \
    TB_WF;                           \
} while (0)

#define TB_NIY   fprintf (TB_OUT_FILE, "Sorry this command is not yet implemented.\n")
 

Definition at line 34 of file tree-browser.c.

#define TB_OUT_FILE   stdout
 

Tree browser.
   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
   Contributed by Sebastian Pop <s.pop@laposte.net>

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.   

Definition at line 32 of file tree-browser.c.

#define TB_SET_HEAD  ) 
 

Value:

do {                                           \
  TB_history_stack = tree_cons (NULL_TREE, (N), TB_history_stack);    \
  head = N;                                                           \
  if (TB_verbose)                                                     \
    if (head)                                                         \
      {                                                               \
        print_generic_expr (TB_OUT_FILE, head, 0);                    \
        fprintf (TB_OUT_FILE, "\n");                                  \
      }                                                               \
} while (0)

#define TB_TREE_CODE  )     (tb_tree_codes[N].code)
 

Definition at line 1261 of file tree-browser.c.

#define TB_TREE_CODE_LEN  )     (tb_tree_codes[N].code_string_len)
 

Definition at line 1263 of file tree-browser.c.

#define TB_TREE_CODE_TEXT  )     (tb_tree_codes[N].code_string)
 

Definition at line 1262 of file tree-browser.c.

#define TB_WF   fprintf (TB_OUT_FILE, "Warning, this command failed.\n")
 

Definition at line 35 of file tree-browser.c.

#define TEST_CHILD  ) 
 

Value:

do {               \
  if (node == TREE_OPERAND (parent, N))  \
    return 1;                            \
} while (0)


Typedef Documentation

typedef enum TB_Comm_code TB_CODE
 

Definition at line 45 of file tree-browser.c.


Enumeration Type Documentation

enum TB_Comm_code
 

Enumerator:
TB_VERBOSE 
Misc. commands.   
verbose 
TB_HPREV 
Walking commands.   
hpr 
TB_UNUSED_COMMAND 
Printing commands.   

Definition at line 40 of file tree-browser.c.

00040                   {
00041 #include "tree-browser.def"
00042   TB_UNUSED_COMMAND
00043 };


Function Documentation

void browse_tree  ) 
 

Entry point in the Tree Browser.   

Definition at line 1295 of file tree-browser.c.

void browse_tree tree   ) 
 

FIXME: To be declared in a .h file.   

static tree find_node_with_code tree *  tp,
int *  walk_subtrees,
void *  data
[static]
 

Find a node with a given code.  This function is used as an argument to
   walk_tree.   

Definition at line 2100 of file tree-browser.c.

static tree store_child_info tree *  tp,
int *  walk_subtrees,
void *  data
[static]
 

For each node store in its children nodes that the current node is their
   parent.  This function is used by walk_tree.   

Definition at line 1904 of file tree-browser.c.

static tree TB_current_chain_node  )  [static]
 

Definition at line 1878 of file tree-browser.c.

static tree TB_current_chain_node tree   )  [static]
 

static tree TB_first_in_bind  )  [static]
 

Search the first node in this BIND_EXPR.   

Definition at line 1804 of file tree-browser.c.

static tree TB_first_in_bind tree   )  [static]
 

static TB_CODE TB_get_command  )  [static]
 

Parse the input string for determining the command the user asked for.   

Definition at line 2036 of file tree-browser.c.

static TB_CODE TB_get_command char *   )  [static]
 

static enum tree_code TB_get_tree_code  )  [static]
 

Parse the input string for determining the tree code.   

Definition at line 2067 of file tree-browser.c.

static enum tree_code TB_get_tree_code char *   )  [static]
 

static long TB_getline  )  [static]
 

Read up to (and including) a '\n' from STREAM into *LINEPTR
   (and null-terminate it). *LINEPTR is a pointer returned from malloc
   (or NULL), pointing to *N characters of space.  It is realloc'd as
   necessary.  Returns the number of characters read (not including the
   null terminator), or -1 on error or EOF.
   This function comes from sed (and is supposed to be a portable version
   of getline).   

Definition at line 2134 of file tree-browser.c.

static long TB_getline char **  ,
long *  ,
FILE * 
[static]
 

Function declarations.   

static tree TB_history_prev void   )  [static]
 

Returns a pointer to the last visited node.   

Definition at line 2114 of file tree-browser.c.

static tree TB_last_in_bind  )  [static]
 

Search the last node in this BIND_EXPR.   

Definition at line 1820 of file tree-browser.c.

static tree TB_last_in_bind tree   )  [static]
 

static tree TB_next_expr  )  [static]
 

Search the next expression in this BIND_EXPR.   

Definition at line 1866 of file tree-browser.c.

static tree TB_next_expr tree   )  [static]
 

static int TB_parent_eq  )  [static]
 

Function used in TB_up_ht.   

Definition at line 1961 of file tree-browser.c.

static int TB_parent_eq const void *  ,
const void * 
[static]
 

static tree TB_prev_expr  )  [static]
 

Search the previous expression in this BIND_EXPR.   

Definition at line 1849 of file tree-browser.c.

static tree TB_prev_expr tree   )  [static]
 

static tree TB_up_expr  )  [static]
 

Search the parent expression for this node.   

Definition at line 1836 of file tree-browser.c.

static tree TB_up_expr tree   )  [static]
 

static void TB_update_up  )  [static]
 

Update information about upper expressions in the hash table.   

Definition at line 2016 of file tree-browser.c.

static void TB_update_up tree   )  [static]
 


Variable Documentation

const struct tb_command tb_commands[] [static]
 

Definition at line 55 of file tree-browser.c.

tree TB_history_stack = NULL_TREE [static]
 

Definition at line 1288 of file tree-browser.c.

const struct tb_tree_code tb_tree_codes[] [static]
 

Definition at line 174 of file tree-browser.c.

htab_t TB_up_ht [static]
 

Static variables.   

Definition at line 1287 of file tree-browser.c.

int TB_verbose = 1 [static]
 

Definition at line 1289 of file tree-browser.c.


Generated on Sun Sep 17 18:03:36 2006 for Tree SSA by  doxygen 1.4.6