X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Firnode.h;h=6d8b2d48ccf5d5cca48d2d30d35cdb71a9001984;hb=3977737475ce98c71e45f363a053e47d5d1bb39d;hp=1dcad1acac1c470f3a577f1c9dbb251ad0069a74;hpb=32d7ce4fc3771ddd8ad5b6849b7357311da67af4;p=libfirm diff --git a/include/libfirm/irnode.h b/include/libfirm/irnode.h index 1dcad1aca..6d8b2d48c 100644 --- a/include/libfirm/irnode.h +++ b/include/libfirm/irnode.h @@ -385,6 +385,12 @@ void set_Block_extbb(ir_node *block, ir_extblk *extblk); ir_node *get_Block_MacroBlock(const ir_node *block); /** Returns the ir_graph this Block belongs to. */ ir_graph *get_Block_irg(const ir_node *block); +/** Returns non-zero if the block has an assigned label. */ +int has_Block_label(const ir_node *block); +/** Returns the label of a Block. */ +ir_label_t get_Block_label(const ir_node *block); +/** Sets a label to a block. */ +void set_Block_label(ir_node *block, ir_label_t label); /** Return the number of Keep alive node. */ int get_End_n_keepalives(ir_node *end); @@ -457,27 +463,14 @@ int get_Return_n_ress(ir_node *node); ir_node *get_Return_res(ir_node *node, int pos); void set_Return_res(ir_node *node, int pos, ir_node *res); -/** - * Possible classes for constant classification. - */ -typedef enum { - CNST_NULL = 0, /**< The node is a const(0). */ - CNST_ONE = +1, /**< The node is a const(1). */ - CNST_ALL_ONE = -1, /**< The node is a const(11111...). */ - CNST_OTHER = 2, /**< The tarval of the const has another value. */ - CNST_SYMCONST = 3, /**< The node is symconst. */ - CNST_NO_CONST = 4 /**< The node is no const at all. */ -} cnst_classify_t; - tarval *get_Const_tarval(const ir_node *node); void set_Const_tarval(ir_node *node, tarval *con); -/** - * Classify a node concerning constant properties. - * @param irn A node to check for. - * @return Constant properties of that node. - */ -cnst_classify_t classify_Const(ir_node *irn); +int is_Const_null(const ir_node *node); + +int is_Const_one(const ir_node *node); + +int is_Const_all_one(const ir_node *node); /** Returns the source language type of a Const node. * Must be an atomic type. Mode of type must be mode of node. @@ -506,8 +499,9 @@ typedef enum { symconst_symbol is entity *. */ symconst_ofs_ent, /**< The SymConst is the offset of its entity in the entities owner type. */ - symconst_enum_const /**< The SymConst is a enumeration constant of an + symconst_enum_const, /**< The SymConst is a enumeration constant of an enumeration type. */ + symconst_label /**< The SymConst is a label address. */ } symconst_kind; /** Returns non-zero if s symconst kind has a type attribute */ @@ -522,15 +516,19 @@ typedef enum { /** Returns non-zero if s symconst kind has an enum_const attribute */ #define SYMCONST_HAS_ENUM(kind) ((kind) == symconst_enum_const) +/** Returns non-zero if s symconst kind has a label attribute */ +#define SYMCONST_HAS_LABEL(kind) ((kind) == symconst_label) + /** SymConst attribute. * * This union contains the symbolic information represented by the node. */ typedef union symconst_symbol { - ir_type *type_p; /**< the type of a symconst */ - ident *ident_p; /**< the ident of a symconst */ - ir_entity *entity_p; /**< the entity of a symconst */ - ir_enum_const *enum_p; /**< the enumeration constant of a symconst */ + ir_type *type_p; /**< The type of a SymConst. */ + ident *ident_p; /**< The ident of a SymConst. */ + ir_entity *entity_p; /**< The entity of a SymConst. */ + ir_enum_const *enum_p; /**< The enumeration constant of a SymConst. */ + ir_label_t label; /**< The label of a SymConst. */ } symconst_symbol; /** Get the kind of the SymConst. */ @@ -561,6 +559,11 @@ union symconst_symbol get_SymConst_symbol(const ir_node *node); void set_SymConst_symbol(ir_node *node, union symconst_symbol sym); +/** Only to access SymConst of kind symconst_label. Else assertion: */ +ir_label_t get_SymConst_label(const ir_node *node); +void set_SymConst_label(ir_node *node, ir_label_t label); + + /** Access the type of the value represented by the SymConst. * * Example: primitive type int for SymConst size. */ @@ -677,6 +680,11 @@ void set_Mul_left(ir_node *node, ir_node *left); ir_node *get_Mul_right(const ir_node *node); void set_Mul_right(ir_node *node, ir_node *right); +ir_node *get_Mulh_left(const ir_node *node); +void set_Mulh_left(ir_node *node, ir_node *left); +ir_node *get_Mulh_right(const ir_node *node); +void set_Mulh_right(ir_node *node, ir_node *right); + ir_node *get_Quot_left(const ir_node *node); void set_Quot_left(ir_node *node, ir_node *left); ir_node *get_Quot_right(const ir_node *node); @@ -816,6 +824,9 @@ int get_negated_pnc(int pnc, ir_mode *mode); /** Calculates the inversed (R^-1) pnc condition, i.e., "<" --> ">" */ int get_inversed_pnc(int pnc); +/** An alternative name for get_inversed_pnc() that can be better memorized. */ +#define get_mirrored_pnc(pnc) get_inversed_pnc(pnc) + ir_node *get_Cmp_left(const ir_node *node); void set_Cmp_left(ir_node *node, ir_node *left); ir_node *get_Cmp_right(const ir_node *node); @@ -930,6 +941,8 @@ ir_mode *get_Load_mode(ir_node *node); void set_Load_mode(ir_node *node, ir_mode *mode); ir_volatility get_Load_volatility(ir_node *node); void set_Load_volatility(ir_node *node, ir_volatility volatility); +ir_align get_Load_align(ir_node *node); +void set_Load_align(ir_node *node, ir_align align); /** * Projection numbers for Store: use for Proj nodes! @@ -949,6 +962,8 @@ ir_node *get_Store_value(ir_node *node); void set_Store_value(ir_node *node, ir_node *value); ir_volatility get_Store_volatility(ir_node *node); void set_Store_volatility(ir_node *node, ir_volatility volatility); +ir_align get_Store_align(ir_node *node); +void set_Store_align(ir_node *node, ir_align align); /** * Projection numbers for Alloc: use for Proj nodes! @@ -1179,6 +1194,8 @@ ir_node *skip_HighLevel(ir_node *node); int is_Const(const ir_node *node); /** Returns true if a node is a Conv node. */ int is_Conv(const ir_node *node); +/** Returns true if a node is a Cast node. */ +int is_Cast(const ir_node *node); /** Returns true if node is a Bad node. */ int is_Bad(const ir_node *node); /** Returns true if node is a NoMem node. */ @@ -1205,6 +1222,18 @@ int is_Or(const ir_node *node); int is_Eor(const ir_node *node); /** Returns true if node is a Sub node. */ int is_Sub(const ir_node *node); +/** Returns true if node is a Not node. */ +int is_Not(const ir_node *node); +/** Returns true if node is a Shl node. */ +int is_Shl(const ir_node *node); +/** Returns true if node is a Shr node. */ +int is_Shr(const ir_node *node); +/** Returns true if node is a Shrs node. */ +int is_Shrs(const ir_node *node); +/** Returns true if node is a Rot node. */ +int is_Rot(const ir_node *node); +/** Returns true if node is a Psi node. */ +int is_Psi(const ir_node *node); /** Returns true if node is a Tuple node. */ int is_Tuple(const ir_node *node); /** Returns true if the node is not a Block */ @@ -1221,6 +1250,8 @@ int is_Call(const ir_node *node); int is_Sel(const ir_node *node); /** Returns true if node is a Mul node. */ int is_Mul(const ir_node *node); +/** Returns true if node is a Mulh node. */ +int is_Mulh(const ir_node *node); /** Returns true if node is a Mux node or a Psi with only one condition. */ int is_Mux(const ir_node *node); /** Returns true if node is a Load node. */ @@ -1365,7 +1396,7 @@ void set_Cond_jmp_pred(ir_node *cond, cond_jmp_predicate pred); * must be passed to the access macro get_irn_data(), 0 if the * registration failed. */ -unsigned register_additional_node_data(unsigned size); +unsigned firm_register_additional_node_data(unsigned size); /** * Return a pointer to the node attributes.