mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-01 16:26:29 +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:
@@ -2319,7 +2319,7 @@ DwarfDebug::collectVariableInfo(const MachineFunction *MF,
|
||||
M->getNamedMetadata(Twine("llvm.dbg.lv.",
|
||||
getRealLinkageName(F->getName())))) {
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
|
||||
DIVariable DV(cast_or_null<MDNode>(NMD->getOperand(i)));
|
||||
DIVariable DV(cast<MDNode>(NMD->getOperand(i)));
|
||||
if (!DV || !Processed.insert(DV))
|
||||
continue;
|
||||
DbgScope *Scope = DbgScopeMap.lookup(DV.getContext());
|
||||
@@ -2783,7 +2783,7 @@ void DwarfDebug::endFunction(const MachineFunction *MF) {
|
||||
M->getNamedMetadata(Twine("llvm.dbg.lv.",
|
||||
getRealLinkageName(FName)))) {
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
|
||||
DIVariable DV(cast_or_null<MDNode>(NMD->getOperand(i)));
|
||||
DIVariable DV(cast<MDNode>(NMD->getOperand(i)));
|
||||
if (!DV || !ProcessedVars.insert(DV))
|
||||
continue;
|
||||
DbgScope *Scope = AbstractScopes.lookup(DV.getContext());
|
||||
|
Reference in New Issue
Block a user