File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 3333#include " llvm/MC/MCSymbol.h"
3434#include " llvm/Support/CommandLine.h"
3535#include " llvm/Support/Error.h"
36+ #include " llvm/Support/FileSystem.h"
3637#include " llvm/Support/Regex.h"
3738#include < algorithm>
3839#include < functional>
@@ -1636,7 +1637,9 @@ void BinaryContext::preprocessDWODebugInfo() {
16361637 if (!opts::CompDirOverride.empty ()) {
16371638 sys::path::append (AbsolutePath, opts::CompDirOverride);
16381639 sys::path::append (AbsolutePath, DWOName);
1639- }
1640+ } else if (!sys::fs::exists (DwarfUnit->getCompilationDir ()) &&
1641+ sys::fs::exists (DWOName))
1642+ AbsolutePath = DWOName;
16401643 DWARFUnit *DWOCU =
16411644 DwarfUnit->getNonSkeletonUnitDIE (false , AbsolutePath).getDwarfUnit ();
16421645 if (!DWOCU->isDWOUnit ()) {
Original file line number Diff line number Diff line change @@ -1851,6 +1851,8 @@ void DWARFRewriter::writeDWOFiles(
18511851 CompDir = opts::DwarfOutputPath.c_str ();
18521852 else if (!opts::CompDirOverride.empty ())
18531853 CompDir = opts::CompDirOverride;
1854+ else if (!sys::fs::exists (CompDir))
1855+ CompDir = " ." ;
18541856
18551857 SmallString<16 > AbsolutePath;
18561858 sys::path::append (AbsolutePath, CompDir);
You can’t perform that action at this time.
0 commit comments