| 52 | } |
| 53 | |
| 54 | unsigned 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 | |
| 77 | bool DebugInfoMap::hasDiffNumArgs(const llvm::CallBase &CB) const { |
| 78 | auto *ACN = getFromCallMap(CB); |