From: Johannes Doerfert Date: Fri, 25 Mar 2022 19:53:38 +0000 (-0500) Subject: [OpenMP][NFC] Add missing virtual destructor to silence warning X-Git-Tag: upstream/15.0.7~12276 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9fd8f34ae547674ac0b5f5fbc5bb66d2bc0fedb;p=platform%2Fupstream%2Fllvm.git [OpenMP][NFC] Add missing virtual destructor to silence warning --- diff --git a/llvm/unittests/Linker/LinkModulesTest.cpp b/llvm/unittests/Linker/LinkModulesTest.cpp index 793c744..7a1217c 100644 --- a/llvm/unittests/Linker/LinkModulesTest.cpp +++ b/llvm/unittests/Linker/LinkModulesTest.cpp @@ -359,4 +359,27 @@ TEST_F(LinkModuleTest, RemangleIntrinsics) { ASSERT_EQ(F->getNumUses(), (unsigned)2); } +TEST_F(LinkModuleTest, StructTypeReusedMerge) { + LLVMContext C; + SMDiagnostic Err; + + const char *M1Str = "%t = type {i32}\n" + "%q = type {%t}\n" + "@t1 = weak global %q zeroinitializer\n"; + std::unique_ptr M1 = parseAssemblyString(M1Str, Err, C); + + const char *M2Str = "%t = type {i32}\n" + "%q = type {%t}\n" + "@t2 = weak global %q zeroinitializer\n"; + std::unique_ptr M2 = parseAssemblyString(M2Str, Err, C); + + Ctx.setDiagnosticHandlerCallBack(expectNoDiags); + Linker::linkModules(*M1, std::move(M2)); + + EXPECT_EQ(M1->getNamedGlobal("t1")->getType(), + M1->getNamedGlobal("t2")->getType()); + EXPECT_TRUE(llvm::for_each(M1->getIdentifiedStructTypes(), [](const StructType *STy) { return STy->hasName(); })); + +} + } // end anonymous namespace diff --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp index 0a6d023..e802885 100644 --- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp +++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp @@ -168,6 +168,8 @@ struct DeviceDataTy { /// accordingly. The implementation should not raise any exception. template struct AllocatorTy { using ElementTy = T; + virtual ~AllocatorTy() {} + /// Create a resource and assign to R. virtual int create(T &R) noexcept = 0; /// Destroy the resource.