Skip to content

Commit bf78496

Browse files
kastiglioneAnthonyLatsis
authored andcommitted
[lldb] Override GetDereferencedType for TypeSystemSwift
(cherry picked from commit feacb72)
1 parent 5b2c9ed commit bf78496

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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)