From: Akira Hatanaka Date: Mon, 23 Jan 2012 23:18:57 +0000 (+0000) Subject: Ignore return type if its size is zero. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8536c086fbac59bd7f9a6493bc99b4a92d585e4;p=clang Ignore return type if its size is zero. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148744 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 88bf8fe122..c51ce91371 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -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();