comparison gcc/c-semantics.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 /* This file contains the definitions and documentation for the common 1 /* This file contains subroutine used by the C front-end to construct GENERIC.
2 tree codes used in the GNU C and C++ compilers (see c-common.def
3 for the standard codes).
4 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008 2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
5 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
6 Written by Benjamin Chelf (chelf@codesourcery.com). 4 Written by Benjamin Chelf (chelf@codesourcery.com).
7 5
8 This file is part of GCC. 6 This file is part of GCC.
70 nestings will be due to outstanding cleanups. */ 68 nestings will be due to outstanding cleanups. */
71 while (1) 69 while (1)
72 { 70 {
73 chain = TREE_CHAIN (u); 71 chain = TREE_CHAIN (u);
74 TREE_CHAIN (u) = NULL_TREE; 72 TREE_CHAIN (u) = NULL_TREE;
73 if (chain)
74 STATEMENT_LIST_HAS_LABEL (chain) |= STATEMENT_LIST_HAS_LABEL (u);
75 if (t == u) 75 if (t == u)
76 break; 76 break;
77 u = chain; 77 u = chain;
78 } 78 }
79 cur_stmt_list = chain; 79 cur_stmt_list = chain;
101 return t; 101 return t;
102 } 102 }
103 103
104 /* Build a generic statement based on the given type of node and 104 /* Build a generic statement based on the given type of node and
105 arguments. Similar to `build_nt', except that we set 105 arguments. Similar to `build_nt', except that we set
106 EXPR_LOCATION to be the current source location. */ 106 EXPR_LOCATION to LOC. */
107 /* ??? This should be obsolete with the lineno_stmt productions 107 /* ??? This should be obsolete with the lineno_stmt productions
108 in the grammar. */ 108 in the grammar. */
109 109
110 tree 110 tree
111 build_stmt (enum tree_code code, ...) 111 build_stmt (location_t loc, enum tree_code code, ...)
112 { 112 {
113 tree ret; 113 tree ret;
114 int length, i; 114 int length, i;
115 va_list p; 115 va_list p;
116 bool side_effects; 116 bool side_effects;
121 va_start (p, code); 121 va_start (p, code);
122 122
123 ret = make_node (code); 123 ret = make_node (code);
124 TREE_TYPE (ret) = void_type_node; 124 TREE_TYPE (ret) = void_type_node;
125 length = TREE_CODE_LENGTH (code); 125 length = TREE_CODE_LENGTH (code);
126 SET_EXPR_LOCATION (ret, input_location); 126 SET_EXPR_LOCATION (ret, loc);
127 127
128 /* TREE_SIDE_EFFECTS will already be set for statements with 128 /* TREE_SIDE_EFFECTS will already be set for statements with
129 implicit side effects. Here we make sure it is set for other 129 implicit side effects. Here we make sure it is set for other
130 expressions by checking whether the parameters have side 130 expressions by checking whether the parameters have side
131 effects. */ 131 effects. */
143 143
144 va_end (p); 144 va_end (p);
145 return ret; 145 return ret;
146 } 146 }
147 147
148 /* Let the back-end know about DECL. */
149
150 void
151 emit_local_var (tree decl)
152 {
153 /* Create RTL for this variable. */
154 if (!DECL_RTL_SET_P (decl))
155 {
156 if (DECL_HARD_REGISTER (decl))
157 /* The user specified an assembler name for this variable.
158 Set that up now. */
159 rest_of_decl_compilation (decl, 0, 0);
160 else
161 expand_decl (decl);
162 }
163 }
164
165 /* Create a CASE_LABEL_EXPR tree node and return it. */ 148 /* Create a CASE_LABEL_EXPR tree node and return it. */
166 149
167 tree 150 tree
168 build_case_label (tree low_value, tree high_value, tree label_decl) 151 build_case_label (location_t loc,
152 tree low_value, tree high_value, tree label_decl)
169 { 153 {
170 return build_stmt (CASE_LABEL_EXPR, low_value, high_value, label_decl); 154 return build_stmt (loc, CASE_LABEL_EXPR, low_value, high_value, label_decl);
171 } 155 }