Skip to content

Commit 83c1fbf

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 0a09814 commit 83c1fbf

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
@@ -1368,23 +1368,17 @@ void goto_convertt::do_function_call_symbol(
13681368
// append d or f for double/float
13691369
name+=use_double?'d':'f';
13701370

1371+
DATA_INVARIANT(
1372+
ns.lookup(name).type == f_type,
1373+
"builtin declaration should match constructed type");
1374+
13711375
symbol_exprt new_function=function;
13721376
new_function.set_identifier(name);
13731377
new_function.type()=f_type;
13741378

13751379
code_function_callt function_call(lhs, new_function, new_arguments);
13761380
function_call.add_source_location()=function.source_location();
13771381

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

0 commit comments

Comments
 (0)