summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-03-13 01:39:20 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-03-13 01:39:20 +0000
commit9d0b3dda1e44b5160697d8b2d993c4e4e0db2a6e (patch)
tree8c113e0e059935c52877173571916d4a2479df62 /unittests
parent645a86f5fbabf807e06056325d3dc5a898062753 (diff)
downloadllvm-9d0b3dda1e44b5160697d8b2d993c4e4e0db2a6e.tar.gz
llvm-9d0b3dda1e44b5160697d8b2d993c4e4e0db2a6e.tar.bz2
llvm-9d0b3dda1e44b5160697d8b2d993c4e4e0db2a6e.tar.xz
Remove a memory leak from MetadataTest.
Tested: valgrind --leak-check=full unittests/VMCore/Debug/VMCoreTests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/VMCore/MetadataTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/VMCore/MetadataTest.cpp b/unittests/VMCore/MetadataTest.cpp
index 13bf27e5d8..04db486cd8 100644
--- a/unittests/VMCore/MetadataTest.cpp
+++ b/unittests/VMCore/MetadataTest.cpp
@@ -132,9 +132,9 @@ TEST(NamedMDNodeTest, Search) {
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);