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 | 0eb419800ae51d6e0e00a656ede0627483755361 (patch) | |
tree | 11dc009d755eda2b02147fc4be338d0912bce39c /lib/Bitcode | |
parent | 7d05c46d601cbb52be605019548c34286c02e3a3 (diff) | |
download | external_llvm-0eb419800ae51d6e0e00a656ede0627483755361.zip external_llvm-0eb419800ae51d6e0e00a656ede0627483755361.tar.gz external_llvm-0eb419800ae51d6e0e00a656ede0627483755361.tar.bz2 |
rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 9916388..0bda03e 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/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; } } |