@@ -1793,37 +1793,104 @@ exprt java_string_library_preprocesst::code_for_function(
1793
1793
{
1794
1794
auto it_id=cprover_equivalent_to_java_function.find (function_id);
1795
1795
if (it_id!=cprover_equivalent_to_java_function.end ())
1796
+ {
1797
+ overriden.insert (function_id);
1796
1798
return make_function_from_call (it_id->second , type, loc, symbol_table);
1799
+ }
1797
1800
1798
1801
it_id=cprover_equivalent_to_java_string_returning_function.find (function_id);
1799
1802
if (it_id!=cprover_equivalent_to_java_string_returning_function.end ())
1803
+ {
1804
+ overriden.insert (function_id);
1800
1805
return make_string_returning_function_from_call (
1801
1806
it_id->second , type, loc, symbol_table);
1807
+ }
1802
1808
1803
1809
it_id=cprover_equivalent_to_java_constructor.find (function_id);
1804
1810
if (it_id!=cprover_equivalent_to_java_constructor.end ())
1811
+ {
1812
+ overriden.insert (function_id);
1805
1813
return make_init_function_from_call (
1806
1814
it_id->second , type, loc, symbol_table);
1815
+ }
1807
1816
1808
1817
it_id=cprover_equivalent_to_java_assign_and_return_function.find (function_id);
1809
1818
if (it_id!=cprover_equivalent_to_java_assign_and_return_function.end ())
1819
+ {
1820
+ overriden.insert (function_id);
1810
1821
return make_assign_and_return_function_from_call (
1811
1822
it_id->second , type, loc, symbol_table);
1823
+ }
1812
1824
1813
1825
it_id=cprover_equivalent_to_java_assign_function.find (function_id);
1814
1826
if (it_id!=cprover_equivalent_to_java_assign_function.end ())
1827
+ {
1828
+ overriden.insert (function_id);
1815
1829
return make_assign_function_from_call (
1816
1830
it_id->second , type, loc, symbol_table);
1831
+ }
1817
1832
1818
1833
auto it=conversion_table.find (function_id);
1819
1834
if (it!=conversion_table.end ())
1835
+ {
1836
+ overriden.insert (function_id);
1820
1837
return it->second (type, loc, symbol_table);
1838
+ }
1821
1839
1822
1840
return nil_exprt ();
1823
1841
}
1824
1842
1825
1843
/* ******************************************************************\
1826
1844
1845
+ Function: java_string_library_preprocesst::shall_function_be_overriden
1846
+
1847
+ Inputs:
1848
+ function_id - name of the function
1849
+
1850
+ Outputs: True if the function has a known replacement for its body
1851
+ or if it has already been replaced (by a call to
1852
+ code_for_function), false otherwise.
1853
+
1854
+ Purpose: Check whether the current function's body is to be replaced
1855
+ with the code created in the preprocessing.
1856
+
1857
+ \*******************************************************************/
1858
+
1859
+ bool java_string_library_preprocesst::shall_function_be_overriden (
1860
+ const irep_idt &function_id)
1861
+ {
1862
+ if (overriden.find (function_id)!=overriden.end ())
1863
+ return false ;
1864
+
1865
+ auto it_id=cprover_equivalent_to_java_function.find (function_id);
1866
+ if (it_id!=cprover_equivalent_to_java_function.end ())
1867
+ return true ;
1868
+
1869
+ it_id=cprover_equivalent_to_java_string_returning_function.find (function_id);
1870
+ if (it_id!=cprover_equivalent_to_java_string_returning_function.end ())
1871
+ return true ;
1872
+
1873
+ it_id=cprover_equivalent_to_java_constructor.find (function_id);
1874
+ if (it_id!=cprover_equivalent_to_java_constructor.end ())
1875
+ return true ;
1876
+
1877
+ it_id=cprover_equivalent_to_java_assign_and_return_function.find (function_id);
1878
+ if (it_id!=cprover_equivalent_to_java_assign_and_return_function.end ())
1879
+ return true ;
1880
+
1881
+ it_id=cprover_equivalent_to_java_assign_function.find (function_id);
1882
+ if (it_id!=cprover_equivalent_to_java_assign_function.end ())
1883
+ return true ;
1884
+
1885
+ auto it=conversion_table.find (function_id);
1886
+ if (it!=conversion_table.end ())
1887
+ return true ;
1888
+
1889
+ return false ;
1890
+ }
1891
+
1892
+ /* ******************************************************************\
1893
+
1827
1894
Function: java_string_library_preprocesst::is_known_string_type
1828
1895
1829
1896
Inputs:
0 commit comments