@@ -57,21 +57,19 @@ class PluginProperties : public Properties {
57
57
return urls;
58
58
}
59
59
60
- llvm::Expected<llvm::StringRef > GetCachePath () {
60
+ llvm::Expected<std::string > GetCachePath () {
61
61
OptionValueString *s =
62
62
m_collection_sp->GetPropertyAtIndexAsOptionValueString (
63
63
ePropertySymbolCachePath);
64
64
// If we don't have a valid cache location, use the default one.
65
65
if (!s || !s->GetCurrentValueAsRef ().size ()) {
66
66
llvm::Expected<std::string> maybeCachePath =
67
67
llvm::getDefaultDebuginfodCacheDirectory ();
68
- if (!maybeCachePath) {
68
+ if (!maybeCachePath)
69
69
return maybeCachePath;
70
- }
71
- m_cache_path = *maybeCachePath;
72
- return llvm::StringRef (m_cache_path);
70
+ return *maybeCachePath;
73
71
}
74
- return s->GetCurrentValueAsRef ();
72
+ return s->GetCurrentValue ();
75
73
}
76
74
77
75
std::chrono::milliseconds GetTimeout () const {
@@ -96,7 +94,6 @@ class PluginProperties : public Properties {
96
94
}
97
95
// Storage for the StringRef's used within the Debuginfod library.
98
96
Args m_server_urls;
99
- std::string m_cache_path;
100
97
};
101
98
102
99
} // namespace
@@ -157,12 +154,11 @@ GetFileForModule(const ModuleSpec &module_spec,
157
154
// Grab LLDB's Debuginfod overrides from the
158
155
// plugin.symbol-locator.debuginfod.* settings.
159
156
PluginProperties &plugin_props = GetGlobalPluginProperties ();
160
- llvm::Expected<llvm::StringRef> cache_path_or_err =
161
- plugin_props.GetCachePath ();
157
+ llvm::Expected<std::string> cache_path_or_err = plugin_props.GetCachePath ();
162
158
// A cache location is *required*.
163
159
if (!cache_path_or_err)
164
160
return {};
165
- llvm::StringRef cache_path = *cache_path_or_err;
161
+ std::string cache_path = *cache_path_or_err;
166
162
llvm::SmallVector<llvm::StringRef> debuginfod_urls =
167
163
llvm::getDefaultDebuginfodUrls ();
168
164
std::chrono::milliseconds timeout = plugin_props.GetTimeout ();
0 commit comments