@@ -908,13 +908,17 @@ java_string_library_preprocesst::string_literal_to_string_expr(
908
908
// / \param loc: location in the program_invocation_name
909
909
// / \param function_id: function the generated code will be added to
910
910
// / \param symbol_table: symbol table
911
+ // / \param message_handler: a message handler
911
912
// / \return Code corresponding to the Java conversion of floats to strings.
912
913
code_blockt java_string_library_preprocesst::make_float_to_string_code (
913
914
const java_method_typet &type,
914
915
const source_locationt &loc,
915
916
const irep_idt &function_id,
916
- symbol_table_baset &symbol_table)
917
+ symbol_table_baset &symbol_table,
918
+ message_handlert &message_handler)
917
919
{
920
+ (void )message_handler;
921
+
918
922
// Getting the argument
919
923
java_method_typet::parameterst params = type.parameters ();
920
924
PRECONDITION (params.size ()==1 );
@@ -1153,6 +1157,7 @@ code_blockt java_string_library_preprocesst::make_assign_function_from_call(
1153
1157
// / \param loc: location in the source
1154
1158
// / \param function_id: function the generated code will be added to
1155
1159
// / \param symbol_table: the symbol table
1160
+ // / \param message_handler: a message handler
1156
1161
// / \return Code corresponding to
1157
1162
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1158
1163
// / string_expr1 = substr(obj->@class_identifier, 6)
@@ -1162,7 +1167,8 @@ code_blockt java_string_library_preprocesst::make_class_identifier_code(
1162
1167
const java_method_typet &type,
1163
1168
const source_locationt &loc,
1164
1169
const irep_idt &function_id,
1165
- symbol_table_baset &symbol_table)
1170
+ symbol_table_baset &symbol_table,
1171
+ message_handlert &message_handler)
1166
1172
{
1167
1173
java_method_typet::parameterst params = type.parameters ();
1168
1174
PRECONDITION (!params.empty ());
@@ -1283,6 +1289,7 @@ java_string_library_preprocesst::make_string_returning_function_from_call(
1283
1289
// / \param loc: location in the source
1284
1290
// / \param function_id: function the generated code will be added to
1285
1291
// / \param symbol_table: symbol table
1292
+ // / \param message_handler: a message handler
1286
1293
// / \return Code corresponding to:
1287
1294
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1288
1295
// / string_expr = string_to_string_expr(arg0)
@@ -1295,8 +1302,11 @@ code_blockt java_string_library_preprocesst::make_copy_string_code(
1295
1302
const java_method_typet &type,
1296
1303
const source_locationt &loc,
1297
1304
const irep_idt &function_id,
1298
- symbol_table_baset &symbol_table)
1305
+ symbol_table_baset &symbol_table,
1306
+ message_handlert &message_handler)
1299
1307
{
1308
+ (void )message_handler;
1309
+
1300
1310
// Code for the output
1301
1311
code_blockt code;
1302
1312
@@ -1331,6 +1341,7 @@ code_blockt java_string_library_preprocesst::make_copy_string_code(
1331
1341
// / \param function_id: name of the function (used for variable naming) where
1332
1342
// / the generated code ends up.
1333
1343
// / \param symbol_table: symbol table
1344
+ // / \param message_handler: a message handler
1334
1345
// / \return Code corresponding to:
1335
1346
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1336
1347
// / string_expr = java_string_to_string_expr(arg1)
@@ -1341,8 +1352,11 @@ code_blockt java_string_library_preprocesst::make_copy_constructor_code(
1341
1352
const java_method_typet &type,
1342
1353
const source_locationt &loc,
1343
1354
const irep_idt &function_id,
1344
- symbol_table_baset &symbol_table)
1355
+ symbol_table_baset &symbol_table,
1356
+ message_handlert &message_handler)
1345
1357
{
1358
+ (void )message_handler;
1359
+
1346
1360
code_blockt copy_constructor_body;
1347
1361
1348
1362
// String expression that will hold the result
@@ -1372,6 +1386,7 @@ code_blockt java_string_library_preprocesst::make_copy_constructor_code(
1372
1386
// / \param loc: location in the source
1373
1387
// / \param function_id: unused
1374
1388
// / \param symbol_table: symbol table
1389
+ // / \param message_handler: a message handler
1375
1390
// / \return Code corresponding to:
1376
1391
// / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1377
1392
// / str_expr = java_string_to_string_expr(this)
@@ -1382,9 +1397,11 @@ code_returnt java_string_library_preprocesst::make_string_length_code(
1382
1397
const java_method_typet &type,
1383
1398
const source_locationt &loc,
1384
1399
const irep_idt &function_id,
1385
- symbol_table_baset &symbol_table)
1400
+ symbol_table_baset &symbol_table,
1401
+ message_handlert &message_handler)
1386
1402
{
1387
1403
(void )function_id;
1404
+ (void )message_handler;
1388
1405
1389
1406
const java_method_typet::parameterst ¶ms = type.parameters ();
1390
1407
PRECONDITION (!params[0 ].get_identifier ().empty ());
@@ -1434,11 +1451,13 @@ void java_string_library_preprocesst::get_all_function_names(
1434
1451
// / code but for which no implementation is provided.
1435
1452
// / \param symbol: symbol of the function to provide code for
1436
1453
// / \param symbol_table: a symbol table
1454
+ // / \param message_handler: a message handler
1437
1455
// / \return Code for the body of the String functions if they are part of the
1438
1456
// / supported String functions, nil_exprt otherwise.
1439
1457
codet java_string_library_preprocesst::code_for_function (
1440
1458
const symbolt &symbol,
1441
- symbol_table_baset &symbol_table)
1459
+ symbol_table_baset &symbol_table,
1460
+ message_handlert &message_handler)
1442
1461
{
1443
1462
const irep_idt &function_id = symbol.name ;
1444
1463
const java_method_typet &type = to_java_method_type (symbol.type );
@@ -1471,7 +1490,7 @@ codet java_string_library_preprocesst::code_for_function(
1471
1490
INVARIANT (
1472
1491
it != conversion_table.end (), " Couldn't retrieve code for string method" );
1473
1492
1474
- return it->second (type, loc, function_id, symbol_table);
1493
+ return it->second (type, loc, function_id, symbol_table, message_handler );
1475
1494
}
1476
1495
1477
1496
// / Check whether a class name is known as a string type.
@@ -1599,7 +1618,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1599
1618
std::placeholders::_1,
1600
1619
std::placeholders::_2,
1601
1620
std::placeholders::_3,
1602
- std::placeholders::_4);
1621
+ std::placeholders::_4,
1622
+ std::placeholders::_5);
1603
1623
cprover_equivalent_to_java_function
1604
1624
[" java::org.cprover.CProverString.parseInt:(Ljava/lang/String;I)I" ] =
1605
1625
ID_cprover_string_parse_int_func;
@@ -1621,15 +1641,17 @@ void java_string_library_preprocesst::initialize_conversion_table()
1621
1641
std::placeholders::_1,
1622
1642
std::placeholders::_2,
1623
1643
std::placeholders::_3,
1624
- std::placeholders::_4);
1644
+ std::placeholders::_4,
1645
+ std::placeholders::_5);
1625
1646
conversion_table
1626
1647
[" java::java.lang.String.<init>:(Ljava/lang/StringBuilder;)V" ] = std::bind (
1627
1648
&java_string_library_preprocesst::make_copy_constructor_code,
1628
1649
this ,
1629
1650
std::placeholders::_1,
1630
1651
std::placeholders::_2,
1631
1652
std::placeholders::_3,
1632
- std::placeholders::_4);
1653
+ std::placeholders::_4,
1654
+ std::placeholders::_5);
1633
1655
cprover_equivalent_to_java_constructor
1634
1656
[" java::java.lang.String.<init>:()V" ]=
1635
1657
ID_cprover_string_empty_string_func;
@@ -1683,7 +1705,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1683
1705
std::placeholders::_1,
1684
1706
std::placeholders::_2,
1685
1707
std::placeholders::_3,
1686
- std::placeholders::_4);
1708
+ std::placeholders::_4,
1709
+ std::placeholders::_5);
1687
1710
cprover_equivalent_to_java_string_returning_function
1688
1711
[" java::java.lang.String.replace:(CC)Ljava/lang/String;" ]=
1689
1712
ID_cprover_string_replace_func;
@@ -1706,7 +1729,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1706
1729
std::placeholders::_1,
1707
1730
std::placeholders::_2,
1708
1731
std::placeholders::_3,
1709
- std::placeholders::_4);
1732
+ std::placeholders::_4,
1733
+ std::placeholders::_5);
1710
1734
cprover_equivalent_to_java_string_returning_function
1711
1735
[" java::java.lang.String.toUpperCase:()Ljava/lang/String;" ]=
1712
1736
ID_cprover_string_to_upper_case_func;
@@ -1722,7 +1746,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1722
1746
std::placeholders::_1,
1723
1747
std::placeholders::_2,
1724
1748
std::placeholders::_3,
1725
- std::placeholders::_4);
1749
+ std::placeholders::_4,
1750
+ std::placeholders::_5);
1726
1751
conversion_table
1727
1752
[" java::java.lang.StringBuilder.<init>:(Ljava/lang/CharSequence;)V" ] =
1728
1753
std::bind (
@@ -1731,7 +1756,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1731
1756
std::placeholders::_1,
1732
1757
std::placeholders::_2,
1733
1758
std::placeholders::_3,
1734
- std::placeholders::_4);
1759
+ std::placeholders::_4,
1760
+ std::placeholders::_5);
1735
1761
cprover_equivalent_to_java_constructor
1736
1762
[" java::java.lang.StringBuilder.<init>:()V" ]=
1737
1763
ID_cprover_string_empty_string_func;
@@ -1773,7 +1799,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1773
1799
std::placeholders::_1,
1774
1800
std::placeholders::_2,
1775
1801
std::placeholders::_3,
1776
- std::placeholders::_4);
1802
+ std::placeholders::_4,
1803
+ std::placeholders::_5);
1777
1804
cprover_equivalent_to_java_string_returning_function
1778
1805
[" java::java.lang.StringBuilder.substring:(II)Ljava/lang/String;" ]=
1779
1806
ID_cprover_string_substring_func;
@@ -1787,7 +1814,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1787
1814
std::placeholders::_1,
1788
1815
std::placeholders::_2,
1789
1816
std::placeholders::_3,
1790
- std::placeholders::_4);
1817
+ std::placeholders::_4,
1818
+ std::placeholders::_5);
1791
1819
1792
1820
// StringBuffer library
1793
1821
conversion_table
@@ -1797,7 +1825,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1797
1825
std::placeholders::_1,
1798
1826
std::placeholders::_2,
1799
1827
std::placeholders::_3,
1800
- std::placeholders::_4);
1828
+ std::placeholders::_4,
1829
+ std::placeholders::_5);
1801
1830
cprover_equivalent_to_java_constructor
1802
1831
[" java::java.lang.StringBuffer.<init>:()V" ]=
1803
1832
ID_cprover_string_empty_string_func;
@@ -1838,7 +1867,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1838
1867
std::placeholders::_1,
1839
1868
std::placeholders::_2,
1840
1869
std::placeholders::_3,
1841
- std::placeholders::_4);
1870
+ std::placeholders::_4,
1871
+ std::placeholders::_5);
1842
1872
1843
1873
// CharSequence library
1844
1874
cprover_equivalent_to_java_function
@@ -1851,7 +1881,8 @@ void java_string_library_preprocesst::initialize_conversion_table()
1851
1881
std::placeholders::_1,
1852
1882
std::placeholders::_2,
1853
1883
std::placeholders::_3,
1854
- std::placeholders::_4);
1884
+ std::placeholders::_4,
1885
+ std::placeholders::_5);
1855
1886
conversion_table
1856
1887
[" java::java.lang.CharSequence.length:()I" ]=
1857
1888
conversion_table[" java::java.lang.String.length:()I" ];
@@ -1860,13 +1891,15 @@ void java_string_library_preprocesst::initialize_conversion_table()
1860
1891
cprover_equivalent_to_java_string_returning_function
1861
1892
[" java::java.lang.Integer.toHexString:(I)Ljava/lang/String;" ]=
1862
1893
ID_cprover_string_of_int_hex_func;
1863
- conversion_table[" java::org.cprover.CProver.classIdentifier:("
1864
- " Ljava/lang/Object;)Ljava/lang/String;" ] =
1865
- std::bind (
1866
- &java_string_library_preprocesst::make_class_identifier_code,
1867
- this ,
1868
- std::placeholders::_1,
1869
- std::placeholders::_2,
1870
- std::placeholders::_3,
1871
- std::placeholders::_4);
1894
+ conversion_table
1895
+ [" java::org.cprover.CProver.classIdentifier:("
1896
+ " Ljava/lang/Object;)Ljava/lang/String;" ] =
1897
+ std::bind (
1898
+ &java_string_library_preprocesst::make_class_identifier_code,
1899
+ this ,
1900
+ std::placeholders::_1,
1901
+ std::placeholders::_2,
1902
+ std::placeholders::_3,
1903
+ std::placeholders::_4,
1904
+ std::placeholders::_5);
1872
1905
}
0 commit comments