Commit 2f53919a authored by Matthias Braun's avatar Matthias Braun
Browse files

remove type_not_visited() and use !type_visited() instead

parent 09cd99a6
......@@ -1041,9 +1041,6 @@ FIRM_API void mark_type_visited(ir_type *tp);
/** Returns non-zero if the type is already visited
* @see @ref visited_counters */
FIRM_API int type_visited(const ir_type *tp);
/** Returns non-zero if the type is not yet visited
* @see @ref visited_counters */
FIRM_API int type_not_visited(const ir_type *tp);
/** Returns the associated link field of a type. */
FIRM_API void *get_type_link(const ir_type *tp);
......
......@@ -246,14 +246,14 @@ void compute_inh_transitive_closure(void)
size_t n_types = get_irp_n_types();
for (size_t i = 0; i < n_types; ++i) {
ir_type *tp = get_irp_type(i);
if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */
if (is_Class_type(tp) && !type_visited(tp)) { /* For others there is nothing to accumulate. */
size_t n_subtypes = get_class_n_subtypes(tp);
int has_unmarked_subtype = 0;
assert(get_type_visited(tp) < get_master_type_visited()-1);
for (size_t j = 0; j < n_subtypes; ++j) {
ir_type *stp = get_class_subtype(tp, j);
if (type_not_visited(stp)) {
if (!type_visited(stp)) {
has_unmarked_subtype = 1;
break;
}
......@@ -270,14 +270,14 @@ void compute_inh_transitive_closure(void)
inc_master_type_visited();
for (size_t i = 0; i < n_types; ++i) {
ir_type *tp = get_irp_type(i);
if (is_Class_type(tp) && type_not_visited(tp)) { /* For others there is nothing to accumulate. */
if (is_Class_type(tp) && !type_visited(tp)) { /* For others there is nothing to accumulate. */
size_t n_supertypes = get_class_n_supertypes(tp);
int has_unmarked_supertype = 0;
assert(get_type_visited(tp) < get_master_type_visited()-1);
for (size_t j = 0; j < n_supertypes; ++j) {
ir_type *stp = get_class_supertype(tp, j);
if (type_not_visited(stp)) {
if (!type_visited(stp)) {
has_unmarked_supertype = 1;
break;
}
......
......@@ -356,11 +356,6 @@ int (type_visited)(const ir_type *tp)
return _type_visited(tp);
}
int (type_not_visited)(const ir_type *tp)
{
return _type_not_visited(tp);
}
type_dbg_info *(get_type_dbg_info)(const ir_type *tp)
{
return _get_type_dbg_info(tp);
......
......@@ -34,7 +34,6 @@
#define set_type_visited(tp, num) _set_type_visited(tp, num)
#define mark_type_visited(tp) _mark_type_visited(tp)
#define type_visited(tp) _type_visited(tp)
#define type_not_visited(tp) _type_not_visited(tp)
#define get_type_dbg_info(tp) _get_type_dbg_info(tp)
#define set_type_dbg_info(tp, db) _set_type_dbg_info(tp, db)
#define is_type(thing) _is_type(thing)
......@@ -303,12 +302,6 @@ static inline int _type_visited(const ir_type *tp)
return tp->visit >= firm_type_visited;
}
static inline int _type_not_visited(const ir_type *tp)
{
assert(tp->kind == k_type);
return tp->visit < firm_type_visited;
}
static inline type_dbg_info *_get_type_dbg_info(const ir_type *tp)
{
return tp->dbi;
......
......@@ -362,7 +362,7 @@ static void class_walk_s2s_2(ir_type *tp, class_walk_func *pre,
/* Assure all supertypes are visited before */
for (size_t i = 0, n = get_class_n_supertypes(tp); i < n; ++i) {
if (type_not_visited(get_class_supertype(tp, i)))
if (!type_visited(get_class_supertype(tp, i)))
return;
}
......@@ -390,7 +390,7 @@ void class_walk_super2sub(class_walk_func *pre,
ir_type *tp = get_irp_type(i);
if (is_Class_type(tp) &&
(get_class_n_supertypes(tp) == 0) &&
type_not_visited(tp) &&
!type_visited(tp) &&
(! is_frame_type(tp)) &&
(tp != get_glob_type())) {
class_walk_s2s_2(tp, pre, post, env);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment