• Home
  • Raw
  • Download

Lines Matching refs:stmt

46 static struct statement * dup_statement(struct statement *stmt)  in dup_statement()  argument
48 struct statement *dup = alloc_statement(stmt->pos, stmt->type); in dup_statement()
49 *dup = *stmt; in dup_statement()
197 struct statement *stmt = alloc_statement(expr->pos, STMT_COMPOUND); in copy_expression() local
198 copy_statement(expr->statement, stmt); in copy_expression()
200 expr->statement = stmt; in copy_expression()
331 static struct statement *copy_one_statement(struct statement *stmt) in copy_one_statement() argument
333 if (!stmt) in copy_one_statement()
335 switch(stmt->type) { in copy_one_statement()
340 struct statement *newstmt = dup_statement(stmt); in copy_one_statement()
342 FOR_EACH_PTR(stmt->declaration, sym) { in copy_one_statement()
343 struct symbol *newsym = copy_symbol(stmt->pos, sym); in copy_one_statement()
348 stmt = newstmt; in copy_one_statement()
353 struct expression *expr = copy_expression(stmt->expression); in copy_one_statement()
354 if (expr == stmt->expression) in copy_one_statement()
356 stmt = dup_statement(stmt); in copy_one_statement()
357 stmt->expression = expr; in copy_one_statement()
361 struct expression *expr = copy_expression(stmt->range_expression); in copy_one_statement()
362 if (expr == stmt->expression) in copy_one_statement()
364 stmt = dup_statement(stmt); in copy_one_statement()
365 stmt->range_expression = expr; in copy_one_statement()
369 struct statement *new = alloc_statement(stmt->pos, STMT_COMPOUND); in copy_one_statement()
370 copy_statement(stmt, new); in copy_one_statement()
371 stmt = new; in copy_one_statement()
375 struct expression *cond = stmt->if_conditional; in copy_one_statement()
376 struct statement *valt = stmt->if_true; in copy_one_statement()
377 struct statement *valf = stmt->if_false; in copy_one_statement()
382 if (stmt->if_conditional == cond && in copy_one_statement()
383 stmt->if_true == valt && in copy_one_statement()
384 stmt->if_false == valf) in copy_one_statement()
386 stmt = dup_statement(stmt); in copy_one_statement()
387 stmt->if_conditional = cond; in copy_one_statement()
388 stmt->if_true = valt; in copy_one_statement()
389 stmt->if_false = valf; in copy_one_statement()
393 struct expression *retval = copy_expression(stmt->ret_value); in copy_one_statement()
394 struct symbol *sym = copy_symbol(stmt->pos, stmt->ret_target); in copy_one_statement()
396 stmt = dup_statement(stmt); in copy_one_statement()
397 stmt->ret_value = retval; in copy_one_statement()
398 stmt->ret_target = sym; in copy_one_statement()
402 stmt = dup_statement(stmt); in copy_one_statement()
403 stmt->case_label = copy_symbol(stmt->pos, stmt->case_label); in copy_one_statement()
404 stmt->case_label->stmt = stmt; in copy_one_statement()
405 stmt->case_expression = copy_expression(stmt->case_expression); in copy_one_statement()
406 stmt->case_to = copy_expression(stmt->case_to); in copy_one_statement()
407 stmt->case_statement = copy_one_statement(stmt->case_statement); in copy_one_statement()
411 struct symbol *switch_break = copy_symbol(stmt->pos, stmt->switch_break); in copy_one_statement()
412 struct symbol *switch_case = copy_symbol(stmt->pos, stmt->switch_case); in copy_one_statement()
413 struct expression *expr = copy_expression(stmt->switch_expression); in copy_one_statement()
414 struct statement *switch_stmt = copy_one_statement(stmt->switch_statement); in copy_one_statement()
416 stmt = dup_statement(stmt); in copy_one_statement()
418 stmt->switch_break = switch_break; in copy_one_statement()
419 stmt->switch_case = switch_case; in copy_one_statement()
420 stmt->switch_expression = expr; in copy_one_statement()
421 stmt->switch_statement = switch_stmt; in copy_one_statement()
425 stmt = dup_statement(stmt); in copy_one_statement()
426 stmt->iterator_break = copy_symbol(stmt->pos, stmt->iterator_break); in copy_one_statement()
427 stmt->iterator_continue = copy_symbol(stmt->pos, stmt->iterator_continue); in copy_one_statement()
428 stmt->iterator_syms = copy_symbol_list(stmt->iterator_syms); in copy_one_statement()
430 stmt->iterator_pre_statement = copy_one_statement(stmt->iterator_pre_statement); in copy_one_statement()
431 stmt->iterator_pre_condition = copy_expression(stmt->iterator_pre_condition); in copy_one_statement()
433 stmt->iterator_statement = copy_one_statement(stmt->iterator_statement); in copy_one_statement()
435 stmt->iterator_post_statement = copy_one_statement(stmt->iterator_post_statement); in copy_one_statement()
436 stmt->iterator_post_condition = copy_expression(stmt->iterator_post_condition); in copy_one_statement()
440 stmt = dup_statement(stmt); in copy_one_statement()
441 stmt->label_identifier = copy_symbol(stmt->pos, stmt->label_identifier); in copy_one_statement()
442 stmt->label_statement = copy_one_statement(stmt->label_statement); in copy_one_statement()
446 stmt = dup_statement(stmt); in copy_one_statement()
447 stmt->goto_label = copy_symbol(stmt->pos, stmt->goto_label); in copy_one_statement()
448 stmt->goto_expression = copy_expression(stmt->goto_expression); in copy_one_statement()
449 stmt->target_list = copy_symbol_list(stmt->target_list); in copy_one_statement()
453 stmt = dup_statement(stmt); in copy_one_statement()
454 stmt->asm_inputs = copy_asm_operands(stmt->asm_inputs); in copy_one_statement()
455 stmt->asm_outputs = copy_asm_operands(stmt->asm_outputs); in copy_one_statement()
460 warning(stmt->pos, "trying to copy statement type %d", stmt->type); in copy_one_statement()
463 return stmt; in copy_one_statement()
477 struct statement *stmt; in copy_statement() local
479 FOR_EACH_PTR(src->stmts, stmt) { in copy_statement()
480 add_statement(&dst->stmts, copy_one_statement(stmt)); in copy_statement()
481 } END_FOR_EACH_PTR(stmt); in copy_statement()
518 struct statement *stmt = alloc_statement(expr->pos, STMT_COMPOUND); in inline_function() local
533 expr->statement = stmt; in inline_function()
556 copy_statement(fn->inline_stmt, stmt); in inline_function()
561 stmt->args = decl; in inline_function()
563 stmt->inline_fn = sym; in inline_function()
580 fn->stmt = alloc_statement(fn->pos, STMT_COMPOUND); in uninline()
581 copy_statement(fn->inline_stmt, fn->stmt); in uninline()