@@ -9,12 +9,6 @@ pub type FunctionPlaces = (PlaceRef, PlaceRef, Option<PlaceRef>);
9
9
10
10
/// Types of function calls that the translator supports.
11
11
pub enum FunctionCall {
12
- /// Call to `std::sync::Arc::<T>::new`
13
- /// Non-recursive call for the translation process.
14
- ArcNew ,
15
- /// Call to `std::clone::Clone::clone`
16
- /// Non-recursive call for the translation process.
17
- Clone ,
18
12
/// Call to `std::sync::Condvar::new`
19
13
/// Non-recursive call for the translation process.
20
14
CondVarNew ,
@@ -24,15 +18,12 @@ pub enum FunctionCall {
24
18
/// Call to `std::sync::Condvar::wait`
25
19
/// Non-recursive call for the translation process.
26
20
CondVarWait ,
27
- /// Call to `std::ops::Deref::deref`
28
- /// Non-recursive call for the translation process.
29
- Deref ,
30
- /// Call to `std::ops::DerefMut::deref_mut`
31
- /// Non-recursive call for the translation process.
32
- DerefMut ,
33
21
/// Abridged function call.
34
22
/// Non-recursive call for the translation process.
35
23
Foreign ,
24
+ /// Abridged function call that involves a synchronization primitive.
25
+ /// Non-recursive call for the translation process.
26
+ ForeignWithSyncPrimitive ,
36
27
/// MIR function call (the "default" case).
37
28
/// Recursive call for the translation process.
38
29
MirFunction ,
@@ -48,9 +39,6 @@ pub enum FunctionCall {
48
39
/// Call to `std::thread::spawn`.
49
40
/// Non-recursive call for the translation process.
50
41
ThreadSpawn ,
51
- /// Call to `std::result::Result::<T, E>::unwrap`.
52
- /// Non-recursive call for the translation process.
53
- Unwrap ,
54
42
}
55
43
56
44
impl FunctionCall {
@@ -74,11 +62,11 @@ impl FunctionCall {
74
62
/// Returns the corresponding variant for the function or `None` otherwise.
75
63
fn is_supported_function ( function_name : & str ) -> Option < Self > {
76
64
match function_name {
77
- "std::clone::Clone::clone" => Some ( Self :: Clone ) ,
78
- "std::ops::Deref::deref" => Some ( Self :: Deref ) ,
79
- "std::ops::DerefMut::deref_mut" => Some ( Self :: DerefMut ) ,
80
- "std::result::Result::<T, E>::unwrap" => Some ( Self :: Unwrap ) ,
81
- "std::sync::Arc::<T>::new" => Some ( Self :: ArcNew ) ,
65
+ "std::clone::Clone::clone"
66
+ | "std::ops::Deref::deref"
67
+ | "std::ops::DerefMut::deref_mut"
68
+ | "std::result::Result::<T, E>::unwrap"
69
+ | "std::sync::Arc::<T>::new" => Some ( Self :: ForeignWithSyncPrimitive ) ,
82
70
"std::sync::Condvar::new" => Some ( Self :: CondVarNew ) ,
83
71
"std::sync::Condvar::notify_one" => Some ( Self :: CondVarNotifyOne ) ,
84
72
"std::sync::Condvar::wait" => Some ( Self :: CondVarWait ) ,
0 commit comments