1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

374 Commits

Author SHA1 Message Date
David Blaikie
a8caf93b53 DebugInfo: Use a 64 bit type for the subrange
While we were encoding 64 bit values (data8) in the subrange itself,
using a 32 bit type for the subrange was still confusing the gdb. Oh,
and make it unsigned too.

As the comment points out, this could be pushed into the frontend so
that it would be 32 or 64 bit as appropriate, etc.

llvm-svn: 205512
2014-04-03 06:28:20 +00:00
David Blaikie
034f61d1e5 DebugLocEntry: Actually merge the loc entry when returning true.
Seems we didn't have any test coverage for merging... awesome. So I
added some - but hit an llvm-objdump bug while I was there. I'm choosing
not to shave that yak right now.

Code review feedback/bug catch by Adrian Prantl in r205360.

llvm-svn: 205373
2014-04-01 23:19:23 +00:00
Adrian Prantl
65a4c6a66e DwarfDebug: Prevent DebugLocEntry merging from coalescing two different
constants into only the first one.

rdar://14874886.

llvm-svn: 205357
2014-04-01 21:04:18 +00:00
David Blaikie
99bdb2e6c3 DebugInfo: Avoid creating unnecessary/empty line tables and remove the special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference
This moves one case of raw text checking down into the MCStreamer
interfaces in the form of a virtual function, even if we ultimately end
up consolidating on the one-or-many line tables issue one day, this is
nicer in the interim. This just generally streamlines a bunch of use
cases into a common code path.

llvm-svn: 205287
2014-04-01 08:07:52 +00:00
Eric Christopher
c52b6d9bcf Reorder arguments on test command line to make it easier to cut and
paste.

llvm-svn: 204875
2014-03-26 23:10:28 +00:00
David Blaikie
5563f7c61c DebugInfo: Add GNU_addr_base and GNU_ranges_base only when there are addresses or ranges
Based on code review feedback from Eric in r204672.

llvm-svn: 204702
2014-03-25 05:34:24 +00:00
David Blaikie
c5322af8c2 DebugInfo: Support debug_loc under fission
Implement debug_loc.dwo, as well as llvm-dwarfdump support for dumping
this section.

Outlined in the DWARF5 spec and http://gcc.gnu.org/wiki/DebugFission the
debug_loc.dwo section has more variation than the standard debug_loc,
allowing 3 different forms of entry (plus the end of list entry). GCC
seems to, and Clang certainly, only use one form, so I've just
implemented dumping support for that for now.

It wasn't immediately obvious that there was a good refactoring to share
the implementation of dumping support between debug_loc and
debug_loc.dwo, so they're separate for now - ideas welcome or I may come
back to it at some point.

As per a comment in the code, we could choose different forms that may
reduce the number of debug_addr entries we emit, but that will require
further study.

llvm-svn: 204697
2014-03-25 01:44:02 +00:00
David Blaikie
a69e0d8494 DebugInfo: Add DW_AT_GNU_ranges_base to skeleton CUs
This is used to avoid relocations in the dwo file by allowing
DW_AT_ranges specified in debug_info.dwo to be relative to this base
address. (r204667 implements the base-relative DW_AT_ranges side of
this)

llvm-svn: 204672
2014-03-24 21:31:35 +00:00
David Blaikie
982d05712f DebugInfo: Implement relative addressing for DW_AT_ranges under fission
This removes the debug_ranges relocations from debug_info.dwo (but
doesn't implement the DW_AT_GNU_ranges_base which is also necessary for
correct functioning)

llvm-svn: 204668
2014-03-24 21:07:27 +00:00
David Blaikie
4dbc173911 DebugInfo: Don't emit relocations to abbreviations in debug_info.dwo
llvm-svn: 204667
2014-03-24 20:53:02 +00:00
David Blaikie
612322e43d DebugInfo: Omit DW_AT_addr_base from skeletal type units.
Type units have no addresses, so there's no need for DW_AT_addr_base.
This removes another relocation from every skeletal type unit and brings
LLVM's skeletal type units in line with GCC's (containing only
GNU_dwo_name (strp), comp_dir (strp), and GNU_pubnames (flag_present)).

Cary's got some ideas about using str_index in the .o file to reduce
those last two relocations (well, replace two relocations with one
relocation (pointing to the string index) and two indicies)

llvm-svn: 204506
2014-03-21 20:27:21 +00:00
Rafael Espindola
ff033b836d Convert CodeGen test into a more specific MC test.
llvm-svn: 204406
2014-03-20 22:05:59 +00:00
Rafael Espindola
982d6d0743 Don't use EmitAbsValue with symbol references.
The function exists to force an expression to be absolute, but there it is not
possible to force a symbol reference since

a = b
.long a

means something else.

This is an alternative fix for pr9951 that uses an assert. It then deletes
the old pr9951 test that was testing nothing already.

llvm-svn: 204399
2014-03-20 21:26:38 +00:00
Eric Christopher
17584b9ad3 Reapply DW_AT_low/high_pc patch:
Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc.

    This commit moves us from a single range per subprogram to extending
    ranges if we are:

    a) In the same section, and
    b) In the same enclosing CU.

    This means we have more fine grained ranges for compile units, and fewer
    ranges overall when we have multiple functions in the same CU
    adjacent to each other in the object file.

    Also remove all of the earlier hacks around this functionality for
    function sections etc. Also update all of the testcases to take into
    account the merging functionality.

with a fix for location entries in the debug_loc section:

Make sure that debug loc entries are relative to the low_pc
of the compile unit. This means that when we only have a single
range that the offset should be just relative to the low_pc
of the unit, for multiple ranges for a CU this means that we'll be
relative to 0 which we emit along with DW_AT_ranges.

This mostly shows up with linked binaries, so add a testcase with
multiple CUs so that our location is going to be offset of a CU
with a non-zero low_pc.

llvm-svn: 204377
2014-03-20 19:16:16 +00:00
Eric Christopher
c3d06012dc Revert "Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc."
This appears to trigger failures with optimization and function arguments somehow.

This reverts commit r204277.

llvm-svn: 204286
2014-03-20 00:12:06 +00:00
Eric Christopher
3b9d5414df Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc.
This commit moves us from a single range per subprogram to extending
ranges if we are:

a) In the same section, and
b) In the same enclosing CU.

This means we have more fine grained ranges for compile units, and fewer
ranges overall when we have multiple functions in the same CU
adjacent to each other in the object file.

Also remove all of the earlier hacks around this functionality for
function sections etc. Also update all of the testcases to take into
account the merging functionality.

llvm-svn: 204277
2014-03-19 22:42:36 +00:00
David Blaikie
37f715972a DebugInfo: Use the comp_dir of the referencing type units when building debug_line.dwo
This isn't a complete fix - it falls back to non-comp_dir when multiple
compile units are in play. Adding a map of comp_dir to table is part of
the more general solution, but I gave up (in the short term) when I
realized I'd also have to calculate the size of each type unit so as to
produce correct DW_AT_stmt_list attributes.

llvm-svn: 204202
2014-03-19 00:11:28 +00:00
David Blaikie
1bdbb37386 DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers where opcodes are never used anyway
Introduce a slightly tighter wrapper around the header structure that
handles this use case. (MCDwarfDwoLineTable)

llvm-svn: 204101
2014-03-18 02:13:23 +00:00
David Blaikie
9b1e3d2728 DebugInfo: Implement debug_line.dwo for file names used in type units during -gsplit-dwarf
This removes an attribute (and more importantly, a relocation) from
skeleton type units and removes some unnecessary file names from the
debug_line section that remains in the .o (and linked executable) file.

There's still a few places we could shave off some more space here:

* use compilation dir of the underlying compilation unit (since all the
  type units share that compilation dir - though this would be more
  complicated in LTO cases where they don't (keep a map of compilation
  dir->line table header?))

* Remove some of the unnecessary header fields from the line table since
  they're not needed in this situation (about 12 bytes per table).

llvm-svn: 204099
2014-03-18 01:17:26 +00:00
Benjamin Kramer
0ca2e11cf6 Use a fixed subtarget for test so atom scheduling can't change the addresses this test relies on.
llvm-svn: 204014
2014-03-15 23:01:29 +00:00
Eric Christopher
f15e1e16b6 Remove command line option for CU hashing. This is on by default now.
Fix up testcases and use of flag.

llvm-svn: 203973
2014-03-14 21:20:07 +00:00
Eric Christopher
fc22ad9058 Use DW_AT_linkage_name when we're emitting DWARF4 or above.
llvm-svn: 203867
2014-03-13 23:26:25 +00:00
NAKAMURA Takumi
c1d16970f9 decl-derived-member.ll: Try to unbreak. Don't add -mtriple to %llc_dwarf.
llvm-svn: 203732
2014-03-12 23:08:19 +00:00
Rafael Espindola
b70064af24 Add a triple to fix the test on OS X.
llvm-svn: 203706
2014-03-12 20:21:35 +00:00
Eric Christopher
12c67979c6 Fix two thinkos in testcase and remove XFAIL.
llvm-svn: 203702
2014-03-12 20:12:02 +00:00
Eric Christopher
949ee245a6 XFAIL this temporarily.
llvm-svn: 203698
2014-03-12 19:06:03 +00:00
Eric Christopher
eb8fe0a36b Move test to X86 only for now.
llvm-svn: 203697
2014-03-12 19:02:44 +00:00
Eric Christopher
4729f8d18e Turn on hashing by default for split dwarf compile units.
llvm-svn: 203680
2014-03-12 17:14:43 +00:00
David Blaikie
da7909c4f3 DebugInfo: Refactor emitDebugPubNames/Types into a common implementation
I could fold the callers into their one call site, but the indirection
(given how verbose choosing the section is) seemed helpful.

The use of a member function pointer's a bit "tricky", but seems limited
enough, the call sites are simple/clean/clear, and there's only one use.

llvm-svn: 203619
2014-03-11 23:18:15 +00:00
David Blaikie
e3178db361 DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in DW_TAG_lexical_blocks
Suggested by Adrian Prantl in code review for r203187

llvm-svn: 203323
2014-03-08 00:58:20 +00:00
Eric Christopher
80a592a1d1 Add support for hashing location information for CU level hashes.
Add a testcase based on sret.cpp where we can now hash the entire
compile unit.

llvm-svn: 203319
2014-03-08 00:29:41 +00:00
Adrian Prantl
23506b3069 Remove unnecessary test for Darwin and update testcase to be a little less
horrible/fragile.
rdar://problem/16264854

llvm-svn: 203309
2014-03-07 23:07:21 +00:00
David Blaikie
e57a2d324f DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in inlined functions
Suggested by Adrian Prantl in code review for r203187.

llvm-svn: 203296
2014-03-07 22:00:56 +00:00
David Blaikie
2ef4fd17f2 DebugInfo: Update test to cover linux (with a FIXME...) too
llvm-svn: 203295
2014-03-07 22:00:49 +00:00
David Blaikie
ea464a2965 DebugInfo: Limit r203187 to non-darwin as lldb can't handle this yet
llvm-svn: 203192
2014-03-07 02:19:41 +00:00
David Blaikie
1c5776f5d1 DebugInfo: Emit DW_TAG_subprogram's DW_AT_high_pc as an offset from the low_pc
This removes a relocation from each subprogram, reducing link times,
etc.

llvm-svn: 203187
2014-03-07 01:30:55 +00:00
David Blaikie
9bd80912d2 DebugInfo: Refactor test to not rely on fixed DIE offsets
llvm-svn: 203186
2014-03-07 01:19:31 +00:00
David Blaikie
dc5decf857 DebugInfo: Improve test to not depend on the specific naming of temporary symbols
llvm-svn: 203184
2014-03-07 00:23:38 +00:00
David Blaikie
be06bbe6e6 DebugInfo: Tag units as having been indexed in GNU pubnames by using a DW_AT_GNU_pubnames of DW_FORM_flag(_present) rather than sec_offsets to the pubnames/types sections
This is consistent with GDB ToT and reduces the number of relocations in
(type and compile) units, substantially reducing relocations and debug
size in fission + type units builds.

llvm-svn: 203082
2014-03-06 05:47:39 +00:00
David Blaikie
2958850616 DebugInfo: Shrink pubnames/pubtypes in the presence of type units by only emitting pub sections for compile units
llvm-svn: 203057
2014-03-06 01:42:00 +00:00
Diego Novillo
1a32bcb47d Add DWARF discriminator support to DILexicalBlocks.
This adds support for emitting discriminators from DILexicalBlocks.

llvm-svn: 202736
2014-03-03 18:53:17 +00:00
Adrian Prantl
d7f77dd966 Debug info: Remove ARMAsmPrinter::EmitDwarfRegOp(). AsmPrinter can now
scan the register file for sub- and super-registers.
No functionality change intended.

(Tests are updated because the comments in the assembler output are
different.)

llvm-svn: 202416
2014-02-27 17:56:08 +00:00
Eric Christopher
2a887e3673 If we're only emitting line tables for a particular CU then don't add
any ranges to the list of ranges for the CU as we don't want to emit
them anyway. This ensures that we will still emit ranges if we have
a compile unit compiled with only line tables and one compiled with
full debug info requested (we'll emit for the one with full debug info).

Update testcase metadata accordingly to continue emitting ranges.

llvm-svn: 202333
2014-02-27 01:25:00 +00:00
David Blaikie
164f6a50be DwarfDebug: Avoid emitting an empty debug_aranges section when aranges are disabled
llvm-svn: 202201
2014-02-25 22:46:44 +00:00
Adrian Prantl
e6ef3933bb Address review comments for r202188.
This is refactoring / simplifying code, updating comments and enabling the
testcase on non-x86 platforms.

No functionality change.

llvm-svn: 202199
2014-02-25 22:27:14 +00:00
Adrian Prantl
29da3d7c51 Debug info: Support variadic functions.
Variadic functions have an unspecified parameter tag after the last
argument. In IR this is represented as an unspecified parameter in the
subroutine type.

Paired commit with CFE r202185.

rdar://problem/13690847

This re-applies r202184 + a bugfix in DwarfDebug's argument handling.

llvm-svn: 202188
2014-02-25 19:57:42 +00:00
Adrian Prantl
a1b5446967 Revert "Debug info: Support variadic functions."
This reverts commit r202184 because of buildbot breakage.

llvm-svn: 202187
2014-02-25 19:48:36 +00:00
Adrian Prantl
66323c33b4 Debug info: Support variadic functions.
Variadic functions have an unspecified parameter tag after the last
argument. In IR this is represented as an unspecified parameter in the
subroutine type.

Paired commit with CFE.

rdar://problem/13690847

llvm-svn: 202184
2014-02-25 19:38:07 +00:00
Eric Christopher
eb6b7bc131 Add support for hashing attributes with DW_FORM_block. This required
passing down an AsmPrinter instance so we could compute the size of
the block which could be target specific. All of the test cases in
the unittest don't have any target specific data so we can use a NULL
AsmPrinter there. This also depends upon block data being added as
integers.

We can now hash the entire fission-cu.ll compile unit so turn the
flag on there with the hash value.

llvm-svn: 201752
2014-02-20 02:50:45 +00:00
Eric Christopher
7ab56547e5 Add a DIELoc class to cover the DW_FORM_exprloc set of expressions
alongside DIEBlock and replace uses accordingly. Use DW_FORM_exprloc
in DWARF4 and later code. Update testcases.

Adding a DIELoc instead of using extra forms inside DIEBlock so
that we can keep location expressions separate from other uses. No
direct use at the moment, however, it's not a lot of code and
using a separately named class keeps it somewhat more obvious
what's going on in various locations.

llvm-svn: 201481
2014-02-16 08:46:55 +00:00