1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/Instrumentation/AddressSanitizer
Adrian Prantl f625c157a1 PR32382: Fix emitting complex DWARF expressions.
The DWARF specification knows 3 kinds of non-empty simple location
descriptions:
1. Register location descriptions
  - describe a variable in a register
  - consist of only a DW_OP_reg
2. Memory location descriptions
  - describe the address of a variable
3. Implicit location descriptions
  - describe the value of a variable
  - end with DW_OP_stack_value & friends

The existing DwarfExpression code is pretty much ignorant of these
restrictions. This used to not matter because we only emitted very
short expressions that we happened to get right by accident.  This
patch makes DwarfExpression aware of the rules defined by the DWARF
standard and now chooses the right kind of location description for
each expression being emitted.

This would have been an NFC commit (for the existing testsuite) if not
for the way that clang describes captured block variables. Based on
how the previous code in LLVM emitted locations, DW_OP_deref
operations that should have come at the end of the expression are put
at its beginning. Fixing this means changing the semantics of
DIExpression, so this patch bumps the version number of DIExpression
and implements a bitcode upgrade.

There are two major changes in this patch:

I had to fix the semantics of dbg.declare for describing function
arguments. After this patch a dbg.declare always takes the *address*
of a variable as the first argument, even if the argument is not an
alloca.

When lowering a DBG_VALUE, the decision of whether to emit a register
location description or a memory location description depends on the
MachineLocation — register machine locations may get promoted to
memory locations based on their DIExpression. (Future) optimization
passes that want to salvage implicit debug location for variables may
do so by appending a DW_OP_stack_value. For example:
  DBG_VALUE, [RBP-8]                        --> DW_OP_fbreg -8
  DBG_VALUE, RAX                            --> DW_OP_reg0 +0
  DBG_VALUE, RAX, DIExpression(DW_OP_deref) --> DW_OP_reg0 +0

All testcases that were modified were regenerated from clang. I also
added source-based testcases for each of these to the debuginfo-tests
repository over the last week to make sure that no synchronized bugs
slip in. The debuginfo-tests compile from source and run the debugger.

https://bugs.llvm.org/show_bug.cgi?id=32382
<rdar://problem/31205000>

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

llvm-svn: 300522
2017-04-18 01:21:53 +00:00
..
X86 [Verifier] Add verification for TBAA metadata 2016-12-11 20:07:15 +00:00
adaptive_global_redzones.ll
asan_address_space_attr.ll [asan] Do not instrument pointers with address space attributes 2016-06-22 00:15:52 +00:00
asan-masked-load-store.ll [ASan] Make ASan instrument variable-masked loads and stores 2017-01-06 15:24:51 +00:00
asan-vs-gvn.ll Do not widen load for different variable in GVN. 2016-09-09 18:42:35 +00:00
basic-msvc64.ll [asan] Support dynamic shadow address instrumentation 2016-09-30 17:46:32 +00:00
basic.ll AddressSanitizer: don't track swifterror memory addresses 2017-02-15 20:43:43 +00:00
debug_info_noninstrumented_alloca2.ll [asan] Speed up compilation of large C++ stringmaps (tons of allocas) with ASan 2016-11-08 21:30:41 +00:00
debug_info_noninstrumented_alloca.ll [asan] Cleanup instrumentation of dynamic allocas 2016-08-20 17:22:27 +00:00
debug_info.ll PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
debug-info-global-var.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
do-not-instrument-globals-darwin.ll [Coverage] Darwin: Move __llvm_covmap from __DATA to __LLVM_COV 2016-10-27 23:17:51 +00:00
do-not-instrument-globals-linux.ll
do-not-instrument-internal-globals.ll
do-not-instrument-profiling-globals.ll [asan] Do not instrument accesses to profiling globals 2016-06-22 17:30:58 +00:00
do-not-instrument-promotable-allocas.ll [asan] Cleanup instrumentation of dynamic allocas 2016-08-20 17:22:27 +00:00
do-not-instrument-sanitizers.ll address comments from: https://reviews.llvm.org/D24566 2016-09-15 15:19:19 +00:00
do-not-touch-comdat-global.ll
do-not-touch-odr-global.ll
do-not-touch-threadlocal.ll
experiment-call.ll
experiment.ll
freebsd.ll opt: Rename -default-data-layout flag to -data-layout and make it always override the layout. 2017-02-17 17:36:52 +00:00
global_cstring_darwin.ll [asan] Move instrumented null-terminated strings to a special section, LLVM part 2016-10-31 18:51:58 +00:00
global_metadata_darwin.ll Revert "[asan] Fix dead stripping of globals on Linux." 2017-04-10 20:36:30 +00:00
global_metadata_windows.ll [asan] Give global metadata private linkage. 2017-04-11 22:28:13 +00:00
global_metadata.ll Revert "[asan] Fix dead stripping of globals on Linux." 2017-04-10 20:36:30 +00:00
instrument_global.ll Revert "[asan] Put ctor/dtor in comdat." 2017-04-10 20:36:36 +00:00
instrument_initializer_metadata.ll
instrument_load_then_store.ll [asan] Delay creation of asan ctor. 2017-04-06 19:55:09 +00:00
instrument-dynamic-allocas.ll [asan] Cleanup instrumentation of dynamic allocas 2016-08-20 17:22:27 +00:00
instrument-no-return.ll
instrument-stack.ll
instrumentation-with-call-threshold.ll
keep_going.ll
lifetime-throw.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
lifetime-uar-uas.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
lifetime.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
local_alias.ll
localescape.ll
ps4.ll [AddressSanitizer] Add PS4 offset 2017-02-23 17:10:28 +00:00
scale-offset.ll [asan] add option to set shadow mapping offset 2016-05-06 10:25:22 +00:00
stack_dynamic_alloca.ll
stack_layout.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
stack-poisoning-and-lifetime-be.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
stack-poisoning-and-lifetime.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00
stack-poisoning.ll [asan] Enable new stack poisoning with store instruction by default 2016-08-29 19:28:34 +00:00
str-nobuiltin.ll [sanitizers] Disable target-specific lowering of string functions. 2016-06-18 10:10:37 +00:00
test64.ll
twice.ll
ubsan.ll