Skip to content

Commit e863241

Browse files
authored
Merge pull request diffblue#7175 from tautschnig/cleanup/float-builtin
C front-end: floating-point built-ins are in the symbol table
2 parents 65af274 + fad8023 commit e863241

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/goto-programs/builtin_functions.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Author: Daniel Kroening, [email protected]
2424
#include <util/rational.h>
2525
#include <util/rational_tools.h>
2626
#include <util/simplify_expr.h>
27-
#include <util/symbol_table_base.h>
27+
#include <util/symbol.h>
2828

2929
#include <langapi/language_util.h>
3030

@@ -1473,21 +1473,17 @@ void goto_convertt::do_function_call_symbol(
14731473
// append d or f for double/float
14741474
name+=use_double?'d':'f';
14751475

1476+
DATA_INVARIANT(
1477+
ns.lookup(name).type == f_type,
1478+
"builtin declaration should match constructed type");
1479+
14761480
symbol_exprt new_function=function;
14771481
new_function.set_identifier(name);
14781482
new_function.type()=f_type;
14791483

14801484
code_function_callt function_call(lhs, new_function, new_arguments);
14811485
function_call.add_source_location()=function.source_location();
14821486

1483-
if(!symbol_table.has_symbol(name))
1484-
{
1485-
symbolt new_symbol{name, f_type, mode};
1486-
new_symbol.base_name=name;
1487-
new_symbol.location=function.source_location();
1488-
symbol_table.add(new_symbol);
1489-
}
1490-
14911487
copy(function_call, FUNCTION_CALL, dest);
14921488
}
14931489
else if(identifier == "alloca" || identifier == "__builtin_alloca")

0 commit comments

Comments
 (0)