mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-26 06:22:56 +02:00
c1b7b4cc37
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 |
||
---|---|---|
.. | ||
apple-version | ||
2003-01-30-LinkerRename.ll | ||
2003-05-31-LinkerRename.ll | ||
alias.ll | ||
alignment.ll | ||
basiclink.a.ll | ||
basiclink.b.ll | ||
comdat2.ll | ||
comdat3.ll | ||
comdat4.ll | ||
comdat5.ll | ||
comdat8.ll | ||
comdat.ll | ||
ConstantGlobals.ll | ||
constructor-comdat.ll | ||
ctors.ll | ||
datalayout-a.ll | ||
datalayout-b.ll | ||
distinct.ll | ||
ident.a.ll | ||
ident.b.ll | ||
linkage2.ll | ||
linkage.a.ll | ||
linkage.b.ll | ||
mdlocation.ll | ||
module-flags-dont-change-others.ll | ||
module-flags-pic-1-b.ll | ||
module-flags-pic-2-b.ll | ||
old_global_ctors.3.4.bc | ||
opaque.ll | ||
pr21374.ll | ||
pr22807-1.ll | ||
pr22807-2.ll | ||
PR8300.a.ll | ||
PR8300.b.ll | ||
PR11464.a.ll | ||
PR11464.b.ll | ||
redefinition.ll | ||
replaced-function-matches-first-subprogram.ll | ||
subprogram-linkonce-weak.ll | ||
targettriple-a.ll | ||
targettriple-b.ll | ||
targettriple-c.ll | ||
testlink.ll | ||
type-unique-alias.ll | ||
type-unique-dst-types2.ll | ||
type-unique-dst-types3.ll | ||
type-unique-inheritance-a.ll | ||
type-unique-inheritance-b.ll | ||
type-unique-name.ll | ||
type-unique-opaque.ll | ||
type-unique-simple2-a.ll | ||
type-unique-simple2-b.ll | ||
type-unique-unrelated2.ll | ||
type-unique-unrelated3.ll | ||
unique-fwd-decl-b.ll | ||
unique-fwd-decl-order.ll | ||
visibility.ll |