mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
llvm/unittests: Use OwningPtr to fix --vg-leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173240 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -45,9 +45,9 @@ static Module *makeLLVMModule() {
|
||||
}
|
||||
|
||||
static void writeModuleToBuffer(SmallVectorImpl<char> &Buffer) {
|
||||
Module *Mod = makeLLVMModule();
|
||||
OwningPtr<Module> Mod(makeLLVMModule());
|
||||
raw_svector_ostream OS(Buffer);
|
||||
WriteBitcodeToFile(Mod, OS);
|
||||
WriteBitcodeToFile(Mod.get(), OS);
|
||||
}
|
||||
|
||||
TEST(BitReaderTest, MaterializeFunctionsForBlockAddr) { // PR11677
|
||||
@ -55,7 +55,7 @@ TEST(BitReaderTest, MaterializeFunctionsForBlockAddr) { // PR11677
|
||||
writeModuleToBuffer(Mem);
|
||||
MemoryBuffer *Buffer = MemoryBuffer::getMemBuffer(Mem.str(), "test", false);
|
||||
std::string errMsg;
|
||||
Module *m = getLazyBitcodeModule(Buffer, getGlobalContext(), &errMsg);
|
||||
OwningPtr<Module> m(getLazyBitcodeModule(Buffer, getGlobalContext(), &errMsg));
|
||||
PassManager passes;
|
||||
passes.add(createVerifierPass());
|
||||
passes.run(*m);
|
||||
|
Reference in New Issue
Block a user