[llvm-commits] [llvm] r98412 - /llvm/trunk/unittests/VMCore/MetadataTest.cpp
Jeffrey Yasskin
jyasskin at google.com
Fri Mar 12 17:39:20 PST 2010
Author: jyasskin
Date: Fri Mar 12 19:39:20 2010
New Revision: 98412
URL: http://llvm.org/viewvc/llvm-project?rev=98412&view=rev
Log:
Remove a memory leak from MetadataTest.
Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests
Modified:
llvm/trunk/unittests/VMCore/MetadataTest.cpp
Modified: llvm/trunk/unittests/VMCore/MetadataTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/VMCore/MetadataTest.cpp?rev=98412&r1=98411&r2=98412&view=diff
==============================================================================
--- llvm/trunk/unittests/VMCore/MetadataTest.cpp (original)
+++ llvm/trunk/unittests/VMCore/MetadataTest.cpp Fri Mar 12 19:39:20 2010
@@ -132,9 +132,9 @@
MDNode *Nodes[2] = { n, n2 };
- Module *M = new Module("MyModule", Context);
+ Module M("MyModule", Context);
const char *Name = "llvm.NMD1";
- NamedMDNode *NMD = NamedMDNode::Create(Context, Name, &Nodes[0], 2, M);
+ NamedMDNode *NMD = NamedMDNode::Create(Context, Name, &Nodes[0], 2, &M);
std::string Str;
raw_string_ostream oss(Str);
NMD->print(oss);
More information about the llvm-commits
mailing list