Mercurial > hg > CbC > CbC_gcc
comparison gcc/c-objc-common.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
1 /* Some code common to C and ObjC front ends. | 1 /* Some code common to C and ObjC front ends. |
2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. | 2 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, |
3 2009 Free Software Foundation, Inc. | |
3 | 4 |
4 This file is part of GCC. | 5 This file is part of GCC. |
5 | 6 |
6 GCC is free software; you can redistribute it and/or modify it under | 7 GCC is free software; you can redistribute it and/or modify it under |
7 the terms of the GNU General Public License as published by the Free | 8 the terms of the GNU General Public License as published by the Free |
24 #include "tree.h" | 25 #include "tree.h" |
25 #include "rtl.h" | 26 #include "rtl.h" |
26 #include "insn-config.h" | 27 #include "insn-config.h" |
27 #include "integrate.h" | 28 #include "integrate.h" |
28 #include "c-tree.h" | 29 #include "c-tree.h" |
30 #include "intl.h" | |
29 #include "c-pretty-print.h" | 31 #include "c-pretty-print.h" |
30 #include "function.h" | 32 #include "function.h" |
31 #include "flags.h" | 33 #include "flags.h" |
32 #include "toplev.h" | 34 #include "toplev.h" |
33 #include "diagnostic.h" | 35 #include "diagnostic.h" |
96 c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, | 98 c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, |
97 int precision, bool wide, bool set_locus, bool hash) | 99 int precision, bool wide, bool set_locus, bool hash) |
98 { | 100 { |
99 tree t = va_arg (*text->args_ptr, tree); | 101 tree t = va_arg (*text->args_ptr, tree); |
100 tree name; | 102 tree name; |
101 const char *n = "({anonymous})"; | |
102 c_pretty_printer *cpp = (c_pretty_printer *) pp; | 103 c_pretty_printer *cpp = (c_pretty_printer *) pp; |
103 pp->padding = pp_none; | 104 pp->padding = pp_none; |
104 | 105 |
105 if (precision != 0 || wide || hash) | 106 if (precision != 0 || wide || hash) |
106 return false; | 107 return false; |
122 } | 123 } |
123 /* FALLTHRU */ | 124 /* FALLTHRU */ |
124 | 125 |
125 case 'F': | 126 case 'F': |
126 if (DECL_NAME (t)) | 127 if (DECL_NAME (t)) |
127 n = lang_hooks.decl_printable_name (t, 2); | 128 { |
129 pp_identifier (cpp, lang_hooks.decl_printable_name (t, 2)); | |
130 return true; | |
131 } | |
128 break; | 132 break; |
129 | 133 |
130 case 'T': | 134 case 'T': |
131 gcc_assert (TYPE_P (t)); | 135 gcc_assert (TYPE_P (t)); |
132 name = TYPE_NAME (t); | 136 name = TYPE_NAME (t); |
133 | 137 |
134 if (name && TREE_CODE (name) == TYPE_DECL) | 138 if (name && TREE_CODE (name) == TYPE_DECL) |
135 { | 139 { |
136 if (DECL_NAME (name)) | 140 if (DECL_NAME (name)) |
137 pp_string (cpp, lang_hooks.decl_printable_name (name, 2)); | 141 pp_identifier (cpp, lang_hooks.decl_printable_name (name, 2)); |
138 else | 142 else |
139 pp_type_id (cpp, t); | 143 pp_type_id (cpp, t); |
140 return true; | 144 return true; |
141 } | 145 } |
142 else | 146 else |
146 } | 150 } |
147 break; | 151 break; |
148 | 152 |
149 case 'E': | 153 case 'E': |
150 if (TREE_CODE (t) == IDENTIFIER_NODE) | 154 if (TREE_CODE (t) == IDENTIFIER_NODE) |
151 n = IDENTIFIER_POINTER (t); | 155 pp_identifier (cpp, IDENTIFIER_POINTER (t)); |
152 else | 156 else |
153 { | 157 pp_expression (cpp, t); |
154 pp_expression (cpp, t); | 158 return true; |
155 return true; | |
156 } | |
157 break; | |
158 | 159 |
159 default: | 160 default: |
160 return false; | 161 return false; |
161 } | 162 } |
162 | 163 |
163 pp_string (cpp, n); | 164 pp_string (cpp, _("({anonymous})")); |
164 return true; | 165 return true; |
165 } | 166 } |
166 | 167 |
167 /* In C and ObjC, all decls have "C" linkage. */ | 168 /* In C and ObjC, all decls have "C" linkage. */ |
168 bool | 169 bool |