1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/lib
Adrian Prantl 63b8f792d5 Fix LLVM's use of DW_OP_bit_piece in DWARF expressions.
LLVM's use of DW_OP_bit_piece is incorrect and a based on a
misunderstanding of the wording in the DWARF specification. The offset
argument of DW_OP_bit_piece refers to the offset into the location
that is on the top of the DWARF expression stack, and not an offset
into the source variable. This has since also been clarified in the
DWARF specification.

This patch fixes all uses of DW_OP_bit_piece to emit the correct
offset and simplifies the DwarfExpression class to semi-automaticaly
emit empty DW_OP_pieces to adjust the offset of the source variable,
thus simplifying the code using DwarfExpression.

While this is an incompatible bugfix, in practice I don't expect this
to be much of a problem since LLVM's old interpretation and the
correct interpretation of DW_OP_bit_piece differ only when there are
gaps in the fragmented locations of the described variables or if
individual fragments are smaller than a byte. LLDB at least won't
interpret locations with gaps in them because is has no way to present
undefined bits in a variable, and there is a high probability that an
old-form expression will be malformed when interpreted correctly,
because the DW_OP_bit_piece offset will be outside of the location at
the top of the stack.

As a nice side-effect, this patch enables us to use a more efficient
encoding for subregisters: In order to express a sub-register at a
non-zero offset we now use a DW_OP_bit_piece instead of shifting the
value into place manually.

This patch also adds missing test coverage for code paths that weren't
exercised before.

<rdar://problem/29335809>
Differential Revision: https://reviews.llvm.org/D27550

llvm-svn: 289266
2016-12-09 20:43:40 +00:00
..
Analysis [Analysis] Fix typo in comment. NFC 2016-12-09 02:18:04 +00:00
AsmParser
Bitcode Fix MSVC bool to uint64_t promotion warning 2016-12-06 11:12:53 +00:00
CodeGen Fix LLVM's use of DW_OP_bit_piece in DWARF expressions. 2016-12-09 20:43:40 +00:00
DebugInfo Make a DWARF generator so we can unit test DWARF APIs with gtest. 2016-12-08 01:03:48 +00:00
Demangle
ExecutionEngine [mips][rtdyld] Merge code to write relocated values to the section. NFC 2016-12-07 11:41:23 +00:00
Fuzzer [libFuzzer] implement crash-resistant merge (https://github.com/google/sanitizers/issues/722). This is a first experimental variant that needs some more testing, thus not yet adding a lit test (but there are unit tests). 2016-12-09 01:17:24 +00:00
IR IR, X86: Understand !absolute_symbol metadata on global variables. 2016-12-08 19:01:00 +00:00
IRReader
LibDriver
LineEditor
Linker IR: Move NumElements field from {Array,Vector}Type to SequentialType. 2016-12-02 03:20:58 +00:00
LTO LTO: Hash the parts of the LTO configuration that affect code generation. 2016-12-08 05:28:30 +00:00
MC Add a comment consumer mechanism to MCAsmLexer 2016-12-08 10:31:21 +00:00
Object [Object][MachO] Reference-ify some helper function arguments. NFC. 2016-12-04 01:56:10 +00:00
ObjectYAML [ObjectYAML] Support for DWARF debug_aranges 2016-12-09 00:26:44 +00:00
Option
Passes
ProfileData
Support Re-commit r289184, "Support: Use a 64-bit seek in raw_fd_ostream::seek()." with a configure-time check for lseek64. 2016-12-09 05:20:43 +00:00
TableGen [TableGen] Centralize/Unify error handling. 2016-12-05 22:58:01 +00:00
Target AMDGPU/SI: Remove XNACK feature from CI 2016-12-09 19:49:58 +00:00
Transforms [SCCP] Teach the pass about mul %x 0 even if %x is overdefined. 2016-12-09 03:08:42 +00:00
CMakeLists.txt
LLVMBuild.txt