Skip to content

Commit 4d75905

Browse files
Merge pull request #11042 from swiftlang/jepa-stable2
[stable/21.x] Cherry-pick a few more overlooked changes from previous stable branch
2 parents bdc63c2 + bf78496 commit 4d75905

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9284,16 +9284,17 @@ bool SwiftASTContext::GetCompileUnitImportsImpl(
92849284
validate_pcm = true;
92859285
#endif
92869286
}
9287-
9288-
auto &pp_opts = m_clangimporter->getClangPreprocessor()
9289-
.getPreprocessorOpts();
9290-
pp_opts.DisablePCHOrModuleValidation =
9291-
validate_pcm ? clang::DisableValidationForModuleKind::None
9292-
: clang::DisableValidationForModuleKind::All;
9293-
pp_opts.ModulesCheckRelocated = validate_pcm;
9294-
9295-
LOG_PRINTF(GetLog(LLDBLog::Types), "PCM validation is %s",
9296-
validate_pcm ? "disabled" : "enabled");
9287+
9288+
const auto &pp_opts =
9289+
m_clangimporter->getClangPreprocessor().getPreprocessorOpts();
9290+
// rdar://155232969
9291+
// pp_opts.DisablePCHOrModuleValidation =
9292+
// validate_pcm ? clang::DisableValidationForModuleKind::None
9293+
// : clang::DisableValidationForModuleKind::All;
9294+
// pp_opts.ModulesCheckRelocated = validate_pcm;
9295+
9296+
if (!validate_pcm)
9297+
LOG_PRINTF(GetLog(LLDBLog::Types), "PCM validation cannot be disabled");
92979298
}
92989299

92999300
LOG_PRINTF(GetLog(LLDBLog::Types), "Importing dependencies of current CU");

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
1717
#include "lldb/Core/PluginManager.h"
1818
#include "lldb/Symbol/CompileUnit.h"
19+
#include "llvm/Support/Error.h"
1920
#include <lldb/lldb-enumerations.h>
2021
#include <llvm/ADT/StringRef.h>
2122

@@ -207,6 +208,13 @@ bool TypeSystemSwift::GetPtrAuthAddressDiversity(
207208
return false;
208209
}
209210

211+
llvm::Expected<CompilerType> TypeSystemSwift::GetDereferencedType(
212+
lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx,
213+
std::string &deref_name, uint32_t &deref_byte_size,
214+
int32_t &deref_byte_offset, ValueObject *valobj, uint64_t &language_flags) {
215+
return llvm::createStringError("Swift types cannot be dereferenced");
216+
}
217+
210218
namespace llvm {
211219
llvm::raw_ostream &
212220
operator<<(llvm::raw_ostream &os,

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwift.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ class TypeSystemSwift : public TypeSystem {
350350
unsigned GetPtrAuthDiscriminator(lldb::opaque_compiler_type_t type) override;
351351
bool GetPtrAuthAddressDiversity(lldb::opaque_compiler_type_t type) override;
352352

353+
llvm::Expected<CompilerType>
354+
GetDereferencedType(lldb::opaque_compiler_type_t type,
355+
ExecutionContext *exe_ctx, std::string &deref_name,
356+
uint32_t &deref_byte_size, int32_t &deref_byte_offset,
357+
ValueObject *valobj, uint64_t &language_flags) override;
358+
353359
/// \}
354360
protected:
355361
/// Used in the logs.

0 commit comments

Comments
 (0)