summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-06-05 00:51:35 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-06-05 00:51:35 +0000
commitad03fa6d3f00b3f2f1def3768775c39fe12fc4a7 (patch)
treecef225af88d6c0f3601b9134d3d689ba000ec7de /lib/CodeGen/AsmPrinter
parenta66075fdd1fd2880f2747518d7f2f47460239c2c (diff)
downloadllvm-ad03fa6d3f00b3f2f1def3768775c39fe12fc4a7.tar.gz
llvm-ad03fa6d3f00b3f2f1def3768775c39fe12fc4a7.tar.bz2
llvm-ad03fa6d3f00b3f2f1def3768775c39fe12fc4a7.tar.xz
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 4dd36830a4..70f0238d51 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1254,11 +1254,12 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) {
assert(DV.isVariable());
if (!Processed.insert(DV))
continue;
- if (LexicalScope *Scope = LScopes.findLexicalScope(DV.getContext()))
- addScopeVariable(
- Scope,
- new DbgVariable(DV, findAbstractVariable(DV, Scope->getScopeNode()),
- this));
+ if (LexicalScope *Scope = LScopes.findLexicalScope(DV.getContext())) {
+ auto *RegVar = new DbgVariable(
+ DV, findAbstractVariable(DV, Scope->getScopeNode()), this);
+ if (!addCurrentFnArgument(RegVar, Scope))
+ addScopeVariable(Scope, RegVar);
+ }
}
}