]> granicus.if.org Git - clang/commitdiff
Only c++ class arguments with non trivial constructor or destructor needs a reference.
authorDevang Patel <dpatel@apple.com>
Tue, 15 Feb 2011 23:36:28 +0000 (23:36 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 15 Feb 2011 23:36:28 +0000 (23:36 +0000)
C struct arguments do not need this adjustment.
This fixes 7 failures in callfuncs.exp from gdb testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125615 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 091dcc9d0ea42822d38bb12a3a81398c9a140661..2debea1733eb3a461d1cb4aea3226d014183a8d0 100644 (file)
@@ -1761,7 +1761,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
   // If an aggregate variable has non trivial destructor or non trivial copy
   // constructor than it is pass indirectly. Let debug info know about this
   // by using reference of the aggregate type as a argument type.
-  if (IndirectArgument && VD->getType()->isRecordType())
+  if (IndirectArgument && VD->getType()->isClassType())
     Ty = DBuilder.CreateReferenceType(Ty);
 
   // If Storage is an aggregate returned as 'sret' then let debugger know