|
24 | 24 | #include <util/rational.h> |
25 | 25 | #include <util/rational_tools.h> |
26 | 26 | #include <util/simplify_expr.h> |
27 | | -#include <util/symbol_table_base.h> |
| 27 | +#include <util/symbol.h> |
28 | 28 |
|
29 | 29 | #include <langapi/language_util.h> |
30 | 30 |
|
@@ -1473,21 +1473,17 @@ void goto_convertt::do_function_call_symbol( |
1473 | 1473 | // append d or f for double/float |
1474 | 1474 | name+=use_double?'d':'f'; |
1475 | 1475 |
|
| 1476 | + DATA_INVARIANT( |
| 1477 | + ns.lookup(name).type == f_type, |
| 1478 | + "builtin declaration should match constructed type"); |
| 1479 | + |
1476 | 1480 | symbol_exprt new_function=function; |
1477 | 1481 | new_function.set_identifier(name); |
1478 | 1482 | new_function.type()=f_type; |
1479 | 1483 |
|
1480 | 1484 | code_function_callt function_call(lhs, new_function, new_arguments); |
1481 | 1485 | function_call.add_source_location()=function.source_location(); |
1482 | 1486 |
|
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 | | - |
1491 | 1487 | copy(function_call, FUNCTION_CALL, dest); |
1492 | 1488 | } |
1493 | 1489 | else if(identifier == "alloca" || identifier == "__builtin_alloca") |
|
0 commit comments