llvm-6502/test/DebugInfo
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
..
AArch64 Move emission of the debug string table to early in the debug 2013-09-20 23:22:52 +00:00
ARM mention command line parameters 2013-09-17 00:15:36 +00:00
Inputs llvm-dwarfdump/libDebugInfo support for type units 2013-09-23 22:44:47 +00:00
PowerPC
SystemZ Move emission of the debug string table to early in the debug 2013-09-20 23:22:52 +00:00
X86 DebugInfo: Fix ordering of members after r191928 2013-10-04 01:39:59 +00:00
2009-10-16-Phi.ll
2009-11-03-InsertExtractValue.ll
2009-11-05-DeadGlobalVariable.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
2009-11-06-NamelessGlobalVariable.ll
2009-11-10-CurrentFn.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
2010-01-05-DbgScope.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-01-19-DbgScope.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-03-12-llc-crash.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-03-19-DbgDeclare.ll
2010-03-24-MemberFn.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-03-30-InvalidDbgInfoCrash.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-04-06-NestedFnDbgInfo.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-04-19-FramePtr.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-05-03-DisableFramePtr.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-05-03-OriginDIE.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-05-10-MultipleCU.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-06-29-InlinedFnLocalVar.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-07-19-Crash.ll Debug Info: add an identifier field to DICompositeType. 2013-08-26 22:39:55 +00:00
2010-10-01-crash.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
array.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
bug_null_debuginfo.ll
debuglineinfo.test
dwarf-public-names.ll MCObjectFileInfo.cpp: Fix a couple of possible typo(s), s/DwarfPub/DwarfGnuPub/, in r190344. 2013-09-10 06:01:56 +00:00
dwarfdump-debug-frame-simple.test
dwarfdump-debug-loc-simple.test
dwarfdump-dump-flags.test
dwarfdump-inlining.test
dwarfdump-pubnames.test Unify pubsection/gnu pubsection printing. 2013-09-25 23:02:36 +00:00
dwarfdump-test.test
dwarfdump-type-units.test Make dwarfdump-type-units.test order-independent 2013-09-24 00:13:23 +00:00
dwarfdump-zlib.test
enum.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
global.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
inheritance.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
inline-debug-info-multiret.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
inline-debug-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
inlined-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
inlined-vars.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
llvm-symbolizer.test
member-order.ll DebugInfo: Fix ordering of members after r191928 2013-10-04 01:39:59 +00:00
member-pointers.ll Debug Info Testing: update context from empty string to null. 2013-09-08 03:11:54 +00:00
namespace.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-recursive-void.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
tu-composite.ll Debug Info: Use identifier to reference DIType in containing type field of 2013-09-07 00:04:05 +00:00
tu-member-pointer.ll Debug Info: Use identifier to reference DIType in base type field of 2013-09-05 18:48:31 +00:00
two-cus-from-same-file.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00
version.ll Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields. 2013-09-06 21:03:58 +00:00