[llvm] r225713 - Bitcode: Range-based for, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Jan 12 14:31:35 PST 2015
Author: dexonsmith
Date: Mon Jan 12 16:31:35 2015
New Revision: 225713
URL: http://llvm.org/viewvc/llvm-project?rev=225713&view=rev
Log:
Bitcode: Range-based for, NFC
Modified:
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=225713&r1=225712&r2=225713&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Jan 12 16:31:35 2015
@@ -799,16 +799,16 @@ static void WriteModuleMetadata(const Mo
}
SmallVector<uint64_t, 64> Record;
- for (unsigned i = 0, e = MDs.size(); i != e; ++i) {
- if (const MDNode *N = dyn_cast<MDNode>(MDs[i])) {
+ for (const Metadata *MD : MDs) {
+ if (const MDNode *N = dyn_cast<MDNode>(MD)) {
WriteMDNode(N, VE, Stream, Record);
continue;
}
- if (const auto *MDC = dyn_cast<ConstantAsMetadata>(MDs[i])) {
+ if (const auto *MDC = dyn_cast<ConstantAsMetadata>(MD)) {
WriteValueAsMetadata(MDC, VE, Stream, Record);
continue;
}
- const MDString *MDS = cast<MDString>(MDs[i]);
+ const MDString *MDS = cast<MDString>(MD);
// Code: [strchar x N]
Record.append(MDS->bytes_begin(), MDS->bytes_end());
More information about the llvm-commits
mailing list