PR19388: DebugInfo: Emit dead arguments in their originally declared order.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 5 Jun 2014 00:51:35 +0000 (00:51 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 5 Jun 2014 00:51:35 +0000 (00:51 +0000)
commitad03fa6d3f00b3f2f1def3768775c39fe12fc4a7
treecef225af88d6c0f3601b9134d3d689ba000ec7de
parenta66075fdd1fd2880f2747518d7f2f47460239c2c
PR19388: DebugInfo: Emit dead arguments in their originally declared order.

Unused arguments were not being added to the argument list, but instead
treated as arbitrary scope variables. This meant they weren't carefully
added in the original argument order.

In this particular example, though, it turns out the argument is only
/mostly/ unused (well, actually it's entirely used, but in a specific
way). It's a struct that, due to ABI reasons, is decomposed into chunks
(exactly one chunk, since it has one member) and then passed. Since only
one of those chunks is used (SROA, etc, kill the original reconstitution
code) we don't have a location to describe the whole variable.

In this particular case, since the struct consists of just the one int,
once we have partial location information, this should have a location
that describes the entire variable (since the piece is the entirety of
the object).

And at some point we'll need to describe the location of even /entirely/
unused arguments so that they can at least be printed on function entry.

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