[llvm] [RemoveDIs] Temporarily suppress memory leak (PR #106779)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 12:02:41 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Vitaly Buka (vitalybuka)

<details>
<summary>Changes</summary>

The #<!-- -->105671 fixes crashes for #<!-- -->105571 but introduces a memory leak.


---
Full diff: https://github.com/llvm/llvm-project/pull/106779.diff


1 Files Affected:

- (modified) llvm/unittests/IR/BasicBlockDbgInfoTest.cpp (+12) 


``````````diff
diff --git a/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp b/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
index 5ce14d3f6b9cef..603bd65470b723 100644
--- a/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
+++ b/llvm/unittests/IR/BasicBlockDbgInfoTest.cpp
@@ -23,6 +23,14 @@
 #include "gtest/gtest.h"
 #include <memory>
 
+#if LLVM_ADDRESS_SANITIZER_BUILD || LLVM_HWADDRESS_SANITIZER_BUILD
+#include <sanitizer/lsan_interface.h>
+#else
+namespace __lsan {
+struct ScopedDisabler {};
+} // namespace __lsan
+#endif
+
 using namespace llvm;
 
 static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
@@ -1527,6 +1535,10 @@ TEST(BasicBlockDbgInfoTest, DbgMoveToEnd) {
 
 TEST(BasicBlockDbgInfoTest, CloneTrailingRecordsToEmptyBlock) {
   LLVMContext C;
+  // FIXME: There is a leak introduced with
+  // https://github.com/llvm/llvm-project/pull/105671
+  __lsan::ScopedDisabler Leaks;
+  (void)Leaks;
   std::unique_ptr<Module> M = parseIR(C, R"(
     define i16 @foo(i16 %a) !dbg !6 {
     entry:

``````````

</details>


https://github.com/llvm/llvm-project/pull/106779


More information about the llvm-commits mailing list