Fix a bug that caused SimplifyCFG to drop DebugLocs.
[oota-llvm.git] / lib / Transforms / Scalar / MergedLoadStoreMotion.cpp
index 6a094b2a7a13c71cd3585044f27a7cd8a64d8e62..7feb0cd1df6a25275d43fecadd53a880cbaa5e93 100644 (file)
@@ -293,7 +293,7 @@ void MergedLoadStoreMotion::hoistInstruction(BasicBlock *BB,
 
   // Intersect optional metadata.
   HoistCand->intersectOptionalDataWith(ElseInst);
-  HoistCand->dropUnknownMetadata();
+  HoistCand->dropUnknownMetadata(LLVMContext::MD_dbg);
 
   // Prepend point for instruction insert
   Instruction *HoistPt = BB->getTerminator();
@@ -472,7 +472,7 @@ bool MergedLoadStoreMotion::sinkStore(BasicBlock *BB, StoreInst *S0,
     BasicBlock::iterator InsertPt = BB->getFirstInsertionPt();
     // Intersect optional metadata.
     S0->intersectOptionalDataWith(S1);
-    S0->dropUnknownMetadata();
+    S0->dropUnknownMetadata(LLVMContext::MD_dbg);
 
     // Create the new store to be inserted at the join point.
     StoreInst *SNew = (StoreInst *)(S0->clone());