Index: llvm/lib/CodeGen/MachineVerifier.cpp =================================================================== --- llvm/lib/CodeGen/MachineVerifier.cpp +++ llvm/lib/CodeGen/MachineVerifier.cpp @@ -1796,12 +1796,21 @@ report("Unspillable Terminator expected to have at most one use!", MI); } - // A fully-formed DBG_VALUE must have a location. Ignore partially formed - // DBG_VALUEs: these are convenient to use in tests, but should never get - // generated. - if (MI->isDebugValue() && MI->getNumOperands() == 4) + // Ignore partially formed DBG_VALUEs: these are convenient to use in tests, + // but should never get + // generated. + if (MI->isDebugValue() && MI->getNumOperands() == 4) { + // A fully-formed DBG_VALUE must have a location. if (!MI->getDebugLoc()) report("Missing DebugLoc for debug instruction", MI); + // A fully-formed DBG_VALUE or DBG_VALUE_LIST must have a DILocalvariable + // associated with it. + if (!MI->getDebugVariable()) + report("Missing DebugVariable for debug instruction", MI); + } + + if (MI->isDebugValue() && MI->getNumOperands() == 4) { + } // Meta instructions should never be the subject of debug value tracking, // they don't create a value in the output program at all.