1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/DebugInfo/Generic
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
..
2009-10-16-Phi.ll
2009-11-03-InsertExtractValue.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2009-11-05-DeadGlobalVariable.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
2009-11-06-NamelessGlobalVariable.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
2009-11-10-CurrentFn.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-01-05-DbgScope.ll Verifier: Disallow a line number without a file in DISubprogram 2017-02-17 23:57:42 +00:00
2010-03-12-llc-crash.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-03-19-DbgDeclare.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-03-24-MemberFn.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-04-06-NestedFnDbgInfo.ll Reverting 268054 & 268063 as they caused PR27579. 2016-04-30 01:44:07 +00:00
2010-04-19-FramePtr.ll DWARF: Omit DW_AT_APPLE attributes (except ObjC ones) when not targeting LLDB 2016-05-24 21:19:28 +00:00
2010-05-03-DisableFramePtr.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-05-03-OriginDIE.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-05-10-MultipleCU.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
2010-06-29-InlinedFnLocalVar.ll Relax test so that it passes on OS X. 2017-02-02 22:08:25 +00:00
2010-10-01-crash.ll DebugInfo: Emit ranges for functions with DISubprograms but lacking locations on any instructions 2016-12-15 23:17:52 +00:00
accel-table-hash-collisions.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
array.ll Relax test so that it passes on OS X. 2017-02-02 22:08:25 +00:00
block-asan.ll PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
bug_null_debuginfo.ll testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
constant-pointers.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
constant-sdnodes-have-dbg-location.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
constantfp-sdnodes-have-dbg-location.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
cross-cu-inlining.ll [DWARF] Force a linkage_name on an inlined subprogram's abstract origin. 2016-04-18 22:41:41 +00:00
cross-cu-linkonce-distinct.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
cross-cu-linkonce.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
cu-range-hole.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
cu-ranges.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
dbg-at-specficiation.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
dead-argument-order.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
debug-info-always-inline.ll
debug-info-qualifiers.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
debuginfofinder-forward-declaration.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
debuginfofinder-inlined-cu.ll [StripDeadDebug/DIFinder] Track inlined SPs 2017-04-11 13:32:11 +00:00
debuginfofinder-multiple-cu.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
def-line.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
discriminator.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
dwarf-public-names.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
empty.ll Speculatively revert r289925, see PR31407 2016-12-16 14:02:28 +00:00
enum-types.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
enum.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
global.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
gmlt_profiling.ll Remove XFAIL for test/DebugInfo/Generic/gmlt_profiling.ll 2017-02-01 23:28:55 +00:00
gmlt.test Refactor the gmlt tests. (NFC) 2017-02-02 01:21:13 +00:00
gvn.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
incorrect-variable-debugloc1.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
incorrect-variable-debugloc.ll [TBAAVerifier] Be stricter around verifying scalar nodes 2016-12-29 15:47:05 +00:00
indvar-discriminator.ll [IndVarSimplify][DebugLoc] When widening the exit loop condition, correctly reuse the debug location of the original comparison. 2016-10-26 10:28:32 +00:00
inheritance.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
inline-debug-info-multiret.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
inline-debug-info.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
inline-debug-loc.ll [InlineFunction] Do not propagate the callsite debug location to instructions inlined from functions with debug info. 2016-12-07 10:37:26 +00:00
inline-no-debug-info.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
inline-scopes.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
inlined-arguments.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
inlined-vars.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
instcombine-phi.ll [InstCombine] Folding of a compare with RHS const should merge debug locations 2016-12-14 20:27:22 +00:00
invalid.ll [IR/Verifier] Don't visit DISubprograms more than needed. 2017-02-18 03:02:44 +00:00
licm-hoist-debug-loc.ll [DWARF] Null out the debug locs of (loop invariant) instructions hoisted by LICM in 2017-01-06 18:38:57 +00:00
linkage-name-abstract.ll [DWARF] Put linkage-name on abstract origin even when there's a declaration. 2016-12-02 01:55:17 +00:00
lit.local.cfg
location-verifier.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
lto-comp-dir.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
mainsubprogram.ll [DebugInfo] Add support for DW_AT_main_subprogram on subprograms 2016-11-28 21:32:19 +00:00
member-order.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
member-pointers.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
missing-abstract-variable.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
multiline.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
namespace_function_definition.ll [DWARF] Force a linkage_name on an inlined subprogram's abstract origin. 2016-04-18 22:41:41 +00:00
namespace_inline_function_definition.ll [DWARF] Force a linkage_name on an inlined subprogram's abstract origin. 2016-04-18 22:41:41 +00:00
namespace.ll [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
nodebug.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
noscopes.ll DebugInfo: Make a Generic test case actually generic (remove datalayout/triple) 2016-12-15 23:39:25 +00:00
piece-verifier.ll [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
PR20038.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
ptrsize.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
recursive_inlining.ll [TBAAVerifier] Be stricter around verifying scalar nodes 2016-12-29 15:47:05 +00:00
restrict.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
simplifycfg_sink_last_inst.ll [DebugInfo] Handle same locations in DILocation::getMergedLocation 2017-01-12 20:34:35 +00:00
skeletoncu.ll Unxfail passing tests on Hexagon 2016-08-19 15:07:58 +00:00
store-tail-merge.ll Merge DebugLoc on combined stores; in this case, when combining stores 2017-02-06 22:19:04 +00:00
sugared-constants.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
sunk-compare.ll Preserve the debug location when CodeGenPrepare sinks a compare instruction into the 2016-10-06 21:43:45 +00:00
template-recursive-void.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
tu-composite.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
tu-member-pointer.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
two-cus-from-same-file.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
typedef.ll Renumber testcase metadata nodes after r290153. 2016-12-22 00:45:21 +00:00
unconditional-branch.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
varargs.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
version.ll [PR27284] Reverse the ownership between DICompileUnit and DISubprogram. 2016-04-15 15:57:41 +00:00
virtual-index.ll DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00