Commit Graph

579 Commits

Author SHA1 Message Date
Manman Ren
b8e48a636e Debug Info: In DIBuilder, the context field of subprogram is updated to use
DIScopeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192378 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-10 18:40:01 +00:00
Manman Ren
75a3ad485c Add comments to debug info testing case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192376 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-10 18:13:17 +00:00
Manman Ren
b4d9c11f6c Debug Info: In DIBuilder, the context and type fields of template_type and
template_value are updated to use DIRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 19:46:28 +00:00
Manman Ren
5e5d494ce0 Debug Info: In DIBuilder, the context field of a forward decl is updated
to use DIScopeRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192309 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 18:10:55 +00:00
Manman Ren
456e5e5521 Debug Info: In DIBuilder, the context field of a DICompositeType is updated
to use DIScopeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192256 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 00:17:04 +00:00
Manman Ren
b6f74f0668 Debug Info: In DIBuilder, the context fields of a static member and a
typedef are updated to use DIScopeRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 23:49:38 +00:00
Manman Ren
c1e2b2582c Debug Info: In DIBuilder, the derived-from field of DICompositeType
is updated to use DITypeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 23:28:51 +00:00
Manman Ren
78c2f9b8cf Debug Info: In DIBuilder, the derived-from field of DIDerivedType
is updated to use DITypeRef.

A paired commit at clang is required due to changes to DIBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192246 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 22:56:31 +00:00
Manman Ren
875857953f Debug Info: update testing to reflect r192018.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 20:06:43 +00:00
Adrian Prantl
d79f6f786a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192158 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 02:30:54 +00:00
Adrian Prantl
a204ac9e90 typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192157 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 02:28:20 +00:00
Adrian Prantl
82c7414448 Reduce testcase from 1r92011.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-08 02:21:44 +00:00
Adrian Prantl
eacbfd1d51 Debug info: Don't crash in SelectionDAGISel when a vreg that is being
pointed to by a dbg_value belonging to a function argument is eliminated
during instruction selection.
rdar://problem/15094721.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192011 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 00:08:27 +00:00
Eric Christopher
371d95851a Use addFlag to add the enum class attribute.
This has the side effect of using DW_FORM_flag_present on dwarf4 and above.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191991 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 22:40:10 +00:00
Rafael Espindola
47e1c700bf Fix this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 14:53:58 +00:00
David Blaikie
c32f2332b0 DebugInfo: Fix ordering of members after r191928
In the case (shown in the attached test) where a member function
definition was emitted into debug info the following could occur:

1) build the debug info for the member function definition
2) in (1), build the debug info for the member function declaration
3) construct and add the member function declaration DIE
4) add it to its context
5) build its context (the type it is a member of)
6) construct the members and add them to the type
7) except don't add member functions because "getOrCreateSubprogram"
adds the function to its parent anyway
8) except we're only partway through building this subprogram
declaration so it hasn't been added yet - but we returned the partially
constructed DIE (since it's already in the MDNode->DIE mapping to avoid
infinitely recursing trying to create the member function DIE)
9) once the type is constructed, add the member function to it
10) now the members are out of order (the member function being defined
is listed as the last member, even though it was declared as the first)

To avoid this, construct the context of the subprogram DIE before we
query to see if it exists. That way we never end up creating it before
creating its context and ending up in this situation.

Alternatively, the type construction that visits/builds all the members
could call something like getOrCreateSubprogram, but that doesn't ever
do the "add to context" step. Then the type building code would always
be responsible for adding members (and the subprogram "addToContextDIE"
would no-op because the context building would have added the subprogram
declaration to the type/context DIE already).

(the test cases updated were overly-sensitive to offsets or abbreviation
numbers. We don't have a nice way to make these tests more robust as yet
- multiline FileCheck matches would be required)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 01:39:59 +00:00
Richard Mitton
7c9659a3b2 Fixed a bug with section names containing special characters.
Changed the dwarf aranges code to not use getLabelEndName, as it turns out it's not reliable to call that given user-defined section names. Section names can have characters in that aren't representable as symbol names.

The dwarf-aranges test case has been updated to include a special character, to check this.

This fixes pr17416.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 22:07:08 +00:00
Eric Christopher
45fae28db7 Make sure we emit a section for pubnames even if that section is
going to be empty. This is particularly important for the gnu
pubnames case since we're emitting a relocation to the section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 17:41:20 +00:00
Alexey Samsonov
9d08d69fd4 Remove wild .debug_aranges entries generated from unimportant labels
r191052 added emitting .debug_aranges to Clang, but this
functionality is broken: it uses all MC labels added in DWARF Asm
printer, including the labels for build relocations between
different DWARF sections, like .Lsection_line or .Ldebug_loc0.

As a result, if any DIE .debug_info would contain "DW_AT_location=0x123"
attribute, .debug_aranges would also contain a range starting from 0x123,
breaking tools that rely on this section.

This patch fixes this by using only MC labels that corresponds to the
addresses in the user program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191884 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 08:54:43 +00:00
Eric Christopher
451c71d67b Add the DW_AT_GNU_ranges_base attribute if we've emitted any ranges
into the debug_ranges section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191721 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 00:43:36 +00:00
Eric Christopher
a6d841561b The DW_AT_GNU_pubnames/pubtypes attributes are actually form
SEC_OFFSET from the beginning of the section so go ahead and emit
a label at the beginning of each one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191710 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 23:14:16 +00:00
Eric Christopher
c839df0e4c Unify pubsection/gnu pubsection printing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191407 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-25 23:02:36 +00:00
David Blaikie
9ddf28d501 llvm-dwarfdump support for gnu_pubtypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 19:50:00 +00:00
Eric Christopher
3d2c90f6dd Add namespaces to the list of items that we expose via pubnames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191257 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:17:57 +00:00
Eric Christopher
7a6ae29cdb Regenerate testcase from source.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191256 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:17:54 +00:00
David Blaikie
cb21ba8e76 Make dwarfdump-type-units.test order-independent
The order in which the comdat type unit sections appear in the output is
unspecified and may vary from machine to machine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191253 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-24 00:13:23 +00:00
Eric Christopher
5a63474e2d Add more external types to the pubtypes table. Expand the asm
checking patch until we get full dumping support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191239 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 23:15:58 +00:00
David Blaikie
438f5391b2 llvm-dwarfdump/libDebugInfo support for type units
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191234 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 22:44:47 +00:00
Eric Christopher
cdeaae4f75 Handle gnu pubtypes sections:
a) Make sure we are emitting the correct section in our section labels
when we begin the module.
b) Make sure we are emitting the correct pubtypes section in the
presence of gnu pubtypes.
c) For C++ struct, union, class, and enumeration types are default
external.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191225 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 20:55:35 +00:00
Richard Mitton
eb46def978 Fixed debug_aranges handling for common symbols.
The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols.

.comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section.

Test case update to account for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191210 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 17:56:20 +00:00
NAKAMURA Takumi
023d90edb0 Initialize BSSSection explicitly in InitMachOMCObjectFileInfo() to appease msvc.
This can revert r191087.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191128 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 02:34:45 +00:00
Eric Christopher
9e0b08dd20 Move emission of the debug string table to early in the debug
info finalization to greatly reduce the number of fixups that the
assembler has to handle in order to improve compile time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191119 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 23:22:52 +00:00
NAKAMURA Takumi
d338788a49 llvm/test: Mark 3 tests as XFAIL:msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191087 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 12:57:34 +00:00
Benjamin Kramer
17111ad920 Move x86-dependent tests into the right directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-20 10:56:40 +00:00
David Blaikie
5cfcb3677a DebugInfo: constrain gnu pubnames test further
Ensures that the pubnames entries actually refer to the intended
entities. This test could be more flexible if there was a way to do
multiline FileCheck matches with captures (in that way the test wouldn't
need to have hardcoded offset values and would thus be resilient to
changes in the layout of the DIEs in this CU).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191055 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:43:46 +00:00
Richard Mitton
5cc319a42a Added support for generate DWARF .debug_aranges sections automatically.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191052 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:21:01 +00:00
David Blaikie
994c37fcb0 DebugInfo: llvm-dwarfdump support for gnu_pubnames section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191050 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 23:01:29 +00:00
David Blaikie
18a6ade6cd DebugInfo: Improve IR annotation comments for GNU pubthings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-19 22:19:37 +00:00
Adrian Prantl
0a4371a207 Debug info: Get rid of the VLA indirection hack in FastISel.
Use the DIVariable::isIndirect() flag set by the frontend instead of
guessing whether to set the machine location's indirection bit.
Paired commit with CFE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190961 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-18 22:08:59 +00:00
Adrian Prantl
06b005f17a mention command line parameters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190827 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-17 00:15:36 +00:00
Adrian Prantl
3d6ce062dc Be sure we run ARM tests only when an ARM backend is present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 23:48:45 +00:00
Adrian Prantl
818833f279 Debug info: Fix PR16736 and rdar://problem/14990587.
A DBG_VALUE is register-indirect iff the first operand is a register
_and_ the second operand is an immediate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190821 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 23:29:03 +00:00
Eric Christopher
8f1a9299de Add initial support for handling gnu style pubnames accepted by some
versions of gold. This support is designed to allow gold to produce
gdb_index sections similar to the accelerator tables and consumable
by gdb.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190649 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 00:35:05 +00:00
NAKAMURA Takumi
c3c9b9b7a8 MCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/, in r190344.
XFAIL can be removed. (in r190374)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190386 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 06:01:56 +00:00
NAKAMURA Takumi
db0e461511 llvm/test/DebugInfo/dwarf-public-names.ll: Mark it as XFAIL for PECOFF targets, for now. Investigating.
FIXME: llvm-dwarfdump doesn't handle PECOFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190374 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10 00:28:23 +00:00
Manman Ren
56736c18c1 Debug Info Testing: use null instead of an empty string in context field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190284 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-09 00:12:17 +00:00
Manman Ren
1ed2e1fb92 Debug Info Testing: update context from empty string to null.
Context should be either null or MDNode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190267 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-08 03:11:54 +00:00
Manman Ren
0e85f6e391 Debug Info: Use identifier to reference DIType in containing type field of
a DISubprogram.
    
Verifier is updated accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-07 00:04:05 +00:00
Manman Ren
1307103dff Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields.
Field 2 of DIType (Context), field 9 of DIDerivedType (TypeDerivedFrom),
field 12 of DICompositeType (ContainingType), fields 2, 7, 12 of DISubprogram
(Context, Type, ContainingType).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 21:03:58 +00:00
Manman Ren
e42279cda4 Debug Info: Use identifier to reference DIType in containing type field of
a DICompositeType.
    
Verifier is updated accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 18:46:00 +00:00