本文整理汇总了C++中goto_programt::get_decl_identifiers方法的典型用法代码示例。如果您正苦于以下问题:C++ goto_programt::get_decl_identifiers方法的具体用法?C++ goto_programt::get_decl_identifiers怎么用?C++ goto_programt::get_decl_identifiers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类goto_programt
的用法示例。
在下文中一共展示了goto_programt::get_decl_identifiers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add_objects
void invariant_propagationt::add_objects(
const goto_programt &goto_program)
{
// get the globals
object_listt globals;
get_globals(globals);
// get the locals
goto_programt::decl_identifierst locals;
goto_program.get_decl_identifiers(locals);
// cache the list for the locals to speed things up
typedef hash_map_cont<irep_idt, object_listt, irep_id_hash> object_cachet;
object_cachet object_cache;
for(goto_programt::instructionst::const_iterator
i_it=goto_program.instructions.begin();
i_it!=goto_program.instructions.end();
i_it++)
{
#if 0
invariant_sett &is=(*this)[i_it].invariant_set;
is.add_objects(globals);
#endif
for(goto_programt::decl_identifierst::const_iterator
l_it=locals.begin();
l_it!=locals.end();
l_it++)
{
// cache hit?
object_cachet::const_iterator e_it=object_cache.find(*l_it);
if(e_it==object_cache.end())
{
const symbolt &symbol=ns.lookup(*l_it);
object_listt &objects=object_cache[*l_it];
get_objects(symbol, objects);
#if 0
is.add_objects(objects);
#endif
}
#if 0
else
is.add_objects(e_it->second);
#endif
}
}
}
示例2: add_vars
void value_set_analysis_fivrt::add_vars(
const goto_programt &goto_program)
{
typedef std::list<value_set_fivrt::entryt> entry_listt;
// get the globals
entry_listt globals;
get_globals(globals);
// get the locals
goto_programt::decl_identifierst locals;
goto_program.get_decl_identifiers(locals);
// cache the list for the locals to speed things up
typedef std::unordered_map<irep_idt, entry_listt, irep_id_hash> entry_cachet;
entry_cachet entry_cache;
value_set_fivrt &v=state.value_set;
v.add_vars(globals);
for(auto l : locals)
{
// cache hit?
entry_cachet::const_iterator e_it=entry_cache.find(l);
if(e_it==entry_cache.end())
{
const symbolt &symbol=ns.lookup(l);
std::list<value_set_fivrt::entryt> &entries=entry_cache[l];
get_entries(symbol, entries);
v.add_vars(entries);
}
else
v.add_vars(e_it->second);
}
}