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

150 Commits

Author SHA1 Message Date
Adrian Prantl
e6b30cee57 Remove support for DIVariable's FlagIndirectVariable and expect
frontends to use a DIExpression with a DW_OP_deref instead.

This is not only a much more natural place for this informationl; there
is also a technical reason: The FlagIndirectVariable is used to mark a
variable that is turned into a reference by virtue of the calling
convention; this happens for example to aggregate return values.
The inliner, for example, may actually need to undo this indirection to
correctly represent the value in its new context. This is impossible to
implement because the DIVariable can't be safely modified. We can however
safely construct a new DIExpression on the fly.

llvm-svn: 226476
2015-01-19 17:57:29 +00:00
Chandler Carruth
0b619fcc8e [cleanup] Re-sort all the #include lines in LLVM using
utils/sort_includes.py.

I clearly haven't done this in a while, so more changed than usual. This
even uncovered a missing include from the InstrProf library that I've
added. No functionality changed here, just mechanical cleanup of the
include order.

llvm-svn: 225974
2015-01-14 11:23:27 +00:00
David Blaikie
51a4f6a794 Provide gmlt-like inline scope information in the skeleton CU to facilitate symbolication without needing the .dwo files
Clang -gsplit-dwarf self-host -O0, binary increases by 0.0005%, -O2,
binary increases by 25%.

A large binary inside Google, split-dwarf, -O0, and other internal flags
(GDB index, etc) increases by 1.8%, optimized build is 35%.

The size impact may be somewhat greater in .o files (I haven't measured
that much - since the linked executable -O0 numbers seemed low enough)
due to relocations. These relocations could be removed if we taught the
llvm-symbolizer to handle indexed addressing in the .o file (GDB can't
cope with this just yet, but GDB won't be reading this info anyway).
Also debug_ranges could be shared between .o and .dwo, though ideally
debug_ranges would get a schema that could used index(+offset)
addressing, and move to the .dwo file, then we'd be back to sharing
addresses in the address pool again.

But for now, these sizes seem small enough to go ahead with this.

Verified that no other DW_TAGs are produced into the .o file other than
subprograms and inlined_subroutines.

llvm-svn: 221306
2014-11-04 22:12:25 +00:00
David Blaikie
74faf3ecee Use common range handling for the CU's ranges
This generalizes the range handling for ranges in both the skeleton and
full unit, laying the foundation for the addition of more ranges (rather
than just the CU's special case) in the skeleton CU with fission+gmlt.

llvm-svn: 221202
2014-11-03 23:10:59 +00:00
David Blaikie
d52ffe9078 Push the CURangeList down into the skeleton CU (where available) rather than the full CU
So that it may be shared between skeleton/full compile unit, for CU
ranges and other ranges to be added for fission+gmlt.

(at some point we might want some kind of object shared between the
skeleton and full compile units for all those things we only want one of
in that scope, rather than having the full unit always look through to
the skeleton... - alternatively, we might be able to have the skeleton
pointer (or another, separate pointer) point to the skeleton or to the
unit itself in non-fission, so we don't have to special case its
absence)

llvm-svn: 221186
2014-11-03 21:52:56 +00:00
David Blaikie
63db855d26 Add DwarfCompileUnit::BaseAddress to track the base address used by relative addressing in debug_ranges and debug_loc
This is one of a few steps to generalize range handling to include the
CU range (thus the CU's range list will be moved into the range list
list, losing track of the base address in the process), which means
generalizing ranges from both the skeleton and full unit under fission.

And... then I can used that generalized support for ranges in
fission+gmlt where there'll be a bunch more ranges in the skeleton.

llvm-svn: 221182
2014-11-03 21:15:30 +00:00
David Blaikie
13ae175ea5 Cleanup some unused or trivial functions in DwarfCompileUnit
llvm-svn: 221164
2014-11-03 17:10:38 +00:00
David Blaikie
5ec0b37419 Sink DwarfUnit::CURanges into DwarfCompileUnit
llvm-svn: 221161
2014-11-03 16:40:43 +00:00
David Blaikie
904a6c8687 Sink range list handling down from DwarfUnit into its only use, in DwarfCompileUnit.
llvm-svn: 221123
2014-11-03 02:41:49 +00:00
David Blaikie
cc391f34cf Add DwarfUnit::isDwoUnit and use it to generalize string creation
Currently we only need to emit skeleton strings into the CU header and
we do this by explicitly calling "addLocalString". With gmlt-in-fission,
we'll be emitting a bunch of other strings from other codepaths where
it's not statically known that these strings will be local or not.

Introduce a virtual function to indicate whether this unit is a DWO unit
or not (I'm not sure if we have a good term for this, the
opposite/alternative to 'skeleton' unit) and use that to generalize the
string emission logic so that strings can be correctly emitted in both
the skeleton and dwo unit when in split dwarf mode.

And to demonstrate that this works, switch the existing special callers
of addLocalString in the skeleton builder to addString - and they still
work. Yay.

llvm-svn: 221094
2014-11-02 08:51:37 +00:00
David Blaikie
bb5b8ec235 Sink DwarfUnit::applySubprogramAttributesToDefinition into DwarfCompileUnit
llvm-svn: 221092
2014-11-02 08:09:09 +00:00
David Blaikie
17a3519bc0 Sink DwarfUnit::addExpr into DwarfCompileUnit
llvm-svn: 221090
2014-11-02 07:11:55 +00:00
David Blaikie
96c3f13e27 Sink DwarfUnit::applyVariableAttributes into DwarfCompileUnit
llvm-svn: 221088
2014-11-02 07:06:51 +00:00
David Blaikie
abebe0162c Sink DwarfUnit::addLocationList down into DwarfCompileUnit
llvm-svn: 221087
2014-11-02 07:03:19 +00:00
David Blaikie
aadd810834 Sink DwarfUnit::addComplexAddress down into DwarfCompileUnit
llvm-svn: 221086
2014-11-02 06:58:44 +00:00
David Blaikie
d6a9a46935 Push DwarfUnit::addAddress down into DwarfCompileUnit
llvm-svn: 221085
2014-11-02 06:46:40 +00:00
David Blaikie
33c9b0d67b Sink DwarfUnit::addVariableAddress into DwarfCompileUnit since type units don't have variables
llvm-svn: 221084
2014-11-02 06:37:23 +00:00
David Blaikie
9a1d2d413e DebugInfo: Sink accelerator table lists down (GlobalNames/Types) into DwarfCompileUnit
llvm-svn: 221083
2014-11-02 06:16:39 +00:00
David Blaikie
530359d196 Don't bother creating LabelBegin for .dwo units
This would help catch cases where we might otherwise try to reference a
dwo CU label, which would be weird - because without relocations in the
dwo file it's not generally meaningful to talk about the CU offsets
there (or, if it is, we can do so in absolute terms without using a
relocation to compute it).

llvm-svn: 221078
2014-11-02 02:26:24 +00:00
David Blaikie
e89a2104cf Drop DwarfCompileUnit::getLocalLabel* in favor of just mapping through the skeleton explicitly.
Confusing to do this two different ways - I'm not too wedded to either
one, but here goes.

llvm-svn: 221076
2014-11-02 01:21:43 +00:00
David Blaikie
795e1a2a21 Sink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place it's needed.
llvm-svn: 221075
2014-11-02 01:21:40 +00:00
David Blaikie
44f17e492d Sink dwarf unit length emission down into DwarfUnit::emitHeader
This allows the CU label to be emitted only for compile units, as
they're the only ones that need it (so they can be referenced from
pubnames)

llvm-svn: 221072
2014-11-01 23:59:23 +00:00
David Blaikie
f36a454c35 Remove DwarfUnit::LabelEnd in favor of computing the length of the section directly
This was a compile-unit specific label (unused in type units) and seems
unnecessary anyway when we can more easily directly compute the size of
the compile unit.

llvm-svn: 221067
2014-11-01 23:07:14 +00:00
David Blaikie
21e8ef20de Sink DwarfUnit::SectionSym into DwarfCompileUnit as it's only needed/used there.
llvm-svn: 221062
2014-11-01 20:06:28 +00:00
David Blaikie
e011711e85 Make DwarfCompileUnit::Skeleton more narrowly typed (DwarfCompileUnit* instead of DwarfUnit*) now that it's specific to DwarfCompileUnit anyway.
llvm-svn: 221060
2014-11-01 19:26:05 +00:00
David Blaikie
1c7f7fe885 Sink DwarfUnit::Skeleton down into DwarfCompileUnit
Type units no longer have skeletons and it's misleading to be able to
query for a type unit's skeleton (it might incorrectly lead one to
conclude that if a unit doesn't have a skeleton it's not in a .dwo
file... ).

llvm-svn: 221055
2014-11-01 18:18:07 +00:00
David Blaikie
bc2a3611cd Add DwarfCompileUnit::getSkeleton that returns DwarfCompileUnit* to avoid having to cast from DwarfUnit* on every call.
llvm-svn: 221031
2014-11-01 00:50:34 +00:00
David Blaikie
1e29b40b41 Sink some of DwarfDebug::collectDeadVariables down into DwarfCompileUnit.
llvm-svn: 221010
2014-10-31 22:30:30 +00:00
David Blaikie
da34a7bac5 Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE into DwarfCompileUnit
llvm-svn: 221005
2014-10-31 21:57:02 +00:00
Frederic Riss
1a2ce34071 Sink DwarfUnit::constructImportedEntityDIE into DwarfCompileUnit.
So that it has access to getOrCreateGlobalVariableDIE. If we ever support
decsribing using directive in C++ classes (thus requiring support in type
units), it will certainly use another mechanism anyway.

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

llvm-svn: 220594
2014-10-24 21:31:09 +00:00
David Blaikie
6a3e82d728 Sink the per-CU part of DwarfDebug::finishSubprogramDefinitions into DwarfCompileUnit.
llvm-svn: 219477
2014-10-10 06:39:29 +00:00
David Blaikie
39b2185feb Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE down into DwarfCompileUnit.
llvm-svn: 219476
2014-10-10 06:39:26 +00:00
David Blaikie
5cc331ae79 Sink DwarfDebug::createAndAddScopeChildren down into DwarfCompileUnit.
llvm-svn: 219437
2014-10-09 20:26:15 +00:00
David Blaikie
6e8ade1095 Sink DwarfDebug::constructSubprogramScopeDIE down into DwarfCompileUnit
llvm-svn: 219436
2014-10-09 20:21:36 +00:00
David Blaikie
477f8cb9ba Sink DwarfDebug::createScopeChildrenDIE down into DwarfCompileUnit.
llvm-svn: 219422
2014-10-09 18:24:28 +00:00
David Blaikie
c7aba518d5 Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
llvm-svn: 219419
2014-10-09 17:56:39 +00:00
David Blaikie
78c64030db Move DwarfUnit::constructVariableDIE down to DwarfCompileUnit, since it's only needed there.
llvm-svn: 219418
2014-10-09 17:56:36 +00:00
David Blaikie
06c6662b4d Sink DwarfDebug::constructLexicalScopeDIE into DwarfCompileUnit
llvm-svn: 219414
2014-10-09 17:08:42 +00:00
David Blaikie
1a81b6999c Sink DwarfDebug::constructInlinedScopeDIE into DwarfCompileUnit
This introduces access to the AbstractSPDies map from DwarfDebug so
DwarfCompileUnit can access it. Eventually this'll sink down to
DwarfFile, but it'll still be generically accessible - not much
encapsulation to provide it. (constructInlinedScopeDIE could stay
further up, in DwarfFile to avoid exposing this - but I don't think
that's particularly better)

llvm-svn: 219411
2014-10-09 16:50:53 +00:00
David Blaikie
4e189e100b Push DwarfDebug::attachRangesOrLowHighPC down into DwarfCompileUnit
llvm-svn: 219372
2014-10-09 00:21:42 +00:00
David Blaikie
f2869de8da Sink DwarfDebug::addScopeRangeList down into DwarfCompileUnit
(& add a few accessors/make a couple of things public for this - it's a
bit of a toss-up, but I think I prefer it this way, keeping some more of
the meaty code down in DwarfCompileUnit - if only to make for smaller
implementation files, etc)

I think we could simplify range handling a bit if we removed the range
lists from each unit and just put a single range list on DwarfDebug,
similar to address pooling.

llvm-svn: 219370
2014-10-09 00:11:39 +00:00
David Blaikie
86080e417c Sink DwarfUnit::addSectionDelta into DwarfCompileUnit, the only place it's needed.
llvm-svn: 219364
2014-10-08 23:30:05 +00:00
David Blaikie
802d562b37 Sink and coalesce DwarfDebug.cpp::addSectionLabel and DwarfUnit::addSectionLabel down into DwarfCompileUnit::addSectionLabel
llvm-svn: 219351
2014-10-08 22:46:27 +00:00
David Blaikie
c48de79313 Push DwarfDebug::constructScopeDIE down into DwarfCompileUnit
One of many steps to generalize subprogram emission to both the DWO and
non-DWO sections (to emit -gmlt-like data under fission). Once the
functions are pushed down into DwarfCompileUnit some of the data
structures will be pushed at least into DwarfFile so that they can be
unique per-file, allowing emission to both files independently.

llvm-svn: 219345
2014-10-08 22:20:02 +00:00
David Blaikie
0eef1c005d Sink DwarfDebug::updateSubprogramScopeDIE into DwarfCompileUnit
This requires exposing some of the current function state from
DwarfDebug. I hope there's not too much of that to expose as I go
through all the functions, but it still seems nicer to expose singular
data down to multiple consumers, than have consumers expose raw mapping
data structures up to DwarfDebug for building subprograms.

Part of a series of refactoring to allow subprograms in both the
skeleton and dwo CUs under Fission.

llvm-svn: 219060
2014-10-04 16:24:00 +00:00
David Blaikie
c691131ef4 Sink DwarfDebug::attachLowHighPC into DwarfCompileUnit
One of many things to sink down into DwarfCompileUnit to allow handling
of subprograms in both the skeleton and dwo CU under Fission.

llvm-svn: 219058
2014-10-04 15:58:47 +00:00
David Blaikie
7bf1cb9a67 Move DwarfCompileUnit from DwarfUnit.h to its own header (DwarfCompileUnit.h)
In preparation for sinking all the subprogram emission code down from
DwarfDebug into DwarfCompileUnit, this will avoid bloating
DwarfUnit.h/cpp greatly and make concerns a bit more clear/isolated.

(sinking this handling down is part of the work to handle emitting
minimal subprograms for -gmlt-like data into the skeleton CU under
fission)

llvm-svn: 219057
2014-10-04 15:49:50 +00:00
David Blaikie
c06b6fc581 DebugInfo: Rename DwarfCompileUnit.* to DwarfUnit.* to match their contents.
llvm-svn: 196140
2013-12-02 19:33:15 +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
Eric Christopher
1713a7abd0 80-column fixups.
llvm-svn: 195790
2013-11-26 22:23:27 +00:00