IR: MDNode => Value: NamedMDNode::addOperand()

Change `NamedMDNode::addOperand()` to take a `Value *` instead of an
`MDNode *`.  This is part of PR21433.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221359 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-11-05 17:16:09 +00:00
parent 33ccf8e66c
commit 72ced73d45
2 changed files with 3 additions and 2 deletions

View File

@ -307,7 +307,7 @@ public:
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;

View File

@ -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));