LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:[email protected]] On Behalf Of
> Guo Yejun
> Sent: Friday, June 17, 2016 3:28
> To: [email protected]
> Cc: Guo, Yejun <[email protected]>
> Subject: [Beignet] [PATCH] output message instead of assert when .bc file
> does not exist
> 
> it is possible that .bc file is missing in the system, provide end users with
> detail message.
> 
> Signed-off-by: Guo Yejun <[email protected]>
> ---
>  backend/src/llvm/llvm_bitcode_link.cpp | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/backend/src/llvm/llvm_bitcode_link.cpp
> b/backend/src/llvm/llvm_bitcode_link.cpp
> index 990babd..748a7fe 100644
> --- a/backend/src/llvm/llvm_bitcode_link.cpp
> +++ b/backend/src/llvm/llvm_bitcode_link.cpp
> @@ -50,7 +50,10 @@ namespace gbe
>          break;
>        }
>      }
> -    assert(findBC);
> +    if (!findBC) {
> +      printf("Fatal Error: ocl lib %s does not exist\n", 
> bitCodeFiles.c_str());
> +      return NULL;
> +    }
> 
>  #if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 5
>      oclLib = getLazyIRFileModule(FilePath, Err, ctx); @@ -138,7 +141,8 @@
> namespace gbe
>      std::set<std::string> materializedFuncs;
>      std::vector<GlobalValue *> Gvs;
>      Module* clonedLib = createOclBitCodeModule(ctx, strictMath);
> -    assert(clonedLib && "Can not create the beignet bitcode\n");
> +    if (clonedLib == NULL)
> +      return NULL;
> 
>      std::vector<const char *> kernels;
>      std::vector<const char *> builtinFuncs;
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to