MCPcopy Create free account
hub / github.com/Samsung/UTopia / cache

Method cache

lib/rootdefanalysis/RDCache.cpp:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace ftg {
7
8void RDCache::cache(const RDNode &Key, std::set<RDNode> Value) {
9 RDNode CopiedKey = Key;
10 CopiedKey.clearVisit();
11 if (Cache.find(CopiedKey) != Cache.end()) {
12 outs() << "Error Key: " << CopiedKey << "\n";
13 assert(false && "Unexpected Program State");
14 }
15
16 for (auto &V : Value) {
17 auto &Node = *const_cast<RDNode *>(&V);
18 Node.clearVisit();
19 }
20 Cache.insert(std::make_pair(CopiedKey, Value));
21}
22
23bool RDCache::has(const RDNode &Key) const {
24 return Cache.find(Key) != Cache.end();

Callers 1

traceMethod · 0.80

Calls 3

clearVisitMethod · 0.80
endMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected