Fix a bug that caused SimplifyCFG to drop DebugLocs.
[oota-llvm.git] / lib / IR / Metadata.cpp
index 6ec4a25f51bb63fbc068a9dfc324d2677ed3fd08..08fa7ce3b0525ee7954c13f06c59b5345eb00479 100644 (file)
@@ -1062,7 +1062,7 @@ void Instruction::dropUnknownMetadata(ArrayRef<unsigned> KnownIDs) {
   KnownSet.insert(KnownIDs.begin(), KnownIDs.end());
 
   // Drop debug if needed
-  if (KnownSet.erase(LLVMContext::MD_dbg))
+  if (!KnownSet.erase(LLVMContext::MD_dbg))
     DbgLoc = DebugLoc();
 
   if (!hasMetadataHashEntry())