Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
136719e8
Commit
136719e8
authored
Apr 02, 2008
by
Michael Beck
Browse files
add is_Global() and get_Global_ent()
[r19064]
parent
e5489501
Changes
2
Show whitespace changes
Inline
Side-by-side
include/libfirm/irnode.h
View file @
136719e8
...
...
@@ -1413,6 +1413,12 @@ cond_jmp_predicate get_Cond_jmp_pred(const ir_node *cond);
/** Sets a new conditional jump prediction. */
void
set_Cond_jmp_pred
(
ir_node
*
cond
,
cond_jmp_predicate
pred
);
/** Checks whether a node represents a global address. */
int
is_Global
(
const
ir_node
*
node
);
/* Returns the entity of a global address. */
ir_entity
*
get_Global_ent
(
const
ir_node
*
node
);
/**
* Access custom node data.
* The data must have been registered with
...
...
ir/ir/irnode.c
View file @
136719e8
...
...
@@ -3084,7 +3084,26 @@ dbg_info *(get_irn_dbg_info)(const ir_node *n) {
return
_get_irn_dbg_info
(
n
);
}
/* checks whether a node represents a global address */
int
is_Global
(
const
ir_node
*
node
)
{
ir_node
*
ptr
;
if
(
is_SymConst_addr_ent
(
node
))
return
1
;
if
(
!
is_Sel
(
node
))
return
0
;
ptr
=
get_Sel_ptr
(
node
);
return
is_globals_pointer
(
ptr
)
!=
NULL
;
}
/* returns the entity of a global address */
ir_entity
*
get_Global_ent
(
const
ir_node
*
node
)
{
if
(
is_SymConst
(
node
))
return
get_SymConst_entity
(
node
);
else
return
get_Sel_entity
(
node
);
}
#ifdef DEBUG_libfirm
void
dump_irn
(
const
ir_node
*
n
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment