mirror of
https://github.com/RPCS3/llvm.git
synced 2026-01-31 01:25:19 +01:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1416,7 +1416,7 @@ static void writeMetadataRecords(ArrayRef<const Metadata *> MDs,
|
||||
#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 Function &F, const ValueEnumerator &VE,
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user