1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Do not write empty METADATA_ATTACHMENT record.

llvm-svn: 84006
This commit is contained in:
Devang Patel 2009-10-13 18:51:28 +00:00
parent 934fb4274a
commit 8f81b906ab

View File

@ -580,12 +580,14 @@ static void WriteMetadataAttachment(const Function &F,
Record.push_back(VE.getValueID(ND)); Record.push_back(VE.getValueID(ND));
} }
} }
if (!StartedMetadataBlock) { if (!Record.empty()) {
Stream.EnterSubblock(bitc::METADATA_ATTACHMENT_ID, 3); if (!StartedMetadataBlock) {
StartedMetadataBlock = true; Stream.EnterSubblock(bitc::METADATA_ATTACHMENT_ID, 3);
StartedMetadataBlock = true;
}
Stream.EmitRecord(bitc::METADATA_ATTACHMENT, Record, 0);
Record.clear();
} }
Stream.EmitRecord(bitc::METADATA_ATTACHMENT, Record, 0);
Record.clear();
} }
if (StartedMetadataBlock) if (StartedMetadataBlock)