mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
CodeGen: Assert that inlined-at locations agree
As a follow-up to r234021, assert that a debug info intrinsic variable's `MDLocalVariable::getInlinedAt()` always matches the `MDLocation::getInlinedAt()` of its `!dbg` attachment. The goal here is to get rid of `MDLocalVariable::getInlinedAt()` entirely (PR22778), but I'll let these assertions bake for a while first. If you have an out-of-tree backend that just broke, you're probably attaching the wrong `DebugLoc` to a `DBG_VALUE` instruction. The one you want is the location that was attached to the corresponding `@llvm.dbg.declare` or `@llvm.dbg.value` call that you started with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234038 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -204,6 +204,8 @@ void llvm::calculateDbgValueHistory(const MachineFunction *MF,
|
||||
// as index into History. The full variables including the
|
||||
// piece expressions are attached to the MI.
|
||||
DIVariable Var = MI.getDebugVariable();
|
||||
assert(Var->isValidLocationForIntrinsic(MI.getDebugLoc()) &&
|
||||
"Expected inlined-at fields to agree");
|
||||
|
||||
if (unsigned PrevReg = Result.getRegisterForVar(Var))
|
||||
dropRegDescribedVar(RegVars, PrevReg, Var);
|
||||
|
Reference in New Issue
Block a user