OSDN Git Service

Fix memory leak in r354692
authorDaniel Sanders <daniel_l_sanders@apple.com>
Sat, 23 Feb 2019 01:13:35 +0000 (01:13 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Sat, 23 Feb 2019 01:13:35 +0000 (01:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354712 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/CodeGen/TargetOptionsTest.cpp

index 93538c0..70ef5e1 100644 (file)
@@ -49,9 +49,9 @@ static void targetOptionsTest(bool EnableIPRA) {
   if (!TM)
     return;
   legacy::PassManager PM;
-  LLVMTargetMachine &LLVMTM = static_cast<LLVMTargetMachine &>(*TM);
+  LLVMTargetMachine *LLVMTM = static_cast<LLVMTargetMachine *>(TM.get());
 
-  TargetPassConfig &TPC = *LLVMTM.createPassConfig(PM);
+  TargetPassConfig &TPC = *LLVMTM->createPassConfig(PM);
   (void)TPC;
 
   ASSERT_TRUE(TM->Options.EnableIPRA == EnableIPRA);