| 279 | } |
| 280 | |
| 281 | unsigned |
| 282 | DefMapGenerator::getNonGlobalEndOffset(const VarDecl &D, |
| 283 | const SourceManager &SrcManager) const { |
| 284 | const auto *DC = D.getDeclContext(); |
| 285 | assert(DC && "Unexpected Program State"); |
| 286 | |
| 287 | DeclStmtFinder Finder(D); |
| 288 | Finder.TraverseDecl(Decl::castFromDeclContext(DC)); |
| 289 | assert(Finder.Result && "Unexpected Program State"); |
| 290 | |
| 291 | auto EndLoc = SrcManager.getTopMacroCallerLoc(Finder.Result->getEndLoc()); |
| 292 | auto Offset = SrcManager.getFileOffset(EndLoc); |
| 293 | return Offset + |
| 294 | Lexer::MeasureTokenLength(EndLoc, SrcManager, clang::LangOptions()); |
| 295 | } |
| 296 | |
| 297 | const Decl * |
| 298 | DefMapGenerator::getFirstVarDeclhasSameBeginLoc(const VarDecl &D) const { |