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
b1b4c10d
Commit
b1b4c10d
authored
Aug 20, 2003
by
Michael Beck
Browse files
Added prefix to variadicity
[r1731]
parent
4352072f
Changes
3
Hide whitespace changes
Inline
Side-by-side
ir/ir/irvrfy.c
View file @
b1b4c10d
...
...
@@ -365,7 +365,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
/* Compare arguments of node with those of type */
mt
=
get_Call_type
(
n
);
if
(
get_method_variadicity
(
mt
)
==
variadic
)
{
if
(
get_method_variadicity
(
mt
)
==
variadicity_
variadic
)
{
ASSERT_AND_RET
(
get_Call_n_params
(
n
)
>=
get_method_n_params
(
mt
),
"Number of args for Call doesn't match number of args in variadic type."
,
...
...
ir/tr/type.c
View file @
b1b4c10d
...
...
@@ -858,7 +858,7 @@ INLINE type *new_type_method (ident *name, int n_param, int n_res) {
res
->
attr
.
ma
.
n_res
=
n_res
;
res
->
attr
.
ma
.
res_type
=
(
type
**
)
xmalloc
(
sizeof
(
type
*
)
*
n_res
);
res
->
attr
.
ma
.
value_ress
=
NULL
;
res
->
attr
.
ma
.
variadicity
=
non_variadic
;
res
->
attr
.
ma
.
variadicity
=
variadicity_
non_variadic
;
return
res
;
}
...
...
@@ -943,6 +943,19 @@ entity *get_method_value_res_ent(type *method, int pos) {
return
get_struct_member
(
method
->
attr
.
ma
.
value_ress
,
pos
);
}
/* Returns the null-terminated name of this variadicity. */
const
char
*
get_variadicity_name
(
variadicity
vari
)
{
#define X(a) case a: return #a
switch
(
vari
)
{
X
(
variadicity_non_variadic
);
X
(
variadicity_variadic
);
default:
return
"BAD VALUE"
;
}
#undef X
}
variadicity
get_method_variadicity
(
type
*
method
)
{
assert
(
method
&&
(
method
->
type_op
==
type_method
));
...
...
ir/tr/type.h
View file @
b1b4c10d
...
...
@@ -554,10 +554,13 @@ entity *get_method_value_res_ent(type *method, int pos);
* non_variadic.
*/
typedef
enum
variadicity
{
non_variadic
,
/**< non variadic */
variadic
/**< variadic */
variadicity_
non_variadic
,
/**< non variadic */
variadicity_
variadic
/**< variadic */
}
variadicity
;
/** Returns the null-terminated name of this variadicity. */
const
char
*
get_variadicity_name
(
variadicity
vari
);
/** Returns the variadicity of a method. */
variadicity
get_method_variadicity
(
type
*
method
);
...
...
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