From 631994b9cff9aff2650cde4fc1af1fba90cadf01 Mon Sep 17 00:00:00 2001 From: Junyan He Date: Wed, 15 Jan 2014 15:34:12 +0800 Subject: [PATCH] Add -cl-fast-relaxed-math into incompatible opts and fix the PreprocessorOptions bug Signed-off-by: Junyan He Reviewed-by: Zhigang Gong --- backend/src/backend/program.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index 284a755..c0358b3 100644 --- a/backend/src/backend/program.cpp +++ b/backend/src/backend/program.cpp @@ -566,7 +566,7 @@ namespace gbe { clang::LangOptions & lang_opts = Clang.getLangOpts(); lang_opts.OpenCL = 1; - clang::PreprocessorOptions prep_opt = Clang.getPreprocessorOpts(); + clang::PreprocessorOptions& prep_opt = Clang.getPreprocessorOpts(); prep_opt.DisablePCHValidation = 1; //llvm flags need command line parsing to take effect @@ -697,9 +697,14 @@ namespace gbe { if(options) { char *p; + /* FIXME: Though we can disable the pch valid check, and load pch successfully, + but these language opts and pre-defined macro will still generate the diag msg + to the diag engine of the Clang and cause the Clang to report error. + We filter them all here to avoid these. */ const char * incompatible_opts[] = { "-cl-single-precision-constant", // "-cl-denorms-are-zero", + "-cl-fast-relaxed-math", "-cl-std=", }; const char * incompatible_defs[] = { -- 2.7.4