Skip to content

Commit 9aad4d0

Browse files
committed
Fix for linux
1 parent 42632ee commit 9aad4d0

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,21 +2921,20 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
29212921

29222922
ArchSpec preferred_arch;
29232923
llvm::Triple preferred_triple;
2924-
if (module_arch && module_triple != llvm::Triple()) {
2924+
if (module_arch && module_arch.IsFullySpecifiedTriple()) {
29252925
LOG_PRINTF(GetLog(LLDBLog::Types),
29262926
"Preferring module triple %s over target triple %s.",
29272927
module_triple.str().c_str(), target_triple.str().c_str());
29282928
preferred_arch = module_arch;
29292929
preferred_triple = module_triple;
29302930
} else {
2931-
// When no module triple, fallback to the target triple.
2931+
// When no viable module triple, fallback to the target triple.
29322932
preferred_arch = target_arch;
29332933
preferred_triple = target_triple;
29342934
}
29352935

29362936
llvm::Triple computed_triple;
2937-
if (preferred_arch.IsFullySpecifiedTriple() ||
2938-
!preferred_triple.isOSDarwin()) {
2937+
if (preferred_arch.IsFullySpecifiedTriple()) {
29392938
// If a fully specified triple was passed in, for example
29402939
// through CreateTargetWithFileAndTargetTriple(), prefer that.
29412940
LOG_PRINTF(GetLog(LLDBLog::Types), "Fully specified target triple %s.",

lldb/test/API/lang/swift/module_import/TestSwiftModuleImport.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ def test(self):
1818

1919
log = self.getBuildArtifact("types.log")
2020
self.runCmd('log enable lldb types -f "%s"' % log)
21-
self.runCmd("expression -- 0", check=False)
22-
with open(log) as f:
23-
lines = f.readlines()
24-
if lines:
25-
for line in lines:
26-
print(line)
27-
print(line, file=sys.stderr)
28-
else:
29-
print("### NO LOGS ###")
30-
print("### NO LOGS ###", file=sys.stderr)
31-
self.assertTrue(False)
21+
self.expect("expression -- 0")
3222
self.filecheck('platform shell cat "%s"' % log, __file__)
3323
# CHECK: SwiftASTContextForExpressions{{.*}}Module import remark: loaded module 'a'

0 commit comments

Comments
 (0)