]> granicus.if.org Git - clang/commitdiff
Ignore return type if its size is zero.
authorAkira Hatanaka <ahatanaka@mips.com>
Mon, 23 Jan 2012 23:18:57 +0000 (23:18 +0000)
committerAkira Hatanaka <ahatanaka@mips.com>
Mon, 23 Jan 2012 23:18:57 +0000 (23:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148744 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp

index 88bf8fe122923a4f6d45d0da900a128b323d7f25..c51ce91371ece1c92d105371f594affa261cac50 100644 (file)
@@ -3222,11 +3222,12 @@ MipsABIInfo::returnAggregateInRegs(QualType RetTy, uint64_t Size) const {
 }
 
 ABIArgInfo MipsABIInfo::classifyReturnType(QualType RetTy) const {
-  if (RetTy->isVoidType())
+  uint64_t Size = getContext().getTypeSize(RetTy);
+
+  if (RetTy->isVoidType() || Size == 0)
     return ABIArgInfo::getIgnore();
 
   if (isAggregateTypeForABI(RetTy)) {
-    uint64_t Size = getContext().getTypeSize(RetTy);
     if (Size <= 128) {
       if (RetTy->isAnyComplexType())
         return ABIArgInfo::getDirect();