[llvm-commits] [llvm] r47848 - in /llvm/trunk/lib/VMCore: Function.cpp Verifier.cpp
Chris Lattner
clattner at apple.com
Mon Mar 3 11:39:03 PST 2008
On Mar 3, 2008, at 10:58 AM, Devang Patel wrote:
> Author: dpatel
> Date: Mon Mar 3 12:58:16 2008
> New Revision: 47848
>
> URL: http://llvm.org/viewvc/llvm-project?rev=47848&view=rev
> Log:
> If a function uses multive values in ret instruction then it
> is returning a struct value.
Why do you want to do this? I think it would make sense to rename
isStructReturn to hasStructRetAttribute() or something, but I don't
think it makes sense to return true if the function returns multiple
results. What does this fix?
-Chris
>
>
> Modified:
> llvm/trunk/lib/VMCore/Function.cpp
> llvm/trunk/lib/VMCore/Verifier.cpp
>
> Modified: llvm/trunk/lib/VMCore/Function.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=47848&r1=47847&r2=47848&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/VMCore/Function.cpp (original)
> +++ llvm/trunk/lib/VMCore/Function.cpp Mon Mar 3 12:58:16 2008
> @@ -170,7 +170,8 @@
>
> /// @brief Determine if the function returns a structure.
> bool Function::isStructReturn() const {
> - return paramHasAttr(1, ParamAttr::StructRet);
> + return paramHasAttr(1, ParamAttr::StructRet)
> + || isa<StructType>(getReturnType());
> }
>
> //
> =
> =
> =
> ----------------------------------------------------------------------=
> ==//
>
> Modified: llvm/trunk/lib/VMCore/Verifier.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=47848&r1=47847&r2=47848&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/VMCore/Verifier.cpp (original)
> +++ llvm/trunk/lib/VMCore/Verifier.cpp Mon Mar 3 12:58:16 2008
> @@ -455,9 +455,6 @@
> isa<StructType>(F.getReturnType()),
> "Functions cannot return aggregate values!", &F);
>
> - Assert1(!F.isStructReturn() || FT->getReturnType() == Type::VoidTy,
> - "Invalid struct-return function!", &F);
> -
> const ParamAttrsList *Attrs = F.getParamAttrs();
>
> Assert1(!Attrs ||
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list