File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
lldb/source/Plugins/TypeSystem/Swift Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1455,6 +1455,8 @@ SwiftASTContext *TypeSystemSwiftTypeRef::GetSwiftASTContext() const {
1455
1455
*const_cast <TypeSystemSwiftTypeRef *>(this ));
1456
1456
m_swift_ast_context =
1457
1457
llvm::dyn_cast_or_null<SwiftASTContext>(m_swift_ast_context_sp.get ());
1458
+ if (m_swift_ast_context && !m_swift_ast_context_triple.str ().empty ())
1459
+ m_swift_ast_context->SetTriple (m_swift_ast_context_triple);
1458
1460
}
1459
1461
return m_swift_ast_context;
1460
1462
}
@@ -1522,8 +1524,10 @@ llvm::Triple TypeSystemSwiftTypeRef::GetTriple() const {
1522
1524
}
1523
1525
1524
1526
void TypeSystemSwiftTypeRef::SetTriple (const llvm::Triple triple) {
1525
- if (auto *swift_ast_context = GetSwiftASTContext ())
1527
+ if (auto *swift_ast_context = GetSwiftASTContextOrNull ())
1526
1528
swift_ast_context->SetTriple (triple);
1529
+ else
1530
+ m_swift_ast_context_triple = triple;
1527
1531
}
1528
1532
1529
1533
void TypeSystemSwiftTypeRef::ClearModuleDependentCaches () {
Original file line number Diff line number Diff line change @@ -427,6 +427,7 @@ class TypeSystemSwiftTypeRef : public TypeSystemSwift {
427
427
#endif
428
428
429
429
// / The sibling SwiftASTContext.
430
+ llvm::Triple m_swift_ast_context_triple;
430
431
mutable bool m_swift_ast_context_initialized = false ;
431
432
mutable lldb::TypeSystemSP m_swift_ast_context_sp;
432
433
mutable SwiftASTContext *m_swift_ast_context = nullptr ;
You can’t perform that action at this time.
0 commit comments