Skip to content

Commit b879073

Browse files
Merge pull request #8407 from adrian-prantl/109227800
[Disable target mismatch check when precise compiler invocations are o...
2 parents 65d2f2d + a74ed32 commit b879073

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

lldb/source/Target/Target.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,9 @@ std::optional<SwiftScratchContextReader> Target::GetSwiftScratchContext(
29292929
}
29302930

29312931
// Opt into the per-module scratch context if we find incompatible triples.
2932-
if (!m_use_scratch_typesystem_per_module) {
2932+
if (!m_use_scratch_typesystem_per_module &&
2933+
!ModuleList::GetGlobalModuleListProperties()
2934+
.GetUseSwiftPreciseCompilerInvocation()) {
29332935
TargetSP target_sp = exe_scope.CalculateTarget();
29342936
if (lldb_module) {
29352937
auto module_arch = lldb_module->GetArchitecture();

lldb/test/API/lang/swift/other_arch_dylib/TestSwiftOtherArchDylib.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,7 @@ def test(self):
3333
self.expect("expression 1", substrs=['1'])
3434

3535
# Check the types log.
36-
import re
37-
import io
38-
types_logfile = io.open(types_log, "r", encoding='utf-8')
39-
re0 = re.compile(r'SwiftASTContextForExpressions::LogConfiguration().*arm64-apple-macosx')
40-
re1 = re.compile(r'Enabling per-module Swift scratch context')
41-
re2 = re.compile(r'wiftASTContextForExpressions..OtherArch..::LogConfiguration().*arm64e-apple-macosx')
42-
found = 0
43-
for line in types_logfile:
44-
if self.TraceOn():
45-
print(line[:-1])
46-
if found == 0 and re0.search(line):
47-
found = 1
48-
elif found == 1 and re1.search(line):
49-
found = 2
50-
elif found == 2 and re2.search(line):
51-
found = 3
52-
break
53-
self.assertEquals(found, 3)
36+
self.filecheck('platform shell cat "%s"' % types_log, __file__)
37+
# CHECK: SwiftASTContextForExpressions::LogConfiguration() arm64-apple-macosx
38+
# CHECK: Enabling per-module Swift scratch context
39+
# CHECK: {{SwiftASTContextForExpressions..OtherArch..}}::LogConfiguration() arm64e-apple-macosx

0 commit comments

Comments
 (0)