summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitbb6a4e2fead631bee82cc78c629a5050e7fde1ab (patch)
tree0868828205085837f6c2bfaa051b5e7946ca1444 /llvm/lib/CodeGen/AsmPrinter
parent599bed75ed32f2100159257a1c1d877ea520d13f (diff)
downloadbcm5719-llvm-bb6a4e2fead631bee82cc78c629a5050e7fde1ab.tar.gz
bcm5719-llvm-bb6a4e2fead631bee82cc78c629a5050e7fde1ab.zip
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. llvm-svn: 210231
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 4dd36830a44..70f0238d513 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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);
+ }
}
}
OpenPOWER on IntegriCloud