forked from OSchip/llvm-project
IR: MDNode => Value: NamedMDNode::addOperand()
Change `NamedMDNode::addOperand()` to take a `Value *` instead of an `MDNode *`. This is part of PR21433. llvm-svn: 221359
This commit is contained in:
parent
f2572c5097
commit
9727e7865e
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue