[Beignet] [PATCH] Backend: Remove uselsee ParseCommandLineOptions

Yang, Rong R rong.r.yang at intel.com
Sun Feb 14 04:42:14 UTC 2016


LGTM, pushed.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Pan Xiuli
> Sent: Friday, January 29, 2016 17:14
> To: beignet at lists.freedesktop.org
> Cc: Pan, Xiuli
> Subject: [Beignet] [PATCH] Backend: Remove uselsee
> ParseCommandLineOptions
> 
> As llvm has refined the ParseCommandLineOptions and it will case double
> free problem we now remove the useless ParseCommandLineOptions
> 
> Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
> ---
>  backend/src/backend/program.cpp | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/backend/src/backend/program.cpp
> b/backend/src/backend/program.cpp index 0bbcb77..ea3ad2d 100644
> --- a/backend/src/backend/program.cpp
> +++ b/backend/src/backend/program.cpp
> @@ -555,8 +555,6 @@ namespace gbe {
>      }
> 
>      args.push_back("-cl-kernel-arg-info");
> -    args.push_back("-mllvm");
> -    args.push_back("-inline-threshold=200000");
>  #ifdef GEN7_SAMPLER_CLAMP_BORDER_WORKAROUND
>      args.push_back("-DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND");
>  #endif
> @@ -622,18 +620,7 @@ namespace gbe {
>      clang::LangOptions & lang_opts = Clang.getLangOpts();
>      lang_opts.OpenCL = 1;
> 
> -    //llvm flags need command line parsing to take effect
> -    if (!Clang.getFrontendOpts().LLVMArgs.empty()) {
> -      unsigned NumArgs = Clang.getFrontendOpts().LLVMArgs.size();
> -      const char **Args = new const char*[NumArgs + 2];
> -      Args[0] = "clang (LLVM option parsing)";
> -      for (unsigned i = 0; i != NumArgs; ++i){
> -        Args[i + 1] = Clang.getFrontendOpts().LLVMArgs[i].c_str();
> -      }
> -      Args[NumArgs + 1] = 0;
> -      llvm::cl::ParseCommandLineOptions(NumArgs + 1, Args);
> -      delete [] Args;
> -    }
> +    GBE_ASSERT(Clang.getFrontendOpts().LLVMArgs.empty() && "We do
> not
> + have llvm args now");
> 
>      // Create an action and make the compiler instance carry it out
>      std::unique_ptr<clang::CodeGenAction> Act(new
> clang::EmitLLVMOnlyAction(llvm_ctx));
> --
> 2.1.4
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list