[llvm] r264557 - BitcodeWriter: Reuse writeMetadataRecords, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 27 16:59:32 PDT 2016
Author: dexonsmith
Date: Sun Mar 27 18:59:32 2016
New Revision: 264557
URL: http://llvm.org/viewvc/llvm-project?rev=264557&view=rev
Log:
BitcodeWriter: Reuse writeMetadataRecords, NFC
Change writeFunctionMetadata to call writeMetadataRecords. For now
there's no functionality change, but makes it easy to serialize other
types of metadata in the function block in the future.
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=264557&r1=264556&r2=264557&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Sun Mar 27 18:59:32 2016
@@ -1416,7 +1416,7 @@ static void writeMetadataRecords(ArrayRe
#include "llvm/IR/Metadata.def"
}
}
- writeValueAsMetadata(cast<ConstantAsMetadata>(MD), VE, Stream, Record);
+ writeValueAsMetadata(cast<ValueAsMetadata>(MD), VE, Stream, Record);
}
}
@@ -1441,11 +1441,8 @@ static void writeFunctionMetadata(const
return;
Stream.EnterSubblock(bitc::METADATA_BLOCK_ID, 3);
-
SmallVector<uint64_t, 64> Record;
- for (const Metadata *MD : VE.getFunctionMDs())
- writeValueAsMetadata(cast<LocalAsMetadata>(MD), VE, Stream, Record);
-
+ writeMetadataRecords(MDs, VE, Stream, Record);
Stream.ExitBlock();
}
More information about the llvm-commits
mailing list