| 151 | } |
| 152 | |
| 153 | bool 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 | |
| 173 | std::vector<clang::CXXMethodDecl *> findCXXMethodDeclFromCXXRecordDecls( |
| 174 | const clang::CXXRecordDecl *CurCXXRecordDecl, std::string MethodName) { |