@@ -19,25 +19,33 @@ bool is_fence(
1919 const goto_programt::instructiont &instruction,
2020 const namespacet &ns)
2121{
22- return (instruction.is_function_call () && ns.lookup (
23- to_code_function_call (instruction.code ).function ()).base_name == " fence" )
24- /* if assembly-sensitive algorithms are not available */
25- || (instruction.is_other () && instruction.code .get_statement ()==ID_fence
26- && instruction.code .get_bool (ID_WWfence)
27- && instruction.code .get_bool (ID_WRfence)
28- && instruction.code .get_bool (ID_RWfence)
29- && instruction.code .get_bool (ID_RRfence));
22+ return (instruction.is_function_call () &&
23+ ns.lookup (
24+ to_symbol_expr (
25+ to_code_function_call (instruction.code ).function ()))
26+ .base_name == " fence" )
27+ /* if assembly-sensitive algorithms are not available */
28+ || (instruction.is_other () &&
29+ instruction.code .get_statement () == ID_fence &&
30+ instruction.code .get_bool (ID_WWfence) &&
31+ instruction.code .get_bool (ID_WRfence) &&
32+ instruction.code .get_bool (ID_RWfence) &&
33+ instruction.code .get_bool (ID_RRfence));
3034}
3135
3236bool is_lwfence (
3337 const goto_programt::instructiont &instruction,
3438 const namespacet &ns)
3539{
36- return (instruction.is_function_call () && ns.lookup (
37- to_code_function_call (instruction.code ).function ()).base_name == " lwfence" )
38- /* if assembly-sensitive algorithms are not available */
39- || (instruction.is_other () && instruction.code .get_statement ()==ID_fence
40- && instruction.code .get_bool (ID_WWfence)
41- && instruction.code .get_bool (ID_RWfence)
42- && instruction.code .get_bool (ID_RRfence));
40+ return (instruction.is_function_call () &&
41+ ns.lookup (
42+ to_symbol_expr (
43+ to_code_function_call (instruction.code ).function ()))
44+ .base_name == " lwfence" )
45+ /* if assembly-sensitive algorithms are not available */
46+ || (instruction.is_other () &&
47+ instruction.code .get_statement () == ID_fence &&
48+ instruction.code .get_bool (ID_WWfence) &&
49+ instruction.code .get_bool (ID_RWfence) &&
50+ instruction.code .get_bool (ID_RRfence));
4351}
0 commit comments