summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/IR/Metadata.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp
index 0b3376c9e9c..3806fe4fd4e 100644
--- a/llvm/lib/IR/Metadata.cpp
+++ b/llvm/lib/IR/Metadata.cpp
@@ -578,7 +578,8 @@ MDNode *NamedMDNode::getOperand(unsigned i) const {
return &*getNMDOps(Operands)[i];
}
-void NamedMDNode::addOperand(MDNode *M) {
+void NamedMDNode::addOperand(Value *V) {
+ auto *M = cast<MDNode>(V);
assert(!M->isFunctionLocal() &&
"NamedMDNode operands must not be function-local!");
getNMDOps(Operands).push_back(TrackingVH<MDNode>(M));
OpenPOWER on IntegriCloud