CodeGen: Assert that inlined-at locations agree
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 3 Apr 2015 19:20:26 +0000 (19:20 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 3 Apr 2015 19:20:26 +0000 (19:20 +0000)
commitf4f021c0a40fd1db3bbcf6cf14c4a4476fee268c
treea74f83eb2b38d688ad65cd288a1f8286a0a4c6c2
parent36ae857dc67e9bfccf32b1b8170cd7794df06acd
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
14 files changed:
include/llvm/CodeGen/MachineInstrBuilder.h
include/llvm/IR/DebugInfoMetadata.h
lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/InlineSpiller.cpp
lib/CodeGen/LiveDebugVariables.cpp
lib/CodeGen/RegAllocFast.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/InstrEmitter.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/X86/X86FastISel.cpp