diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:45:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-28 20:45:51 +0000 |
commit | 7093946ab1d3b836e1f340a1c66c16880b5b6ef4 (patch) | |
tree | 1813750fbb165fbf9dc4a1ae1b79fd2a9959fd82 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | c9558df1f0144f43c4c6025d2bef4aa2ead518ee (diff) | |
download | bcm5719-llvm-7093946ab1d3b836e1f340a1c66c16880b5b6ef4.tar.gz bcm5719-llvm-7093946ab1d3b836e1f340a1c66c16880b5b6ef4.zip |
rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.
llvm-svn: 92225
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 9916388dad1..0bda03e337f 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -840,17 +840,10 @@ bool BitcodeReader::ParseMetadata() { (void) Kind; for (unsigned i = 1; i != RecordLength; ++i) Name[i-1] = Record[i]; - MetadataContext &TheMetadata = Context.getMetadata(); - unsigned ExistingKind = TheMetadata.getMDKind(Name.str()); - if (ExistingKind == 0) { - unsigned NewKind = TheMetadata.registerMDKind(Name.str()); - (void) NewKind; - assert (Kind == NewKind - && "Unable to handle custom metadata mismatch!"); - } else { - assert (ExistingKind == Kind - && "Unable to handle custom metadata mismatch!"); - } + + unsigned NewKind = Context.getMetadata().getMDKindID(Name.str()); + assert(Kind == NewKind && + "FIXME: Unable to handle custom metadata mismatch!");(void)NewKind; break; } } |