Skip to content

Commit 076c37e

Browse files
committed
Typedef names are symbols
remove_internal_symbols must get to see typedef names so as not to remove type symbols that constitute typedef names. Follow-up to 99067de
1 parent eb7d247 commit 076c37e

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/goto-cc/compile.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ void compilet::convert_symbols(goto_functionst &dest)
869869

870870
if(s_it->second.type.id()==ID_code &&
871871
!s_it->second.is_macro &&
872+
!s_it->second.is_type &&
872873
s_it->second.value.id()!="compiled" &&
873874
s_it->second.value.is_not_nil())
874875
{

src/goto-programs/read_goto_binary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static bool link_functions(
358358
rename_symbolt macro_application;
359359

360360
forall_symbols(it, dest_symbol_table.symbols)
361-
if(it->second.is_macro)
361+
if(it->second.is_macro && !it->second.is_type)
362362
{
363363
const symbolt &symbol=it->second;
364364

src/util/find_symbols.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ void find_symbols(kindt kind, const typet &src, find_symbols_sett &dest)
219219

220220
forall_subtypes(it, src)
221221
find_symbols(kind, *it, dest);
222+
223+
const irep_idt &typedef_name=src.get(ID_C_typedef);
224+
if(!typedef_name.empty())
225+
dest.insert(typedef_name);
222226
}
223227

224228
if(src.id()==ID_struct ||

0 commit comments

Comments
 (0)