Commit Graph

35 Commits

Author SHA1 Message Date
Frederic Riss
6c54948916 Update dwarf::ApplePropertyAttributes enum to meaningful values.
Summary:
We currently emit an DW_AT_APPLE_property_attribute with a value that is a
bitfield describing the various attributes applied to an ObjectiveC property.
While trying to add testing to one of my dwarfdump patches that would pretty
print that, I realized this information looks totally broken and has maybe
never been correct.

As with every DWARF info, we have some enum in Dwarf.h that describes this
attribute (enum ApplePropertyAttributes). It seems however that the attribute
value is set from another definition of these flags in Sema/DeclSpec.h (enum
ObjCPropertyAttributeKind). And these 2 enums aren't in sync.

This patch updates the Dwarf.h values to the ones we are (and have been for
a very long time) emitting. We change some publicly (and even documented
in SourceLevelDebugging.rst) values, but I doubt this could be an issue as
the information has been wrong for so long...

Reviewers: echristo, dblaikie, aprantl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219311 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08 14:59:44 +00:00
Duncan P. N. Exon Smith
f13b76b94f DI: Fixup global syntax in example
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219056 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-04 15:44:01 +00:00
Duncan P. N. Exon Smith
1225b7a30a DI: Line up comments in examples
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219055 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-04 15:35:25 +00:00
Duncan P. N. Exon Smith
a472e864de DI: Fixup example IR from r219051
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219054 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-04 15:31:08 +00:00
Duncan P. N. Exon Smith
c48707aec8 DI: Prune another example
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219053 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-04 15:30:52 +00:00
Duncan P. N. Exon Smith
ffd2f5051e DI: Update and prune metadata examples
Update a couple of the examples of debug info metadata, and prune the
rest.  Point to the true reference implementation in the source.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219051 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-04 14:56:56 +00:00
Duncan P. N. Exon Smith
83902832de Revert "Revert "DI: Fold constant arguments into a single MDString""
This reverts commit r218918, effectively reapplying r218914 after fixing
an Ocaml bindings test and an Asan crash.  The root cause of the latter
was a tightened-up check in `DILexicalBlock::Verify()`, so I'll file a
PR to investigate who requires the loose check (and why).

Original commit message follows.

--

This patch addresses the first stage of PR17891 by folding constant
arguments together into a single MDString.  Integers are stringified and
a `\0` character is used as a separator.

Part of PR17891.

Note: I've attached my testcases upgrade scripts to the PR.  If I've
just broken your out-of-tree testcases, they might help.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219010 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-03 20:01:09 +00:00
Duncan P. N. Exon Smith
32e192aeb3 Revert "DI: Fold constant arguments into a single MDString"
This reverts commit r218914 while I investigate some bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218918 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-02 22:15:31 +00:00
Duncan P. N. Exon Smith
0917b70630 DI: Fold constant arguments into a single MDString
This patch addresses the first stage of PR17891 by folding constant
arguments together into a single MDString.  Integers are stringified and
a `\0` character is used as a separator.

Part of PR17891.

Note: I've attached my testcases upgrade scripts to the PR.  If I've
just broken your out-of-tree testcases, they might help.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218914 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-02 21:56:57 +00:00
Adrian Prantl
02474a32eb Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.

Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.

By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.

The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)

This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.

What this patch doesn't do:

This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.

http://reviews.llvm.org/D4919
rdar://problem/17994491

Thanks to dblaikie and dexonsmith for reviewing this patch!

Note: I accidentally committed a bogus older version of this patch previously.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:55:02 +00:00
Adrian Prantl
10c4265675 Revert r218778 while investigating buldbot breakage.
"Move the complex address expression out of DIVariable and into an extra"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218782 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 18:10:54 +00:00
Adrian Prantl
076fd5dfc1 Move the complex address expression out of DIVariable and into an extra
argument of the llvm.dbg.declare/llvm.dbg.value intrinsics.

Previously, DIVariable was a variable-length field that has an optional
reference to a Metadata array consisting of a variable number of
complex address expressions. In the case of OpPiece expressions this is
wasting a lot of storage in IR, because when an aggregate type is, e.g.,
SROA'd into all of its n individual members, the IR will contain n copies
of the DIVariable, all alike, only differing in the complex address
reference at the end.

By making the complex address into an extra argument of the
dbg.value/dbg.declare intrinsics, all of the pieces can reference the
same variable and the complex address expressions can be uniqued across
the CU, too.
Down the road, this will allow us to move other flags, such as
"indirection" out of the DIVariable, too.

The new intrinsics look like this:
declare void @llvm.dbg.declare(metadata %storage, metadata %var, metadata %expr)
declare void @llvm.dbg.value(metadata %storage, i64 %offset, metadata %var, metadata %expr)

This patch adds a new LLVM-local tag to DIExpressions, so we can detect
and pretty-print DIExpression metadata nodes.

What this patch doesn't do:

This patch does not touch the "Indirect" field in DIVariable; but moving
that into the expression would be a natural next step.

http://reviews.llvm.org/D4919
rdar://problem/17994491

Thanks to dblaikie and dexonsmith for reviewing this patch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218778 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01 17:55:39 +00:00
David Blaikie
c7260209a8 Use DILexicalBlockFile, rather than DILexicalBlock, to track discriminator changes to ensure discriminator changes don't introduce new DWARF DW_TAG_lexical_blocks.
Somewhat unnoticed in the original implementation of discriminators, but
it could cause instructions to end up in new, small,
DW_TAG_lexical_blocks due to the use of DILexicalBlock to track
discriminator changes.

Instead, use DILexicalBlockFile which we already use to track file
changes without introducing new scopes, so it works well to track
discriminator changes in the same way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216239 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 22:45:21 +00:00
David Blaikie
1bb69f17d8 Correct the emission kind constants committed in r214771
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214772 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 20:36:00 +00:00
David Blaikie
b00cca00f4 Document the "emission kind" field of the DICompileUnit in LLVM's Source Level Debugging metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214771 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 20:32:48 +00:00
Adrian Prantl
2a39c993eb Debug info: Infrastructure to support debug locations for fragmented
variables (for example, by-value struct arguments passed in registers, or
large integer values split across several smaller registers).
On the IR level, this adds a new type of complex address operation OpPiece
to DIVariable that describes size and offset of a variable fragment.
On the DWARF emitter level, all pieces describing the same variable are
collected, sorted and emitted as DWARF expressions using the DW_OP_piece
and DW_OP_bit_piece operators.

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

What this patch doesn't do / Future work:
- This patch only adds the backend machinery to make this work, patches
  that change SROA and SelectionDAG's type legalizer to actually create
  such debug info will follow. (http://reviews.llvm.org/D2680)
- Making the DIVariable complex expressions into an argument of dbg.value
  will reduce the memory footprint of the debug metadata.
- The sorting/uniquing of pieces should be moved into DebugLocEntry,
  to facilitate the merging of multi-piece entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214576 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 22:11:58 +00:00
Adrian Prantl
93b97c9a57 Debug info: split out complex DIVariable address expressions into a
separate MDNode so they can be uniqued via folding set magic. To conserve
space, DIVariable nodes are still variable-length, with the last two
fields being optional.

No functional change.
http://reviews.llvm.org/D3526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212050 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 17:17:35 +00:00
Jeroen Ketema
503447efba [docs] Fix typo, align comments, fix syntax highlighting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210462 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09 10:12:29 +00:00
Adrian Prantl
5e8144df32 Switch the type field in DIVariable and DIGlobalVariable over to DITypeRefs.
This allows us to catch more opportunities for ODR-based type uniquing
during LTO.
Paired commit with CFE which updates some testcases to verify the new
DIBuilder behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204106 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-18 02:34:58 +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
Alp Toker
087ab613f4 Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:44:44 +00:00
Benjamin Kramer
d59761480e Fix common typos in the docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 17:53:27 +00:00
Bill Wendling
1a57aa4367 Update to current output.
PR14039

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193494 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-27 04:50:34 +00:00
Manman Ren
33f4c796ac Add unique identifier field to Composite Types and Format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 17:07:49 +00:00
David Blaikie
61212bcaff Debug Info: Update documentation to match recent (& not so recent) schema changes
This updates the debug info metadata schema documentation for various
schema changes made recently surrounding filename information for
scopes and the representation of imported entities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-29 02:05:13 +00:00
Eric Christopher
61e0b78d78 Formatting fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 23:10:26 +00:00
Eric Christopher
afa288de50 Make the fields in the diagram match the descriptive text above them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177314 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 20:21:47 +00:00
Dmitri Gribenko
4913680168 Documentation: correct syntax (one missing comma, one extra comma)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175375 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 20:07:40 +00:00
Eric Christopher
34760ee55f This is actually located at the end, not the middle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 07:22:25 +00:00
Chris Lattner
2ba4bd97d1 remove the rest of the "written by" lines in the documentation. It is
against the developer policy to include this sort of thing as SVN blame
already captures this in a far more fine-grained way.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 21:24:04 +00:00
Eric Christopher
9a1e0e252a Remove the llvm-local DW_TAG_vector_type tag and add a test to
make sure that vector types do work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171833 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 01:53:52 +00:00
Eric Christopher
72a81be374 Remove what appears to be a dead llvm-specific debug tag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171821 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-08 00:16:33 +00:00
David Blaikie
92f09170aa Documentation updates for pointer-to-member debug info added in r171698.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 06:02:07 +00:00
Eli Bendersky
00a3e5e724 Some grammar fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 00:27:25 +00:00
Dmitri Gribenko
bbef5ead4c Documentation: convert SourceLevelDebugging.html to reST
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168493 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-22 11:56:02 +00:00