PR15662: Optimized debug info produces out of order function parameters
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 5 Jun 2013 05:39:59 +0000 (05:39 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 5 Jun 2013 05:39:59 +0000 (05:39 +0000)
commit032d62487c888fe1ce500dfe9e22ae76efbe18e5
treecc966f7443407005ecf5cb053e5c5f1856ee176a
parentad7ecc65b1b1d6466ff035168c86f208a91aa1b4
PR15662: Optimized debug info produces out of order function parameters

When a function is inlined we lazily construct the variables
representing the function's parameters. After that, we add any remaining
unused parameters.

If the function doesn't use all the parameters, or uses them out of
order, then the DWARF would produce them in that order, producing a
parameter order that doesn't match the source.

This fix causes us to always keep the arg variables at the start of the
variable list & in the original order from the source.

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