1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/lib/IR
Vedant Kumar 48bac26038 [DebugInfo] LowerDbgDeclare: Add derefs when handling CallInst users
LowerDbgDeclare inserts a dbg.value before each use of an address
described by a dbg.declare. When inserting a dbg.value before a CallInst
use, however, it fails to append DW_OP_deref to the DIExpression.

The DW_OP_deref is needed to reflect the fact that a dbg.value describes
a source variable directly (as opposed to a dbg.declare, which relies on
pointer indirection).

This patch adds in the DW_OP_deref where needed. This results in the
correct values being shown during a debug session for a program compiled
with ASan and optimizations (see https://reviews.llvm.org/D49520). Note
that ConvertDebugDeclareToDebugValue is already correct -- no changes
there were needed.

One complication is that SelectionDAG is unable to distinguish between
direct and indirect frame-index (FRAMEIX) SDDbgValues. This patch also
fixes this long-standing issue in order to not regress integration tests
relying on the incorrect assumption that all frame-index SDDbgValues are
indirect. This is a necessary fix: the newly-added DW_OP_derefs cannot
be lowered properly otherwise. Basically the fix prevents a direct
SDDbgValue with DIExpression(DW_OP_deref) from being dereferenced twice
by a debugger. There were a handful of tests relying on this incorrect
"FRAMEIX => indirect" assumption which actually had incorrect
DW_AT_locations: these are all fixed up in this patch.

Testing:

- check-llvm, and an end-to-end test using lldb to debug an optimized
  program.
- Existing unit tests for DIExpression::appendToStack fully cover the
  new DIExpression::append utility.
- check-debuginfo (the debug info integration tests)

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

llvm-svn: 338069
2018-07-26 20:56:53 +00:00
..
AsmWriter.cpp [ThinLTO] Escape module paths when printing 2018-07-12 14:40:21 +00:00
AttributeImpl.h Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Attributes.cpp [Inliner] Teach inliner to merge 'min-legal-vector-width' function attribute 2018-07-24 18:49:00 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [X86] Remove and autoupgrade the scalar fma intrinsics with masking. 2018-07-12 00:29:56 +00:00
BasicBlock.cpp Rename skipDebugInfo -> skipDebugIntrinsics, NFC 2018-06-26 21:16:59 +00:00
CMakeLists.txt Reappl "[Dominators] Add the DomTreeUpdater class" 2018-07-03 02:06:23 +00:00
Comdat.cpp
ConstantFold.cpp llvm: Add support for "-fno-delete-null-pointer-checks" 2018-07-09 22:27:23 +00:00
ConstantFold.h
ConstantRange.cpp [IR] Strip trailing whitespace. NFC 2018-07-03 12:39:52 +00:00
Constants.cpp [Constants] extend getBinOpIdentity(); NFC 2018-07-06 15:18:58 +00:00
ConstantsContext.h Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Core.cpp [LLVM-C] Improve Bindings For Aliases 2018-05-20 23:49:08 +00:00
DataLayout.cpp Use uniform mechanism for OOM errors handling 2018-06-09 05:19:45 +00:00
DebugInfo.cpp [IR] Strip trailing whitespace. NFC 2018-07-03 12:39:52 +00:00
DebugInfoMetadata.cpp [DebugInfo] LowerDbgDeclare: Add derefs when handling CallInst users 2018-07-26 20:56:53 +00:00
DebugLoc.cpp
DiagnosticHandler.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DiagnosticInfo.cpp
DiagnosticPrinter.cpp
DIBuilder.cpp [DebugInfo] Refactoring DIType::setFlags to DIType::cloneWithFlags, NFC 2018-06-01 23:15:09 +00:00
Dominators.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
DomTreeUpdater.cpp [Dominators] Assert if there is modification to DelBB while it is awaiting deletion 2018-07-25 06:18:33 +00:00
Function.cpp llvm: Add support for "-fno-delete-null-pointer-checks" 2018-07-09 22:27:23 +00:00
Globals.cpp
GVMaterializer.cpp
InlineAsm.cpp
Instruction.cpp [IR] Introduce helpers to skip debug instructions (NFC) 2018-06-19 23:42:17 +00:00
Instructions.cpp Improve ConvertDebugDeclareToDebugValue 2018-06-26 06:17:00 +00:00
IntrinsicInst.cpp [DebugInfo] Fix PR37395. 2018-07-03 07:56:04 +00:00
IRBuilder.cpp [IR] Strip trailing whitespace. NFC 2018-07-03 12:39:52 +00:00
IRPrintingPasses.cpp IR: Skip -print-*-all after -print-* 2018-07-11 23:30:25 +00:00
LegacyPassManager.cpp [ORE] Move loop invariant ORE checks outside the PM loop. 2018-07-22 05:27:41 +00:00
LLVMBuild.txt
LLVMContext.cpp
LLVMContextImpl.cpp [LLVMContext] Detecting leaked instructions with metadata 2018-06-29 20:13:13 +00:00
LLVMContextImpl.h Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
Mangler.cpp
MDBuilder.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Metadata.cpp Extend the GlobalObject metadata interface 2018-05-31 13:29:58 +00:00
MetadataImpl.h
Module.cpp Add remarks describing when a pass changes the IR instruction count of a module 2018-05-18 17:26:39 +00:00
ModuleSummaryIndex.cpp
Operator.cpp
OptBisect.cpp
Pass.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
PassManager.cpp
PassRegistry.cpp
ProfileSummary.cpp
SafepointIRVerifier.cpp SafepointIRVerifier should ignore dead blocks and dead edges 2018-06-25 13:51:11 +00:00
Statepoint.cpp
SymbolTableListTraitsImpl.h
Type.cpp [IR] Strip trailing whitespace. NFC 2018-07-03 12:39:52 +00:00
TypeFinder.cpp
Use.cpp
User.cpp
Value.cpp Implement strip.invariant.group 2018-07-02 04:49:30 +00:00
ValueSymbolTable.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Verifier.cpp Recommit r335794 "Add support for generating a call graph profile from Branch Frequency Info." with fix for removed functions. 2018-07-16 00:28:24 +00:00