77// ===----------------------------------------------------------------------===//
88#include " SYCL.h"
99#include " CommonArgs.h"
10- #include " clang/Driver/Action.h"
11- #include " clang/Driver/Compilation.h"
12- #include " clang/Driver/Driver.h"
13- #include " clang/Driver/DriverDiagnostic.h"
14- #include " clang/Driver/InputInfo.h"
15- #include " clang/Driver/Options.h"
16- #include " llvm/Option/Option.h"
17- #include " llvm/Support/CommandLine.h"
18- #include " llvm/Support/FileSystem.h"
1910#include " llvm/Support/Path.h"
20- #include < algorithm>
21- #include < sstream>
2211
2312using namespace clang ::driver;
2413using namespace clang ::driver::toolchains;
@@ -64,32 +53,29 @@ void SYCLInstallationDetector::print(llvm::raw_ostream &OS) const {
6453 }
6554}
6655
67- // Unsupported options for SYCL device compilation
68- // -fcf-protection, -fsanitize, -fprofile-generate, -fprofile-instr-generate
69- // -ftest-coverage, -fcoverage-mapping, -fcreate-profile, -fprofile-arcs
70- // -fcs-profile-generate -forder-file-instrumentation, --coverage
71- static std::vector<OptSpecifier> getUnsupportedOpts (void ) {
56+ // Unsupported options for SYCL device compilation.
57+ static std::vector<OptSpecifier> getUnsupportedOpts () {
7258 std::vector<OptSpecifier> UnsupportedOpts = {
73- options::OPT_fsanitize_EQ,
74- options::OPT_fcf_protection_EQ,
59+ options::OPT_fsanitize_EQ, // -fsanitize
60+ options::OPT_fcf_protection_EQ, // -fcf-protection
7561 options::OPT_fprofile_generate,
7662 options::OPT_fprofile_generate_EQ,
77- options::OPT_fno_profile_generate,
63+ options::OPT_fno_profile_generate, // -f[no-]profile-generate
7864 options::OPT_ftest_coverage,
79- options::OPT_fno_test_coverage,
65+ options::OPT_fno_test_coverage, // -f[no-]test-coverage
8066 options::OPT_fcoverage_mapping,
81- options::OPT_fno_coverage_mapping,
82- options::OPT_coverage,
67+ options::OPT_fno_coverage_mapping, // -f[no-]coverage-mapping
68+ options::OPT_coverage, // --coverage
8369 options::OPT_fprofile_instr_generate,
8470 options::OPT_fprofile_instr_generate_EQ,
71+ options::OPT_fno_profile_instr_generate, // -f[no-]profile-instr-generate
8572 options::OPT_fprofile_arcs,
86- options::OPT_fno_profile_arcs,
87- options::OPT_fno_profile_instr_generate,
88- options::OPT_fcreate_profile,
73+ options::OPT_fno_profile_arcs, // -f[no-]profile-arcs
74+ options::OPT_fcreate_profile, // -fcreate-profile
8975 options::OPT_fprofile_instr_use,
90- options::OPT_fprofile_instr_use_EQ,
91- options::OPT_forder_file_instrumentation,
92- options::OPT_fcs_profile_generate,
76+ options::OPT_fprofile_instr_use_EQ, // -fprofile-instr-use
77+ options::OPT_forder_file_instrumentation, // -forder-file-instrumentation
78+ options::OPT_fcs_profile_generate, // -fcs-profile-generate
9379 options::OPT_fcs_profile_generate_EQ};
9480 return UnsupportedOpts;
9581}
@@ -105,7 +91,7 @@ SYCLToolChain::SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
10591 for (OptSpecifier Opt : getUnsupportedOpts ()) {
10692 if (const Arg *A = Args.getLastArg (Opt)) {
10793 // All sanitizer options are not currently supported, except
108- // AddressSanitizer
94+ // AddressSanitizer.
10995 if (A->getOption ().getID () == options::OPT_fsanitize_EQ &&
11096 A->getValues ().size () == 1 ) {
11197 std::string SanitizeVal = A->getValue ();
0 commit comments