aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-02-10 00:40:52 +0000
committerDevang Patel <dpatel@apple.com>2011-02-10 00:40:52 +0000
commit0691f93ac23978e2b28b031e5c4a0b3c6dc94798 (patch)
tree529cb60f65f47163b1a8eebeeef3b2c474cdbded /lib/CodeGen/CGDebugInfo.cpp
parent9a7d023625ede88abe31469a756f65bdcaa29d0a (diff)
If an aggregate is returned as 'sret' argument then let debugger know about this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125249 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 8036efe9ec..091dcc9d0e 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1764,6 +1764,12 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
if (IndirectArgument && VD->getType()->isRecordType())
Ty = DBuilder.CreateReferenceType(Ty);
+ // If Storage is an aggregate returned as 'sret' then let debugger know
+ // about this.
+ if (llvm::Argument *Arg = dyn_cast<llvm::Argument>(Storage))
+ if (Arg->hasStructRetAttr())
+ Ty = DBuilder.CreateReferenceType(Ty);
+
// Get location information.
unsigned Line = getLineNumber(VD->getLocation());
unsigned Column = getColumnNumber(VD->getLocation());