Skip to content

Commit

Permalink
Specify clang exe path in Driver Creation
Browse files Browse the repository at this point in the history
By doing so, TheDriver can get the correct resource dir.

Closes: ROCm#48
Reference: ROCm#49
  • Loading branch information
littlewu2508 committed Nov 18, 2022
1 parent 7cfede0 commit e0fb8ac
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/comgr/src/comgr-compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ AMDGPUCompiler::executeInProcessDriver(ArrayRef<const char *> Args) {
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs);
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
ProcessWarningOptions(Diags, *DiagOpts, /*ReportDiags=*/false);
Driver TheDriver("", "", Diags);
Driver TheDriver((Twine(env::getLLVMPath()) + "/bin/clang").str(), "", Diags);
TheDriver.setTitle("AMDGPU Code Object Manager");
TheDriver.setCheckInputsExist(false);

Expand Down Expand Up @@ -998,11 +998,6 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
HIPIncludePath = (Twine(env::getHIPPath()) + "/include").str();
// HIP headers depend on hsa.h which is in ROCM_DIR/include.
ROCMIncludePath = (Twine(env::getROCMPath()) + "/include").str();
ClangIncludePath =
(Twine(env::getLLVMPath()) + "/lib/clang/" + CLANG_VERSION_STRING).str();
ClangIncludePath2 = (Twine(env::getLLVMPath()) + "/lib/clang/" +
CLANG_VERSION_STRING + "/include")
.str();

Args.push_back("-x");

Expand All @@ -1028,10 +1023,6 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
Args.push_back(ROCMIncludePath.c_str());
Args.push_back("-isystem");
Args.push_back(HIPIncludePath.c_str());
Args.push_back("-isystem");
Args.push_back(ClangIncludePath.c_str());
Args.push_back("-isystem");
Args.push_back(ClangIncludePath2.c_str());
break;
default:
return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT;
Expand Down

0 comments on commit e0fb8ac

Please sign in to comment.