Commit Graph

348 Commits

Author SHA1 Message Date
Eric Christopher
2aeb92e640 Move test to X86 only for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203697 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 19:02:44 +00:00
Eric Christopher
020026c5f6 Turn on hashing by default for split dwarf compile units.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203680 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 17:14:43 +00:00
David Blaikie
e98b0e466f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203619 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 23:18:15 +00:00
David Blaikie
5af111c380 DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in DW_TAG_lexical_blocks
Suggested by Adrian Prantl in code review for r203187

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203323 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-08 00:58:20 +00:00
Eric Christopher
b1c8844101 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-08 00:29:41 +00:00
Adrian Prantl
bd86fbe0d7 Remove unnecessary test for Darwin and update testcase to be a little less
horrible/fragile.
rdar://problem/16264854

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203309 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 23:07:21 +00:00
David Blaikie
9623e46f00 DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in inlined functions
Suggested by Adrian Prantl in code review for r203187.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203296 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 22:00:56 +00:00
David Blaikie
0afacf185d DebugInfo: Update test to cover linux (with a FIXME...) too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203295 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 22:00:49 +00:00
David Blaikie
4b102527fa DebugInfo: Limit r203187 to non-darwin as lldb can't handle this yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203192 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 02:19:41 +00:00
David Blaikie
34fa5640b8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203187 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 01:30:55 +00:00
David Blaikie
e2bb4f48ad DebugInfo: Refactor test to not rely on fixed DIE offsets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 01:19:31 +00:00
David Blaikie
63557bfbfb DebugInfo: Improve test to not depend on the specific naming of temporary symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 00:23:38 +00:00
David Blaikie
ca8b562f2d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203082 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 05:47:39 +00:00
David Blaikie
4b2ab80c3e DebugInfo: Shrink pubnames/pubtypes in the presence of type units by only emitting pub sections for compile units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203057 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 01:42:00 +00:00
Diego Novillo
6f8c0c0613 Add DWARF discriminator support to DILexicalBlocks.
This adds support for emitting discriminators from DILexicalBlocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 18:53:17 +00:00
Adrian Prantl
4bd26ae070 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.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202416 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 17:56:08 +00:00
Eric Christopher
14ec6808c4 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202333 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 01:25:00 +00:00
David Blaikie
889b1299a7 DwarfDebug: Avoid emitting an empty debug_aranges section when aranges are disabled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202201 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 22:46:44 +00:00
Adrian Prantl
35989a76ac Address review comments for r202188.
This is refactoring / simplifying code, updating comments and enabling the
testcase on non-x86 platforms.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202199 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 22:27:14 +00:00
Adrian Prantl
dbaa6ab8b5 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 19:57:42 +00:00
Adrian Prantl
9791b3f9ae Revert "Debug info: Support variadic functions."
This reverts commit r202184 because of buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202187 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 19:48:36 +00:00
Adrian Prantl
c6d0a14a78 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 19:38:07 +00:00
Eric Christopher
31dd38ed2f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201752 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-20 02:50:45 +00:00
Eric Christopher
0cefb0ecbc 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201481 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-16 08:46:55 +00:00
David Blaikie
132a287941 DebugInfo: Deduplicate entries in the fission address table
This broke in r185459 while TLS support was being generalized to handle
non-symbol TLS representations.

I thought about/tried having an enum rather than a bool to track the
TLS-ness of the address table entry, but namespaces and naming seemed
more hassle than it was worth for only one caller that needed to specify
this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201469 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-15 19:34:03 +00:00
David Blaikie
4b45137a4f DebugInfo: Implement DW_AT_stmt_list for type units
Type units will share the statement list of their defining compile unit.
This is a tradeoff that reduces .o debug info size at the cost of some
linked debug info size (since the contents of those string tables won't
be deduplicated along with the type unit) which seems right for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201445 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 23:58:13 +00:00
David Blaikie
c4e1b13b08 DebugInfo: Don't include the name of the CU file in the line table file list when it's unneeded
Recommitting r201380 (reverted in r201389)
Recommitting r201351 and r201355 (reverted in r201351 and r201355)

We weren't emitting the an empty (header only) line table when the line
table was empty - this made the DWARF invalid (the compile unit would
point to the zero-size debug_lines section where there should've been an
empty line table but there was nothing at all). Fix that, and as a
consequence this works around/addresses PR18809.

Also, we emit a non-empty line table to workaround a darwin linker bug,
so XFAILing on darwin too.

Also, mark the test as 'REQUIRES: object-emission' because it does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201429 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 19:51:35 +00:00
Diego Novillo
837c54fa7b Support DWARF discriminators in object streamer.
Summary:
This adds support for emitting DWARF path discriminator values in
the object streamer. It also changes the DWARF dumper to show
discriminator values in the line table output.

Reviewers: echristo

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2794

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201427 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 19:27:53 +00:00
Eric Christopher
89eb5dc65d Revert "DebugInfo: Don't include the name of the CU file in the line table file list when it's unneeded"
This reverts commit r201380 for now while we investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 05:33:16 +00:00
David Blaikie
35d2f61510 DebugInfo: Don't include the name of the CU file in the line table file list when it's unneeded
Recommitting r201351 and r201355 (reverted in r201351 and r201355)

We weren't emitting the an empty (header only) line table when the line
table was empty - this made the DWARF invalid (the compile unit would
point to the zero-size debug_lines section where there should've been an
empty line table but there was nothing at all). Fix that, and as a
consequence this works around/addresses PR18809.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201380 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 01:57:59 +00:00
Eric Christopher
5483012b4d Disable emission of aranges by default and add a command line
option to enable again that will be matched with a commit to enable
in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201378 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14 01:26:55 +00:00
NAKAMURA Takumi
fa9ce5c791 Tweak llvm/test/DebugInfo/X86/generate-odr-hash.ll corresponding to r201351 (Revert r201187).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201355 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 18:28:28 +00:00
David Blaikie
e53b2aceda DebugInfo: Demonstrate that we're not currently uniquing address table entries in fission
Since I just discovered this while poking at other things, here's the
test case so I have it to come back to later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201267 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 23:03:54 +00:00
David Blaikie
2964013680 DebugInfo: Merge fission and non-fission (and 32 and 64 bit) tests for TLS support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201266 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 23:03:51 +00:00
Adrian Prantl
4c1ea6b115 Debug info: Bugfix for r201190: DW_OP_piece takes bytes, not bits.
rdar://problem/16015314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201253 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 19:34:44 +00:00
David Blaikie
9a0eced3af DwarfUnit: Include type unit's file strings in the defining compile unit's file_names table
There's still one piece missing here, which is adding the
DW_AT_stmt_list to the type unit that refer's to the compile unit's line
table. Working on that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201198 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-12 00:40:47 +00:00
Adrian Prantl
e48e9419ea Reapply r201180 with an additional error path.
Debug info: Emit values in subregisters that do not have a separate
DWARF register number by emitting a super-register + DW_OP_bit_piece.
This is necessary because on x86_64, there are no DWARF register numbers
for i386-style subregisters.
Fixes a bunch of FIXMEs.

rdar://problem/16015314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201190 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 22:22:15 +00:00
Adrian Prantl
20d5e1b247 Revert "Debug info: Emit values in subregisters that do not have a separate"
This reverts commit r201179 for buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 22:03:30 +00:00
Adrian Prantl
f4f80ebbc7 Debug info: Emit values in subregisters that do not have a separate
DWARF register number by emitting a super-register + DW_OP_bit_piece.
This is necessary because on x86_64, there are no DWARF register numbers
for i386-style subregisters.
Fixes a bunch of FIXMEs.

rdar://problem/16015314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201180 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 21:22:59 +00:00
David Blaikie
cec7ce78d7 DebugInfo: Remove some unneeded conditionals now that DIBuilder no longer emits zero-length arrays as {i32 0}
A bunch of test cases needed to be cleaned up for this, many my fault -
when implementid imported modules I updated test cases by simply
duplicating the prior metadata field - which wasn't always the empty
metadata entry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200731 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-04 01:23:52 +00:00
David Blaikie
0451736fc9 DebugInfo: Flag type unit references as declarations
This ensures DWARF consumers don't confuse these references for
definitions. I'd argue it might be nice to improve debuggers so we don't
need this, but it's just one field in an abbreviation anyway - so it
doesn't seem worth the fight.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200569 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 19:52:26 +00:00
Timur Iskhodzhanov
ab42578bdd Reland r200340 - 'Add line table debug info to COFF files when using a win32 triple'
This incorporates a couple of fixes reviewed at http://llvm-reviews.chandlerc.com/D2651

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200440 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-30 01:39:17 +00:00
Eric Christopher
c55cb498c9 If we use DW_AT_ranges we need to specify a base address that ranges
are relative to in the compile unit. Currently let's just use 0...

Thanks to Greg Clayton for the catch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200425 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-29 22:22:56 +00:00
Eric Christopher
c879504978 Turn on CU ranges if we've got multiple compile units in the same
module since there's no range guarantee that we could make given
output order. This also fixes up the testcases that have multiple
CUs to have the correct range offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200422 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-29 22:06:27 +00:00
NAKAMURA Takumi
52de969206 Revert r200340, "Add line table debug info to COFF files when using a win32 triple."
It was incompatible with --target=i686-win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200375 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-29 06:05:38 +00:00
Timur Iskhodzhanov
38afdbea2c Add line table debug info to COFF files when using a win32 triple.
Reviewed at http://llvm-reviews.chandlerc.com/D2232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200340 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-28 21:33:27 +00:00
Alp Toker
ae43cab6ba Fix known typos
Sweep the codebase for common typos. Includes some changes to visible function
names that were misspelt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200018 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24 17:20:08 +00:00
Eric Christopher
e47a1d72f7 Revert "Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a"
in order to fix the cygwin/mingw bots.

This reverts commit r199990.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199991 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24 11:52:53 +00:00
Eric Christopher
a268ba84d7 Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a
compile unit. Make these relocations on the platforms that need
relocations and add a routine to ensure that we don't put the
addresses in an offset table for split dwarf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199990 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24 11:40:29 +00:00
Eric Christopher
2f9fe10f6f Make the use of DW_AT_ranges in the compile unit depend also upon
the existence of comdat/special sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199954 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-23 22:55:47 +00:00