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 
389 FIRM_API ir_node *new_rd_DivRL(dbg_info *db, ir_node *block, ir_node *memop,
390  ir_node *op1, ir_node *op2, ir_mode *mode,
391  int pinned);
392 
402 FIRM_API ir_node *new_r_DivRL(ir_node *block, ir_node *memop,
403  ir_node *op1, ir_node *op2, ir_mode *mode,
404  int pinned);
405 
417 FIRM_API ir_node *new_d_DivRL(dbg_info *db, ir_node *memop,
418  ir_node *op1, ir_node *op2, ir_mode *mode,
419  int pinned);
420 
431 FIRM_API ir_node *new_DivRL(ir_node *memop, ir_node *op1, ir_node *op2,
432  ir_mode *mode, int pinned);
433 
454 FIRM_API ir_node *new_rd_ASM(dbg_info *db, ir_node *block, ir_node *mem,
455  int arity, ir_node *in[], ir_asm_constraint *inputs,
456  size_t n_outs, ir_asm_constraint *outputs,
457  size_t n_clobber, ident *clobber[],
458  ident *asm_text);
459 
473 FIRM_API ir_node *new_r_ASM(ir_node *block, ir_node *mem,
474  int arity, ir_node *in[], ir_asm_constraint *inputs,
475  size_t n_outs, ir_asm_constraint *outputs,
476  size_t n_clobber, ident *clobber[],
477  ident *asm_text);
478 
493 FIRM_API ir_node *new_d_ASM(dbg_info *db, ir_node *mem, int arity,
494  ir_node *in[], ir_asm_constraint *inputs,
495  size_t n_outs, ir_asm_constraint *outputs,
496  size_t n_clobber, ident *clobber[],
497  ident *asm_text);
498 
512 FIRM_API ir_node *new_ASM(ir_node *mem, int arity, ir_node *in[],
513  ir_asm_constraint *inputs, size_t n_outs,
514  ir_asm_constraint *outputs,
515  size_t n_clobber, ident *clobber[], ident *asm_text);
516 
529 
533 FIRM_API ir_graph *get_current_ir_graph(void);
534 
538 FIRM_API void set_current_ir_graph(ir_graph *graph);
539 
549 FIRM_API ir_node *new_d_immBlock(dbg_info *db);
559 FIRM_API ir_node *new_immBlock(void);
568 FIRM_API ir_node *new_r_immBlock(ir_graph *irg);
577 FIRM_API ir_node *new_rd_immBlock(dbg_info *db, ir_graph *irg);
578 
580 FIRM_API void add_immBlock_pred(ir_node *immblock, ir_node *jmp);
581 
583 FIRM_API void mature_immBlock(ir_node *block);
584 
591 FIRM_API void set_cur_block(ir_node *target);
596 FIRM_API void set_r_cur_block(ir_graph *irg, ir_node *target);
597 
599 FIRM_API ir_node *get_cur_block(void);
601 FIRM_API ir_node *get_r_cur_block(ir_graph *irg);
602 
612 FIRM_API ir_node *get_value(int pos, ir_mode *mode);
615 FIRM_API ir_node *get_r_value(ir_graph *irg, int pos, ir_mode *mode);
616 
625 FIRM_API ir_mode *ir_guess_mode(int pos);
629 FIRM_API ir_mode *ir_r_guess_mode(ir_graph *irg, int pos);
630 
641 FIRM_API void set_value(int pos, ir_node *value);
643 FIRM_API void set_r_value(ir_graph *irg, int pos, ir_node *value);
644 
651 FIRM_API ir_node *get_store(void);
654 FIRM_API ir_node *get_r_store(ir_graph *irg);
655 
663 FIRM_API void set_store(ir_node *store);
666 FIRM_API void set_r_store(ir_graph *irg, ir_node *store);
667 
672 FIRM_API void keep_alive(ir_node *ka);
673 
675 FIRM_API void irg_finalize_cons(ir_graph *irg);
676 
682 FIRM_API void verify_new_node(ir_node *node);
683 
690 
693 #include "end.h"
694 
695 #endif
void irg_finalize_cons(ir_graph *irg)
Puts the graph into state "phase_high".
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_d_Const_long(dbg_info *db, ir_mode *mode, long value)
struct dbg_info dbg_info
Source Reference.
Definition: firm_types.h:40
ir_mode * ir_guess_mode(int pos)
Try to guess the mode 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.
void add_immBlock_pred(ir_node *immblock, ir_node *jmp)
Add a control flow edge to an immature block.
void set_current_ir_graph(ir_graph *graph)
Sets graph which is currently constructed.
ir_node * new_immBlock(void)
Create an immature Block.
ir_node * new_r_Phi_loop(ir_node *block, int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
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, ir_mode *mode, int pinned)
Constructor for a remainderless Div node.
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.
void set_store(ir_node *store)
Memorize a new definition of the memory state.
ir_node * new_d_immBlock(dbg_info *db)
Create an immature Block.
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_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_DivRL(dbg_info *db, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, int pinned)
Constructor for a remainderless Div node.
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.
A input/output constraint attribute.
Definition: firm_types.h:267
void mature_immBlock(ir_node *block)
Finalize a Block node, when all control flows are known.
ir_node * new_r_immBlock(ir_graph *irg)
Create an immature Block.
ir_node * new_d_DivRL(dbg_info *db, ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, int pinned)
Constructor for a remainderless Div node.
ir_graph * get_current_ir_graph(void)
Returns graph which is currently constructed.
void set_value(int pos, ir_node *value)
Memorize a new definition of a variable.
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_value(ir_graph *irg, int pos, ir_node *value)
Sets current value of a variable in a given graph.
ir_node * get_value(int pos, ir_mode *mode)
Returns the current value of a local variable.
ir_node * new_Const_long(ir_mode *mode, long value)
Make a const from a long.
ir_node * new_Phi_loop(int arity, ir_node *in[])
Constructor for memory Phi with keep-alive edge.
void keep_alive(ir_node *ka)
keep this node alive even if End is not control-reachable from it
ir_node * new_DivRL(ir_node *memop, ir_node *op1, ir_node *op2, ir_mode *mode, int pinned)
Constructor for a remainderless Div node.
ir_graph * current_ir_graph
Global variable holding the graph which is currently constructed.
Definition: ircons.h:528
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.
ir_node * get_r_store(ir_graph *irg)
Returns current memory state for a given graph.
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...
struct ir_mode ir_mode
SSA Value mode.
Definition: firm_types.h:59
struct ir_node ir_node
Procedure Graph Node.
Definition: firm_types.h:53
void set_r_store(ir_graph *irg, ir_node *store)
Sets current memory state for a given graph.
ir_node * get_r_cur_block(ir_graph *irg)
Returns current block of a given graph.
const char ident
Identifier.
Definition: firm_types.h:50
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
ir_node * get_store(void)
Returns the current memory state.
ir_node * new_r_Const_long(ir_graph *irg, ir_mode *mode, long value)
Constructor for a Const node.
ir_node * get_cur_block(void)
Returns the current block of the current 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 * get_r_value(ir_graph *irg, int pos, ir_mode *mode)
Returns the current value of a local variable in given graph.
ir_mode * ir_r_guess_mode(ir_graph *irg, int pos)
Try to guess the mode of a local variable in a given graph.