Skip to content

Commit 6af163f

Browse files
authored
Merge pull request #1512 from Teemperor/cherry/766db6824d6c8f8061c1477be474c955db5296d7
[lldb] Fix that Swift uses the DisplayName in the FormatManager (cherry-pick swift/master-rebranch)
2 parents 95b0bda + d0dfff1 commit 6af163f

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

lldb/source/DataFormatters/FormatManager.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
#include "lldb/Target/Language.h"
1919
#include "lldb/Utility/Log.h"
2020

21+
// BEGIN SWIFT
22+
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
23+
// END SWIFT
24+
2125
using namespace lldb;
2226
using namespace lldb_private;
2327
using namespace lldb_private::formatters;
@@ -192,14 +196,21 @@ void FormatManager::GetPossibleMatches(
192196
entries.push_back(
193197
{type_name, did_strip_ptr, did_strip_ref, did_strip_typedef});
194198

195-
const SymbolContext *sc = nullptr;
196-
if (valobj.GetFrameSP())
197-
sc = &valobj.GetFrameSP()->GetSymbolContext(eSymbolContextFunction);
198-
199-
ConstString display_type_name(compiler_type.GetTypeName());
200-
if (display_type_name != type_name)
201-
entries.push_back({display_type_name, did_strip_ptr,
202-
did_strip_ref, did_strip_typedef});
199+
// BEGIN SWIFT
200+
TypeSystem *ts = compiler_type.GetTypeSystem();
201+
if (ts && !llvm::isa<TypeSystemClang>(ts)) {
202+
// END SWIFT
203+
const SymbolContext *sc = nullptr;
204+
if (valobj.GetFrameSP())
205+
sc = &valobj.GetFrameSP()->GetSymbolContext(eSymbolContextFunction);
206+
207+
ConstString display_type_name(compiler_type.GetDisplayTypeName(sc));
208+
if (display_type_name != type_name)
209+
entries.push_back({display_type_name, reason, did_strip_ptr,
210+
did_strip_ref, did_strip_typedef});
211+
// BEGIN SWIFT
212+
}
213+
// END SWIFT
203214
}
204215

205216
for (bool is_rvalue_ref = true, j = true;

0 commit comments

Comments
 (0)