* */
| 243 | * |
| 244 | */ |
| 245 | void |
| 246 | StatementArrayOp::Output(std::ostream &out, FactMgr* fm, int indent) const |
| 247 | { |
| 248 | size_t i; |
| 249 | output_header(out, indent); |
| 250 | |
| 251 | if (body) { |
| 252 | body->Output(out, fm, indent); |
| 253 | } |
| 254 | else if (init_value) { |
| 255 | output_tab(out, indent); |
| 256 | out << "{"; |
| 257 | outputln(out); |
| 258 | // cannot assign array members to a struct/union constant directly, has to create a "fake" struct var first |
| 259 | if (init_value->term_type == eConstant && array_var->is_aggregate()) { |
| 260 | output_tab(out, indent+1); |
| 261 | array_var->type->Output(out); |
| 262 | out << " tmp = "; |
| 263 | init_value->Output(out); |
| 264 | out << ";"; |
| 265 | outputln(out); |
| 266 | output_tab(out, indent+1); |
| 267 | array_var->output_with_indices(out, ctrl_vars); |
| 268 | out << " = tmp;"; |
| 269 | outputln(out); |
| 270 | } |
| 271 | else { |
| 272 | output_tab(out, indent+1); |
| 273 | array_var->output_with_indices(out, ctrl_vars); |
| 274 | out << " = "; |
| 275 | init_value->Output(out); |
| 276 | out << ";"; |
| 277 | outputln(out); |
| 278 | } |
| 279 | output_tab(out, indent); |
| 280 | out << "}"; |
| 281 | outputln(out); |
| 282 | } |
| 283 | // output the closing bracelets |
| 284 | for (i=1; i<array_var->get_dimension(); i++) { |
| 285 | indent--; |
| 286 | output_tab(out, indent); |
| 287 | out << "}"; |
| 288 | outputln(out); |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | bool |
| 293 | StatementArrayOp::visit_facts(vector<const Fact*>& inputs, CGContext& cg_context) const |
no test coverage detected