Skip to content

Commit 8c19757

Browse files
author
git apple-llvm automerger
committed
Merge commit '771130a54aed' from swift/release/6.2 into stable/20240723
2 parents 07b7770 + 771130a commit 8c19757

File tree

14 files changed

+129
-83
lines changed

14 files changed

+129
-83
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,18 +2707,17 @@ SwiftASTContext::CreateInstance(const SymbolContext &sc,
27072707

27082708
CompileUnit *cu = sc.comp_unit;
27092709
const char *key = TypeSystemSwiftTypeRef::DeriveKeyFor(sc);
2710-
bool swift_context = cu && cu->GetLanguage() == eLanguageTypeSwift;
27112710
std::string m_description;
27122711
{
27132712
StreamString ss;
27142713
ss << "SwiftASTContext";
27152714
if (for_expressions)
27162715
ss << "ForExpressions";
27172716
ss << "(module: " << '"' << key << "\", " << "cu: " << '"';
2718-
if (cu && swift_context)
2717+
if (cu)
27192718
ss << cu->GetPrimaryFile().GetFilename();
27202719
else
2721-
ss << "*";
2720+
ss << "null";
27222721
ss << '"' << ')';
27232722
m_description = ss.GetString();
27242723
}
@@ -2798,8 +2797,7 @@ SwiftASTContext::CreateInstance(const SymbolContext &sc,
27982797
ModuleList module_module;
27992798
if (!target_sp)
28002799
module_module.Append(module_sp);
2801-
ModuleList &modules =
2802-
(target_sp && swift_context) ? target_sp->GetImages() : module_module;
2800+
ModuleList &modules = target_sp ? target_sp->GetImages() : module_module;
28032801
const size_t num_images = modules.GetSize();
28042802

28052803
// Set the SDK path prior to doing search paths. Otherwise when we
@@ -3135,8 +3133,7 @@ SwiftASTContext::CreateInstance(const SymbolContext &sc,
31353133
}
31363134
}
31373135
};
3138-
if (swift_context)
3139-
scan_module(module_sp, 0);
3136+
scan_module(module_sp, 0);
31403137
for (size_t mi = 0; mi != num_images; ++mi) {
31413138
auto image_sp = modules.GetModuleAtIndex(mi);
31423139
if (!visited_modules.count(image_sp.get()))

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,14 +2072,15 @@ ConstString TypeSystemSwiftTypeRef::GetSwiftModuleFor(const SymbolContext &sc) {
20722072
}
20732073

20742074
const char *TypeSystemSwiftTypeRef::DeriveKeyFor(const SymbolContext &sc) {
2075-
if (sc.comp_unit && sc.comp_unit->GetLanguage() == eLanguageTypeSwift)
2075+
if (sc.function)
20762076
if (ConstString name = GetSwiftModuleFor(sc))
20772077
return name.GetCString();
20782078

2079-
// Otherwise create a catch-all context per unique triple.
2080-
if (sc.module_sp)
2081-
return ConstString(sc.module_sp->GetArchitecture().GetTriple().str()).AsCString();
2082-
2079+
if (sc.module_sp) {
2080+
if (sc.module_sp->GetFileSpec())
2081+
return sc.module_sp->GetFileSpec().GetFilename().GetCString();
2082+
return sc.module_sp->GetObjectName().GetCString();
2083+
}
20832084
return nullptr;
20842085
}
20852086

@@ -2562,9 +2563,6 @@ template <> bool Equivalent<CompilerType>(CompilerType l, CompilerType r) {
25622563
ConstString rhs = r.GetMangledTypeName();
25632564
if (lhs == ConstString("$sSiD") && rhs == ConstString("$sSuD"))
25642565
return true;
2565-
if (lhs.GetStringRef() == "$sSPySo0023unnamedstruct_hEEEdhdEaVGSgD" &&
2566-
rhs.GetStringRef() == "$ss13OpaquePointerVSgD")
2567-
return true;
25682566
// Ignore missing sugar.
25692567
swift::Demangle::Demangler dem;
25702568
auto l_node = GetDemangledType(dem, lhs.GetStringRef());

lldb/test/API/lang/swift/po/objc/Base.h

Lines changed: 0 additions & 3 deletions
This file was deleted.

lldb/test/API/lang/swift/po/objc/Foo.swift

Lines changed: 0 additions & 15 deletions
This file was deleted.

lldb/test/API/lang/swift/po/objc/Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.

lldb/test/API/lang/swift/po/objc/TestSwiftPOObjC.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

lldb/test/API/lang/swift/po/objc/main.m

Lines changed: 0 additions & 13 deletions
This file was deleted.

lldb/test/API/lang/swift/po/objc/module.modulemap

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFExecutableName</key>
6+
<string>test</string>
7+
</dict>
8+
</plist>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
all: dylib xctest
2+
C_SOURCES=xctest.c
3+
EXE=xctest
4+
5+
include Makefile.rules
6+
7+
.PHONY: dylib
8+
dylib:
9+
"$(MAKE)" MAKE_DSYM=$(MAKE_DSYM) CC=$(CC) SWIFTC=$(SWIFTC) \
10+
ARCH=$(ARCH) DSYMUTIL=$(DSYMUTIL) \
11+
VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/dylib.mk all
12+
13+
clean::
14+
rm -rf *.o *.dSYM *.dylib *.swiftdoc *.swiftmodule *.xctest xctest
15+
"$(MAKE)" VPATH=$(SRCDIR) -f $(SRCDIR)/dylib.mk clean
16+

0 commit comments

Comments
 (0)