MCPcopy Create free account
hub / github.com/Rust-API/Rust-API-Bypass-Checker / get

Method get

src/analysis/memory/known_names.rs:110–115  ·  view source on GitHub ↗

Get the well known name for the given def id and cache the association. I.e. the first call for an unknown def id will be somewhat costly but subsequent calls will be cheap. If the def_id does not have an actual well known name, this returns KnownNames::None.

(&mut self, tcx: TyCtxt<'_>, def_id: DefId)

Source from the content-addressed store, hash-verified

108 /// subsequent calls will be cheap. If the def_id does not have an actual well
109 /// known name, this returns KnownNames::None.
110 pub fn get(&mut self, tcx: TyCtxt<'_>, def_id: DefId) -> KnownNames {
111 *self
112 .name_cache
113 .entry(def_id)
114 .or_insert_with(|| Self::get_known_name_for(tcx, def_id))
115 }
116
117 /// Uses information obtained from tcx to figure out which well known name (if any)
118 /// this def id corresponds to.

Callers 15

for_functionMethod · 0.45
visit_constantMethod · 0.45
visit_switch_intMethod · 0.45
visit_callMethod · 0.45
visit_assertMethod · 0.45
visit_aggregateMethod · 0.45
handle_size_ofMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected