Skip to content

Commit 3f91bdf

Browse files
committed
Revert "Replace ArchSpec::PiecewiseCompare() with Triple::operator==()"
This reverts commit 5e6bed8c0ea2f7fe380127763c8f753adae0fc1b while investigating the bots.
1 parent 87fadb3 commit 3f91bdf

File tree

6 files changed

+29
-33
lines changed

6 files changed

+29
-33
lines changed

lldb/include/lldb/Utility/ArchSpec.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@ class ArchSpec {
505505

506506
bool IsFullySpecifiedTriple() const;
507507

508+
void PiecewiseTripleCompare(const ArchSpec &other, bool &arch_different,
509+
bool &vendor_different, bool &os_different,
510+
bool &os_version_different,
511+
bool &env_different) const;
512+
508513
/// Detect whether this architecture uses thumb code exclusively
509514
///
510515
/// Some embedded ARM chips (e.g. the ARM Cortex M0-7 line) can only execute

lldb/source/Target/Target.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,8 +1568,14 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec, bool set_platform,
15681568

15691569
if (m_arch.GetSpec().IsCompatibleMatch(other)) {
15701570
compatible_local_arch = true;
1571+
bool arch_changed, vendor_changed, os_changed, os_ver_changed,
1572+
env_changed;
15711573

1572-
if (m_arch.GetSpec().GetTriple() == other.GetTriple())
1574+
m_arch.GetSpec().PiecewiseTripleCompare(other, arch_changed,
1575+
vendor_changed, os_changed,
1576+
os_ver_changed, env_changed);
1577+
1578+
if (!arch_changed && !vendor_changed && !os_changed && !env_changed)
15731579
replace_local_arch = false;
15741580
}
15751581
}

lldb/source/Utility/ArchSpec.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,23 @@ bool ArchSpec::IsFullySpecifiedTriple() const {
14211421
return true;
14221422
}
14231423

1424+
void ArchSpec::PiecewiseTripleCompare(
1425+
const ArchSpec &other, bool &arch_different, bool &vendor_different,
1426+
bool &os_different, bool &os_version_different, bool &env_different) const {
1427+
const llvm::Triple &me(GetTriple());
1428+
const llvm::Triple &them(other.GetTriple());
1429+
1430+
arch_different = (me.getArch() != them.getArch());
1431+
1432+
vendor_different = (me.getVendor() != them.getVendor());
1433+
1434+
os_different = (me.getOS() != them.getOS());
1435+
1436+
os_version_different = (me.getOSMajorVersion() != them.getOSMajorVersion());
1437+
1438+
env_different = (me.getEnvironment() != them.getEnvironment());
1439+
}
1440+
14241441
bool ArchSpec::IsAlwaysThumbInstructions() const {
14251442
std::string Status;
14261443
if (GetTriple().getArch() == llvm::Triple::arm ||

lldb/test/API/macosx/arm64e-attach/Makefile

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

lldb/test/API/macosx/arm64e-attach/TestArm64eAttach.py

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

lldb/test/API/macosx/arm64e-attach/main.c

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

0 commit comments

Comments
 (0)