diff options
author | Zhang Qing Shan <zhangqingshan.zll@bytedance.com> | 2022-09-10 08:05:20 +0800 |
---|---|---|
committer | Zhang Qing Shan <zhangqingshan.zll@bytedance.com> | 2022-09-13 13:45:51 +0800 |
commit | 4531f5385125dd6448004a16cd80a94484ca68b7 (patch) | |
tree | 19bfe2eea3cbc8073b71a84d6043b86df837fdfe /llvm/tools/llvm-dwp/llvm-dwp.cpp | |
parent | 79fa0ec8c4bfeeb21f7b44ebd9a66e7ec9781798 (diff) | |
download | llvm-4531f5385125dd6448004a16cd80a94484ca68b7.zip llvm-4531f5385125dd6448004a16cd80a94484ca68b7.tar.gz llvm-4531f5385125dd6448004a16cd80a94484ca68b7.tar.bz2 |
[llvm-dwp] Get the DWO file from relative path if the absolute path is not valid
Extend the llvm-dwp to support searching the DWOs that from relative path for the
case that build from remote building system(different comp_dir).
Reviewd By: dblaikie
Differential Revision: https://reviews.llvm.org/D133480
Diffstat (limited to 'llvm/tools/llvm-dwp/llvm-dwp.cpp')
-rw-r--r-- | llvm/tools/llvm-dwp/llvm-dwp.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp index 7d1dd61..f9d1dc4 100644 --- a/llvm/tools/llvm-dwp/llvm-dwp.cpp +++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp @@ -71,7 +71,10 @@ getDWOFilenames(StringRef ExecFilename) { if (!DWOCompDir.empty()) { SmallString<16> DWOPath(std::move(DWOName)); sys::fs::make_absolute(DWOCompDir, DWOPath); - DWOPaths.emplace_back(DWOPath.data(), DWOPath.size()); + if (!sys::fs::exists(DWOPath) && sys::fs::exists(DWOName)) + DWOPaths.push_back(std::move(DWOName)); + else + DWOPaths.emplace_back(DWOPath.data(), DWOPath.size()); } else { DWOPaths.push_back(std::move(DWOName)); } |