libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
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 
446 FIRM_API ir_node *new_rd_ASM(dbg_info *db, ir_node *block, ir_node *mem,
447  int arity, ir_node *in[],
448  size_t n_constraints, ir_asm_constraint *constraints,
449  size_t n_clobber, ident *clobber[],
450  ident *asm_text);
451 
464 FIRM_API ir_node *new_r_ASM(ir_node *block, ir_node *mem,
465  int arity, ir_node *in[],
466  size_t n_constraints, ir_asm_constraint *constraints,
467  size_t n_clobber, ident *clobber[],
468  ident *asm_text);
469 
483 FIRM_API ir_node *new_d_ASM(dbg_info *db, ir_node *mem,
484  int arity, ir_node *in[],
485  size_t n_constraints, ir_asm_constraint *constraints,
486  size_t n_clobber, ident *clobber[],
487  ident *asm_text);
488 
501 FIRM_API ir_node *new_ASM(ir_node *mem, int arity, ir_node *in[],
502  size_t n_constraints, ir_asm_constraint *constraints,
503  size_t n_clobber, ident *clobber[], ident *asm_text);
504 
517 
521 FIRM_API ir_graph *get_current_ir_graph(void);
522 
526 FIRM_API void set_current_ir_graph(ir_graph *graph);
527 
537 FIRM_API ir_node *new_d_immBlock(dbg_info *db);
547 FIRM_API ir_node *new_immBlock(void);
556 FIRM_API ir_node *new_r_immBlock(ir_graph *irg);
565 FIRM_API ir_node *new_rd_immBlock(dbg_info *db, ir_graph *irg);
566 
568 FIRM_API void add_immBlock_pred(ir_node *immblock, ir_node *jmp);
569 
571 FIRM_API void mature_immBlock(ir_node *block);
572 
579 FIRM_API void set_cur_block(ir_node *target);
584 FIRM_API void set_r_cur_block(ir_graph *irg, ir_node *target);
585 
587 FIRM_API ir_node *get_cur_block(void);
589 FIRM_API ir_node *get_r_cur_block(ir_graph *irg);
590 
600 FIRM_API ir_node *get_value(int pos, ir_mode *mode);
603 FIRM_API ir_node *get_r_value(ir_graph *irg, int pos, ir_mode *mode);
606 FIRM_API ir_node *get_b_value(ir_node *block, int pos, ir_mode *mode);
607 
616 FIRM_API ir_mode *ir_guess_mode(int pos);
620 FIRM_API ir_mode *ir_r_guess_mode(ir_graph *irg, int pos);
621 
632 FIRM_API void set_value(int pos, ir_node *value);
634 FIRM_API void set_r_value(ir_graph *irg, int pos, ir_node *value);
636 FIRM_API void set_b_value(ir_node *block, 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);
650 FIRM_API ir_node *get_b_store(ir_node *block);
651 
659 FIRM_API void set_store(ir_node *store);
662 FIRM_API void set_r_store(ir_graph *irg, ir_node *store);
665 FIRM_API void set_b_store(ir_node *block, ir_node *store);
666 
671 FIRM_API void keep_alive(ir_node *ka);
672 
674 FIRM_API void irg_finalize_cons(ir_graph *irg);
675 
681 FIRM_API void verify_new_node(ir_node *node);
682 
689 
692 #include "end.h"
693 
694 #endif
ir_node * get_r_store(ir_graph *irg)
Returns current memory state for a given graph.
ir_node * new_d_Phi_loop(dbg_info *db, int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
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:123
ir_node * new_immBlock(void)
Create an immature Block.
void keep_alive(ir_node *ka)
keep this node alive even if End is not control-reachable from it
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 * 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_rd_Const_long(dbg_info *db, ir_graph *irg, ir_mode *mode, long value)
Constructor for a Const node.
void set_r_cur_block(ir_graph *irg, ir_node *target)
Sets current block of a given graph.
void mature_immBlock(ir_node *block)
Finalize a Block node, when all control flows are known.
struct ir_graph ir_graph
Procedure Graph.
Definition: firm_types.h:74
ir_node * new_d_Const_long(dbg_info *db, ir_mode *mode, long value)
struct dbg_info dbg_info
Source Reference.
Definition: firm_types.h:40
ir_node * new_r_immBlock(ir_graph *irg)
Create an immature Block.
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
ir_node * get_b_value(ir_node *block, int pos, ir_mode *mode)
Returns the current value of a local variable in given block.
ir_node * new_Phi_loop(int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
void set_cur_block(ir_node *target)
Sets the current block in which the following constructors place the nodes they construct.
ir_node * new_ASM(ir_node *mem, int arity, ir_node *in[], size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
void set_b_value(ir_node *block, int pos, ir_node *value)
Sets current value of a variable in a given block.
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...
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_Const_long(ir_mode *mode, long value)
Make a const from a long.
struct ir_mode ir_mode
SSA Value mode.
Definition: firm_types.h:59
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.
void irg_finalize_cons(ir_graph *irg)
Puts the graph into state "phase_high".
ir_mode * ir_guess_mode(int pos)
Try to guess the mode of a local variable.
A input/output constraint attribute.
Definition: firm_types.h:270
void set_current_ir_graph(ir_graph *graph)
Sets graph which is currently constructed.
ir_node * new_d_ASM(dbg_info *db, ir_node *mem, int arity, ir_node *in[], size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
void set_r_store(ir_graph *irg, ir_node *store)
Sets current memory state for a given graph.
void set_r_value(ir_graph *irg, int pos, ir_node *value)
Sets current value of a variable in a given graph.
ir_node * new_r_ASM(ir_node *block, ir_node *mem, int arity, ir_node *in[], size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
ir_node * get_store(void)
Returns the current memory state.
const char ident
Identifier.
Definition: firm_types.h:50
ir_node * new_rd_ASM(dbg_info *db, ir_node *block, ir_node *mem, int arity, ir_node *in[], size_t n_constraints, ir_asm_constraint *constraints, size_t n_clobber, ident *clobber[], ident *asm_text)
Constructor for an ASM pseudo node.
ir_node * get_r_cur_block(ir_graph *irg)
Returns current block of a given graph.
void set_b_store(ir_node *block, ir_node *store)
Sets current memory state for a given block.
ir_graph * get_current_ir_graph(void)
Returns graph which is currently constructed.
ir_node * new_d_immBlock(dbg_info *db)
Create an immature Block.
ir_node * get_cur_block(void)
Returns the current block of the current graph.
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.
ir_node * new_r_Const_long(ir_graph *irg, ir_mode *mode, long value)
Constructor for a Const 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 * current_ir_graph
Global variable holding the graph which is currently constructed.
Definition: ircons.h:516
void set_value(int pos, ir_node *value)
Memorize a new definition of a variable.
ir_node * new_rd_immBlock(dbg_info *db, ir_graph *irg)
Create an immature Block.
void verify_new_node(ir_node *node)
If firm is built in debug mode, verify that a newly created node is fine.
ir_node * get_value(int pos, ir_mode *mode)
Returns the current value of a local variable.
ir_node * get_b_store(ir_node *block)
Returns current memory state for a given block.
void set_store(ir_node *store)
Memorize a new definition of the memory state.
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 * new_DivRL(ir_node *memop, ir_node *op1, ir_node *op2, int pinned)
Constructor for a remainderless Div node.