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

Function findDefinedFunctionDecls

lib/utils/ASTUtil.cpp:318–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318std::set<clang::FunctionDecl *>
319findDefinedFunctionDecls(clang::ASTContext &Ctx, std::set<std::string> Names) {
320 std::set<clang::FunctionDecl *> Result;
321 std::string MatchTag = "FunctionTag";
322 auto Matcher = functionDecl(isDefinition()).bind(MatchTag);
323 for (auto &Node : match(Matcher, Ctx)) {
324 auto *Record = const_cast<clang::FunctionDecl *>(
325 Node.getNodeAs<clang::FunctionDecl>(MatchTag));
326 if (!Record)
327 continue;
328
329 if (Names.size() == 0) {
330 Result.insert(Record);
331 continue;
332 }
333
334 for (auto &MangledName : util::getMangledNames(*Record)) {
335 if (Names.find(MangledName) != Names.end()) {
336 Result.insert(Record);
337 break;
338 }
339 }
340 }
341 return Result;
342}
343
344} // namespace util
345

Callers 1

ParamNumberAnalyzerMethod · 0.85

Calls 4

getMangledNamesFunction · 0.85
sizeMethod · 0.80
endMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected