OSDN Git Service

* c-lex.c (interpret_float): Give a pedwarn rather than a warning
[pf3gnuchains/gcc-fork.git] / gcc / java / xref.c
1 /* Write cross reference information extracted from Java(TM)
2    source and bytecode files, in one of formats documented below.
3    Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
4    Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.
22
23 Java and all Java-based marks are trademarks or registered trademarks
24 of Sun Microsystems, Inc. in the United States and other countries.
25 The Free Software Foundation is independent of Sun Microsystems, Inc.  */
26
27 #include "config.h"
28 #include "system.h"
29 #include "coretypes.h"
30 #include "tm.h"
31 #include "tree.h"
32 #include "java-tree.h"
33 #include "xref.h"
34 #include "jcf.h"
35 #include "parse.h"
36
37 static xref_flag_table xref_table [] = {
38   {NULL, NULL, NULL, NULL},
39 };
40
41 /* Decode an xref flag value. Return 0 if the flag wasn't found. */
42
43 int
44 xref_flag_value (const char *flag)
45 {
46   int i;
47   for (i = 0; xref_table [i].key; i++)
48     if (!strcmp (flag, xref_table [i].key))
49       return i+1;
50   return 0;
51 }
52
53 void
54 xref_set_data (int flag, void *data)
55 {
56   xref_table [flag-1].data = data;
57 }
58
59 void *
60 xref_get_data (int flag)
61 {
62   return xref_table [flag-1].data;
63 }
64
65 void
66 xref_set_current_fp (FILE *fp)
67 {
68   xref_table [flag_emit_xref-1].fp = fp;
69 }
70
71 /* Branch to the right xref "back-end".  */
72
73 void
74 expand_xref (tree node)
75 {
76   /* Maintain these two cached. */
77   static FILE *fp = NULL;
78   static void (*current_expand) (FILE *, tree) = NULL;
79
80   if ( !flag_emit_xref )
81     return;
82
83   if (!fp)
84     fp = xref_table [flag_emit_xref-1].fp;
85   if (!current_expand)
86     current_expand = xref_table [flag_emit_xref-1].expand;
87
88   (*current_expand) (fp, node);
89 }
90
91 /* Implementation of the xref back-ends. */
92