Iterator< T > Class Template ReferenceIterator class that works on various Collection-related classes.
More...
#include <Iterator.h>
Inheritance diagram for Iterator< T >:
[legend]List of all members.
|
Public Member Functions |
| INLINE | Iterator () |
| INLINE | Iterator (const TypedCollection< T > &l, const T *first_elem=0, const T *last_elem=0, cond_proc func=0, void *extra_data=0) |
| INLINE | Iterator (const TypedCollection< T > &l, cond_proc func, void *extra_data=0) |
| INLINE | Iterator (const TypedCollection< T > &l, iter_option option, const T *first_elem=0, const T *last_elem=0) |
| INLINE | Iterator (const TypedCollection< T > *l) |
| INLINE Iterator< T > & | operator= (const TypedCollection< T > &list) |
| INLINE | Iterator (const Iterator< T > &other) |
| | This method copies the entire state (including current element) of the iterator.
|
| | ~Iterator () |
| INLINE Iterator< T > & | operator= (const Iterator< T > &other) |
| | This method copies the entire state (including current element) of the iterator.
|
| INLINE void | reset () |
| | Go back to the beginning of the iteration space.
|
| INLINE void | set_to_last () |
| | Set the iterator to the last value Useful if you need to iterator backwards.
|
| INLINE void | next (iter_option option=STOP_ON_GHOSTS) |
| | go to the next valid element, or if stop_at_ghosts to the next element
|
| INLINE void | operator++ () |
| | go to previous element according to how Iterator was defined
|
| INLINE void | prev (iter_option option=STOP_ON_GHOSTS) |
| | go to the previous valid element, or if stop_at_ghosts to the previous element
|
| INLINE void | operator-- () |
| | #ifdef CLEAN_ITERATOR INLINE const T ¤t() const; // Return a reference to the current element // If there is no current, this results in an error #else
|
| INLINE T & | current () |
| | #endif
|
| INLINE Boolean | end () |
| | Return true if there no more Nodes to iterate on.
|
| INLINE Boolean | valid () |
| | Equivalent to NOT end().
|
| INLINE Boolean | current_valid () const |
| | Return true iff valid() would return True AND the current node is still valid.
|
| INLINE Boolean | current_invalid () const |
| | Equivalent to ( ! current_valid() ).
|
| INLINE void | modify (const T &el) |
| | Useful for RefMutators This sets the current reference to el and results in an error if called on a live collection.
|
| INLINE void | modify (T *el) |
| | Useful for Mutators This sets current to el and results in an error if called on a ref-collection.
|
| INLINE void | modify_in_place (modify_proc mod, void *extra_data GIV(0)) |
| | Modify current in place by calling mod(obj, extra_data) where obj is the pointer which owns current.
|
| INLINE void | del () |
| | Delete the current element, useful for Mutators and RefMutators.
|
| INLINE T * | grab () |
| | Grab the current element, useful for Mutators.
|
| INLINE Assign< T > | assign () |
| INLINE T * | pull () |
| | assign/pull is designed to allow the functionality of modifying an element of a list to be some function of the old value of that position
|
Protected Attributes |
| BaseIter | _iter |
Detailed Description
template<class T>
class Iterator< T >
Iterator class that works on various Collection-related classes.
These Iterators can operate on any structure derived from Collection (which doesn't violate a couple of simple rules discussed at the end). An Iterator declared to be of type T can iterate over any of Collection structure also of type T. A single Iterator can also be used to Iterate over multiple Collection-classes as long as they are all of type T. That is, an Iterator<Expression>, ExIter, can Iterate over a Set<Expression>, then a List<Expression> and then a RefList<Expression>.
Note that in the following, if _last_elem_ptr comes before _first_elem_ptr in the list, the iteration space will be empty
Declare an iterator: Iterator<T> Li = some_coll;
(will iterate from the first to the last elements in the list.
Note when previously declared iterators are assigned to a
different list, they loose all of there specifications
including the iteration space and the conditional function.)
--or--
Iterator<T> Li(some_coll)
(same as above)
--or--
Iterator<T> Li(some_coll, first_elem_ptr, last_elem_ptr);
(will iterate from first_elem_ptr to last_elem_ptr, inclusive)
--or--
Iterator<T> Li(some_coll, cond_proc, extra_data);
(will iterate only over those (in order) where the call
(*cond_proc)(Li.current(), extra_data) returns non-zero)
--or--
Iterator<T> Li(some_coll, first_elem_ptr, last_elem_ptr,
cond_proc, extra_data);
(will iterate only over those (in order) from first_elem_ptr to
last_elem_ptr where the call (*cond_proc)(Li.current(), extra_data)
returns non-zero)
Example:
Resetting the iterator to the start of the subrange:
This implementation works with the reference counting scheme of Collections. Thus, it is not possible for an element of a Collection to be deleted out from under an iterator. It is possible, however, for the current() node to suddenly become invalid--that is for the object suddenly being made inaccessable, turning the current node into a ghost-node. It is illegal to try to access the current node if it is a ghost-node. This can be checked by calling current_valid().
Ghost nodes can only be encountered in live structures by loosing ownership of the current node, but they are more frequent in reference structures. If an object is deleted from a live structure, references to it will remain. These, too, become "ghost-nodes". By default, ghost-nodes are skipped over by the iterator. For example, all of the Iterators described above skip over ghost-nodes. However, if an iterator is declared as the default, it is still possible to check for ghost nodes within the iteration space by calling next() and prev() using the argument: next(STOP_ON_GHOSTS) --or-- prev(STOP_ON_GHOSTS)
Also, it is possible to declare an iterator which will always stop on the ghost nodes. This is done by passing a flag in the constructor after the name of the list. This can be done as follows:
If the iterators are declared with this flag, ++ and -- will automatically stop on ghost-nodes. next() and prev(), however, will still stop on ghost-nodes only if they have a positive flag. The general rule is that the ++ and -- operators behave according to how the Iterator was declared, while next and prev behave according to whether they have an argument.
The iterator does not communicate with the collection which it is iterating over except in the form of indicating references. However, the Collection must adhere to some behavior rules in order for the iterators to work properly. Specifically, when an element is removed from the collection Collection::_unlink_wrapper() should be called to do the unlinking. The iterator depenends on the fact that an unlinked wrapper\'s next and prev fields are left untouched until the wrapper deletes itself (which will happen automatically when its ref count is 0). The iterator depends on these ghost-nodes maintaining their contact with the Collection.
It should be noted that each Collection-based structure which is going to make use of iterators must have its own set of constructors within the ITerator class.
Definition at line 151 of file Iterator.h.
Constructor & Destructor Documentation
|
|
This method copies the entire state (including current element) of the iterator.
If you don't like this, then immediately follow this constructor with a call to reset()
Definition at line 407 of file Iterator.h. |
Member Function Documentation
|
|
This method copies the entire state (including current element) of the iterator.
If you don't like this, then immediately follow this constructor with a call to reset()
Definition at line 415 of file Iterator.h. |
|
template<class T> |
| INLINE void Iterator< T >::reset |
( |
|
) |
|
|
|
|
Go back to the beginning of the iteration space.
Definition at line 423 of file Iterator.h.
References BaseIter::reset().
Referenced by _compute_private_kill_sets(), _create_parent(), _delete_dead_code(), _fold_divisible_in_plus(), _generate_subst_order(), _logical_complement(), _remove_unreachable(), DDgraphTester::add(), DDgraph::add(), DDgraphTester::add_dditerator(), add_dummy_eta_assignments_after_loops(), StmtList::build_all_refs(), EquivalenceDict::clean(), StmtList::del(), find_id_exprs(), find_substituted_id_exprs(), fix_substituted(), SSAProgramUnit::insert_phi_stmt(), main(), merge_DVs(), modify_dummy_eta_assignments_after_loops(), normalize_cfg(), SSAFullRangeDict::pretty_print(), GSAFullRangeDict::pretty_print(), AbstractAccess::print(), ArrayDims::print_last_star(), print_substituted(), process(), referred_symbols(), InlineObject::remap_arg_names(), replace_expression(), replace_symbol(), DDiterator::reset(), SSAProgramUnit::SEARCH(), SEARCH(), DDiterator::set_to_last(), simplify_expressions(), StmtList::split_elseif(), split_multiple_entries(), stmt_toporder(), sym_factors(), syms_in_expr(), and Equivalence::write(). |
|
template<class T> |
| INLINE void Iterator< T >::set_to_last |
( |
|
) |
|
|
|
template<class T> |
| INLINE void Iterator< T >::operator++ |
( |
|
) |
|
|
|
|
go to the previous valid element, or if stop_at_ghosts to the previous element
|
|
template<class T> |
| INLINE void Iterator< T >::operator-- |
( |
|
) |
|
|
|
|
#ifdef CLEAN_ITERATOR INLINE const T ¤t() const; // Return a reference to the current element // If there is no current, this results in an error #else
template <class t=""> INLINE const T & Iterator<T>::current() const { return (T &) _iter.current(); } #else
Definition at line 458 of file Iterator.h.
References BaseIter::prev(), SKIP_GHOSTS, BaseIter::skip_ghosts(), and STOP_ON_GHOSTS. |
|
template<class T> |
| INLINE T & Iterator< T >::current |
( |
|
) |
|
|
|
|
#endif
Definition at line 478 of file Iterator.h.
References BaseIter::current().
Referenced by _add_asserts_to_ranges(), _add_call_returns(), _add_control_assigns(), _add_data_assigns(), EvolutionGraph::_add_evolutions(), _add_flow_edges(), Statement::_add_ioread_sets(), _add_leaf_nodes_to_set(), _add_map_to_map(), _add_range_refs(), _add_refs(), _add_subscript_constraints_to_ranges(), _add_vars_to_set(), _additive_inverse(), _alias_consts(), _annotate_assert(), _annotate_stmts(), _are_all_id_args(), _are_vars_in_expr(), BinRep::_ascii_format(), _assert_clear_substituted(), _assert_expand_substituted(), _assert_refs_to_set(), _assert_substitute_parameters(), NonBinaryExpr::_backup_aux(), EvolutionGraph::_build(), _build_call_diamond(), _build_call_jump_functions(), _build_modified_vars(), _build_range_use_set(), _calc_loop_variants(), _calc_toporder(), _calc_toporder1(), _call_args_expand_substituted(), _collect_candidates(), _collect_stats(), _collect_uses(), _combine_int_relations(), _combine_min_max(), _combine_other_logicals(), _compute_private_kill_sets(), _contains_non_candidate_vars(), EvolutionGraph::_contains_unknown_variants(), _contains_vars_not_in_set(), _create_data_assigns(), _create_new_actual_consts(), _create_parent(), _delete_dead_code(), _delete_expr_in_list(), _delete_non_consts(), _determine_entry_points(), _divide_by_factor1(), NonBinaryExpr::_divide_by_int(), _dump_workspaces(), _eg_forward_substitute(), _extract_ranges(), _extract_ranges_rel(), _factor_out_var_top(), _filter_out_entering_consts(), _filter_out_mod_params(), _filter_vars(), _find_call_sites(), _find_scalar_sources(), _find_scc_from_list(), _find_visit_order(), _fold_divisible_in_mult(), _fold_divisible_in_plus(), NonBinaryExpr::_fold_top(), NonBinaryExpr::_gcd(), _generate_subst_order(), _generate_subst_order1(), _get_array_ref_preds(), _get_top_scalars(), EvolutionGraph::_global_range(), EvolutionGraph::_global_range_per_iteration(), _grab_divisible(), _grab_scc_from_list(), _has_asserts(), _has_param_in_expr(), _init_candidates(), _init_data_preds(), _init_ipcp_workspaces(), _init_non_local_vars(), _init_workspaces(), Predicates::_insert_condition(), _intersect_range_maps(), _invert_expr(), _ipcp_build_jump_functions(), _ipcp_propagate_constants(), _is_block_unreachable(), _is_constant_expr(), _is_constant_expr_filter(), _is_neg_min(), _is_not_in_siglist(), _is_pos_max(), _iterate_to_fixed_point(), _iterate_to_fixed_point_phase(), _kill_bad_join_consts(), _linear_const_filter(), _loc_in_siglist(), _loc_in_siglist_expon(), _loc_of_integer_constant(), _logical_complement(), EvolutionGraph::_loop_invariant(), _make_nonlocals_modified_at_calls(), _make_nonlocals_used_at_calls(), _member_exp_ref(), _merge_range_mult_terms(), _multiply_out_divs_for_var1(), _norm_func_calls1(), _normalize_func_calls(), _num_args_with_var(), _num_divisible_candidates(), _num_var_occurrences_in_expr(), _p_mm_o_of_add(), _p_mm_o_of_mult(), _p_r_o_of_add(), _p_r_o_of_min_max(), _patch_flow_graph(), _pgm_entry(), _power_of_factor(), _print(), _print_var_set(), _propagate_constants1(), _pull_in_add_expr(), _pull_in_div_expr(), _pull_in_exp_expr(), _pull_in_mult_expr(), _pull_min_max_out_top(), _pull_out_common_min_max1(), _pull_out_divisible(), _pull_ranges_out(), _push_down_args_nots(), _put_pred_on_work_list(), _put_succ_on_work_list(), _refs_to_set(), _remove_assertion(), _remove_divs_from_rel(), _remove_duplicates(), _remove_ratdivs(), _remove_truncates1(), _remove_unreachable(), _rename_alias_consts(), _replace_or_traverse_aux(), _set_needs_widening(), IOStmt::_setptrs(), _simplify(), _simplify_using_ranges(), _simplify_var_mods(), _solve_linear_expr(), _sort_expr_list(), _subst_mods_with_var(), _subst_vars_in_expr1(), _sym_factor(), _translate_range(), _update_succ_edges(), _use_widening_operator(), _var_power_in_expr(), _vars_in_expr(), accessor_test(), Translator::actual(), actual_out_param(), DDgraphTester::add(), DDgraph::add(), IPCPProcData::add_constant_set(), DDgraphTester::add_dditerator(), add_dummy_eta_assignments_after_loops(), add_dummy_global_assignments_at_calls(), add_maymods(), IPCPProcData::add_maymods(), SymbolAccess::add_read(), SymbolAccess::add_readwrite(), SymbolAccess::add_write(), AliasSets::alias(), AliasSets::aliases(), ar_interleave(), NonBinaryExpr::arg_refs(), StmtList::build_all_refs(), build_def_map(), build_in_out_set(), build_in_out_sets(), CallStmt::build_refs(), AssignedGotoStmt::build_succ(), FlowEntryStmt::build_succ(), cdg_clone(), cdg_dag2tree(), check_div(), check_scalars_affine(), EquivalenceDict::clean(), clean_after_standard_enforcement(), ProgramUnit::clean_workspace(), clear_cdg_visited(), VariableSymbol::clear_common(), clear_substituted(), clone_loop(), clone_loop_body(), Program::compute_call_lists(), compute_top(), compute_top_range_from_actuals(), conformable_test(), constant_value(), StmtList::contains_DO(), contains_func_call(), contains_infinity(), contains_min_or_max(), contains_side_effect_call(), contiguous_aggregation(), SSAProgramUnit::convert_to_standard(), copy_append_list(), copy_directives(), count_stmts(), StmtList::create_assertions(), StmtList::create_directives(), StmtList::create_flow_graph(), IPCPProcData::create_jump_function(), ProgramUnit::create_program_unit(), Data::Data(), DDiterator::DDiterator(), StmtList::del(), StmtList::delete_flow_graph(), determine_root_expr_type(), dfs_stmts(), ProgramUnit::distribution_of(), DVfield::dv(), eg_compare(), eg_contradictory_gate(), eg_forward_substitute(), eg_range(), eg_range_from_input(), elim_equivalent_descrs(), eliminate_loop(), eliminate_unreachable_statements(), enforce_standard_within_bounds(), Program::entry_points(), equiv_aliases(), evaluate_dag2tree(), StmtList::exchange_convert(), DataList::exchange_convert(), NonBinaryExpr::exchange_expr(), expand_substituted(), expr_type(), external_program_unit(), extract_possible_factors(), extract_ranges(), IPCPConstants::filter_out_vars_not_in_set(), find_id_exprs(), _find_info::find_match(), find_preds(), WorkSpaceStack::find_ref(), find_substituted_id_exprs(), fix_alternate_expr(), fix_substituted(), gather_symb_const(), gating(), Directive::generate_convex_serial_directive(), Directive::generate_convex_spp_reduction_directive(), Directive::generate_convex_spp_serial_directive(), Directive::generate_csrd_epilogue_directive(), Directive::generate_csrd_induction_directive(), Directive::generate_csrd_parallel_directive(), Directive::generate_csrd_prologue_directive(), generate_maymods(), Directive::generate_omp_do_directive(), Directive::generate_omp_parallel_directive(), Directive::generate_sgi_parallel_directive(), get_array_refs(), get_hash(), get_in(), get_in_out(), DoStmt::get_loop_name(), get_out(), get_phinode_entries(), DDiterator::grab(), has_maymod(), IPCPProcData::have_consts_sets_changed(), included_gates(), infer_preds(), CDGNode::ins(), CDSet::ins(), StmtList::ins_before(), SSAProgramUnit::insert_phi_stmt(), invariant_expression(), is_a_parallel_loop(), is_defined(), is_evenly_divisible(), Expression::is_side_effect_free(), is_var_in_maymod(), last_gsa_symbol(), IPCPProcData::local_vars(), localize_goto(), loop_variant_scalars(), loop_variant_vars(), main(), make_common_maymod(), InlineObject::make_conformable(), make_maymod(), InlineObject::map_existing_common_block(), DoStmt::marked_parallel(), DoStmt::marked_serial(), AbstractAccess::match_dims(), NonBinaryExpr::member_ref(), merge_DVs(), modify_dummy_eta_assignments_after_loops(), BaseStmtRanges::narrow_ranges(), Expression::node_compare(), NonBinaryExpr::NonBinaryExpr(), normalize_cfg(), normalize_loop(), occurs(), open_output_file(), operator<<(), CDSet::operator<=(), CDSet::operator==(), BaseStmtRanges::operator==(), optimize_ssa_beta(), optimize_ssa_eta(), optimize_ssa_gamma(), optimize_ssa_mu(), optimize_ssa_zero(), parse_directives(), pDominanceFrontier(), peel_loop_last(), Predicates::Predicates(), SSAFullRangeDict::pretty_print(), SSAControlRangeDict::pretty_print(), RangeAccessor::pretty_print(), GSAFullRangeDict::pretty_print(), GSAControlRangeDict::pretty_print(), ControlRangeDict::pretty_print(), BaseStmtRanges::pretty_print(), TopSortNode::print(), SymbolAccessRef::print(), SymbolAccess::print(), SSAFullRangeData::print(), SharedDims::print(), Namelist::print(), ReturnJumpFunction::print(), IPCPProcData::print(), GSAFullRangeData::print(), ActiveArc::print(), CommonBlock::print(), BaseStmtRanges::print(), AssertNoWait::print(), AssertForward::print(), AssertUnknownShared::print(), AssertNoMod::print(), AssertMayMod::print(), AssertParallelCondition::print(), AssertInduction::print(), AssertPostamble::print(), AssertPreamble::print(), AssertNoDependence::print(), AssertSideEffectFree::print(), AssertRunTimeTest::print(), AssertNoPutGet::print(), AssertNoInline::print(), AssertRecursiveInline::print(), AssertInline::print(), AssertDepIO::print(), AssertRTShadow::print(), AssertSharedRefs::print(), AssertReadOnlyRefs::print(), AssertPrivateRefs::print(), AssertRangeWritten::print(), AssertFirstValue::print(), AssertInstrument::print(), AssertDepOverlap::print(), AssertDepWFvsRO::print(), AssertDepRWvsWF::print(), AssertDepROvsRW::print(), AssertReductDescr::print(), AssertTestMonotone::print(), AssertPrivateDescr::print(), AssertOverlapSort::print(), AssertOverlap::print(), AssertSafeCondition::print(), AssertRelation::print(), AssertCritical::print(), AssertSerial::print(), AssertComment::print(), AssertPartialFirstValue::print(), AssertPartialReduction::print(), AssertReduction::print(), AssertEpilogue::print(), AssertPrologue::print(), AssertParallel::print(), AssertDynLastValue::print(), AssertLastValue::print(), AssertSubst::print(), AssertSchedule::print(), AssertLoopLabel::print(), AssertShared::print(), AssertPrivate::print(), ArrayDims::print(), AbstractAccess::print(), InterProcConstProp::print_consts_sets(), IOStmt::print_debug(), ArrayDims::print_last_star(), print_prec_list(), print_string_list(), print_substituted(), DoStmt::private_vars_ref(), process(), process2(), program_wide_range(), propagate_outermost_DOs(), quick_pgm_entry(), referred_symbols(), relink_all_lptrs(), PointerSymbol::relink_dptrs(), VariableSymbol::relink_dptrs(), DataList::relink_ptrs(), IOStmt::relink_sptrs(), InlineObject::remap_arg_names(), SymbolAccessRef::remap_interface_vars(), SymbolAccess::remap_interface_vars(), remove_assigned_goto_stmts(), StmtList::remove_directives(), remove_gotos(), remove_maymod_assertions(), remove_redundant_min_max_terms(), remove_trivial_gotos(), remove_unreachable_code(), rename_all_occurences(), SSAProgramUnit::rename_variables(), replace_expression(), replace_symbol(), DDiterator::reset(), ProgramUnit::routine_name_ref(), same_commutative(), SSAProgramUnit::SEARCH(), SEARCH(), search_expression(), set_ranges_for_symbol(), DDiterator::set_to_last(), DDgraphTester::show_active_arcs(), DDgraphTester::show_arcs(), DDgraphTester::show_dditerator(), DDgraphTester::show_program(), RangeComparator::signz(), SimBiGraph::SimBiGraph(), SimGraph::SimGraph(), simplify_descriptors(), simplify_descriptors_scalar(), simplify_expressions(), StmtRanges::simplify_min_max(), sink_return_points(), sort_sym_list(), StmtList::split_elseif(), split_multiple_entries(), stmt_maymods(), stmt_toporder(), WorkSpaceStack::structures_OK(), BaseStmtRanges::subst_in_ranges(), subst_vars_in_map(), substitute_parameters(), substitute_parameters_data(), Summation::sum_contains(), Summation::sum_mul(), sym_factors(), syms_in_expr(), test_expr_str(), PropConstWS::toporder(), SSAFullRangeDict::touch(), GSAFullRangeDict::touch(), trace_into_called_pgm(), trace_unique_def(), IPCPProcData::transfer_const_set(), translate_one_symbol(), translate_var(), uncdg(), BaseStmtRanges::union_ranges(), untranslate_var(), PropCtrlRangeWS::update_out_ranges(), BaseStmtRanges::widen_some_ranges(), SymbolAccessRef::write(), SymbolAccess::write(), ProgramUnit::write(), NamelistDict::write(), Equivalence::write(), and CommonBlockDict::write(). |
|
|
Return true if there no more Nodes to iterate on.
Definition at line 486 of file Iterator.h.
References BaseIter::end().
Referenced by _create_parent(), DDiterator::DDiterator(), SharedDims::print(), ArrayDims::print(), ArrayDims::print_all_colons(), ArrayDims::print_last_star(), print_prec_list(), process(), relink_all_lptrs(), DDiterator::reset(), DDiterator::set_to_last(), and DDgraphTester::show_dditerator(). |
|
|
Equivalent to NOT end().
Definition at line 493 of file Iterator.h.
References BaseIter::valid().
Referenced by _add_asserts_to_ranges(), _add_call_returns(), _add_control_assigns(), _add_data_assigns(), EvolutionGraph::_add_evolutions(), _add_flow_edges(), Statement::_add_ioread_sets(), _add_leaf_nodes_to_set(), _add_map_to_map(), _add_range_refs(), _add_refs(), _add_subscript_constraints_to_ranges(), _add_vars_to_set(), _additive_inverse(), _alias_consts(), _annotate_assert(), _annotate_expr(), _annotate_stmt(), _annotate_stmts(), _are_all_id_args(), _are_vars_in_expr(), BinRep::_ascii_format(), _assert_clear_substituted(), _assert_expand_substituted(), _assert_refs_to_set(), _assert_substitute_parameters(), NonBinaryExpr::_backup_aux(), EvolutionGraph::_build(), _build_call_diamond(), _build_call_jump_functions(), _build_modified_vars(), _build_range_use_set(), _calc_loop_variants(), _calc_toporder(), _calc_toporder1(), _call_args_expand_substituted(), _collect_candidates(), _collect_stats(), _collect_uses(), _combine_int_relations(), _combine_min_max(), _combine_other_logicals(), _compute_private_kill_sets(), _contains_non_candidate_vars(), EvolutionGraph::_contains_unknown_variants(), _contains_vars_not_in_set(), _create_data_assigns(), _create_new_actual_consts(), _create_parent(), _delete_dead_code(), _delete_expr_in_list(), _delete_non_consts(), _determine_entry_points(), _divide_by_factor1(), NonBinaryExpr::_divide_by_int(), _dump_workspaces(), _eg_forward_substitute(), _elim_known_facts(), _extract_ranges(), _extract_ranges_rel(), _factor_out_var(), _factor_out_var_top(), _filter_arrays(), _filter_out_entering_consts(), _filter_out_mod_params(), _filter_vars(), _find_call_sites(), _find_scalar_sources(), _find_scc_from_list(), _find_visit_order(), _fold_divisible_in_mult(), _fold_divisible_in_plus(), NonBinaryExpr::_fold_top(), NonBinaryExpr::_gcd(), _generate_subst_order(), _generate_subst_order1(), _get_array_ref_preds(), _get_top_scalars(), EvolutionGraph::_global_range(), EvolutionGraph::_global_range_per_iteration(), _grab_divisible(), _grab_scc_from_list(), _has_asserts(), _has_param_in_expr(), _init_candidates(), _init_data_preds(), _init_ipcp_workspaces(), _init_non_local_vars(), _init_workspaces(), Predicates::_insert_condition(), _intersect_range_maps(), _invert_expr(), _ipcp_build_jump_functions(), _ipcp_propagate_constants(), _is_block_unreachable(), _is_constant_expr(), _is_constant_expr_filter(), _is_neg_min(), _is_not_in_siglist(), _is_pos_max(), _iterate_to_fixed_point(), _iterate_to_fixed_point_phase(), _kill_bad_join_consts(), _linear_const_filter(), _loc_in_siglist(), _loc_in_siglist_expon(), _loc_of_integer_constant(), _logical_complement(), EvolutionGraph::_loop_invariant(), _make_nonlocals_modified_at_calls(), _make_nonlocals_used_at_calls(), _member_exp_ref(), _merge_range_mult_terms(), _mult_range_with_expr(), _multiply_out_divs_for_var1(), _norm_func_calls1(), _normalize_func_calls(), _num_args_with_var(), _num_divisible_candidates(), _num_stmts_in_block(), _num_var_occurrences_in_expr(), _p_mm_o_of_add(), _p_mm_o_of_mult(), _p_r_o_of_add(), _p_r_o_of_min_max(), _patch_flow_graph(), _pgm_entry(), _power_of_factor(), _print(), _print_var_set(), _propagate_constants1(), _pull_in_add_expr(), _pull_in_div_expr(), _pull_in_exp_expr(), _pull_in_mult_expr(), _pull_min_max_out_top(), _pull_out_common_min_max1(), _pull_out_divisible(), _pull_ranges_out(), _push_down_args_nots(), _put_pred_on_work_list(), _put_succ_on_work_list(), _refs_to_set(), _remove_assertion(), _remove_divs_from_rel(), _remove_duplicates(), _remove_local_effects_from_expr1(), _remove_ratdivs(), _remove_truncates1(), _remove_unreachable(), _rename_alias_consts(), _replace_or_traverse_aux(), _set_needs_widening(), IOStmt::_setptrs(), _simplify(), _simplify_using_ranges(), _simplify_var_mods(), _solve_linear_expr(), _sort_expr_list(), _subst_ints_in_expr(), _subst_mods_with_var(), _subst_unkeepable_vars(), _subst_vars_in_expr1(), _substitute_mono_var1(), _sym_factor(), TranslateObject::_translate_GSA_symbol_refs_mutr(), _translate_range(), _update_succ_edges(), _use_widening_operator(), _var_power_in_expr(), _vars_in_expr(), abs_to_max(), accessor_test(), Translator::actual(), actual_out_param(), DDgraphTester::add(), DDgraph::add(), IPCPProcData::add_constant_set(), DDgraphTester::add_dditerator(), add_dummy_eta_assignments_after_loops(), add_dummy_global_assignments_at_calls(), add_maymods(), IPCPProcData::add_maymods(), SymbolAccess::add_read(), SymbolAccess::add_readwrite(), SymbolAccess::add_write(), AliasSets::alias(), AliasSets::aliases(), ar_interleave(), NonBinaryExpr::arg_refs(), StmtList::build_all_refs(), build_def_map(), build_in_out_set(), build_in_out_sets(), CallStmt::build_refs(), AssignedGotoStmt::build_succ(), FlowEntryStmt::build_succ(), cdg_clone(), cdg_dag2tree(), check_div(), check_scalars_affine(), EquivalenceDict::clean(), clean_after_standard_enforcement(), ProgramUnit::clean_workspace(), clear_cdg_visited(), VariableSymbol::clear_common(), clear_substituted(), clone_loop(), clone_loop_body(), Program::compute_call_lists(), compute_top(), compute_top_range_from_actuals(), constant_value(), StmtList::contains_DO(), contains_func_call(), contains_infinity(), contains_min_or_max(), contains_side_effect_call(), contiguous_aggregation(), SSAProgramUnit::convert_to_SSA(), SSAProgramUnit::convert_to_standard(), copy_append_list(), copy_directives(), count_stmts(), StmtList::create_assertions(), StmtList::create_directives(), StmtList::create_flow_graph(), IPCPProcData::create_jump_function(), ProgramUnit::create_program_unit(), StmtList::del(), StmtList::delete_flow_graph(), determine_root_expr_type(), dfs_stmts(), StmtList::display(), ProgramUnit::distribution_of(), DVfield::dv(), eg_compare(), eg_contradictory_gate(), eg_forward_substitute(), eg_range(), eg_range_from_input(), elim_equivalent_descrs(), eliminate_loop(), eliminate_unreachable_statements(), enforce_standard_within_bounds(), Program::entry_points(), equiv_aliases(), evaluate_dag2tree(), StmtList::exchange_convert(), DataList::exchange_convert(), NonBinaryExpr::exchange_expr(), expand_substituted(), expr_expand_substituted(), expr_substitute_parameters(), expr_type(), external_program_unit(), extract_possible_factors(), extract_ranges(), IPCPConstants::filter_out_vars_not_in_set(), find_id_exprs(), _find_info::find_match(), find_preds(), WorkSpaceStack::find_ref(), find_substituted_id_exprs(), fix_substituted(), gather_symb_const(), gating(), Directive::generate_convex_private_directive(), Directive::generate_convex_serial_directive(), Directive::generate_convex_spp_private_directive(), Directive::generate_convex_spp_reduction_directive(), Directive::generate_convex_spp_serial_directive(), Directive::generate_csrd_epilogue_directive(), Directive::generate_csrd_parallel_directive(), Directive::generate_csrd_prologue_directive(), generate_maymods(), Directive::generate_omp_do_directive(), Directive::generate_omp_parallel_directive(), Directive::generate_sgi_parallel_directive(), get_array_refs(), get_hash(), get_in(), get_in_out(), DoStmt::get_loop_name(), get_out(), get_phinode_entries(), DDiterator::grab(), has_maymod(), IPCPProcData::have_consts_sets_changed(), included_gates(), infer_preds(), CDGNode::ins(), CDSet::ins(), StmtList::ins_before(), SSAProgramUnit::insert_phi_stmt(), invariant_expression(), is_a_parallel_loop(), is_defined(), is_evenly_divisible(), Expression::is_side_effect_free(), is_var_in_maymod(), StmtList::iterate_entry_points(), last_gsa_symbol(), IPCPProcData::local_vars(), localize_goto(), loop_variant_scalars(), loop_variant_vars(), main(), make_common_maymod(), make_maymod(), InlineObject::map_existing_common_block(), DoStmt::marked_parallel(), DoStmt::marked_serial(), NonBinaryExpr::member_ref(), merge_DVs(), IPCPConstants::merge_invocation_sites(), modify_dummy_eta_assignments_after_loops(), BaseStmtRanges::narrow_ranges(), Expression::node_compare(), NonBinaryExpr::NonBinaryExpr(), normalize_cfg(), normalize_loop(), StmtList::number_of_stmts_in_DO(), occurs(), operator<<(), CDSet::operator<=(), CDSet::operator==(), BaseStmtRanges::operator==(), optimize_ssa_beta(), optimize_ssa_eta(), optimize_ssa_gamma(), optimize_ssa_mu(), optimize_ssa_zero(), parse_directives(), pDominanceFrontier(), peel_loop_last(), Predicates::Predicates(), SSAFullRangeDict::pretty_print(), SSAControlRangeDict::pretty_print(), RangeAccessor::pretty_print(), GSAFullRangeDict::pretty_print(), GSAControlRangeDict::pretty_print(), ControlRangeDict::pretty_print(), BaseStmtRanges::pretty_print(), TopSortNode::print(), SymbolAccessRef::print(), SymbolAccess::print(), SSAFullRangeData::print(), Namelist::print(), ReturnJumpFunction::print(), IPCPProcData::print(), GSAFullRangeData::print(), ActiveArc::print(), CommonBlock::print(), BaseStmtRanges::print(), AssertNoWait::print(), AssertForward::print(), AssertUnknownShared::print(), AssertNoMod::print(), AssertMayMod::print(), AssertParallelCondition::print(), AssertInduction::print(), AssertPostamble::print(), AssertPreamble::print(), AssertNoDependence::print(), AssertSideEffectFree::print(), AssertRunTimeTest::print(), AssertNoPutGet::print(), AssertNoInline::print(), AssertRecursiveInline::print(), AssertInline::print(), AssertDepIO::print(), AssertRTShadow::print(), AssertSharedRefs::print(), AssertReadOnlyRefs::print(), AssertPrivateRefs::print(), AssertRangeWritten::print(), AssertFirstValue::print(), AssertInstrument::print(), AssertDepOverlap::print(), AssertDepWFvsRO::print(), AssertDepRWvsWF::print(), AssertDepROvsRW::print(), AssertReductDescr::print(), AssertTestMonotone::print(), AssertPrivateDescr::print(), AssertOverlapSort::print(), AssertOverlap::print(), AssertSafeCondition::print(), AssertRelation::print(), AssertCritical::print(), AssertSerial::print(), AssertComment::print(), AssertPartialFirstValue::print(), AssertPartialReduction::print(), AssertReduction::print(), AssertEpilogue::print(), AssertPrologue::print(), AssertParallel::print(), AssertDynLastValue::print(), AssertLastValue::print(), AssertSubst::print(), AssertSchedule::print(), AssertLoopLabel::print(), AssertShared::print(), AssertPrivate::print(), AbstractAccess::print(), InterProcConstProp::print_consts_sets(), IOStmt::print_debug(), ArrayDims::print_last_star(), print_string_list(), print_substituted(), DoStmt::private_vars_ref(), process(), process2(), program_wide_range(), propagate_outermost_DOs(), pull_min_max_out(), quick_pgm_entry(), referred_symbols(), PointerSymbol::relink_dptrs(), VariableSymbol::relink_dptrs(), DataList::relink_ptrs(), IOStmt::relink_sptrs(), InlineObject::remap_arg_names(), SymbolAccessRef::remap_interface_vars(), SymbolAccess::remap_interface_vars(), remove_assigned_goto_stmts(), StmtList::remove_directives(), remove_gotos(), remove_maymod_assertions(), remove_redundant_min_max_terms(), remove_trivial_gotos(), remove_unreachable_code(), rename_all_occurences(), SSAProgramUnit::rename_variables(), replace_expression(), replace_symbol(), ProgramUnit::routine_name_ref(), same_commutative(), SSAProgramUnit::SEARCH(), SEARCH(), search_expression(), set_ranges_for_symbol(), DDgraphTester::show_active_arcs(), DDgraphTester::show_arcs(), DDgraphTester::show_dditerator(), DDgraphTester::show_program(), RangeComparator::signz(), SimBiGraph::SimBiGraph(), SimGraph::SimGraph(), simplify_descriptors(), simplify_descriptors_scalar(), simplify_expressions(), StmtRanges::simplify_min_max(), sink_return_points(), sort_sym_list(), StmtList::split_elseif(), split_multiple_entries(), stmt_maymods(), stmt_toporder(), WorkSpaceStack::structures_OK(), BaseStmtRanges::subst_in_ranges(), subst_vars_in_map(), substitute_argument(), substitute_parameters(), substitute_parameters_data(), Summation::sum_add(), Summation::sum_contains(), Summation::sum_mul(), sym_factors(), syms_in_expr(), test_expr_str(), PropConstWS::toporder(), SSAFullRangeDict::touch(), GSAFullRangeDict::touch(), trace_into_called_pgm(), trace_unique_def(), IPCPProcData::transfer_const_set(), translate_and_reshape(), TranslateObject::translate_GSA_symbol_refs(), translate_one_symbol(), InlineObject::translate_symbol_refs(), translate_var(), uncdg(), BaseStmtRanges::union_ranges(), untranslate_var(), PropCtrlRangeWS::update_out_ranges(), BaseStmtRanges::widen_some_ranges(), SymbolAccessRef::write(), SymbolAccess::write(), ProgramUnit::write(), NamelistDict::write(), Equivalence::write(), and CommonBlockDict::write(). |
|
|
Return true iff valid() would return True AND the current node is still valid.
This function will return False even if valid() returns True if the current node is invalid, which will happen if the current node has become a ghost node by being deleted from its Collection. In the event that the current node is invalid, it is a checked run-time error to make a call to current(). However, the valid() method still returns True since the end of the iteration space has not yet been reached. Also, the operator++/--/prev()/next() methods will all work correctly and properly find the next element in the iteration space. If there is any chance that the current element pointed to by a BaseIter can be deleted, both valid() and current_valid() must return True for a call to current() to be acceptable.
Definition at line 500 of file Iterator.h.
References BaseIter::current_valid().
Referenced by _remove_unreachable(), EquivalenceDict::clean(), StmtList::del(), determine_root_expr_type(), main(), process(), process2(), and Equivalence::write(). |
|
template<class T> |
| INLINE void Iterator< T >::modify |
( |
const T & |
el |
) |
|
|
|
template<class T> |
| INLINE void Iterator< T >::modify |
( |
T * |
el |
) |
|
|
|
template<class T> |
| INLINE void Iterator< T >::modify_in_place |
( |
modify_proc |
mod, |
|
|
void *extra_data |
GIV(0) |
|
) |
|
|
|
|
Modify current in place by calling mod(obj, extra_data) where obj is the pointer which owns current.
The procedure 'mod' is expected to do it's own garbage collection. The procedure must be of the form: (*mod)(T *& object, void *extra_data) This results in an error if current is invalid or if it is called on a ref-collection.
Reimplemented in Mutator< T >.
Definition at line 532 of file Iterator.h.
References BaseIter::modify_in_place().
Referenced by process(). |
|
template<class T> |
| INLINE void Iterator< T >::del |
( |
|
) |
|
|
|
template<class T> |
| INLINE T * Iterator< T >::grab |
( |
|
) |
|
|
|
|
Grab the current element, useful for Mutators.
Results in an error if called on a ref-collection. - Note:
- current will now be invalid.
Reimplemented in Mutator< T >.
Definition at line 548 of file Iterator.h.
References BaseIter::grab().
Referenced by process(). |
|
template<class T> |
| INLINE T * Iterator< T >::pull |
( |
|
) |
|
|
|
|
assign/pull is designed to allow the functionality of modifying an element of a list to be some function of the old value of that position
The assign() is meant to be executed first, to capture the original position in the under-lying list for the element. The Assign<T> object returned by assign() stores the position information of the element. Then, pull() is used to remove the element from the list, without losing its position in the list.
The 'pull' method removes the specified object from its list (like grab) but maintains it's 'place' in the list. Once an object has been pulled, it is no longer possible to access the List using the pulled object as a reference. Once an object has been pulled it can be modified in any way. Once the modification is complete, the object can be returned to its position by assigning to the Assign<T> object (the one created by the original assign() call).
The user, of course, is responsible for garbage collecting any intermediate forms of the pulled object which may be created. A complete use would be as follows:
'function' is simply a function which returns the modified value. If the modified value is a different object than the original, function is responsible for garbage collecting the original. In this case, the specified object is pulled from the list, modified somehow by function and the returned value takes it's place in the list.
Reimplemented in Mutator< T >.
Definition at line 563 of file Iterator.h.
References BaseIter::pull(). |
Member Data Documentation
The documentation for this class was generated from the following file:
|