diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-10-13 03:26:19 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-10-13 03:26:19 +0000 |
commit | 584af871ccc4321c702cb5877c7b57ea7e41d113 (patch) | |
tree | 7b7faccb3de98781b6c91bd122d43ddec873767b /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 1ed6910338c565f5942b60940a9586d1a4675fc3 (diff) | |
download | llvm-584af871ccc4321c702cb5877c7b57ea7e41d113.zip llvm-584af871ccc4321c702cb5877c7b57ea7e41d113.tar.gz llvm-584af871ccc4321c702cb5877c7b57ea7e41d113.tar.bz2 |
BitcodeWriter: Stop using implicit ilist iterator conversion, NFC
Now LLVMBitWriter compiles without implicit ilist iterator conversions.
In these cases, the cleanest thing was to switch to range-based for
loops. Since there wasn't much noise I converted sub-loops and parent
loops as a drive-by.
llvm-svn: 250144
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 10acaf8..11f6aea 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1350,16 +1350,15 @@ static void WriteMetadataAttachment(const Function &F, Record.clear(); } - for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) - for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); - I != E; ++I) { + for (const BasicBlock &BB : F) + for (const Instruction &I : BB) { MDs.clear(); - I->getAllMetadataOtherThanDebugLoc(MDs); + I.getAllMetadataOtherThanDebugLoc(MDs); // If no metadata, ignore instruction. if (MDs.empty()) continue; - Record.push_back(VE.getInstructionID(I)); + Record.push_back(VE.getInstructionID(&I)); for (unsigned i = 0, e = MDs.size(); i != e; ++i) { Record.push_back(MDs[i].first); |