Change `NamedMDNode::addOperand()` to take a `Value *` instead of an
`MDNode *`. This is part of PR21433.
llvm-svn: 221359
MDNode *getOperand(unsigned i) const;
unsigned getNumOperands() const;
- void addOperand(MDNode *M);
+ void addOperand(Value *M);
StringRef getName() const;
void print(raw_ostream &ROS) const;
void dump() 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));