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

Method getDefinedFuncDecl

lib/tcanalysis/TCTExtractor.cpp:46–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46const FunctionDecl *
47TCTExtractor::getDefinedFuncDecl(const clang::Expr *E) const {
48 const auto *DRE = dyn_cast_or_null<DeclRefExpr>(E);
49 if (!DRE)
50 return nullptr;
51
52 const auto *D = dyn_cast_or_null<FunctionDecl>(DRE->getDecl());
53 if (!D)
54 return nullptr;
55
56 std::string Tag = "DefinedFuncDecl";
57 auto Matcher = functionDecl(hasBody(compoundStmt()), isDefinition(),
58 hasName(D->getNameAsString()))
59 .bind(Tag);
60
61 for (const auto *ASTUnit : SrcCollection.getASTUnits())
62 for (auto &Node :
63 match(Matcher, *const_cast<ASTContext *>(&ASTUnit->getASTContext()))) {
64 const auto *FD = Node.getNodeAs<FunctionDecl>(Tag);
65 if (!FD)
66 continue;
67 return FD;
68 }
69 return nullptr;
70}
71
72const VarDecl *TCTExtractor::getTCArray(const ASTContext &Ctx) const {
73 std::string Tag = "TCArray";

Callers

nothing calls this directly

Calls 1

getASTUnitsMethod · 0.45

Tested by

no test coverage detected