(instance: Instance<'tcx>, tcx: TyCtxt<'tcx>)
| 57 | |
| 58 | impl AtomicApi { |
| 59 | pub fn from_instance<'tcx>(instance: Instance<'tcx>, tcx: TyCtxt<'tcx>) -> Option<Self> { |
| 60 | let path = tcx.def_path_str_with_args(instance.def_id(), instance.args); |
| 61 | if ATOMIC_API_REGEX["AtomicRead"].is_match(&path) { |
| 62 | Some(AtomicApi::Read) |
| 63 | } else if ATOMIC_API_REGEX["AtomicWrite"].is_match(&path) { |
| 64 | Some(AtomicApi::Write) |
| 65 | } else if ATOMIC_API_REGEX["AtomicReadWrite"].is_match(&path) { |
| 66 | Some(AtomicApi::ReadWrite) |
| 67 | } else { |
| 68 | None |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // AtomicPtr::store(&self, ptr: *mut T, order: Ordering) |
nothing calls this directly
no outgoing calls
no test coverage detected