summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.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/Function.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/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 0da9b98258c..42fb7649aa6 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -347,8 +347,8 @@ void Function::setParent(Module *parent) {
void Function::dropAllReferences() {
setIsMaterializable(false);
- for (iterator I = begin(), E = end(); I != E; ++I)
- I->dropAllReferences();
+ for (BasicBlock &BB : *this)
+ BB.dropAllReferences();
// Delete all basic blocks. They are now unused, except possibly by
// blockaddresses, but BasicBlock's destructor takes care of those.
@@ -531,11 +531,9 @@ static std::string getMangledTypeStr(Type* Ty) {
std::string Intrinsic::getName(ID id, ArrayRef<Type*> Tys) {
assert(id < num_intrinsics && "Invalid intrinsic ID!");
- if (Tys.empty())
- return IntrinsicNameTable[id];
std::string Result(IntrinsicNameTable[id]);
- for (unsigned i = 0; i < Tys.size(); ++i) {
- Result += "." + getMangledTypeStr(Tys[i]);
+ for (Type *Ty : Tys) {
+ Result += "." + getMangledTypeStr(Ty);
}
return Result;
}
OpenPOWER on IntegriCloud