1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 06:22:56 +02:00
llvm-mirror/test/Linker/Inputs
Duncan P. N. Exon Smith c1b7b4cc37 Linker: Drop function pointers for overridden subprograms
Instead of dropping subprograms that have been overridden, just set
their function pointers to `nullptr`.  This is a minor adjustment to the
stop-gap fix for PR21910 committed in r224487, and fixes the crasher
from PR22792.

The problem that r224487 put a band-aid on: how do we find the canonical
subprogram for a `Function`?  Since the backend currently relies on
`DebugInfoFinder` (which does a naive in-order traversal of compile
units and picks the first subprogram) for this, r224487 tried dropping
non-canonical subprograms.

Dropping subprograms fails because the backend *also* builds up a map
from subprogram to compile unit (`DwarfDebug::SPMap`) based on the
subprogram lists.  A missing subprogram causes segfaults later when an
inlined reference (such as in this testcase) is created.

Instead, just drop the `Function` pointer to `nullptr`, which nicely
mirrors what happens when an already-inlined `Function` is optimized
out.  We can't really be sure that it's the same definition anyway, as
the testcase demonstrates.

This still isn't completely satisfactory.  Two flaws at least that I can
think of:

  - I still haven't found a straightforward way to make this symmetric
    in the IR.  (Interestingly, the DWARF output is already symmetric,
    and I've tested for that to be sure we don't regress.)
  - Using `DebugInfoFinder` to find the canonical subprogram for a
    function is kind of crazy.  We should just attach metadata to the
    function, like this:

        define weak i32 @foo(i32, i32) !dbg !MDSubprogram(...) {

llvm-svn: 233164
2015-03-25 02:26:32 +00:00
..
apple-version [LinkModules] Change the way ModuleLinker merges triples. 2015-02-13 00:40:41 +00:00
2003-01-30-LinkerRename.ll
2003-05-31-LinkerRename.ll
alias.ll
alignment.ll Add a few extra cases to the test. NFC. 2014-12-05 00:02:42 +00:00
basiclink.a.ll
basiclink.b.ll
comdat2.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
comdat3.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
comdat4.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
comdat5.ll [opaque pointer type] Add textual IR support for explicit type parameter to gep operator 2015-03-13 18:20:45 +00:00
comdat8.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
comdat.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00
ConstantGlobals.ll
constructor-comdat.ll
ctors.ll
datalayout-a.ll
datalayout-b.ll
distinct.ll Utils: Keep distinct MDNodes distinct in MapMetadata() 2015-01-08 22:42:30 +00:00
ident.a.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
ident.b.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
linkage2.ll
linkage.a.ll
linkage.b.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
mdlocation.ll Utils: Handle remapping distinct MDLocations 2015-01-14 01:29:32 +00:00
module-flags-dont-change-others.ll Linker: Don't use MDNode::replaceOperandWith() 2015-01-07 21:32:27 +00:00
module-flags-pic-1-b.ll
module-flags-pic-2-b.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
old_global_ctors.3.4.bc
opaque.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
pr21374.ll Ask the module for its the identified types. 2014-12-03 07:18:23 +00:00
pr22807-1.ll Remember to move a type to the correct set when setting the body. 2015-03-06 00:50:21 +00:00
pr22807-2.ll Remember to move a type to the correct set when setting the body. 2015-03-06 00:50:21 +00:00
PR8300.a.ll
PR8300.b.ll
PR11464.a.ll
PR11464.b.ll [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction 2015-02-27 19:29:02 +00:00
redefinition.ll
replaced-function-matches-first-subprogram.ll DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
subprogram-linkonce-weak.ll Linker: Drop function pointers for overridden subprograms 2015-03-25 02:26:32 +00:00
targettriple-a.ll [LinkModules] Change the way ModuleLinker merges triples. 2015-02-13 00:40:41 +00:00
targettriple-b.ll [LinkModules] Change the way ModuleLinker merges triples. 2015-02-13 00:40:41 +00:00
targettriple-c.ll [LinkModules] Change the way ModuleLinker merges triples. 2015-02-13 00:40:41 +00:00
testlink.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
type-unique-alias.ll Link the type of aliases. 2014-11-25 04:43:59 +00:00
type-unique-dst-types2.ll Add a test showing what the linker IdentifiedStructTypes is for. 2014-12-01 03:20:57 +00:00
type-unique-dst-types3.ll Add a test showing what the linker IdentifiedStructTypes is for. 2014-12-01 03:20:57 +00:00
type-unique-inheritance-a.ll DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
type-unique-inheritance-b.ll DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
type-unique-name.ll Set the body of a new struct as soon as it is created. 2014-11-25 15:33:40 +00:00
type-unique-opaque.ll Add back r222727 with a fix. 2014-11-28 16:41:24 +00:00
type-unique-simple2-a.ll DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
type-unique-simple2-b.ll DebugInfo: Move new hierarchy into place 2015-03-03 17:24:31 +00:00
type-unique-unrelated2.ll Add an interesting test that we already get right. NFC. 2014-11-25 03:47:57 +00:00
type-unique-unrelated3.ll Add an interesting test that we already get right. NFC. 2014-11-25 03:47:57 +00:00
unique-fwd-decl-b.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
unique-fwd-decl-order.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
visibility.ll Change the .ll syntax for comdats and add a syntactic sugar. 2015-01-06 22:55:16 +00:00