Merge pull request #30367 from adrian-prantl/sdk-5.3

Adapt to API change that moved Sysroot attribute to CompileUnit
This commit is contained in:
fredriss
2020-03-11 18:31:43 -07:00
committed by GitHub

View File

@@ -659,10 +659,8 @@ private:
} }
} }
StringRef Sysroot = IGM.Context.SearchPathOpts.SDKPath;
llvm::DIModule *M = llvm::DIModule *M =
DBuilder.createModule(Parent, Name, ConfigMacros, RemappedIncludePath, DBuilder.createModule(Parent, Name, ConfigMacros, RemappedIncludePath);
Sysroot);
DIModuleCache.insert({Key, llvm::TrackingMDNodeRef(M)}); DIModuleCache.insert({Key, llvm::TrackingMDNodeRef(M)});
return M; return M;
} }
@@ -1697,13 +1695,18 @@ IRGenDebugInfoImpl::IRGenDebugInfoImpl(const IRGenOptions &Opts,
DBuilder.createFile(DebugPrefixMap.remapPath(SourcePath), DBuilder.createFile(DebugPrefixMap.remapPath(SourcePath),
DebugPrefixMap.remapPath(Opts.DebugCompilationDir)); DebugPrefixMap.remapPath(Opts.DebugCompilationDir));
StringRef Sysroot = IGM.Context.SearchPathOpts.SDKPath;
TheCU = DBuilder.createCompileUnit( TheCU = DBuilder.createCompileUnit(
Lang, MainFile, Lang, MainFile,
Producer, Opts.shouldOptimize(), Opts.getDebugFlags(PD), Producer, Opts.shouldOptimize(), Opts.getDebugFlags(PD),
MajorRuntimeVersion, SplitName, MajorRuntimeVersion, SplitName,
Opts.DebugInfoLevel > IRGenDebugInfoLevel::LineTables Opts.DebugInfoLevel > IRGenDebugInfoLevel::LineTables
? llvm::DICompileUnit::FullDebug ? llvm::DICompileUnit::FullDebug
: llvm::DICompileUnit::LineTablesOnly); : llvm::DICompileUnit::LineTablesOnly,
/* DWOId */ 0, /* SplitDebugInlining */ true,
/* DebugInfoForProfiling */ false,
llvm::DICompileUnit::DebugNameTableKind::Default,
/* RangesBaseAddress */ false, Sysroot);
// Because the swift compiler relies on Clang to setup the Module, // Because the swift compiler relies on Clang to setup the Module,
// the clang CU is always created first. Several dwarf-reading // the clang CU is always created first. Several dwarf-reading