[Beignet] [PATCH] Backend: Remove uselsee ParseCommandLineOptions
Pan Xiuli
xiuli.pan at intel.com
Fri Jan 29 01:13:45 PST 2016
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
More information about the Beignet
mailing list