diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-21 23:38:33 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-21 23:38:33 +0000 |
commit | 17aa92c92a925b4a674440c7ef088c223990e854 (patch) | |
tree | bc129644ee9db39dc25a41c22ce01b14ede5728f /unittests | |
parent | fcbd1a749f9db4bf144a3343c4d707e1de087a7e (diff) | |
download | external_llvm-17aa92c92a925b4a674440c7ef088c223990e854.zip external_llvm-17aa92c92a925b4a674440c7ef088c223990e854.tar.gz external_llvm-17aa92c92a925b4a674440c7ef088c223990e854.tar.bz2 |
Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/VMCore/MetadataTest.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/unittests/VMCore/MetadataTest.cpp b/unittests/VMCore/MetadataTest.cpp index 04db486..942b848 100644 --- a/unittests/VMCore/MetadataTest.cpp +++ b/unittests/VMCore/MetadataTest.cpp @@ -130,11 +130,12 @@ TEST(NamedMDNodeTest, Search) { MDNode *n = MDNode::get(Context, &V, 1); MDNode *n2 = MDNode::get(Context, &V2, 1); - MDNode *Nodes[2] = { n, n2 }; - Module M("MyModule", Context); const char *Name = "llvm.NMD1"; - NamedMDNode *NMD = NamedMDNode::Create(Context, Name, &Nodes[0], 2, &M); + NamedMDNode *NMD = M.getOrInsertNamedMetadata(Name); + NMD->addOperand(n); + NMD->addOperand(n2); + std::string Str; raw_string_ostream oss(Str); NMD->print(oss); |