Skip to content

Commit 915d498

Browse files
CAS configuration
1 parent a04e9f3 commit 915d498

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

lldb/include/lldb/Core/ModuleList.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ class ModuleListProperties : public Properties {
100100
bool GetSwiftEnableASTContext() const;
101101
// END SWIFT
102102

103+
// START CAS
104+
FileSpec GetCASOnDiskPath() const;
105+
FileSpec GetCASPluginPath() const;
106+
std::vector<std::pair<std::string, std::string>> GetCASPluginOptions() const;
107+
// END CAS
108+
103109
FileSpec GetClangModulesCachePath() const;
104110
bool SetClangModulesCachePath(const FileSpec &path);
105111
bool GetEnableExternalLookup() const;

lldb/source/Core/CoreProperties.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ let Definition = "modulelist" in {
7474
DefaultTrue,
7575
Desc<"Enable instantiating Swift AST contexts.">;
7676
// END SWIFT
77+
// BEGIN CAS
78+
def CASOnDiskPath: Property<"cas-path", "FileSpec">,
79+
Global,
80+
DefaultStringValue<"">,
81+
Desc<"The path for CAS storage">;
82+
def CASPluginPath: Property<"cas-plugin-path", "FileSpec">,
83+
Global,
84+
DefaultStringValue<"">,
85+
Desc<"The path for CAS plugin dynamic library">;
86+
def CASPluginOptions: Property<"cas-plugin-options", "Array">,
87+
ElementType<"String">,
88+
Desc<"A list of options to be passed to CAS plugins">;
89+
// END CAS
7790
def SymLinkPaths: Property<"debug-info-symlink-paths", "FileSpecList">,
7891
Global,
7992
DefaultStringValue<"">,

lldb/source/Core/ModuleList.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,32 @@ bool ModuleListProperties::GetSwiftEnableASTContext() const {
282282
}
283283
// END SWIFT
284284

285+
// START CAS
286+
FileSpec ModuleListProperties::GetCASOnDiskPath() const {
287+
const uint32_t idx = ePropertyCASOnDiskPath;
288+
return GetPropertyAtIndexAs<FileSpec>(idx, {});
289+
}
290+
291+
FileSpec ModuleListProperties::GetCASPluginPath() const {
292+
const uint32_t idx = ePropertyCASPluginPath;
293+
return GetPropertyAtIndexAs<FileSpec>(idx, {});
294+
}
295+
296+
std::vector<std::pair<std::string, std::string>>
297+
ModuleListProperties::GetCASPluginOptions() const {
298+
Args args;
299+
const uint32_t idx = ePropertyCASPluginOptions;
300+
m_collection_sp->GetPropertyAtIndexAsArgs(idx, args);
301+
std::vector<std::pair<std::string, std::string>> options;
302+
for (auto &arg: args) {
303+
llvm::StringRef opt = arg.c_str();
304+
auto splitted = opt.split("=");
305+
options.emplace_back(splitted.first.str(), splitted.second.str());
306+
}
307+
return options;
308+
}
309+
// END CAS
310+
285311
FileSpec ModuleListProperties::GetLLDBIndexCachePath() const {
286312
const uint32_t idx = ePropertyLLDBIndexCachePath;
287313
return GetPropertyAtIndexAs<FileSpec>(idx, {});

0 commit comments

Comments
 (0)