diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-04-28 14:56:59 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-04-28 14:56:59 +0000 |
commit | 986027020e308ad14caf6e591f38a19f73db2f60 (patch) | |
tree | 09ba5b50d325ddadb9024f4edb8d419c1dbe3801 | |
parent | 78beaaae9de250e4240eaa45b52d13432cf9ef11 (diff) | |
download | clang_35a-986027020e308ad14caf6e591f38a19f73db2f60.tar.gz |
Renaming range-based for loop variables so they don't appear iterator-like.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207422 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/Consumed.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/Analysis/Consumed.cpp b/lib/Analysis/Consumed.cpp index 31823f33f0..aac5658d56 100644 --- a/lib/Analysis/Consumed.cpp +++ b/lib/Analysis/Consumed.cpp @@ -57,8 +57,8 @@ ConsumedWarningsHandlerBase::~ConsumedWarningsHandlerBase() {} static SourceLocation getFirstStmtLoc(const CFGBlock *Block) { // Find the source location of the first statement in the block, if the block // is not empty. - for (const auto &BI : *Block) - if (Optional<CFGStmt> CS = BI.getAs<CFGStmt>()) + for (const auto &B : *Block) + if (Optional<CFGStmt> CS = B.getAs<CFGStmt>()) return CS->getStmt()->getLocStart(); // Block is empty. @@ -1142,19 +1142,19 @@ bool ConsumedBlockInfo::isBackEdgeTarget(const CFGBlock *Block) { void ConsumedStateMap::checkParamsForReturnTypestate(SourceLocation BlameLoc, ConsumedWarningsHandlerBase &WarningsHandler) const { - for (const auto &DMI : VarMap) { - if (isa<ParmVarDecl>(DMI.first)) { - const ParmVarDecl *Param = cast<ParmVarDecl>(DMI.first); + for (const auto &DM : VarMap) { + if (isa<ParmVarDecl>(DM.first)) { + const ParmVarDecl *Param = cast<ParmVarDecl>(DM.first); const ReturnTypestateAttr *RTA = Param->getAttr<ReturnTypestateAttr>(); if (!RTA) continue; ConsumedState ExpectedState = mapReturnTypestateAttrState(RTA); - if (DMI.second != ExpectedState) + if (DM.second != ExpectedState) WarningsHandler.warnParamReturnTypestateMismatch(BlameLoc, Param->getNameAsString(), stateToString(ExpectedState), - stateToString(DMI.second)); + stateToString(DM.second)); } } } @@ -1190,14 +1190,14 @@ void ConsumedStateMap::intersect(const ConsumedStateMap *Other) { return; } - for (const auto &DMI : Other->VarMap) { - LocalState = this->getState(DMI.first); + for (const auto &DM : Other->VarMap) { + LocalState = this->getState(DM.first); if (LocalState == CS_None) continue; - if (LocalState != DMI.second) - VarMap[DMI.first] = CS_Unknown; + if (LocalState != DM.second) + VarMap[DM.first] = CS_Unknown; } } @@ -1208,16 +1208,16 @@ void ConsumedStateMap::intersectAtLoopHead(const CFGBlock *LoopHead, ConsumedState LocalState; SourceLocation BlameLoc = getLastStmtLoc(LoopBack); - for (const auto &DMI : LoopBackStates->VarMap) { - LocalState = this->getState(DMI.first); + for (const auto &DM : LoopBackStates->VarMap) { + LocalState = this->getState(DM.first); if (LocalState == CS_None) continue; - if (LocalState != DMI.second) { - VarMap[DMI.first] = CS_Unknown; + if (LocalState != DM.second) { + VarMap[DM.first] = CS_Unknown; WarningsHandler.warnLoopStateMismatch(BlameLoc, - DMI.first->getNameAsString()); + DM.first->getNameAsString()); } } } @@ -1242,8 +1242,8 @@ void ConsumedStateMap::remove(const VarDecl *Var) { } bool ConsumedStateMap::operator!=(const ConsumedStateMap *Other) const { - for (const auto &DMI : Other->VarMap) - if (this->getState(DMI.first) != DMI.second) + for (const auto &DM : Other->VarMap) + if (this->getState(DM.first) != DM.second) return true; return false; } @@ -1404,14 +1404,14 @@ void ConsumedAnalyzer::run(AnalysisDeclContext &AC) { Visitor.reset(CurrStates); // Visit all of the basic block's statements. - for (const auto &BI : *CurrBlock) { - switch (BI.getKind()) { + for (const auto &B : *CurrBlock) { + switch (B.getKind()) { case CFGElement::Statement: - Visitor.Visit(BI.castAs<CFGStmt>().getStmt()); + Visitor.Visit(B.castAs<CFGStmt>().getStmt()); break; case CFGElement::TemporaryDtor: { - const CFGTemporaryDtor &DTor = BI.castAs<CFGTemporaryDtor>(); + const CFGTemporaryDtor &DTor = B.castAs<CFGTemporaryDtor>(); const CXXBindTemporaryExpr *BTE = DTor.getBindTemporaryExpr(); Visitor.checkCallability(PropagationInfo(BTE), @@ -1421,7 +1421,7 @@ void ConsumedAnalyzer::run(AnalysisDeclContext &AC) { } case CFGElement::AutomaticObjectDtor: { - const CFGAutomaticObjDtor &DTor = BI.castAs<CFGAutomaticObjDtor>(); + const CFGAutomaticObjDtor &DTor = B.castAs<CFGAutomaticObjDtor>(); SourceLocation Loc = DTor.getTriggerStmt()->getLocEnd(); const VarDecl *Var = DTor.getVarDecl(); |