Add an explicit API to read the Xcode SDK DWARF attribute from compile units

When debugging from a SymbolMap the creation of CompileUnits for the
individual object files is so lazy that RegisterXcodeSDK() is not
invoked at all before the Swift TypeSystem wants to read it. This
patch fixes this by introducing an explicit
SymbolFile::ParseXcodeSDK() call that can be invoked deterministically
before the result is required.

<rdar://problem/62532151+62326862>

https://reviews.llvm.org/D79273
This commit is contained in:
Adrian Prantl
2020-05-01 15:50:53 -07:00
parent 5e3ab8f229
commit 5935227e11
8 changed files with 42 additions and 22 deletions

View File

@@ -1598,9 +1598,6 @@ bool Module::RemapSourceFile(llvm::StringRef path,
void Module::RegisterXcodeSDK(llvm::StringRef sdk_name, llvm::StringRef sysroot) {
XcodeSDK sdk(sdk_name.str());
if (m_xcode_sdk == sdk)
return;
m_xcode_sdk.Merge(sdk);
PlatformSP module_platform =
Platform::GetPlatformForArchitecture(GetArchitecture(), nullptr);
ConstString sdk_path(module_platform->GetSDKPath(sdk));