Skip to content

Commit e898729

Browse files
committed
Remove (unused) replacement of symbol-type symbols
Any such replacement would raise questions about type consistency. The code would also have required updating to include various tag types.
1 parent 0cc5108 commit e898729

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

src/util/replace_symbol.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ bool replace_symbolt::replace(
110110

111111
bool replace_symbolt::have_to_replace(const exprt &dest) const
112112
{
113-
if(expr_map.empty() && type_map.empty())
113+
if(expr_map.empty())
114114
return false;
115115

116116
// first look at type
@@ -186,17 +186,6 @@ bool replace_symbolt::replace(typet &dest) const
186186
if(!replace(*it))
187187
result=false;
188188
}
189-
else if(dest.id() == ID_symbol_type)
190-
{
191-
type_mapt::const_iterator it =
192-
type_map.find(to_symbol_type(dest).get_identifier());
193-
194-
if(it!=type_map.end())
195-
{
196-
dest=it->second;
197-
result=false;
198-
}
199-
}
200189
else if(dest.id()==ID_array)
201190
{
202191
array_typet &array_type=to_array_type(dest);
@@ -209,7 +198,7 @@ bool replace_symbolt::replace(typet &dest) const
209198

210199
bool replace_symbolt::have_to_replace(const typet &dest) const
211200
{
212-
if(expr_map.empty() && type_map.empty())
201+
if(expr_map.empty())
213202
return false;
214203

215204
if(dest.has_subtype())
@@ -251,11 +240,6 @@ bool replace_symbolt::have_to_replace(const typet &dest) const
251240
if(have_to_replace(*it))
252241
return true;
253242
}
254-
else if(dest.id() == ID_symbol_type)
255-
{
256-
const irep_idt &identifier = to_symbol_type(dest).get_identifier();
257-
return type_map.find(identifier) != type_map.end();
258-
}
259243
else if(dest.id()==ID_array)
260244
return have_to_replace(to_array_type(dest).size());
261245

src/util/replace_symbol.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,10 @@ class replace_symbolt
2424
{
2525
public:
2626
typedef std::unordered_map<irep_idt, exprt> expr_mapt;
27-
typedef std::unordered_map<irep_idt, typet> type_mapt;
2827

2928
void insert(const class symbol_exprt &old_expr,
3029
const exprt &new_expr);
3130

32-
void insert(const irep_idt &identifier,
33-
const typet &type)
34-
{
35-
type_map.insert(std::pair<irep_idt, typet>(identifier, type));
36-
}
37-
3831
/// \brief Replaces a symbol with a constant
3932
/// If you are replacing symbols with constants in an l-value, you can
4033
/// create something that is not an l-value. For example if your
@@ -66,23 +59,21 @@ class replace_symbolt
6659
void clear()
6760
{
6861
expr_map.clear();
69-
type_map.clear();
7062
}
7163

7264
bool empty() const
7365
{
74-
return expr_map.empty() && type_map.empty();
66+
return expr_map.empty();
7567
}
7668

7769
std::size_t erase(const irep_idt &id)
7870
{
79-
return expr_map.erase(id) + type_map.erase(id);
71+
return expr_map.erase(id);
8072
}
8173

8274
bool replaces_symbol(const irep_idt &id) const
8375
{
84-
return expr_map.find(id) != expr_map.end() ||
85-
type_map.find(id) != type_map.end();
76+
return expr_map.find(id) != expr_map.end();
8677
}
8778

8879
replace_symbolt();
@@ -100,7 +91,6 @@ class replace_symbolt
10091

10192
protected:
10293
expr_mapt expr_map;
103-
type_mapt type_map;
10494

10595
protected:
10696
bool have_to_replace(const exprt &dest) const;

0 commit comments

Comments
 (0)