Hide MetadataContext implementation details.

llvm-svn: 84886
This commit is contained in:
Devang Patel
2009-10-22 19:36:54 +00:00
parent 6da5dbf3c2
commit 1155fdf6dc
5 changed files with 192 additions and 53 deletions

View File

@@ -840,7 +840,15 @@ bool BitcodeReader::ParseMetadata() {
for (unsigned i = 1; i != RecordLength; ++i)
Name[i-1] = Record[i];
MetadataContext &TheMetadata = Context.getMetadata();
TheMetadata.MDHandlerNames[Name.str()] = Kind;
unsigned ExistingKind = TheMetadata.getMDKind(Name.str());
if (ExistingKind == 0) {
unsigned NewKind = TheMetadata.registerMDKind(Name.str());
assert (Kind == NewKind
&& "Unable to handle custom metadata mismatch!");
} else {
assert (ExistingKind == Kind
&& "Unable to handle custom metadata mismatch!");
}
break;
}
}