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
5d8483cb
Commit
5d8483cb
authored
Sep 15, 2005
by
Michael Beck
Browse files
added function for convertion jump prediction into human readable names
[r6626]
parent
d6c483ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/irnode.c
View file @
5d8483cb
...
...
@@ -2264,12 +2264,23 @@ int (is_irn_constlike)(const ir_node *node) {
return
_is_irn_constlike
(
node
);
}
/* Returns the conditional jump predication of a Cond node. */
/* Gets the string representation of the jump prediction .*/
const
char
*
get_cond_jmp_predicate_name
(
cond_jmp_predicate
pred
)
{
switch
(
pred
)
{
default:
case
COND_JMP_PRED_NONE
:
return
"no prediction"
;
case
COND_JMP_PRED_TRUE
:
return
"true taken"
;
case
COND_JMP_PRED_FALSE
:
return
"false taken"
;
}
}
/* Returns the conditional jump prediction of a Cond node. */
cond_jmp_predicate
(
get_Cond_jmp_pred
)(
ir_node
*
cond
)
{
return
_get_Cond_jmp_pred
(
cond
);
}
/* Sets a new conditional jump predic
a
tion. */
/* Sets a new conditional jump prediction. */
void
(
set_Cond_jmp_pred
)(
ir_node
*
cond
,
cond_jmp_predicate
pred
)
{
_set_Cond_jmp_pred
(
cond
,
pred
);
}
...
...
ir/ir/irnode.h
View file @
5d8483cb
...
...
@@ -998,18 +998,21 @@ type *get_irn_type(ir_node *n);
int
is_irn_constlike
(
const
ir_node
*
node
);
/**
* A type
for
express
ion
conditional jump predic
a
tions.
* A type
to
express conditional jump predictions.
*/
typedef
enum
{
COND_JMP_PRED_NONE
,
/**< No jump predic
a
tion. Default. */
COND_JMP_PRED_NONE
,
/**< No jump prediction. Default. */
COND_JMP_PRED_TRUE
,
/**< The True case is predicted. */
COND_JMP_PRED_FALSE
/**< The False case is predicted. */
}
cond_jmp_predicate
;
/** Returns the conditional jump predication of a Cond node. */
/** Gets the string representation of the jump prediction .*/
const
char
*
get_cond_jmp_predicate_name
(
cond_jmp_predicate
pred
);
/** Returns the conditional jump prediction of a Cond node. */
cond_jmp_predicate
get_Cond_jmp_pred
(
ir_node
*
cond
);
/** Sets a new conditional jump predic
a
tion. */
/** Sets a new conditional jump prediction. */
void
set_Cond_jmp_pred
(
ir_node
*
cond
,
cond_jmp_predicate
pred
);
/**
...
...
Write
Preview
Markdown
is supported
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