[Beignet] [PATCH] GBE: Fix a warning in getConstantPointerRegister.

Yang, Rong R rong.r.yang at intel.com
Sun Aug 10 19:58:27 PDT 2014


LGTM, will push it, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Ruiling Song
> Sent: Monday, August 11, 2014 10:15 AM
> To: beignet at lists.freedesktop.org
> Cc: Song, Ruiling
> Subject: [Beignet] [PATCH] GBE: Fix a warning in getConstantPointerRegister.
> 
> compiler complains "warning: control reaches end of non-void function"
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  backend/src/llvm/llvm_gen_backend.cpp |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/backend/src/llvm/llvm_gen_backend.cpp
> b/backend/src/llvm/llvm_gen_backend.cpp
> index b0571a4..169d589 100644
> --- a/backend/src/llvm/llvm_gen_backend.cpp
> +++ b/backend/src/llvm/llvm_gen_backend.cpp
> @@ -1090,8 +1090,10 @@ namespace gbe
>        ctx.ADD(ir::Type::TYPE_S32, reg, pointer_reg, offset_reg);
>        return reg;
>      }
> -    else
> -      assert(0);
> +    else {
> +      GBE_ASSERT(0 && "Unsupported constant expression");
> +      return regTranslator.getScalar(val, elemID);
> +    }
>    }
> 
>    ir::Register GenWriter::getConstantRegister(Constant *c, uint32_t elemID)
> {
> --
> 1.7.10.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list