projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make NamedMDNode not be a subclass of Value, and simplify the interface
[oota-llvm.git]
/
unittests
/
VMCore
/
MetadataTest.cpp
diff --git
a/unittests/VMCore/MetadataTest.cpp
b/unittests/VMCore/MetadataTest.cpp
index 04db486cd87102a4f1a8da896e4969eed4081d3e..942b848232507c1feee97a4d84e5681dcdd1fbcd 100644
(file)
--- 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 *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";
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);
std::string Str;
raw_string_ostream oss(Str);
NMD->print(oss);