mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-16 11:24:39 +00:00
Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1327,9 +1327,9 @@ void UndefValue::destroyConstant() {
|
||||
//
|
||||
|
||||
MDNode::MDNode(Value*const* Vals, unsigned NumVals)
|
||||
: Constant(Type::MetadataTy, MDNodeVal, 0, 0) {
|
||||
: MetadataBase(Type::MetadataTy, Value::MDNodeVal) {
|
||||
for (unsigned i = 0; i != NumVals; ++i)
|
||||
Node.push_back(ElementVH(Vals[i], this));
|
||||
Node.push_back(WeakVH(Vals[i]));
|
||||
}
|
||||
|
||||
void MDNode::Profile(FoldingSetNodeID &ID) const {
|
||||
@@ -1337,11 +1337,6 @@ void MDNode::Profile(FoldingSetNodeID &ID) const {
|
||||
ID.AddPointer(*I);
|
||||
}
|
||||
|
||||
void MDNode::destroyConstant() {
|
||||
getType()->getContext().erase(this);
|
||||
destroyConstantImpl();
|
||||
}
|
||||
|
||||
//---- ConstantExpr::get() implementations...
|
||||
//
|
||||
|
||||
@@ -2315,6 +2310,4 @@ void MDNode::replaceElement(Value *From, Value *To) {
|
||||
assert(Replacement != this && "I didn't contain From!");
|
||||
|
||||
uncheckedReplaceAllUsesWith(Replacement);
|
||||
|
||||
destroyConstant();
|
||||
}
|
||||
|
Reference in New Issue
Block a user