diff --git a/llvm/include/llvm/Transforms/Utils/DebugSSAUpdater.h b/llvm/include/llvm/Transforms/Utils/DebugSSAUpdater.h index 90899c86f5c3b..2d25ce3245793 100644 --- a/llvm/include/llvm/Transforms/Utils/DebugSSAUpdater.h +++ b/llvm/include/llvm/Transforms/Utils/DebugSSAUpdater.h @@ -235,6 +235,11 @@ class DebugSSAUpdater { DebugSSAUpdater(const DebugSSAUpdater &) = delete; DebugSSAUpdater &operator=(const DebugSSAUpdater &) = delete; + ~DebugSSAUpdater() { + for (auto &Block : BlockMap) + delete Block.second; + } + void reset() { for (auto &Block : BlockMap) delete Block.second;