r207422 - Renaming range-based for loop variables so they don't appear iterator-like.
Aaron Ballman
aaron at aaronballman.com
Mon Apr 28 07:56:59 PDT 2014
Author: aaronballman
Date: Mon Apr 28 09:56:59 2014
New Revision: 207422
URL: http://llvm.org/viewvc/llvm-project?rev=207422&view=rev
Log:
Renaming range-based for loop variables so they don't appear iterator-like.
Modified:
cfe/trunk/lib/Analysis/Consumed.cpp
Modified: cfe/trunk/lib/Analysis/Consumed.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=207422&r1=207421&r2=207422&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/Consumed.cpp (original)
+++ cfe/trunk/lib/Analysis/Consumed.cpp Mon Apr 28 09:56:59 2014
@@ -57,8 +57,8 @@ ConsumedWarningsHandlerBase::~ConsumedWa
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
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 C
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::intersectAtLoopHe
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 VarD
}
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(AnalysisDeclC
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(AnalysisDeclC
}
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();
More information about the cfe-commits
mailing list