libFirm
ircons.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5 
294 #ifndef FIRM_IR_IRCONS_H
295 #define FIRM_IR_IRCONS_H
296 
297 #include "firm_types.h"
298 #include "begin.h"
299 #include "irnode.h"
300 
317 FIRM_API ir_node *new_rd_Const_long(dbg_info *db, ir_graph *irg,
318  ir_mode *mode, long value);
319 
330 FIRM_API ir_node *new_r_Const_long(ir_graph *irg, ir_mode *mode, long value);
331 
339 FIRM_API ir_node *new_d_Const_long(dbg_info *db, ir_mode *mode, long value);
340 
352 FIRM_API ir_node *new_Const_long(ir_mode *mode, long value);
353 
361 FIRM_API ir_node *new_rd_Phi_loop(dbg_info *db, ir_node *block,
362  int arity, ir_node *in[]);
363 
365 FIRM_API ir_node *new_r_Phi_loop(ir_node *block, int arity, ir_node *in[]);
366 
368 FIRM_API ir_node *new_d_Phi_loop(dbg_info *db, int arity, ir_node *in[]);
369 
371 FIRM_API ir_node *new_Phi_loop(int arity, ir_node *in[]);
372 
388 FIRM_API ir_node *new_rd_DivRL(dbg_info *db, ir_node *block, ir_node *memop,
389  ir_node *op1, ir_node *op2, int pinned);
390 
399 FIRM_API ir_node *new_r_DivRL(ir_node *block, ir_node *memop,
400  ir_node *op1, ir_node *op2, int pinned);
401 
412 FIRM_API ir_node *new_d_DivRL(dbg_info *db, ir_node *memop,
413  ir_node *op1, ir_node *op2, int pinned);
414 
424 FIRM_API ir_node *new_DivRL(ir_node *memop, ir_node *op1, ir_node *op2,
425  int pinned);
426 
447 FIRM_API ir_node *new_rd_ASM(dbg_info *db, ir_node *block, ir_node *mem,
448  int arity, ir_node *in[], ir_asm_constraint *inputs,
449  size_t n_outs, ir_asm_constraint *outputs,
450  size_t n_clobber, ident *clobber[],
451  ident *asm_text);
452 
466 FIRM_API ir_node *new_r_ASM(ir_node *block, ir_node *mem,
467  int arity, ir_node *in[], ir_asm_constraint *inputs,
468  size_t n_outs, ir_asm_constraint *outputs,
469  size_t n_clobber, ident *clobber[],
470  ident *asm_text);
471 
486 FIRM_API ir_node *new_d_ASM(dbg_info *db, ir_node *mem, int arity,
487  ir_node *in[], ir_asm_constraint *inputs,
488  size_t n_outs, ir_asm_constraint *outputs,
489  size_t n_clobber, ident *clobber[],
490  ident *asm_text);
491 
505 FIRM_API ir_node *new_ASM(ir_node *mem, int arity, ir_node *in[],
506  ir_asm_constraint *inputs, size_t n_outs,
507  ir_asm_constraint *outputs,
508  size_t n_clobber, ident *clobber[], ident *asm_text);
509 
522 
526 FIRM_API ir_graph *get_current_ir_graph(void);
527 
531 FIRM_API void set_current_ir_graph(ir_graph *graph);
532 
542 FIRM_API ir_node *new_d_immBlock(dbg_info *db);
552 FIRM_API ir_node *new_immBlock(void);
561 FIRM_API ir_node *new_r_immBlock(ir_graph *irg);
570 FIRM_API ir_node *new_rd_immBlock(dbg_info *db, ir_graph *irg);
571 
573 FIRM_API void add_immBlock_pred(ir_node *immblock, ir_node *jmp);
574 
576 FIRM_API void mature_immBlock(ir_node *block);
577 
584 FIRM_API void set_cur_block(ir_node *target);
589 FIRM_API void set_r_cur_block(ir_graph *irg, ir_node *target);
590 
592 FIRM_API ir_node *get_cur_block(void);
594 FIRM_API ir_node *get_r_cur_block(ir_graph *irg);
595 
605 FIRM_API ir_node *get_value(int pos, ir_mode *mode);
608 FIRM_API ir_node *get_r_value(ir_graph *irg, int pos, ir_mode *mode);
609 
618 FIRM_API ir_mode *ir_guess_mode(int pos);
622 FIRM_API ir_mode *ir_r_guess_mode(ir_graph *irg, int pos);
623 
634 FIRM_API void set_value(int pos, ir_node *value);
636 FIRM_API void set_r_value(ir_graph *irg, int pos, ir_node *value);
637 
644 FIRM_API ir_node *get_store(void);
647 FIRM_API ir_node *get_r_store(ir_graph *irg);
648 
656 FIRM_API void set_store(ir_node *store);
659 FIRM_API void set_r_store(ir_graph *irg, ir_node *store);
660 
665 FIRM_API void keep_alive(ir_node *ka);
666 
668 FIRM_API void irg_finalize_cons(ir_graph *irg);
669 
675 FIRM_API void verify_new_node(ir_node *node);
676 
683 
686 #include "end.h"
687 
688 #endif
void irg_finalize_cons(ir_graph *irg)
Puts the graph into state "phase_high".
ir_node * new_rd_Const_long(dbg_info *db, ir_graph *irg, ir_mode *mode, long value)
Constructor for a Const node.
ir_node * new_r_immBlock(ir_graph *irg)
Create an immature Block.
const char ident
Identifier.
Definition: firm_types.h:50
ir_node * new_ASM(ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
ir_node * new_DivRL(ir_node *memop, ir_node *op1, ir_node *op2, int pinned)
Constructor for a remainderless Div node.
ir_node * new_d_immBlock(dbg_info *db)
Create an immature Block.
ir_mode * ir_guess_mode(int pos)
Try to guess the mode of a local variable.
void set_store(ir_node *store)
Memorize a new definition of the memory state.
void set_current_ir_graph(ir_graph *graph)
Sets graph which is currently constructed.
void keep_alive(ir_node *ka)
keep this node alive even if End is not control-reachable from it
ir_graph * current_ir_graph
Global variable holding the graph which is currently constructed.
Definition: ircons.h:521
ir_node * new_rd_DivRL(dbg_info *db, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2, int pinned)
Constructor for a remainderless Div node.
void set_value(int pos, ir_node *value)
Memorize a new definition of a variable.
void verify_new_node(ir_node *node)
If firm is built in debug mode, verify that a newly created node is fine.
struct dbg_info dbg_info
Source Reference.
Definition: firm_types.h:40
ir_node * get_value(int pos, ir_mode *mode)
Returns the current value of a local variable.
void set_cur_block(ir_node *target)
Sets the current block in which the following constructors place the nodes they construct.
ir_node * new_d_ASM(dbg_info *db, ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
ir_node * new_rd_ASM(dbg_info *db, ir_node *block, ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
ir_node * new_r_ASM(ir_node *block, ir_node *mem, int arity, ir_node *in[], ir_asm_constraint *inputs, size_t n_outs, ir_asm_constraint *outputs, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
void set_r_cur_block(ir_graph *irg, ir_node *target)
Sets current block of a given graph.
ir_node * new_Phi_loop(int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
ir_node * new_d_Const_long(dbg_info *db, ir_mode *mode, long value)
A input/output constraint attribute.
Definition: firm_types.h:267
ir_node * new_d_DivRL(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, int pinned)
Constructor for a remainderless Div node.
ir_node * new_rd_Phi_loop(dbg_info *db, ir_node *block, int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
ir_node * new_r_Const_long(ir_graph *irg, ir_mode *mode, long value)
Constructor for a Const node.
ir_mode * ir_r_guess_mode(ir_graph *irg, int pos)
Try to guess the mode of a local variable in a given graph.
ir_node * get_r_value(ir_graph *irg, int pos, ir_mode *mode)
Returns the current value of a local variable in given graph.
void add_immBlock_pred(ir_node *immblock, ir_node *jmp)
Add a control flow edge to an immature block.
ir_node * new_d_Phi_loop(dbg_info *db, int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
ir_node * get_r_cur_block(ir_graph *irg)
Returns current block of a given graph.
struct ir_mode ir_mode
SSA Value mode.
Definition: firm_types.h:59
ir_node * get_r_store(ir_graph *irg)
Returns current memory state for a given graph.
ir_node * get_cur_block(void)
Returns the current block of the current graph.
void mature_immBlock(ir_node *block)
Finalize a Block node, when all control flows are known.
ir_node * new_immBlock(void)
Create an immature Block.
ir_node * uninitialized_local_variable_func_t(ir_graph *irg, ir_mode *mode, int pos)
This function is called, whenever a local variable is used before definition.
Definition: firm_types.h:120
void set_r_store(ir_graph *irg, ir_node *store)
Sets current memory state for a given graph.
ir_node * new_rd_immBlock(dbg_info *db, ir_graph *irg)
Create an immature Block.
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
void set_r_value(ir_graph *irg, int pos, ir_node *value)
Sets current value of a variable in a given graph.
ir_node * get_store(void)
Returns the current memory state.
ir_node * new_Const_long(ir_mode *mode, long value)
Make a const from a long.
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
ir_node * new_r_DivRL(ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2, int pinned)
Constructor for a remainderless Div node.
ir_node * new_r_Phi_loop(ir_node *block, int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
ir_graph * get_current_ir_graph(void)
Returns graph which is currently constructed.
void ir_set_uninitialized_local_variable_func(uninitialized_local_variable_func_t *func)
Register a new callback for the case that the value of an uninitialized variable is requested...