File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,10 @@ std::string type2name(const typet &type, const namespacet &ns)
277277// / If we want utilities like dump_c to work properly identifiers
278278// / should ideally always be valid C identifiers
279279// / This replaces some invalid characters that can appear in type2name output.
280- std::string type2identifier (const typet &type, const namespacet &ns )
280+ std::string type_name2type_identifier (const std::string &name )
281281{
282- auto type2name_res = type2name (type, ns);
283282 std::string result{};
284- for (char c : type2name_res )
283+ for (char c : name )
285284 {
286285 switch (c)
287286 {
@@ -301,3 +300,8 @@ std::string type2identifier(const typet &type, const namespacet &ns)
301300 }
302301 return result;
303302}
303+
304+ std::string type2identifier (const typet &type, const namespacet &ns)
305+ {
306+ return type_name2type_identifier (type2name (type, ns));
307+ }
You can’t perform that action at this time.
0 commit comments