diff options
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
| -rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 20 | 
1 files changed, 5 insertions, 15 deletions
| diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 9916388dad100..7dffafa8314eb 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -17,8 +17,6 @@  #include "llvm/DerivedTypes.h"  #include "llvm/InlineAsm.h"  #include "llvm/IntrinsicInst.h" -#include "llvm/LLVMContext.h" -#include "llvm/Metadata.h"  #include "llvm/Module.h"  #include "llvm/Operator.h"  #include "llvm/AutoUpgrade.h" @@ -840,17 +838,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 = TheModule->getMDKindID(Name.str()); +      assert(Kind == NewKind && +             "FIXME: Unable to handle custom metadata mismatch!");(void)NewKind;        break;      }      } @@ -1580,7 +1571,6 @@ bool BitcodeReader::ParseMetadataAttachment() {    if (Stream.EnterSubBlock(bitc::METADATA_ATTACHMENT_ID))      return Error("Malformed block record"); -  MetadataContext &TheMetadata = Context.getMetadata();    SmallVector<uint64_t, 64> Record;    while(1) {      unsigned Code = Stream.ReadCode(); @@ -1606,7 +1596,7 @@ bool BitcodeReader::ParseMetadataAttachment() {        for (unsigned i = 1; i != RecordLength; i = i+2) {          unsigned Kind = Record[i];          Value *Node = MDValueList.getValueFwdRef(Record[i+1]); -        TheMetadata.addMD(Kind, cast<MDNode>(Node), Inst); +        Inst->setMetadata(Kind, cast<MDNode>(Node));        }        break;      } | 
