Skip to content

Commit 7acb09f

Browse files
committed
[SYCLNATIVECPU] moved conditional
1 parent f14c4f2 commit 7acb09f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

100644100755
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,11 @@ static std::vector<OptSpecifier> getUnsupportedOpts(void) {
13991399
}
14001400

14011401
// Currently supported options by SYCL NativeCPU device compilation
1402-
static inline bool SupportedByNativeCPU(OptSpecifier Opt) {
1402+
static inline bool SupportedByNativeCPU(const SYCLToolChain &TC,
1403+
const OptSpecifier &Opt) {
1404+
if (!TC.IsSYCLNativeCPU)
1405+
return false;
1406+
14031407
switch (Opt.getID()) {
14041408
case options::OPT_fcoverage_mapping:
14051409
case options::OPT_fno_coverage_mapping:
@@ -1424,7 +1428,7 @@ SYCLToolChain::SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
14241428
if (const Arg *A = Args.getLastArg(Opt)) {
14251429
// Native CPU can support options unsupported by other targets,
14261430
// currently source-based code coverage
1427-
if (this->IsSYCLNativeCPU && SupportedByNativeCPU(Opt))
1431+
if (SupportedByNativeCPU(*this, Opt))
14281432
continue;
14291433
// All sanitizer options are not currently supported, except
14301434
// AddressSanitizer
@@ -1468,7 +1472,7 @@ SYCLToolChain::TranslateArgs(const llvm::opt::DerivedArgList &Args,
14681472
if (Opt.matches(UnsupportedOpt)) {
14691473
// NativeCPU should allow most normal cpu options like
14701474
// for coverage testing and we enable them as we have tests.
1471-
if (this->IsSYCLNativeCPU && SupportedByNativeCPU(Opt.getID()))
1475+
if (SupportedByNativeCPU(*this, Opt.getID()))
14721476
continue;
14731477
if (Opt.getID() == options::OPT_fsanitize_EQ &&
14741478
A->getValues().size() == 1) {

0 commit comments

Comments
 (0)