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

Function isImplicitArgument

lib/utils/ASTUtil.cpp:153–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153bool isImplicitArgument(clang::Expr &E, unsigned AIdx) {
154 auto Args = getArgExprs(E);
155 // TODO:
156 // Below comparison can not distinguish invalid AIdx is given.
157 if (AIdx >= Args.size())
158 return true;
159
160 auto *Arg = Args[AIdx];
161 if (!Arg)
162 throw std::runtime_error("Unexpected nullptr of llvm instance");
163
164 if (isa<ImplicitValueInitExpr>(Arg)) {
165 // NOTE:
166 // Happened when parameter is generated implicitly in IR.
167 // (ex: int* p = new int())
168 return true;
169 }
170 return false;
171}
172
173std::vector<clang::CXXMethodDecl *> findCXXMethodDeclFromCXXRecordDecls(
174 const clang::CXXRecordDecl *CurCXXRecordDecl, std::string MethodName) {

Callers 4

ASTDefNodeMethod · 0.85
getFromArgMapMethod · 0.85
isArgsInMacroMethod · 0.85
TEST_FFunction · 0.85

Calls 2

getArgExprsFunction · 0.85
sizeMethod · 0.80

Tested by 1

TEST_FFunction · 0.68