From 093cb79d4bcbe3cb8fd0bda40137e2c9415b67f1 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 21 Jul 2010 18:54:18 +0000 Subject: 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). llvm-svn: 109028 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a1f646a4253..5f7d052ec01 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -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(NMD->getOperand(i))); + DIVariable DV(cast(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(NMD->getOperand(i))); + DIVariable DV(cast(NMD->getOperand(i))); if (!DV || !ProcessedVars.insert(DV)) continue; DbgScope *Scope = AbstractScopes.lookup(DV.getContext()); -- cgit v1.2.3