llvm-6502/test
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
..
Analysis Remove the very substantial, largely unmaintained legacy PGO 2013-10-02 15:42:23 +00:00
Assembler
Bindings/Ocaml
Bitcode AutoUpgrade: upgrade from scalar TBAA format to struct-path aware TBAA format. 2013-09-28 00:22:27 +00:00
BugPoint
CodeGen [arm] Enhance the test case by checking .fpu directive. 2013-10-03 12:18:56 +00:00
DebugInfo DebugInfo: Fix ordering of members after r191928 2013-10-04 01:39:59 +00:00
ExecutionEngine Adding support and tests for multiple module handling in lli 2013-10-04 00:49:38 +00:00
Feature
FileCheck
Instrumentation ObjectSizeOffsetEvaluator: Don't run into infinite recursion if we have a cyclic GEP. 2013-09-29 19:39:13 +00:00
Integer
JitListener
Linker Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_type 2013-10-01 23:45:54 +00:00
LTO Optimize linkonce_odr unnamed_addr functions during LTO. 2013-10-03 18:29:09 +00:00
MC [ARM] Warn on deprecated IT blocks in v8 AArch32 assembly. 2013-10-03 09:31:51 +00:00
Object
Other
TableGen
tools Resurrect lit.local.cfg to un-break hexagon buildbot. 2013-09-27 21:26:38 +00:00
Transforms Pull fptrunc's upwards through selects when one of the select's selectands was a constant. This has a number of benefits, including producing small immediates (easier to materialize, smaller constant pools) as well as being more likely to allow the fptrunc to fuse with a preceding instruction (truncating selects are unusual). 2013-10-03 21:08:05 +00:00
Unit
Verifier
YAMLParser
CMakeLists.txt Fixing lli-child-target build 2013-10-02 22:27:23 +00:00
lit.cfg Remove the very substantial, largely unmaintained legacy PGO 2013-10-02 15:42:23 +00:00
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh