Reapply "Verifier: Check for incompatible bit piece expressions"
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 13 Apr 2015 18:53:11 +0000 (18:53 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 13 Apr 2015 18:53:11 +0000 (18:53 +0000)
commit88116fe71ab0953859fd3f32027149b5ee6d3a16
tree2d4485ae2229922b9072b11512fe26119a1fa447
parentfabde10209420a985b11119d55791c98fe014af7
Reapply "Verifier: Check for incompatible bit piece expressions"

This reverts commit r234717, reapplying r234698 (in spirit).

As described in r234717, the original `Verifier` check had a
use-after-free.  Instead of storing pointers to "interesting" debug info
intrinsics whose bit piece expressions should be verified once we have
typerefs, do a second traversal.  I've added a testcase to catch the
`llc` crasher.

Original commit message:

    Verifier: Check for incompatible bit piece expressions

    Convert an assertion into a `Verifier` check.  Bit piece expressions
    must fit inside the variable, and mustn't be the entire variable.
    Catching this in the verifier will help us find bugs sooner, and makes
    `DIVariable::getSizeInBits()` dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234776 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DebugInfo.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/IR/DebugInfo.cpp
lib/IR/Verifier.cpp
test/DebugInfo/X86/deleted-bit-piece.ll [new file with mode: 0644]