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

Method getDiffNumArgs

lib/astirmap/DebugInfoMap.cpp:54–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54unsigned DebugInfoMap::getDiffNumArgs(const llvm::CallBase &CB) const {
55 auto *ACN = getFromCallMap(CB);
56 if (!ACN)
57 throw std::runtime_error("CallNode not found");
58
59 auto *E = ACN->getNode().get<Expr>();
60 if (!E)
61 throw std::runtime_error("CallNode has non Expr Node");
62
63 auto *FuncDecl = util::getFunctionDecl(*(const_cast<Expr *>(E)));
64 if (!FuncDecl)
65 throw std::runtime_error("FunctionDecl not found");
66
67 unsigned Result = 0;
68 auto *MethodDecl = dyn_cast<clang::CXXMethodDecl>(FuncDecl);
69 if (MethodDecl && !MethodDecl->isStatic())
70 Result++;
71 if (CB.hasStructRetAttr())
72 Result++;
73
74 return Result;
75}
76
77bool DebugInfoMap::hasDiffNumArgs(const llvm::CallBase &CB) const {
78 auto *ACN = getFromCallMap(CB);

Callers 2

analyzeTargetCallArgsMethod · 0.80
TEST_FFunction · 0.80

Calls 1

getFunctionDeclFunction · 0.50

Tested by 1

TEST_FFunction · 0.64