llvm.org GIT mirror llvm / 838b35d
Fix memory leak in unittest added in r241101. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241123 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Samsonov 5 years ago
1 changed file(s) with 7 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
341341
342342 DIBuilder DIB(*M);
343343 auto File = DIB.createFile("tmp.cpp", "/");
344 auto CU = DIB.createCompileUnit(dwarf::DW_LANG_C_plus_plus_11, "tmp.cpp", "/",
345 "", true, "", 0);
344346 auto SPType = DIB.createSubroutineType(File, DIB.getOrCreateTypeArray(None));
345347 auto SP =
346 DIB.createFunction(File, "foo", "foo", File, 1, SPType, false, true, 1);
348 DIB.createFunction(CU, "foo", "foo", File, 1, SPType, false, true, 1);
347349 DebugLoc DL1 = DILocation::get(Ctx, 2, 0, SP);
348350 DebugLoc DL2 = DILocation::get(Ctx, 3, 0, SP);
349351
362364 EXPECT_EQ(DL2, Builder.getCurrentDebugLocation());
363365 auto Call2 = Builder.CreateCall(Callee, None);
364366 EXPECT_EQ(DL2, Call2->getDebugLoc());
365 }
366 }
367
368 DIB.finalize();
369 }
370 }