1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

369 Commits

Author SHA1 Message Date
Eric Christopher
44c95476e5 constify a few accessors.
llvm-svn: 203032
2014-03-06 00:00:53 +00:00
Eric Christopher
69cf648667 Add a DIELocList class to handle pointers into the location list.
This enables us to figure out where in the debug_loc section our
locations are so that we can eventually hash them. It also helps
remove some special case code in emission. No functional change.

llvm-svn: 203018
2014-03-05 22:41:20 +00:00
Chandler Carruth
797ae6fd0d [Layering] Move DebugLoc.h into the IR library. The implementation
already lived there and it is where it belongs -- this is the in-memory
debug location representation.

This is just cleanup -- Modules can actually cope with this, but that
doesn't make it right. After chatting with folks that have out-of-tree
stuff, going ahead and moving the rest of the headers seems preferable.

llvm-svn: 202960
2014-03-05 10:30:38 +00:00
Chandler Carruth
cd48c56575 [cleanup] Re-sort all the includes with utils/sort_includes.py.
llvm-svn: 202811
2014-03-04 10:07:28 +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
David Blaikie
1b730f915c 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.

llvm-svn: 201469
2014-02-15 19:34:03 +00:00
David Blaikie
76cef86094 DwarfUnit: Provide a reference to a defining DwarfCompileUnit from DwarfTypeUnit.
Type units need to insert their file strings into the compile unit's
line/file table. This is preliminary work to that end.

llvm-svn: 201196
2014-02-12 00:31:30 +00:00
Eric Christopher
8501a676f4 Make the compile unit map a MapVector so that we can assume a stable
output ordering.

llvm-svn: 200421
2014-01-29 22:06:23 +00:00
Eric Christopher
2b6e161fce Revert r199871 and replace it with a simple check in the debug info
code to see if we're emitting a function into a non-default
text section. This is still a less-than-ideal solution, but more
contained than r199871 to determine whether or not we're emitting
code into an array of comdat sections.

llvm-svn: 200269
2014-01-28 00:49:26 +00:00
Eric Christopher
978cb80bd7 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.

llvm-svn: 199991
2014-01-24 11:52:53 +00:00
Eric Christopher
4f169ecdfb 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.

llvm-svn: 199990
2014-01-24 11:40:29 +00:00
Eric Christopher
c6424df0d3 Make sure we emit a relocation to the debug_ranges section in the
presence of CU ranges.

llvm-svn: 199276
2014-01-15 00:04:29 +00:00
David Blaikie
7af36c3a6d Revert "Revert r198851, "Prototype of skeleton type units for fission""
This reverts commit r198865 which reverts r198851.

ASan identified a use-of-uninitialized of the DwarfTypeUnit::Ty variable
in skeleton type units.

llvm-svn: 198908
2014-01-10 01:38:41 +00:00
NAKAMURA Takumi
d87c5b8748 Revert r198851, "Prototype of skeleton type units for fission"
It caused undefined behavior. DwarfTypeUnit::Ty might not be initialized properly, I guess.

llvm-svn: 198865
2014-01-09 13:08:00 +00:00
David Blaikie
fbb88d8a1f Prototype of skeleton type units for fission
llvm-svn: 198851
2014-01-09 05:08:28 +00:00
David Blaikie
cc6bbc4be1 DwarfDebug: Refactor out common skeleton construction code to be reused for type unit skeletons.
llvm-svn: 198846
2014-01-09 04:28:46 +00:00
David Blaikie
510d8feaa6 DwarfUnit: Rename "Node" to "CUNode" and propagate it through DwarfTypeUnit as well.
Since we'll now also need the split dwarf file name along with the
language in DwarfTypeUnits, just use the whole DICompileUnit rather than
explicitly handling each field needed.

llvm-svn: 198842
2014-01-09 03:23:41 +00:00
David Blaikie
1da0d0e284 Revert "Revert "Debug Info: Type Units: Simplify type hashing using IR-provided unique names.""
This reverts commit r198398, thus reapplying r198397.

I had accidentally introduced an endianness issue when applying the hash
to the type unit. Using support::ulittle64_t in the reinterpret_cast in
addDwarfTypeUnitType fixes this issue.

Original commit message:

Debug Info: Type Units: Simplify type hashing using IR-provided unique
names.

What's good for LTO metadata size problems ought to be good for non-LTO
debug info size too, so let's rely on the same uniqueness in both cases.
If it's insufficient for non-LTO for whatever reason (since we now won't
be uniquing CU-local types or any C types - but these are likely to not
be the most significant contributors to type bloat) we should consider a
frontend solution that'll help both LTO and non-LTO alike, rather than
using DWARF-level DIE-hashing that only helps non-LTO debug info size.

It's also much simpler this way and benefits C++ even more since we can
deduplicate lexically separate definitions of the same C++ type since
they have the same mangled name.

llvm-svn: 198436
2014-01-03 18:59:42 +00:00
David Blaikie
da9c5e06c4 Revert "Debug Info: Type Units: Simplify type hashing using IR-provided unique names."
Reverting due to bot failure I won't have time to investigate until
tomorrow.

This reverts commit r198397.

llvm-svn: 198398
2014-01-03 04:49:04 +00:00
David Blaikie
680e4ef4b3 Debug Info: Type Units: Simplify type hashing using IR-provided unique names.
What's good for LTO metadata size problems ought to be good for non-LTO
debug info size too, so let's rely on the same uniqueness in both cases.
If it's insufficient for non-LTO for whatever reason (since we now won't
be uniquing CU-local types or any C types - but these are likely to not
be the most significant contributors to type bloat) we should consider a
frontend solution that'll help both LTO and non-LTO alike, rather than
using DWARF-level DIE-hashing that only helps non-LTO debug info size.

It's also much simpler this way and benefits C++ even more since we can
deduplicate lexically separate definitions of the same C++ type since
they have the same mangled name.

llvm-svn: 198397
2014-01-03 04:20:26 +00:00
Eric Christopher
2ceb2862cb Revert r198208 and reapply:
r198196: Use a pointer to keep track of the skeleton unit for each normal unit and construct it up front.
      r198199: Reapply r198196 with a fix to zero initialize the skeleton pointer.
      r198202: Fix aranges and split dwarf by ensuring that the symbol and relocation back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo.

with a fix to use integer 0 for DW_AT_low_pc since the relocation to the text section symbol was causing issues with COFF. Accordingly remove addLocalLabelAddress and machinery since we're not currently using it.

llvm-svn: 198222
2013-12-30 17:22:27 +00:00
NAKAMURA Takumi
c905b89ce0 Revert r198199 (and r198202). It broke 3 DebugInfo tests for targeting i686-cygming.
r198196: Use a pointer to keep track of the skeleton unit for each normal unit and construct it up front.
  r198199: Reapply r198196 with a fix to zero initialize the skeleton pointer.
  r198202: Fix aranges and split dwarf by ensuring that the symbol and relocation back to the compile unit from the aranges section is to the skeleton unit and not the one in the dwo.

They could be reproducible with explicit target.

  llvm/lib/MC/WinCOFFObjectWriter.cpp:224: bool {anonymous}::COFFSymbol::should_keep() const: Assertion `Section->Number != -1 && "Sections with relocations must be real!"' failed.

llvm-svn: 198208
2013-12-30 09:26:10 +00:00
Eric Christopher
4a8a28d5d8 Fix aranges and split dwarf by ensuring that the symbol and relocation
back to the compile unit from the aranges section is to the skeleton
unit and not the one in the dwo.

Do this by adding a method to grab a forwarded on local sym and local
section by querying the skeleton if one exists and using that. Add
a few tests to verify the relocations are back to the correct section.

llvm-svn: 198202
2013-12-30 05:25:49 +00:00
David Blaikie
a2d4a79272 DebugInfo: Introduce new DIValue, DIETypeSignature to encode references to type units via their signatures
This simplifies type unit and type unit reference creation as well as
setting the stage for inter-type hashing across type unit boundaries.

llvm-svn: 197539
2013-12-17 23:32:35 +00:00
Eric Christopher
628a7340e7 We never emit info into the macro info section, stop emitting an
empty one.

llvm-svn: 196849
2013-12-10 00:26:10 +00:00
Eric Christopher
50bcf81f5d Rename CompileUnit->DwarfCompileUnit and TypeUnit->DwarfTypeUnit for
clarity. No functional change.

llvm-svn: 196844
2013-12-09 23:57:44 +00:00
Eric Christopher
4191add126 Rename Unit->DwarfUnit to match the file name and make it a bit less
ambiguous. Reformat to match.

llvm-svn: 196838
2013-12-09 23:32:48 +00:00
David Blaikie
b4fa4b53a5 DebugInfo: Include the section and start-of-section label in the unit
This is a precursor to moving type units into the correct (debug_types)
section with comdat groups and full type unit headers.

llvm-svn: 196615
2013-12-06 22:14:48 +00:00
David Blaikie
24e2ea8a35 DebugInfo: Ensure unit IDs (for non-skeletal units) match thein index in the list
This simplifies reasoning about the code and enables simple navigation
from a skeleton to its full unit. (currently there are no type unit
skeletons, so the skeleton list doesn't have the same ID == index
property)

Eventually we should get rid of this ID and just store the labels we
need as the IDs are allowing this code to create difficult to
manage/understand associations (loops over non-skeletal units are
implicitly referencing their skeletal units during pub* emission, for
example). It may be necessary to have some kind of skeleton->full unit
association and a more direct pointer or similar device would be
preferable than an index.

llvm-svn: 196600
2013-12-06 19:38:46 +00:00
Eric Christopher
e62b076d5b Rename DwarfUnits to DwarfFile to help avoid some naming confusion.
llvm-svn: 196519
2013-12-05 18:06:10 +00:00
David Blaikie
042cd582a0 DwarfDebug/DwarfUnit: Push abbreviation structures down into DwarfUnits to reduce duplication
llvm-svn: 196479
2013-12-05 07:43:55 +00:00
David Blaikie
5e586ea3ed DwarfDebug: Avoid unnecessary abbreviation lookup when emitting DIEs
DIEs already contain references directly to their DIEAbbrev, use that
instead of looking it up based on index.

llvm-svn: 196446
2013-12-05 01:01:41 +00:00
David Blaikie
a2745869cd DwarfDebug: Remove trivial function wrapper
llvm-svn: 196445
2013-12-05 01:01:37 +00:00
David Blaikie
7ce191027c DwarfDebug: Reduce code duplication for sec offset emission
llvm-svn: 196414
2013-12-04 21:31:26 +00:00
Eric Christopher
907181fbbb Update comment grammar and contents.
llvm-svn: 196323
2013-12-03 22:05:55 +00:00
Timur Iskhodzhanov
2340a0ee1c Reland 196270 "Generalize debug info / EH emission in AsmPrinter"
Addressing the existense AMDGPUAsmPrinter and other subclasses of AsmPrinter

llvm-svn: 196288
2013-12-03 15:10:23 +00:00
NAKAMURA Takumi
c0b01ff922 Revert r196270, "Generalize debug info / EH emission in AsmPrinter"
It broke CodeGen/R600 tests with +Asserts.

llvm-svn: 196272
2013-12-03 13:15:54 +00:00
Timur Iskhodzhanov
8ce8c7a5d7 Generalize debug info / EH emission in AsmPrinter
llvm-svn: 196270
2013-12-03 12:05:18 +00:00
Eric Christopher
9cdc5dc3f1 Refactor the handling of lexical block and inline scope ranges
into a single function. No functional change.

llvm-svn: 196181
2013-12-03 00:45:59 +00:00
Eric Christopher
05bec0f59b Update doxygen tags.
llvm-svn: 196180
2013-12-03 00:45:56 +00:00
Eric Christopher
e4a344abbf Reorder member function declarations to match source order.
llvm-svn: 196179
2013-12-03 00:45:54 +00:00
Eric Christopher
6532a47d78 Make ranges and range lists be a discrete entity that can be located
and emitted per function and CU. Begins coalescing ranges as a first
class entity through debug info. No functional change.

llvm-svn: 196178
2013-12-03 00:45:45 +00:00
David Blaikie
8f5d7bdcbe DebugInfo: Refactor CompileUnit into a Unit baseclass and CompileUnit/TypeUnit derived classes.
Header/cpp file rename to follow immediately - just splitting out the
commits for ease of review/reading to demonstrate that the renaming
changes are entirely mechanical.

llvm-svn: 196139
2013-12-02 19:33:10 +00:00
David Blaikie
74530dc54e DebugInfo: Type Units: Propagate the correct DW_AT_language into type units.
llvm-svn: 196130
2013-12-02 18:44:29 +00:00
Eric Christopher
1713a7abd0 80-column fixups.
llvm-svn: 195790
2013-11-26 22:23:27 +00:00
David Blaikie
bbf2455d59 DwarfDebug: Include type units in accelerator tables.
Since type units aren't in the CUMap, use the DwarfUnits list to iterate
over units for tasks such as accelerator table building.

llvm-svn: 195776
2013-11-26 19:14:34 +00:00
David Blaikie
221a129b24 DwarfDebug: Move ownership of CompileUnits into DwarfUnits
This avoids the need for an extra list of SkeletonCUs and associated
cleanup while staging things to be cleaner for further type unit
improvements.

Also hopefully fixes a memory leak introduced in r195166.

llvm-svn: 195536
2013-11-23 01:17:34 +00:00
Eric Christopher
b1461615d9 Move member variable up to where the rest of non-DWARF5 variables reside.
llvm-svn: 195380
2013-11-21 22:56:11 +00:00
David Blaikie
7888a33645 CR feedback for r195166: Add comments regarding type unit mapping and type units disabling cross-CU sharing.
Changes suggested by Manman Ren.

llvm-svn: 195262
2013-11-20 18:40:16 +00:00
David Blaikie
e40c1e850f DebugInfo: Partial implementation of DWARF type units.
Emit DW_TAG_type_units into the debug_info section using compile unit
headers. This is bogus/unusable by debuggers, but testable and provides
more isolated review.

Subsequent patches will include support for type unit headers and
emission into the debug_types section, as well as comdat grouping the
types based on their hash. Also the CompileUnit type will be renamed
'Unit' and relevant portions pulled out into respective CompileUnit and
TypeUnit types.

llvm-svn: 195166
2013-11-19 23:08:21 +00:00