]> granicus.if.org Git - llvm/commit
[codeview] support more DW_OPs for more complete debug info
authorBob Haarman <llvm@inglorion.net>
Tue, 29 Aug 2017 00:06:59 +0000 (00:06 +0000)
committerBob Haarman <llvm@inglorion.net>
Tue, 29 Aug 2017 00:06:59 +0000 (00:06 +0000)
commit2eaf4212bb034c0504b1eb019d5e7c4091342ff4
tree9c2c1f21ec0a3c09fe189b757a2e5809d8a5433c
parent233d2b81e8b307be4294df5540f4f21c0a3696fb
[codeview] support more DW_OPs for more complete debug info

Summary:
Some variables show up in Visual Studio as "optimized out" even in -O0
-Od builds. This change fixes two issues that would cause this to
happen. The first issue is that not all DIExpressions we generate were
recognized by the CodeView writer. This has been addressed by adding
support for DW_OP_constu, DW_OP_minus, and DW_OP_plus. The second
issue is that we had no way to encode DW_OP_deref in CodeView. We get
around that by changinge the type we encode in the debug info to be
a reference to the type in the source code.

This fixes PR34261.

Reviewers: aprantl, rnk, zturner

Reviewed By: rnk

Subscribers: mgorny, llvm-commits, aprantl, hiraditya

Differential Revision: https://reviews.llvm.org/D36907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311957 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
lib/CodeGen/AsmPrinter/CodeViewDebug.h
lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
lib/CodeGen/AsmPrinter/DebugHandlerBase.h
test/CodeGen/MIR/X86/diexpr-win32.mir [new file with mode: 0644]
test/DebugInfo/COFF/pieces.ll
test/DebugInfo/COFF/types-array-advanced.ll