Skip to content

Commit d215c1c

Browse files
committed
C front-end: floating-point built-ins are in the symbol table
It should never be the case that no symbol for `__CPROVER_isgreaterf`, `__CPROVER_isgreaterd` and similar floating-point built-ins is present for these are declared in cprover_builtin_headers.h. This commit removes dead code and adds an additional consistency check.
1 parent d94c1cf commit d215c1c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/goto-programs/builtin_functions.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,23 +1370,17 @@ void goto_convertt::do_function_call_symbol(
13701370
// append d or f for double/float
13711371
name+=use_double?'d':'f';
13721372

1373+
DATA_INVARIANT(
1374+
ns.lookup(name).type == f_type,
1375+
"builtin declaration should match constructed type");
1376+
13731377
symbol_exprt new_function=function;
13741378
new_function.set_identifier(name);
13751379
new_function.type()=f_type;
13761380

13771381
code_function_callt function_call(lhs, new_function, new_arguments);
13781382
function_call.add_source_location()=function.source_location();
13791383

1380-
if(!symbol_table.has_symbol(name))
1381-
{
1382-
symbolt new_symbol;
1383-
new_symbol.base_name=name;
1384-
new_symbol.name=name;
1385-
new_symbol.type=f_type;
1386-
new_symbol.location=function.source_location();
1387-
symbol_table.add(new_symbol);
1388-
}
1389-
13901384
copy(function_call, FUNCTION_CALL, dest);
13911385
}
13921386
else if(

0 commit comments

Comments
 (0)