]> granicus.if.org Git - clang/commitdiff
If an aggregate is returned as 'sret' argument then let debugger know about this.
authorDevang Patel <dpatel@apple.com>
Thu, 10 Feb 2011 00:40:52 +0000 (00:40 +0000)
committerDevang Patel <dpatel@apple.com>
Thu, 10 Feb 2011 00:40:52 +0000 (00:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125249 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 8036efe9ec415af96f77e5c245fcc87ff795a9bc..091dcc9d0ea42822d38bb12a3a81398c9a140661 100644 (file)
@@ -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());