| 91 | } |
| 92 | |
| 93 | FunctionDecl *getFunctionDecl(Expr &E) { |
| 94 | if (auto *CE = dyn_cast<CallExpr>(&E)) |
| 95 | return CE->getDirectCallee(); |
| 96 | |
| 97 | if (auto *CMCE = dyn_cast<CXXMemberCallExpr>(&E)) |
| 98 | return CMCE->getDirectCallee(); |
| 99 | |
| 100 | if (auto *CCE = dyn_cast<CXXConstructExpr>(&E)) |
| 101 | return CCE->getConstructor(); |
| 102 | |
| 103 | if (auto *CNE = dyn_cast<CXXNewExpr>(&E)) |
| 104 | return CNE->getOperatorNew(); |
| 105 | |
| 106 | if (auto *CDE = dyn_cast<CXXDeleteExpr>(&E)) |
| 107 | return CDE->getOperatorDelete(); |
| 108 | |
| 109 | return nullptr; |
| 110 | } |
| 111 | |
| 112 | clang::CharSourceRange |
| 113 | getMacroFunctionExpansionRange(const clang::SourceManager &SrcManager, |
no outgoing calls
no test coverage detected