Skip to content

Commit a904300

Browse files
author
Daniel Kroening
committed
remove unused string_constantt::from_array_expr
1 parent 0802e42 commit a904300

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/util/string_constant.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -70,38 +70,3 @@ array_exprt string_constantt::to_array_expr() const
7070

7171
return dest;
7272
}
73-
74-
/// convert array constant into string
75-
/// \return true on error
76-
bool string_constantt::from_array_expr(const array_exprt &src)
77-
{
78-
id(ID_string_constant);
79-
type()=src.type();
80-
81-
const typet &subtype = to_array_type(type()).subtype();
82-
83-
// check subtype
84-
if(subtype!=signed_char_type() &&
85-
subtype!=unsigned_char_type())
86-
return true;
87-
88-
std::string value;
89-
90-
forall_operands(it, src)
91-
{
92-
mp_integer int_value=0;
93-
if(to_integer(*it, int_value))
94-
return true;
95-
unsigned unsigned_value=integer2unsigned(int_value);
96-
value+=static_cast<char>(unsigned_value);
97-
}
98-
99-
// Drop the implicit zero at the end.
100-
// Not clear what the semantics should be if it's not there.
101-
if(!value.empty() && value[value.size()-1]==0)
102-
value.resize(value.size()-1);
103-
104-
set_value(value);
105-
106-
return false;
107-
}

0 commit comments

Comments
 (0)