| 82 | } |
| 83 | |
| 84 | SourceLocation ASTNode::getEndLoc(const DynTypedNode &Node, |
| 85 | const SourceLocation &BeginLoc, |
| 86 | const SourceManager &SrcManager) const { |
| 87 | auto Range = util::getMacroFunctionExpansionRange(SrcManager, BeginLoc); |
| 88 | if (Range.isValid()) |
| 89 | return Range.getEnd(); |
| 90 | |
| 91 | SourceLocation Result; |
| 92 | if (const auto *AST = Node.get<Decl>()) |
| 93 | Result = AST->getEndLoc(); |
| 94 | else if (const auto *AST = Node.get<CXXCtorInitializer>()) |
| 95 | Result = AST->getSourceRange().getEnd(); |
| 96 | else if (const auto *AST = Node.get<Stmt>()) |
| 97 | Result = AST->getEndLoc(); |
| 98 | assert(Result.isValid() && "Unimplemented"); |
| 99 | |
| 100 | return SrcManager.getTopMacroCallerLoc(Result); |
| 101 | } |
| 102 | |
| 103 | QualType ASTNode::getType(const DynTypedNode &Node) const { |
| 104 | if (const auto *AST = Node.get<VarDecl>()) |
no test coverage detected