Skip to content

Commit

Permalink
Revert clang driver changes
Browse files Browse the repository at this point in the history
  • Loading branch information
againull committed Mar 5, 2024
1 parent 37e8754 commit 8cdd920
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(WIN32)
endif()

# This must be in sync with llvm/sycl/CMakeLists.txt.
SET_SOURCE_FILES_PROPERTIES( ToolChains/Clang.cpp
SET_SOURCE_FILES_PROPERTIES( ToolChains/MSVC.cpp ToolChains/Clang.cpp
PROPERTIES COMPILE_DEFINITIONS SYCL_MAJOR_VERSION="7" )

add_clang_library(clangDriver
Expand Down
15 changes: 9 additions & 6 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5035,14 +5035,16 @@ static void ProcessVSRuntimeLibrary(const ArgList &Args,
!Args.hasArg(options::OPT_nolibsycl)) {
if (RTOptionID == options::OPT__SLASH_MDd) {
if (Args.hasArg(options::OPT_fpreview_breaking_changes))
CmdArgs.push_back("--dependent-lib=sycl-previewd");
CmdArgs.push_back("--dependent-lib=sycl" SYCL_MAJOR_VERSION
"-previewd");
else
CmdArgs.push_back("--dependent-lib=sycld");
CmdArgs.push_back("--dependent-lib=sycl" SYCL_MAJOR_VERSION "d");
} else {
if (Args.hasArg(options::OPT_fpreview_breaking_changes))
CmdArgs.push_back("--dependent-lib=sycl-preview");
CmdArgs.push_back("--dependent-lib=sycl" SYCL_MAJOR_VERSION
"-preview");
else
CmdArgs.push_back("--dependent-lib=sycl");
CmdArgs.push_back("--dependent-lib=sycl" SYCL_MAJOR_VERSION);
}
CmdArgs.push_back("--dependent-lib=sycl-devicelib-host");
}
Expand Down Expand Up @@ -6596,9 +6598,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (!D.IsCLMode() && TC.getTriple().isWindowsMSVCEnvironment()) {
if (isDependentLibAdded(Args, "msvcrtd")) {
if (Args.hasArg(options::OPT_fpreview_breaking_changes))
CmdArgs.push_back("--dependent-lib=sycl-previewd");
CmdArgs.push_back("--dependent-lib=sycl" SYCL_MAJOR_VERSION
"-previewd");
else
CmdArgs.push_back("--dependent-lib=sycld");
CmdArgs.push_back("--dependent-lib=sycl" SYCL_MAJOR_VERSION "d");
}
} else if (!D.IsCLMode() && TC.getTriple().isWindowsGNUEnvironment()) {
if (Args.hasArg(options::OPT_fpreview_breaking_changes))
Expand Down
9 changes: 5 additions & 4 deletions clang/lib/Driver/ToolChains/MSVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (!Args.hasArg(options::OPT__SLASH_MDd) &&
!isDependentLibAdded(Args, "msvcrtd")) {
if (Args.hasArg(options::OPT_fpreview_breaking_changes))
CmdArgs.push_back("-defaultlib:sycl-preview.lib");
CmdArgs.push_back("-defaultlib:sycl" SYCL_MAJOR_VERSION "-preview.lib");
else
CmdArgs.push_back("-defaultlib:sycl.lib");
CmdArgs.push_back("-defaultlib:sycl" SYCL_MAJOR_VERSION ".lib");
} else {
if (Args.hasArg(options::OPT_fpreview_breaking_changes))
CmdArgs.push_back("-defaultlib:sycl-previewd.lib");
CmdArgs.push_back("-defaultlib:sycl" SYCL_MAJOR_VERSION
"-previewd.lib");
else
CmdArgs.push_back("-defaultlib:sycld.lib");
CmdArgs.push_back("-defaultlib:sycl" SYCL_MAJOR_VERSION "d.lib");
}
CmdArgs.push_back("-defaultlib:sycl-devicelib-host.lib");
}
Expand Down

0 comments on commit 8cdd920

Please sign in to comment.