summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CoverageMappingGen.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-07-27 02:20:20 +0000
committerVedant Kumar <vsk@apple.com>2017-07-27 02:20:20 +0000
commit7838696ea4251c54afc9cf4526d5c4ce4670e527 (patch)
treebce9a4a0bed8d8984be933f545947f82c481e8ac /clang/lib/CodeGen/CoverageMappingGen.cpp
parent69a9971adee5fcf849f361cda053a89acc36dd78 (diff)
downloadbcm5719-llvm-7838696ea4251c54afc9cf4526d5c4ce4670e527.tar.gz
bcm5719-llvm-7838696ea4251c54afc9cf4526d5c4ce4670e527.zip
[Coverage] NFC: Save a pair of calls to get{Start,End}
llvm-svn: 309244
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index a1023473bdd..11c57145f78 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;
}
OpenPOWER on IntegriCloud