mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-01-04 01:21:45 +00:00
Disallow null as a named metadata operand.
Make MDNode::destroy private. Fix the one thing that used MDNode::destroy, outside of MDNode itself. One should never delete or destroy an MDNode explicitly. MDNodes implicitly go away when there are no references to them (implementation details aside). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109028 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -233,8 +233,7 @@ unsigned DIArray::getNumElements() const {
|
||||
}
|
||||
|
||||
/// replaceAllUsesWith - Replace all uses of debug info referenced by
|
||||
/// this descriptor. After this completes, the current debug info value
|
||||
/// is erased.
|
||||
/// this descriptor.
|
||||
void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) {
|
||||
if (!DbgNode)
|
||||
return;
|
||||
@@ -249,7 +248,6 @@ void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) {
|
||||
const MDNode *DN = D;
|
||||
const Value *V = cast_or_null<Value>(DN);
|
||||
Node->replaceAllUsesWith(const_cast<Value*>(V));
|
||||
Node->destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1385,7 +1383,7 @@ static Value *findDbgGlobalDeclare(GlobalVariable *V) {
|
||||
return 0;
|
||||
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
|
||||
DIDescriptor DIG(cast_or_null<MDNode>(NMD->getOperand(i)));
|
||||
DIDescriptor DIG(cast<MDNode>(NMD->getOperand(i)));
|
||||
if (!DIG.isGlobalVariable())
|
||||
continue;
|
||||
if (DIGlobalVariable(DIG).getGlobal() == V)
|
||||
|
||||
Reference in New Issue
Block a user