llvm-project/llvm
Petr Hosek f6cd6ffbc9 [SafeStack] Insert the deref after the offset
While debugging code that uses SafeStack, we've noticed that LLVM
produces an invalid DWARF. Concretely, in the following example:

  int main(int argc, char* argv[]) {
    std::string value = "";
    printf("%s\n", value.c_str());
    return 0;
  }

DWARF would describe the value variable as being located at:

  DW_OP_breg14 R14+0, DW_OP_deref, DW_OP_constu 0x20, DW_OP_minus

The assembly to get this variable is:

  leaq    -32(%r14), %rbx

The order of operations in the DWARF symbols is incorrect in this case.
Specifically, the deref is incorrect; this appears to be incorrectly
re-inserted in repalceOneDbgValueForAlloca.

With this change which inserts the deref after the offset instead of
before it, LLVM produces correct DWARF:

  DW_OP_breg14 R14-32

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

llvm-svn: 366726
2019-07-22 18:52:42 +00:00
..
benchmarks
bindings [IR/DIVar] Add the flag for params that have unmodified value 2019-06-26 11:19:26 +00:00
cmake Re-commit: r366610 and r366612: Expand pseudo-components before embedding in llvm-config 2019-07-19 22:46:47 +00:00
docs unbreak links 2019-07-19 05:49:11 +00:00
examples [ORC] Add deprecation warnings to ORCv1 layers and utilities. 2019-07-17 16:40:52 +00:00
include [Object][XCOFF] Remove extra includes from XCOFF related files. [NFC] 2019-07-22 18:47:55 +00:00
lib [SafeStack] Insert the deref after the offset 2019-07-22 18:52:42 +00:00
projects Revert "[libc++] Integrate the PSTL into libc++" 2019-07-19 18:52:46 +00:00
resources
runtimes
test [SafeStack] Insert the deref after the offset 2019-07-22 18:52:42 +00:00
tools [yaml2obj] - Change how we handle implicit sections. 2019-07-22 12:01:52 +00:00
unittests [SmallBitVector] Fix bug in find_next_unset for small types with indices >=32 2019-07-21 16:06:26 +00:00
utils TableGen: Support physical register inputs > 255 2019-07-22 15:02:34 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [cmake] Convert the NATIVE llvm build process to be project agnostic 2019-07-19 00:10:06 +00:00
CODE_OWNERS.TXT Update email address in CODE_OWNERS 2019-07-01 16:01:15 +00:00
CREDITS.TXT Update email address. 2019-07-17 07:02:02 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.