Skip to content

Commit 1240129

Browse files
committed
[lldb] Adjust for implicitly-deleted copy constructor of ModuleListProperties
GetGlobalModuleListProperties() returns a ModuleListProperties, but that class has an implicitly deleted copy constructor. Therefore we should be grabbing a reference to the ModuleListProperties. Additionally, the uses I noticed in SwiftASTContext can be made const.
1 parent 8ba776b commit 1240129

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lldb/source/Symbol/SwiftASTContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ static bool IsDeviceSupport(const char *path) {
841841

842842
static std::string GetClangModulesCacheProperty() {
843843
llvm::SmallString<128> path;
844-
auto props = ModuleList::GetGlobalModuleListProperties();
844+
const auto &props = ModuleList::GetGlobalModuleListProperties();
845845
props.GetClangModulesCachePath().GetPath(path);
846846
return path.str();
847847
}
@@ -2690,7 +2690,7 @@ swift::ClangImporterOptions &SwiftASTContext::GetClangImporterOptions() {
26902690

26912691
// Set the Clang module search path.
26922692
llvm::SmallString<128> path;
2693-
auto props = ModuleList::GetGlobalModuleListProperties();
2693+
const auto &props = ModuleList::GetGlobalModuleListProperties();
26942694
props.GetClangModulesCachePath().GetPath(path);
26952695
clang_importer_options.ModuleCachePath = path.str();
26962696

@@ -3423,7 +3423,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
34233423
if (!m_ast_context_ap->SearchPathOpts.SDKPath.empty() || TargetHasNoSDK()) {
34243424
if (!clang_importer_options.OverrideResourceDir.empty()) {
34253425
// Create the DWARFImporterDelegate.
3426-
auto props = ModuleList::GetGlobalModuleListProperties();
3426+
const auto &props = ModuleList::GetGlobalModuleListProperties();
34273427
if (props.GetUseDWARFImporter())
34283428
m_dwarf_importer_delegate_up =
34293429
std::make_unique<SwiftDWARFImporterDelegate>(*this);
@@ -3480,7 +3480,7 @@ swift::ASTContext *SwiftASTContext::GetASTContext() {
34803480
prebuiltModuleCachePath.c_str());
34813481

34823482
// Determine the Swift module loading mode to use.
3483-
auto props = ModuleList::GetGlobalModuleListProperties();
3483+
const auto &props = ModuleList::GetGlobalModuleListProperties();
34843484
swift::ModuleLoadingMode loading_mode;
34853485
switch (props.GetSwiftModuleLoadingMode()) {
34863486
case eSwiftModuleLoadingModePreferSerialized:

0 commit comments

Comments
 (0)