summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CloneFunction.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 86f7068f975..bd6cd3a87b5 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -188,11 +188,9 @@ static void CloneDebugInfoMetadata(Function *NewFunc, const Function *OldFunc,
const DISubprogram *OldSubprogramMDNode = FindSubprogram(OldFunc, Finder);
if (!OldSubprogramMDNode) return;
- // Ensure that OldFunc appears in the map.
- // (if it's already there it must point to NewFunc anyway)
- VMap[OldFunc] = NewFunc;
auto *NewSubprogram =
cast<DISubprogram>(MapMetadata(OldSubprogramMDNode, VMap));
+ NewFunc->setSubprogram(NewSubprogram);
for (auto *CU : Finder.compile_units()) {
auto Subprograms = CU->getSubprograms();
OpenPOWER on IntegriCloud