[DWARF] Fix a few corner cases in expression emission
authorKeno Fischer <kfischer@college.harvard.edu>
Tue, 9 Jun 2015 01:53:59 +0000 (01:53 +0000)
committerKeno Fischer <kfischer@college.harvard.edu>
Tue, 9 Jun 2015 01:53:59 +0000 (01:53 +0000)
commitb4863a99c98e7cecd9dcc13397abeb453854a2d5
treef4e5046e36f0a75c6889ce92e4552894ee8ce628
parentcfd8f11d48146e551016b98c7314e3126170907d
[DWARF] Fix a few corner cases in expression emission

Summary: I noticed an object file with `DW_OP_reg4 DW_OP_breg4 0` as a DWARF expression,
which I traced to a missing break (and `++I`) in this code snippet.
While I was at it, I also added support for a few other corner cases
along the same lines that I could think of.

Test Plan: Hand-crafted test case to exercises these cases is included.

Reviewers: echristo, dblaikie, aprantl

Reviewed By: aprantl

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10302

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239380 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfExpression.cpp
lib/CodeGen/AsmPrinter/DwarfExpression.h
test/DebugInfo/expressions.ll [new file with mode: 0644]