summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-06-26 14:10:56 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-06-26 14:10:56 +0000
commitaf28e7d6fa1fdaf3a7a63e4564b3b8d30d4e9133 (patch)
tree5beb9de8291820460f0297b7389e2e8f28218bf4 /llvm/lib/IR/Attributes.cpp
parent57819aa185196b8d3c4dda3c2282d2128aef3a51 (diff)
downloadbcm5719-llvm-af28e7d6fa1fdaf3a7a63e4564b3b8d30d4e9133.tar.gz
bcm5719-llvm-af28e7d6fa1fdaf3a7a63e4564b3b8d30d4e9133.zip
Apply clang-tidy's modernize-loop-convert to most of lib/IR.
Only minor manual fixes. No functionality change intended. llvm-svn: 273813
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index b470fac5782..bc49b930070 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -570,61 +570,61 @@ AttributeSetNode *AttributeSetNode::get(LLVMContext &C,
}
bool AttributeSetNode::hasAttribute(StringRef Kind) const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Kind))
+ for (Attribute I : *this)
+ if (I.hasAttribute(Kind))
return true;
return false;
}
Attribute AttributeSetNode::getAttribute(Attribute::AttrKind Kind) const {
if (hasAttribute(Kind)) {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Kind))
- return *I;
+ for (Attribute I : *this)
+ if (I.hasAttribute(Kind))
+ return I;
}
return Attribute();
}
Attribute AttributeSetNode::getAttribute(StringRef Kind) const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Kind))
- return *I;
+ for (Attribute I : *this)
+ if (I.hasAttribute(Kind))
+ return I;
return Attribute();
}
unsigned AttributeSetNode::getAlignment() const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Attribute::Alignment))
- return I->getAlignment();
+ for (Attribute I : *this)
+ if (I.hasAttribute(Attribute::Alignment))
+ return I.getAlignment();
return 0;
}
unsigned AttributeSetNode::getStackAlignment() const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Attribute::StackAlignment))
- return I->getStackAlignment();
+ for (Attribute I : *this)
+ if (I.hasAttribute(Attribute::StackAlignment))
+ return I.getStackAlignment();
return 0;
}
uint64_t AttributeSetNode::getDereferenceableBytes() const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Attribute::Dereferenceable))
- return I->getDereferenceableBytes();
+ for (Attribute I : *this)
+ if (I.hasAttribute(Attribute::Dereferenceable))
+ return I.getDereferenceableBytes();
return 0;
}
uint64_t AttributeSetNode::getDereferenceableOrNullBytes() const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Attribute::DereferenceableOrNull))
- return I->getDereferenceableOrNullBytes();
+ for (Attribute I : *this)
+ if (I.hasAttribute(Attribute::DereferenceableOrNull))
+ return I.getDereferenceableOrNullBytes();
return 0;
}
std::pair<unsigned, Optional<unsigned>>
AttributeSetNode::getAllocSizeArgs() const {
- for (iterator I = begin(), E = end(); I != E; ++I)
- if (I->hasAttribute(Attribute::AllocSize))
- return I->getAllocSizeArgs();
+ for (Attribute I : *this)
+ if (I.hasAttribute(Attribute::AllocSize))
+ return I.getAllocSizeArgs();
return std::make_pair(0, 0);
}
OpenPOWER on IntegriCloud