Skip to content

Commit ed5f719

Browse files
committed
Move of alias code from VSA to LVSA.
1 parent a44becc commit ed5f719

File tree

3 files changed

+0
-85
lines changed

3 files changed

+0
-85
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -369,67 +369,6 @@ void value_sett::get_value_set(
369369
#endif
370370
}
371371

372-
/// Builds a version of expr suitable for alias-comparison
373-
/// \param expr: The expression to be converted to the alias-uniform structure
374-
/// \return expr without information which is irrelevant to alias-comparison
375-
static exprt get_uniform_expr(const exprt &expr)
376-
{
377-
if(expr.id()==ID_object_descriptor)
378-
{
379-
object_descriptor_exprt ob;
380-
ob.object() = get_uniform_expr(to_object_descriptor_expr(expr).object());
381-
ob.offset() = to_object_descriptor_expr(expr).offset();
382-
return ob;
383-
}
384-
if(expr.id()==ID_external_value_set)
385-
{
386-
exprt copy = expr;
387-
copy.set(ID_is_initializer, ID_0);
388-
return copy;
389-
}
390-
return expr;
391-
}
392-
393-
/// Reconstructs a type of a pointer to the object expr
394-
/// \param expr: An object in a points-to set we make an alias type for
395-
/// \return A type of a pointer to the object expr
396-
static typet get_alias_type(const exprt &expr)
397-
{
398-
if(expr.id()==ID_object_descriptor)
399-
{
400-
object_descriptor_exprt ob_expr=to_object_descriptor_expr(expr);
401-
if(ob_expr.offset().id()==ID_invalid || ob_expr.offset().id()==ID_unknown)
402-
return pointer_type(ob_expr.object().type());
403-
}
404-
return pointer_type(expr.type());
405-
}
406-
407-
void value_sett::get_may_alias_set(
408-
const exprt &expr,
409-
value_setst::valuest &dest,
410-
const namespacet &ns) const
411-
{
412-
object_mapt pointed_objects;
413-
get_value_set(expr, pointed_objects, ns, false);
414-
std::vector<exprt> uniform_pointed_objects;
415-
for(const auto &num_obj : pointed_objects.read())
416-
uniform_pointed_objects.push_back(get_uniform_expr(to_expr(num_obj)));
417-
418-
for(const auto &name_entry : values)
419-
for(const auto &enum_eobj : name_entry.second.object_map.read())
420-
{
421-
if(std::find(uniform_pointed_objects.cbegin(),
422-
uniform_pointed_objects.cend(),
423-
get_uniform_expr(to_expr(enum_eobj)))!=
424-
uniform_pointed_objects.cend())
425-
{
426-
dest.push_back(symbol_exprt(
427-
name_entry.second.identifier,
428-
get_alias_type(to_expr(enum_eobj))));
429-
}
430-
}
431-
}
432-
433372
void value_sett::get_value_set(
434373
const exprt &expr,
435374
object_mapt &dest,

src/pointer-analysis/value_set.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,6 @@ class value_sett
221221
value_setst::valuest &dest,
222222
const namespacet &ns) const;
223223

224-
/// Computes all pointers which MAY point to objects pointed to by expr
225-
/// \param expr: Identifies a points-to set for which to compute aliases
226-
/// \param dest: Output container for pointers to objects pointed to by expr
227-
/// \param ns: A reference to a symbol table
228-
void get_may_alias_set(
229-
const exprt &expr,
230-
value_setst::valuest &dest,
231-
const namespacet &ns) const;
232-
233224
expr_sett &get(
234225
const idt &identifier,
235226
const std::string &suffix);

src/pointer-analysis/value_set_analysis.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,6 @@ class value_set_analysis_baset:
113113
baset::ns);
114114
}
115115

116-
/// Fills in dest with all pointers to any object pointed to be expr
117-
/// \param l: A program location w.r.t which the operation will be performed
118-
/// \param expr: Identifies a points-to set whose aliases we will compute
119-
/// \param dest: Output container for aliases
120-
virtual void get_may_alias_values(
121-
locationt l,
122-
const exprt &expr,
123-
value_setst::valuest &dest)
124-
{
125-
((const value_sett&)(*this)[l].value_set).get_may_alias_set(
126-
expr,
127-
dest,
128-
baset::ns);
129-
}
130-
131116
/*******************************************************************\
132117
133118
Function: value_set_analysis_baset::is_singular

0 commit comments

Comments
 (0)