[lldb] Fix Clang modules build after D101329

D101329 introduces the Process:SaveCore function returning a
`llvm::Expected<bool>`. That function causes that Clang with -fmodules crashes
while compiling LLDB's PythonDataObjects.cpp. With enabled asserts Clang fails
because of:

    Assertion failed: (CachedFieldIndex && "failed to find field in parent")

Crash can be reproduced by building via -DLLVM_ENABLE_MODULES=On with Clang
12.0.1 and then building PythonDataObjects.cpp.o .

Clang bug is tracked at rdar://82901462
This commit is contained in:
Raphael Isemann 2021-09-10 13:10:09 +02:00
parent 05b4e49a17
commit 0c8444bd34
2 changed files with 5 additions and 3 deletions

View File

@ -695,9 +695,7 @@ public:
/// \return
/// true if saved successfully, false if saving the core dump
/// is not supported by the plugin, error otherwise.
virtual llvm::Expected<bool> SaveCore(llvm::StringRef outfile) {
return false;
}
virtual llvm::Expected<bool> SaveCore(llvm::StringRef outfile);
protected:
virtual JITLoaderList &GetJITLoaders();

View File

@ -2650,6 +2650,10 @@ DynamicLoader *Process::GetDynamicLoader() {
DataExtractor Process::GetAuxvData() { return DataExtractor(); }
llvm::Expected<bool> Process::SaveCore(llvm::StringRef outfile) {
return false;
}
JITLoaderList &Process::GetJITLoaders() {
if (!m_jit_loaders_up) {
m_jit_loaders_up = std::make_unique<JITLoaderList>();