llvm-6502/test/DebugInfo/X86
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
..
2010-04-13-PubType.ll Don't bother emitting the pubtypes section on darwin since there aren't 2013-08-30 00:40:17 +00:00
2010-08-10-DbgConstant.ll
2011-09-26-GlobalVarContext.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
2011-12-16-BadStructRef.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
aligned_stack_var.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
arguments.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
block-capture.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
byvalstruct.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
coff_relative_names.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
concrete_out_of_line.ll DebugInfo: Fix ordering of members after r191928 2013-10-04 01:39:59 +00:00
dbg_value_direct.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-at-specficiation.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
dbg-byval-parameter.ll Move some debug testcases to the debug info directory. 2013-08-27 23:48:57 +00:00
dbg-const-int.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-const.ll Move some debug testcases to the debug info directory. 2013-08-27 23:48:57 +00:00
dbg-declare-arg.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
dbg-declare.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
dbg-file-name.ll Move some debug testcases to the debug info directory. 2013-08-27 23:48:57 +00:00
dbg-i128-const.ll Move some debug testcases to the debug info directory. 2013-08-27 23:48:57 +00:00
dbg-large-unsigned-const.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
dbg-merge-loc-entry.ll Move some debug testcases to the debug info directory. 2013-08-27 23:48:57 +00:00
dbg-prolog-end.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-subrange.ll Initialize BSSSection explicitly in InitMachOMCObjectFileInfo() to appease msvc. 2013-09-21 02:34:45 +00:00
dbg-value-dag-combine.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-value-inlined-parameter.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-value-isel.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-value-location.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-value-range.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
dbg-value-terminator.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
debug_frame.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
debug-info-block-captured-self.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
debug-info-blocks.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
debug-info-static-member.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
DW_AT_byte_size.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
DW_AT_location-reference.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
DW_AT_object_pointer.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
DW_AT_specification.ll DebugInfo: Fix ordering of members after r191928 2013-10-04 01:39:59 +00:00
DW_AT_stmt_list_sec_offset.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
DW_TAG_friend.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
dwarf-aranges-no-dwarf-labels.ll Remove wild .debug_aranges entries generated from unimportant labels 2013-10-03 08:54:43 +00:00
dwarf-aranges.ll Fixed a bug with section names containing special characters. 2013-10-03 22:07:08 +00:00
dwarf-public-names.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
dwarf-pubnames-split.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
earlydup-crash.ll
eh_symbol.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
elf-names.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
empty-and-one-elem-array.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
empty-array.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
ending-run.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
enum-class.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
enum-fwd-decl.ll
fission-cu.ll
fission-hash.ll Add the rest of the stock attributes to the attribute table. 2013-09-03 20:00:20 +00:00
fission-ranges.ll Add the DW_AT_GNU_ranges_base attribute if we've emitted any ranges 2013-10-01 00:43:36 +00:00
generate-odr-hash.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
gnu-public-names-empty.ll Make sure we emit a section for pubnames even if that section is 2013-10-03 17:41:20 +00:00
gnu-public-names.ll The DW_AT_GNU_pubnames/pubtypes attributes are actually form 2013-09-30 23:14:16 +00:00
instcombine-instrinsics.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
line-info.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
linkage-name.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
lit.local.cfg
low-pc-cu.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
main-file-name.s
misched-dbg-value.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
multiple-aranges.ll Fixed a bug with section names containing special characters. 2013-10-03 22:07:08 +00:00
multiple-at-const-val.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
nondefault-subrange-array.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
objc-fwd-decl.ll
op_deref.ll Debug info: Get rid of the VLA indirection hack in FastISel. 2013-09-18 22:08:59 +00:00
parameters.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
pointer-type-size.ll Debug Info Testing: Updated to use null instead of "i32 0" for containing-type 2013-09-06 18:13:59 +00:00
pr9951.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
pr11300.ll DebugInfo: Fix ordering of members after r191928 2013-10-04 01:39:59 +00:00
pr12831.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
pr13303.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
prologue-stack.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
reference-argument.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
rvalue-ref.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
stmt-list-multiple-compile-units.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
stmt-list.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
stringpool.ll Initialize BSSSection explicitly in InitMachOMCObjectFileInfo() to appease msvc. 2013-09-21 02:34:45 +00:00
struct-loc.ll Debug Info Testing: Updated to use null instead of "i32 0" for containing-type 2013-09-06 18:13:59 +00:00
subrange-type.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
subreg.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
template.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
tls-fission.ll
tls.ll
union-template.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
vector.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
vla.ll Debug info: Get rid of the VLA indirection hack in FastISel. 2013-09-18 22:08:59 +00:00