diff options
Diffstat (limited to 'lib/IR/Function.cpp')
-rw-r--r-- | lib/IR/Function.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index 0da9b98258c..42fb7649aa6 100644 --- a/lib/IR/Function.cpp +++ b/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; } |