1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
llvm-mirror/test/Bitcode
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
..
Inputs Bitcode: Introduce BitcodeWriter interface. 2016-11-29 20:43:47 +00:00
2006-12-11-Cast-ConstExpr.ll
2009-06-11-FirstClassAggregateConstant.ll
aggregateInstructions.3.2.ll
aggregateInstructions.3.2.ll.bc
anon-functions.ll
arm32_neon_vcnt_upgrade.ll
atomic.ll
attributes-3.3.ll
attributes-3.3.ll.bc
attributes.ll
auto_upgrade_intrinsics.bc
avr-calling-conventions.ll
avr-calling-conventions.ll.bc
binaryFloatInstructions.3.2.ll
binaryFloatInstructions.3.2.ll.bc
binaryIntInstructions.3.2.ll
binaryIntInstructions.3.2.ll.bc
bitcode-wrapper-header-armv7m.ll
bitcode-wrapper-header-x86_64.ll
bitwiseInstructions.3.2.ll
bitwiseInstructions.3.2.ll.bc
blockaddress.ll
calling-conventions.3.2.ll
calling-conventions.3.2.ll.bc
case-ranges-3.3.ll
case-ranges-3.3.ll.bc
cmpxchg-upgrade.ll
cmpxchg-upgrade.ll.bc
cmpxchg.3.6.ll
cmpxchg.3.6.ll.bc
compatibility-3.6.ll Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly 2017-03-25 20:20:23 +00:00
compatibility-3.6.ll.bc
compatibility-3.7.ll Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly 2017-03-25 20:20:23 +00:00
compatibility-3.7.ll.bc
compatibility-3.8.ll Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly 2017-03-25 20:20:23 +00:00
compatibility-3.8.ll.bc
compatibility-3.9.ll Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly 2017-03-25 20:20:23 +00:00
compatibility-3.9.ll.bc [Bitcode] Add compatibility test for the 3.9 release 2016-09-09 17:24:31 +00:00
compatibility-4.0.ll Change the default attributes for llvm.prefetch to inaccessiblemem_or_argmemonly 2017-03-25 20:20:23 +00:00
compatibility-4.0.ll.bc [Bitcode] Add compatibility test for the 4.0 release 2017-03-17 17:53:26 +00:00
compatibility.ll [IR] Add AllowContract to FastMathFlags 2017-03-28 20:11:52 +00:00
constantsTest.3.2.ll
constantsTest.3.2.ll.bc
conversionInstructions.3.2.ll
conversionInstructions.3.2.ll.bc
debug-loc-again.ll
DICompileUnit-no-DWOId.ll
DICompileUnit-no-DWOId.ll.bc
DIExpression-4.0.ll [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
DIExpression-4.0.ll.bc [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
DIExpression-aggresult.ll PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
DIExpression-aggresult.ll.bc PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
DIExpression-deref.ll PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
DIExpression-deref.ll.bc PR32382: Fix emitting complex DWARF expressions. 2017-04-18 01:21:53 +00:00
diglobalvariable-3.8.ll [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
diglobalvariable-3.8.ll.bc [IR] Remove the DIExpression field from DIGlobalVariable. 2016-12-20 02:09:43 +00:00
DIGlobalVariableExpression2.ll Fix bitcode upgrade for DIGlobalVariables with a var: field. 2017-02-08 17:44:43 +00:00
DIGlobalVariableExpression2.ll.bc Fix bitcode upgrade for DIGlobalVariables with a var: field. 2017-02-08 17:44:43 +00:00
DIGlobalVariableExpression.ll Fix the bitcode upgrade for DIGlobalVariable in a DIImportedEntity context. 2017-02-07 17:35:41 +00:00
DIGlobalVariableExpression.ll.bc Fix the bitcode upgrade for DIGlobalVariable in a DIImportedEntity context. 2017-02-07 17:35:41 +00:00
dilocalvariable-3.9.ll DebugInfo: add bitcode upgrade test for alignment 2016-10-26 08:34:19 +00:00
dilocalvariable-3.9.ll.bc DebugInfo: add bitcode upgrade test for alignment 2016-10-26 08:34:19 +00:00
DILocalVariable-explicit-tags.ll
DILocalVariable-explicit-tags.ll.bc
DINamespace.ll Add DWARF debug info support for C++11 inline namespaces. 2016-11-03 19:42:02 +00:00
DINamespace.ll.bc Add DWARF debug info support for C++11 inline namespaces. 2016-11-03 19:42:02 +00:00
DISubprogram-distinct-definitions.ll
DISubprogram-distinct-definitions.ll.bc
dityperefs-3.8.ll Fix the bitcode upgrade for DIGlobalVariable in a DIImportedEntity context. 2017-02-07 17:35:41 +00:00
dityperefs-3.8.ll.bc
drop-debug-info.3.5.ll
drop-debug-info.3.5.ll.bc
extractelement.ll
fcmp-fast.ll
flags.ll
function-encoding-rel-operands.ll
function-local-metadata.3.5.ll
function-local-metadata.3.5.ll.bc
global-variables.3.2.ll
global-variables.3.2.ll.bc
highLevelStructure.3.2.ll
highLevelStructure.3.2.ll.bc
identification.ll
inalloca.ll
invalid.ll
invalid.ll.bc
invalid.test Bitcode: Introduce initial multi-module reader API. 2016-11-16 21:44:45 +00:00
linkage-types-3.2.ll
linkage-types-3.2.ll.bc
local-linkage-default-visibility.3.4.ll
local-linkage-default-visibility.3.4.ll.bc
mdnodes-distinct-in-post-order.ll Add an index for Module Metadata record in the bitcode 2016-12-28 22:30:28 +00:00
mdnodes-distinct-nodes-break-cycles.ll Add an index for Module Metadata record in the bitcode 2016-12-28 22:30:28 +00:00
mdnodes-distinct-nodes-first.ll Add an index for Module Metadata record in the bitcode 2016-12-28 22:30:28 +00:00
mdnodes-in-post-order.ll Add an index for Module Metadata record in the bitcode 2016-12-28 22:30:28 +00:00
mdstring-high-bits.ll
memInstructions.3.2.ll
memInstructions.3.2.ll.bc
metadata-2.ll
metadata-function-blocks.ll Add an index for Module Metadata record in the bitcode 2016-12-28 22:30:28 +00:00
metadata-only-empty-string.ll
metadata-strings.ll
metadata.3.5.ll
metadata.3.5.ll.bc
metadata.ll
miscInstructions.3.2.ll
miscInstructions.3.2.ll.bc
module_hash.ll
multi-module.ll Bitcode: Add a more comprehensive multi-module test now that we have both llvm-cat and llvm-modextract. 2016-11-29 21:55:09 +00:00
null-type.ll Bitcode: Introduce initial multi-module reader API. 2016-11-16 21:44:45 +00:00
null-type.ll.bc
old-aliases.ll
old-aliases.ll.bc
operand-bundles-bc-analyzer.ll
operand-bundles.ll
padding.test
pr18704.ll
pr18704.ll.bc
PR23310.test
ptest-new.ll
ptest-old.ll
select.ll
shuffle.ll
source-filename.test
ssse3_palignr.ll
standardCIntrinsic.3.2.ll
standardCIntrinsic.3.2.ll.bc
summary_version.ll [ThinLTO] Subsume all importing checks into a single flag 2017-01-05 14:32:16 +00:00
tailcall.ll
terminatorInstructions.3.2.ll
terminatorInstructions.3.2.ll.bc
thinlto-alias2.ll [ThinLTO] Record calls to aliases 2016-10-08 16:11:42 +00:00
thinlto-alias.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-empty-summary-section.ll [ThinLTO] Always emit a summary when compiling in ThinLTO mode 2016-09-20 23:07:17 +00:00
thinlto-function-summary-callgraph-pgo.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-function-summary-callgraph-profile-summary.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-function-summary-callgraph.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-function-summary-originalnames.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-function-summary-refgraph.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-function-summary.ll Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
thinlto-summary-globalvar.ll
thinlto-summary-linkage-types.ll
thinlto-summary-section.ll [ThinLTO] Subsume all importing checks into a single flag 2017-01-05 14:32:16 +00:00
thinlto-type-tests.ll IR: Function summary representation for type tests. 2016-12-21 23:03:45 +00:00
thinlto-type-vcalls.ll IR: Function summary extensions for whole-program devirtualization pass. 2017-02-10 22:29:38 +00:00
thinlto-unused-type-tests.ll IR: Function summary representation for type tests. 2016-12-21 23:03:45 +00:00
upgrade-debug-info-for-profiling.ll Change debug-info-for-profiling from a TargetOption to a function attribute. 2017-02-01 22:45:09 +00:00
upgrade-debug-info-for-profiling.ll.bc Change debug-info-for-profiling from a TargetOption to a function attribute. 2017-02-01 22:45:09 +00:00
upgrade-global-ctors.ll
upgrade-global-ctors.ll.bc
upgrade-loop-metadata.ll
upgrade-loop-metadata.ll.bc
upgrade-module-flag.ll Fix autoupgrade logic for Objective-C class properties module flag 2016-09-16 00:38:18 +00:00
upgrade-pointer-address-space.ll [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
upgrade-pointer-address-space.ll.bc [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types 2017-03-08 23:55:44 +00:00
upgrade-subprogram-this.ll
upgrade-subprogram-this.ll.bc
upgrade-subprogram.ll
upgrade-subprogram.ll.bc
upgrade-tbaa.ll
use-list-order2.ll
use-list-order.ll
variableArgumentIntrinsic.3.2.ll
variableArgumentIntrinsic.3.2.ll.bc
vectorInstructions.3.2.ll
vectorInstructions.3.2.ll.bc
visibility-styles.3.2.ll
visibility-styles.3.2.ll.bc
vst-forward-declaration.ll
weak-cmpxchg-upgrade.ll
weak-cmpxchg-upgrade.ll.bc
weak-macho-3.5.ll
weak-macho-3.5.ll.bc