rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAGBuilder.cpp
index 8fe7c4554501de761365e88c603132e20ffac195..266cb64b7155663c603b43ca3a73739140dac320 100644 (file)
@@ -4383,9 +4383,9 @@ SelectionDAGBuilder::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
     if (MMI) {
       MetadataContext &TheMetadata = 
         DI.getParent()->getContext().getMetadata();
-      unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
-      MDNode *Dbg = TheMetadata.getMD(MDDbgKind, &DI);
-      MMI->setVariableDbgInfo(Variable, FI, Dbg);
+      unsigned MDDbgKind = TheMetadata.getMDKindID("dbg");
+      if (MDNode *Dbg = TheMetadata.getMD(MDDbgKind, &DI))
+        MMI->setVariableDbgInfo(Variable, FI, Dbg);
     }
     return 0;
   }