DebugInfo: Fix overwriting/loss of inlined arguments to recursively inlined functions.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 7 Aug 2014 22:22:49 +0000 (22:22 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 7 Aug 2014 22:22:49 +0000 (22:22 +0000)
commit263998aa1dcb67ecb9e0093f8c5f25ed7c2f9749
tree13d9a07eb809e5b558a61964f26c3cef90f0b977
parentcf76da912c5aa51df4bdb1e57dec3748e5ec8ff4
DebugInfo: Fix overwriting/loss of inlined arguments to recursively inlined functions.

Due to an unnecessary special case, inlined arguments that happened to
be from the same function as they were inlined into were misclassified
as non-inline arguments and would overwrite the non-inlined arguments.

Assert that we never overwrite a function's arguments, and stop
misclassifying inlined arguments as non-inline arguments to fix this
issue.

Excuse the rather crappy test case - handcrafted IR might do better, or
someone who understands better how to tickle the inliner to create a
recursive inlining situation like this (though it may also be necessary
to tickle the variable in a particular way to cause it to be recorded in
the MMI side table and go down this particular path for location
information).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215157 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/recursive_inlining.ll [new file with mode: 0644]