1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

2573 Commits

Author SHA1 Message Date
Alexey Samsonov
86bd2c034d Use a single data structure to store all user variables in DwarfDebug
Summary:
Get rid of UserVariables set, and turn DbgValues into MapVector
to get a fixed ordering, as suggested in review for http://reviews.llvm.org/D3573.

Test Plan: llvm regression tests

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D3579

llvm-svn: 207720
2014-04-30 23:02:40 +00:00
David Blaikie
df8ca29906 Revert "Emit DW_AT_object_pointer once, on the declaration, for each function."
Breaks GDB buildbot
(http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/14517)

GCC emits DW_AT_object_pointer /everywhere/ (declaration, abstract
definition, inlined subroutine), but it looks like GCC relies on it
being somewhere other than the declaration, at least. I'll experiment
further & can hopefully still remove it from the inlined_subroutine.

This reverts commit r207705.

llvm-svn: 207719
2014-04-30 22:58:19 +00:00
Joerg Sonnenberger
113e756703 Prepare support of Itanium ABI on ARM as opposed to EHABI by
conditionally emitting .fnstart and friends only for EHABI.

llvm-svn: 207718
2014-04-30 22:43:13 +00:00
David Blaikie
f12b7ea2d9 DebugInfo: Omit DW_AT_artificial on DW_TAG_formal_parameters in DW_TAG_inlined_subroutines.
They just don't need to be there - they're inherited from the abstract
definition. In theory I would like them to be inherited from the
declaration, but the DWARF standard doesn't quite say that... we can
probably do it anyway but I'm less confident about that so I'll leave it
for a separate commit.

llvm-svn: 207717
2014-04-30 22:41:33 +00:00
Alexey Samsonov
8f5245ce6b Convert more loops to range-based equivalents
llvm-svn: 207714
2014-04-30 22:17:38 +00:00
Alexey Samsonov
db1cffce83 Slightly simplify code in DwarfDebug::beginFunction
llvm-svn: 207710
2014-04-30 21:44:17 +00:00
Alexey Samsonov
90773577bb Move logic for calculating DBG_VALUE history map into separate file/class.
Summary: No functionality change.

Test Plan: llvm regression test suite.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: echristo, llvm-commits

Differential Revision: http://reviews.llvm.org/D3573

llvm-svn: 207708
2014-04-30 21:34:11 +00:00
David Blaikie
5560047d31 Emit DW_AT_object_pointer once, on the declaration, for each function.
This effectively reverts r164326, but adds some comments and
justification and ensures we /don't/ emit the DW_AT_object_pointer on
the (abstract and concrete) definitions. (while still preserving it on
standalone definitions involving ObjC Blocks)

This does increase the size of member function declarations from 7 to 11
bytes, unfortunately, but still seems like the Right Thing to do so that
callers that see only the declaration still have the information about
the object pointer. That said, I don't know what, if any, DWARF
consumers don't have a heuristic to guess this in the case of normal
C++ member functions - perhaps we can remove it entirely.

llvm-svn: 207705
2014-04-30 21:29:41 +00:00
Reid Kleckner
1d2b4b0f8f Fix the clang-cl self-host build by defining ~DwarfDebug out of line
DwarfDebug.h has a SmallVector member containing a unique_ptr of an
incomplete type.  MSVC doesn't have key functions, so the vtable and
dtor are emitted in AsmPrinter.cpp, where DwarfDebug's ctor is called.
AsmPrinter.cpp include DwarfUnit.h and doesn't get a complete definition
of DwarfTypeUnit.  We could fix the problem by including DwarfUnit.h in
DwarfDebug.h, but that would increase header bloat.  Instead, define
~DwarfDebug out of line.

llvm-svn: 207701
2014-04-30 20:34:31 +00:00
Alexey Samsonov
307f1e3874 Convert several loops over MachineFunction basic blocks to range-based loops
llvm-svn: 207683
2014-04-30 18:29:51 +00:00
David Blaikie
b630e434da Fix some 80 cols violations committed in r207539
Caught by Eric Christopher in post-commit review.

llvm-svn: 207595
2014-04-29 23:43:06 +00:00
David Blaikie
1fbf8e4869 DwarfDebug: Split the initialization of abstract and non-abstract subprogram DIEs.
These were called from distinct places and had significant distinct
behavior. No need to make that a dynamic check inside the function
rather than just having two functions (refactoring some common code into
a helper function to be called from the two separate functions).

llvm-svn: 207539
2014-04-29 15:58:35 +00:00
David Blaikie
1f2c2892ef Remove DwarfUnit::LabelRange since it's unused.
Seems at some point the intent was to emit fission ranges_base as unique
per CU but the code today emits ranges_base as the start of the ranges
section for all CUs being compiled and all the ranges_base relative
addresses are relative to that. So removing this dead code and leaving
the status quo until there's a reason to change it (perhaps something's
faster if it has distinct ranges for each CU).

llvm-svn: 207464
2014-04-28 23:36:52 +00:00
David Blaikie
e6804866b6 AddressPool::HasBeenUsed: Add comment explaining the use-case for this flag.
Based on code review by Eric Christopher on r207323

llvm-svn: 207460
2014-04-28 22:52:50 +00:00
David Blaikie
f9b06eb99e DIE: Document some learnings about why the world isn't perfect.
llvm-svn: 207458
2014-04-28 22:41:39 +00:00
David Blaikie
93b3fbef79 Satisfy sub-optimal GCC warning.
(Clang doesn't warn here because it knows the string is benign - the
assert still checks what it's intended to - though putting the correct
parens does make clang-format format the code a little better)

llvm-svn: 207456
2014-04-28 22:27:26 +00:00
Eli Bendersky
028d8b328f Add (...) around && clause to appeace gcc 4.8's warning
llvm-svn: 207452
2014-04-28 22:19:12 +00:00
David Blaikie
64838d0189 DebugInfo: Just store the DIE by value in the DwarfUnit
Since all 4 ctor calls in DwarfDebug just pass in a trivially
constructed DIE with the right tag type, sink the tag selection down
into the Dwarf*Unit ctors (removing the argument entirely from callers
in DwarfDebug) and initialize the DIE member in DwarfUnit.

llvm-svn: 207448
2014-04-28 21:14:27 +00:00
David Blaikie
2977225bc4 Pass DIEs to DwarfUnit constructors by unique_ptr.
llvm-svn: 207447
2014-04-28 21:04:29 +00:00
Eric Christopher
a5d10a654c Reformat, 80-col, tab characters, etc.
llvm-svn: 207444
2014-04-28 20:42:22 +00:00
David Blaikie
e15490943b Improve explicit memory ownership of DIEs
Now that the subtle constructScopeDIE has been refactored into two
functions - one returning memory to take ownership of, one returning a
pointer to already owning memory - push unique_ptr through more APIs.

I think this completes most of the unique_ptr ownership of DIEs.

llvm-svn: 207442
2014-04-28 20:36:45 +00:00
David Blaikie
7b4f7635db DwarfDebug: Omit DW_AT_object_pointer on inlined_subroutines
While refactoring out constructScopeDIE into two functions I realized we
were emitting DW_AT_object_pointer in the inlined subroutine when we
didn't need to (GCC doesn't, and the abstract subprogram definition has
the information already).

So here's the refactoring and the bug fix. This is one step of
refactoring to remove some subtle memory ownership semantics. It turns
out the original constructScopeDIE returned ownership in its return
value in some cases and not in others. The split into two functions now
separates those two semantics - further cleanup (unique_ptr, etc) will
follow.

llvm-svn: 207441
2014-04-28 20:27:02 +00:00
Craig Topper
b663bffa27 [C++] Use 'nullptr'.
llvm-svn: 207394
2014-04-28 04:05:08 +00:00
Adrian Prantl
c6c1b378f8 Clarify the doxygen comment for AsmPrinter::EmitDwarfRegOpPiece and add
default arguments to the function.

No functional change.

llvm-svn: 207372
2014-04-27 18:50:45 +00:00
Adrian Prantl
474f0cfd36 Debug info: Refactor EmitDwarfRegOpPiece to be a member function of
AsmPrinter.
No functional change.

http://reviews.llvm.org/D3373
rdar://problem/15928306

llvm-svn: 207369
2014-04-27 18:25:45 +00:00
Adrian Prantl
33815a6326 Debug Info: Prepare DebugLocEntry to handle more than a single value per
entry. This is in preparation for generic DW_OP_piece support.
No functional change so far.

http://reviews.llvm.org/D3373
rdar://problem/15928306

llvm-svn: 207368
2014-04-27 18:25:40 +00:00
Benjamin Kramer
171a3310a4 Make helper functions static.
llvm-svn: 207359
2014-04-27 14:54:59 +00:00
David Blaikie
bcb7340715 Remove redundant explicit default initialization of non-trivially constructed member.
llvm-svn: 207357
2014-04-27 14:47:23 +00:00
NAKAMURA Takumi
4b708bedcf Add the default constructor DwarfAccelTable::DataArray() to initialize (MCSymbol*)StrSym explicitly.
It will fix crash in codegen on msvc x64.

llvm-svn: 207356
2014-04-27 11:59:44 +00:00
David Blaikie
84f56770da DwarfDebug: Roll argument into call.
llvm-svn: 207334
2014-04-26 22:37:45 +00:00
David Blaikie
b12eecfe0b DebugInfo: Fix and test a regression caused by r207263 causing the DW_AT_object_pointer to go missing on blocks
Noticed by inspection. Test coverage added.

llvm-svn: 207333
2014-04-26 22:12:18 +00:00
David Blaikie
25a7c1380d DWARF Type Units: Avoid emitting type units under fission if the type requires an address.
Since there's no way to ensure the type unit in the .dwo and the type
unit skeleton in the .o are correlated, this cannot work.

This implementation is a bit inefficient for a few reasons, called out
in comments.

llvm-svn: 207323
2014-04-26 17:27:38 +00:00
David Blaikie
2cfea484cb DwarfDebug: Minor refactoring around type unit construction
Sinking addition of the declaration attribute down to where the
signature is added. So that if the signature is not added neither is the
declaration attribute (this will come in handy when aborting type unit
construction to instead emit the type into the CU directly in some
cases)

Pull out type unit identifier hashing just to simplify the function a
little, it'll be getting longer.

llvm-svn: 207321
2014-04-26 16:26:41 +00:00
Eric Christopher
0914022daa Make sure that rangelists are also relative to the compile unit
low_pc similar to location lists.

Fixes PR19563

llvm-svn: 207283
2014-04-25 22:23:54 +00:00
David Blaikie
014910bdcb DwarfAccelTable: Store the string symbol in the accelerator table to avoid duplicate lookup.
This also avoids the need for subtly side-effecting calls to manifest
strings in the string table at the point where items are added to the
accelerator tables.

llvm-svn: 207281
2014-04-25 22:21:35 +00:00
David Blaikie
795c9f381d Encapsulate the DWARF string pool in a separate type.
Pulls out some more code from some of the rather monolithic DWARF
classes. Unlike the address table, the string table won't move up into
DwarfDebug - each DWARF file has its own string table (but there can be
only one address table).

llvm-svn: 207277
2014-04-25 21:34:35 +00:00
David Blaikie
c5c1e1ec36 DwarfUnit: Remove unused function
llvm-svn: 207264
2014-04-25 20:02:24 +00:00
David Blaikie
7ce6b4003f DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.
This should reduce the chance of memory leaks like those fixed in
r207240.

There's still some unclear ownership of DIEs happening in DwarfDebug.
Pushing unique_ptr and references through more APIs should help expose
the cases where ownership is a bit fuzzy.

llvm-svn: 207263
2014-04-25 20:00:34 +00:00
David Blaikie
e3e1144d71 DIEEntry: Refer to the specified DIE via reference rather than pointer.
Makes some more cases (the unit tests, specifically), lexically
compatible with a change to unique_ptr.

llvm-svn: 207261
2014-04-25 19:33:43 +00:00
David Blaikie
e5d83756ee DwarfUnit: return by reference from createAndAddDIE
Since this doesn't return ownership (the DIE has been added to the
specified parent already) nor return null, just return by reference.

llvm-svn: 207259
2014-04-25 18:52:29 +00:00
David Blaikie
ad6109fd52 Return DIE by reference instead of pointer from DwarfUnit::getUnitDie
llvm-svn: 207255
2014-04-25 18:35:57 +00:00
David Blaikie
ec60d29162 DwarfUnit: Suddently, DIE references, everywhere.
This'll make changing to unique_ptr ownership of DIEs easier since the
usages will now have '*' on them making them textually compatible
between unique_ptr and raw pointer.

llvm-svn: 207253
2014-04-25 18:26:14 +00:00
David Blaikie
31047da334 Refactor some common logic in DwarfUnit::constructVariableDIE and pass non-null DIE by reference to DbgVariable::setDIE
llvm-svn: 207244
2014-04-25 17:32:19 +00:00
David Blaikie
31058c6eb0 Add missing cpp file header
Code review feedback from Paul Robinson on r207022

llvm-svn: 207198
2014-04-25 06:22:32 +00:00
Craig Topper
c7c3a99ec2 [C++] Use 'nullptr'.
llvm-svn: 207083
2014-04-24 06:44:33 +00:00
David Blaikie
052cdbf046 Remove unused parameter
llvm-svn: 207061
2014-04-24 01:25:10 +00:00
David Blaikie
7e6a431bb1 Remove the intermediate AccelTypes maps in DWARF units.
llvm-svn: 207060
2014-04-24 01:23:49 +00:00
David Blaikie
cba93c7350 Remove the intermediate AccelNamespace maps in DWARF units.
llvm-svn: 207059
2014-04-24 01:02:42 +00:00
David Blaikie
00d0daca29 Remove the intermediate AccelObjC maps in DWARF units
llvm-svn: 207057
2014-04-24 00:53:32 +00:00
David Blaikie
16ac64caec And actually use the DwarfDebug::AccelNames to emit the names.
Fix for r207049 which would've emitted no accelerated names at all...

llvm-svn: 207051
2014-04-23 23:46:25 +00:00