From: Devang Patel Date: Thu, 10 Feb 2011 00:40:52 +0000 (+0000) Subject: If an aggregate is returned as 'sret' argument then let debugger know about this. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0691f93ac23978e2b28b031e5c4a0b3c6dc94798;p=clang 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 --- 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(Storage)) + if (Arg->hasStructRetAttr()) + Ty = DBuilder.CreateReferenceType(Ty); + // Get location information. unsigned Line = getLineNumber(VD->getLocation()); unsigned Column = getColumnNumber(VD->getLocation());