Index: lib/Transforms/Utils/CloneFunction.cpp =================================================================== --- lib/Transforms/Utils/CloneFunction.cpp +++ lib/Transforms/Utils/CloneFunction.cpp @@ -52,6 +52,8 @@ for (BasicBlock::const_iterator II = BB->begin(), IE = BB->end(); II != IE; ++II) { + if (!DIFinder && II->getDebugLoc()) + VMap.MD()[II->getDebugLoc()].reset(II->getDebugLoc()); if (DIFinder && TheModule) { if (auto *DDI = dyn_cast(II)) DIFinder->processDeclare(*TheModule, DDI);