From: Vedant Kumar Date: Thu, 27 Jul 2017 02:20:20 +0000 (+0000) Subject: [Coverage] NFC: Save a pair of calls to get{Start,End} X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7838696ea4251c54afc9cf4526d5c4ce4670e527;p=platform%2Fupstream%2Fllvm.git [Coverage] NFC: Save a pair of calls to get{Start,End} llvm-svn: 309244 --- diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index a102347..11c5714 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -481,15 +481,17 @@ struct CounterCoverageMappingBuilder /// \brief Propagate counts through the children of \c S. Counter propagateCounts(Counter TopCount, const Stmt *S) { - size_t Index = pushRegion(TopCount, getStart(S), getEnd(S)); + SourceLocation StartLoc = getStart(S); + SourceLocation EndLoc = getEnd(S); + size_t Index = pushRegion(TopCount, StartLoc, EndLoc); Visit(S); Counter ExitCount = getRegion().getCounter(); popRegions(Index); // The statement may be spanned by an expansion. Make sure we handle a file // exit out of this expansion before moving to the next statement. - if (SM.isBeforeInTranslationUnit(getStart(S), S->getLocStart())) - MostRecentLocation = getEnd(S); + if (SM.isBeforeInTranslationUnit(StartLoc, S->getLocStart())) + MostRecentLocation = EndLoc; return ExitCount; }