diff options
author | Stephen Kelly <steveire@gmail.com> | 2018-08-09 21:08:08 +0000 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2018-08-09 21:08:08 +0000 |
commit | f2ceec4811c3587056344dd5ef8d819261e256ad (patch) | |
tree | e3d713a6806e8f9b334df4a7083d82dfc5c06d79 /clang/lib/Analysis | |
parent | a6e4358f071e18aa969c0ae820745510b3581aff (diff) | |
download | bcm5719-llvm-f2ceec4811c3587056344dd5ef8d819261e256ad.tar.gz bcm5719-llvm-f2ceec4811c3587056344dd5ef8d819261e256ad.zip |
Port getLocStart -> getBeginLoc
Reviewers: teemperor!
Subscribers: jholewinski, whisperity, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D50350
llvm-svn: 339385
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r-- | clang/lib/Analysis/AnalysisDeclContext.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Analysis/CloneDetection.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Analysis/Consumed.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Analysis/ReachableCode.cpp | 20 | ||||
-rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 8 |
6 files changed, 24 insertions, 24 deletions
diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp index 9557f68452f..3967e04d22b 100644 --- a/clang/lib/Analysis/AnalysisDeclContext.cpp +++ b/clang/lib/Analysis/AnalysisDeclContext.cpp @@ -137,7 +137,7 @@ bool AnalysisDeclContext::isBodyAutosynthesized() const { bool AnalysisDeclContext::isBodyAutosynthesizedFromModelFile() const { bool Tmp; Stmt *Body = getBody(Tmp); - return Tmp && Body->getLocStart().isValid(); + return Tmp && Body->getBeginLoc().isValid(); } /// Returns true if \param VD is an Objective-C implicit 'self' parameter. @@ -500,7 +500,7 @@ void LocationContext::dumpStack( OS << "Calling anonymous code"; if (const Stmt *S = cast<StackFrameContext>(LCtx)->getCallSite()) { OS << " at "; - printLocation(OS, SM, S->getLocStart()); + printLocation(OS, SM, S->getBeginLoc()); } break; case Scope: @@ -510,7 +510,7 @@ void LocationContext::dumpStack( OS << "Invoking block"; if (const Decl *D = cast<BlockInvocationContext>(LCtx)->getDecl()) { OS << " defined at "; - printLocation(OS, SM, D->getLocStart()); + printLocation(OS, SM, D->getBeginLoc()); } break; } diff --git a/clang/lib/Analysis/CloneDetection.cpp b/clang/lib/Analysis/CloneDetection.cpp index deabee92391..38db6ccb923 100644 --- a/clang/lib/Analysis/CloneDetection.cpp +++ b/clang/lib/Analysis/CloneDetection.cpp @@ -78,7 +78,7 @@ ASTContext &StmtSequence::getASTContext() const { } SourceLocation StmtSequence::getBeginLoc() const { - return front()->getLocStart(); + return front()->getBeginLoc(); } SourceLocation StmtSequence::getEndLoc() const { return back()->getLocEnd(); } diff --git a/clang/lib/Analysis/Consumed.cpp b/clang/lib/Analysis/Consumed.cpp index bc81a71b3d9..6f9780251c7 100644 --- a/clang/lib/Analysis/Consumed.cpp +++ b/clang/lib/Analysis/Consumed.cpp @@ -64,7 +64,7 @@ static SourceLocation getFirstStmtLoc(const CFGBlock *Block) { // is not empty. for (const auto &B : *Block) if (Optional<CFGStmt> CS = B.getAs<CFGStmt>()) - return CS->getStmt()->getLocStart(); + return CS->getStmt()->getBeginLoc(); // Block is empty. // If we have one successor, return the first statement in that block @@ -78,12 +78,12 @@ static SourceLocation getLastStmtLoc(const CFGBlock *Block) { // Find the source location of the last statement in the block, if the block // is not empty. if (const Stmt *StmtNode = Block->getTerminator()) { - return StmtNode->getLocStart(); + return StmtNode->getBeginLoc(); } else { for (CFGBlock::const_reverse_iterator BI = Block->rbegin(), BE = Block->rend(); BI != BE; ++BI) { if (Optional<CFGStmt> CS = BI->getAs<CFGStmt>()) - return CS->getStmt()->getLocStart(); + return CS->getStmt()->getBeginLoc(); } } @@ -893,7 +893,7 @@ void ConsumedStmtVisitor::VisitReturnStmt(const ReturnStmt *Ret) { } } - StateMap->checkParamsForReturnTypestate(Ret->getLocStart(), + StateMap->checkParamsForReturnTypestate(Ret->getBeginLoc(), Analyzer.WarningsHandler); } diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index 05bc1a5d102..4e063f4ca74 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -619,8 +619,8 @@ void LiveVariablesImpl::dumpBlockLiveness(const SourceManager &M) { llvm::sort(declVec.begin(), declVec.end(), [](const Decl *A, const Decl *B) { - return A->getLocStart() < B->getLocStart(); - }); + return A->getBeginLoc() < B->getBeginLoc(); + }); for (std::vector<const VarDecl*>::iterator di = declVec.begin(), de = declVec.end(); di != de; ++di) { diff --git a/clang/lib/Analysis/ReachableCode.cpp b/clang/lib/Analysis/ReachableCode.cpp index ed26a94f3d6..0d4b78ba027 100644 --- a/clang/lib/Analysis/ReachableCode.cpp +++ b/clang/lib/Analysis/ReachableCode.cpp @@ -153,7 +153,7 @@ static bool isExpandedFromConfigurationMacro(const Stmt *S, // value comes from a macro, but we can do much better. This is likely // to be over conservative. This logic is factored into a separate function // so that we can refine it later. - SourceLocation L = S->getLocStart(); + SourceLocation L = S->getBeginLoc(); if (L.isMacroID()) { SourceManager &SM = PP.getSourceManager(); if (IgnoreYES_NO) { @@ -200,7 +200,7 @@ static bool isConfigurationValue(const Stmt *S, // Special case looking for the sigil '()' around an integer literal. if (const ParenExpr *PE = dyn_cast<ParenExpr>(S)) - if (!PE->getLocStart().isMacroID()) + if (!PE->getBeginLoc().isMacroID()) return isConfigurationValue(PE->getSubExpr(), PP, SilenceableCondVal, IncludeIntegers, true); @@ -446,7 +446,7 @@ bool DeadCodeScan::isDeadCodeRoot(const clang::CFGBlock *Block) { } static bool isValidDeadStmt(const Stmt *S) { - if (S->getLocStart().isInvalid()) + if (S->getBeginLoc().isInvalid()) return false; if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(S)) return BO->getOpcode() != BO_Comma; @@ -474,9 +474,9 @@ const Stmt *DeadCodeScan::findDeadCode(const clang::CFGBlock *Block) { static int SrcCmp(const std::pair<const CFGBlock *, const Stmt *> *p1, const std::pair<const CFGBlock *, const Stmt *> *p2) { - if (p1->second->getLocStart() < p2->second->getLocStart()) + if (p1->second->getBeginLoc() < p2->second->getBeginLoc()) return -1; - if (p2->second->getLocStart() < p1->second->getLocStart()) + if (p2->second->getBeginLoc() < p1->second->getBeginLoc()) return 1; return 0; } @@ -509,7 +509,7 @@ unsigned DeadCodeScan::scanBackwards(const clang::CFGBlock *Start, } // Specially handle macro-expanded code. - if (S->getLocStart().isMacroID()) { + if (S->getBeginLoc().isMacroID()) { count += scanMaybeReachableFromBlock(Block, PP, Reachable); continue; } @@ -592,7 +592,7 @@ static SourceLocation GetUnreachableLoc(const Stmt *S, case Expr::CXXFunctionalCastExprClass: { const CXXFunctionalCastExpr *CE = cast <CXXFunctionalCastExpr>(S); R1 = CE->getSubExpr()->getSourceRange(); - return CE->getLocStart(); + return CE->getBeginLoc(); } case Stmt::CXXTryStmtClass: { return cast<CXXTryStmt>(S)->getHandler(0)->getCatchLoc(); @@ -605,7 +605,7 @@ static SourceLocation GetUnreachableLoc(const Stmt *S, default: ; } R1 = S->getSourceRange(); - return S->getLocStart(); + return S->getBeginLoc(); } void DeadCodeScan::reportDeadCode(const CFGBlock *B, @@ -631,12 +631,12 @@ void DeadCodeScan::reportDeadCode(const CFGBlock *B, // a for/for-range loop. This is the block that contains // the increment code. if (const Stmt *LoopTarget = B->getLoopTarget()) { - SourceLocation Loc = LoopTarget->getLocStart(); + SourceLocation Loc = LoopTarget->getBeginLoc(); SourceRange R1(Loc, Loc), R2; if (const ForStmt *FS = dyn_cast<ForStmt>(LoopTarget)) { const Expr *Inc = FS->getInc(); - Loc = Inc->getLocStart(); + Loc = Inc->getBeginLoc(); R2 = Inc->getSourceRange(); } diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index 2ebd8270376..42f6a797e66 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -819,13 +819,13 @@ static void findBlockLocations(CFG *CFGraph, // Find the source location of the last statement in the block, if the // block is not empty. if (const Stmt *S = CurrBlock->getTerminator()) { - CurrBlockInfo->EntryLoc = CurrBlockInfo->ExitLoc = S->getLocStart(); + CurrBlockInfo->EntryLoc = CurrBlockInfo->ExitLoc = S->getBeginLoc(); } else { for (CFGBlock::const_reverse_iterator BI = CurrBlock->rbegin(), BE = CurrBlock->rend(); BI != BE; ++BI) { // FIXME: Handle other CFGElement kinds. if (Optional<CFGStmt> CS = BI->getAs<CFGStmt>()) { - CurrBlockInfo->ExitLoc = CS->getStmt()->getLocStart(); + CurrBlockInfo->ExitLoc = CS->getStmt()->getBeginLoc(); break; } } @@ -837,7 +837,7 @@ static void findBlockLocations(CFG *CFGraph, for (const auto &BI : *CurrBlock) { // FIXME: Handle other CFGElement kinds. if (Optional<CFGStmt> CS = BI.getAs<CFGStmt>()) { - CurrBlockInfo->EntryLoc = CS->getStmt()->getLocStart(); + CurrBlockInfo->EntryLoc = CS->getStmt()->getBeginLoc(); break; } } @@ -2080,7 +2080,7 @@ void BuildLockset::VisitDeclStmt(DeclStmt *S) { CXXConstructorDecl *CtorD = findConstructorForByValueReturn(RD); if (!CtorD || !CtorD->hasAttrs()) continue; - handleCall(buildFakeCtorCall(CtorD, {E}, E->getLocStart()), CtorD, VD); + handleCall(buildFakeCtorCall(CtorD, {E}, E->getBeginLoc()), CtorD, VD); } } } |