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

Method getASTDefNode

lib/astirmap/CalledFunctionMacroMapper.cpp:93–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93ASTDefNode *CalledFunctionMacroMapper::getASTDefNode(llvm::Instruction &I) {
94 auto *CB = dyn_cast<llvm::CallBase>(&I);
95 if (!CB)
96 return nullptr;
97
98 auto *F = util::getCalledFunction(*CB);
99 if (!F)
100 return nullptr;
101
102 IRNode Node(I);
103 const auto &Index = Node.getIndex();
104 DBKey Key(Index.getPath(), Index.getLine(), Index.getColumn(),
105 F->getName().str());
106
107 if (DupKey.find(Key) != DupKey.end())
108 return nullptr;
109
110 auto Acc = DefMap.find(Key);
111 if (Acc == DefMap.end())
112 return nullptr;
113 return Acc->second.get();
114}
115
116CalledFunctionMacroMapper::DBKey::DBKey(std::string FilePath, unsigned Line,
117 unsigned Column,

Callers

nothing calls this directly

Calls 8

getCalledFunctionFunction · 0.85
getPathMethod · 0.80
getColumnMethod · 0.80
endMethod · 0.80
getLineMethod · 0.45
getNameMethod · 0.45
findMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected