@@ -19,25 +19,33 @@ bool is_fence(
19
19
const goto_programt::instructiont &instruction,
20
20
const namespacet &ns)
21
21
{
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));
30
34
}
31
35
32
36
bool is_lwfence (
33
37
const goto_programt::instructiont &instruction,
34
38
const namespacet &ns)
35
39
{
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));
43
51
}
0 commit comments