This revision was automatically updated to reflect the committed changes. Closed by commit rG8120eba5fce3: [lldb/ArchSpec] Always match simulator environment in IsEqualTo (authored by friss).
Changed prior to commit: https://reviews.llvm.org/D84716?vs=281084&id=281088#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84716/new/ https://reviews.llvm.org/D84716 Files: lldb/source/Utility/ArchSpec.cpp lldb/unittests/Utility/ArchSpecTest.cpp Index: lldb/unittests/Utility/ArchSpecTest.cpp =================================================================== --- lldb/unittests/Utility/ArchSpecTest.cpp +++ lldb/unittests/Utility/ArchSpecTest.cpp @@ -306,6 +306,14 @@ ASSERT_FALSE(A.IsExactMatch(B)); ASSERT_FALSE(A.IsCompatibleMatch(B)); } + { + ArchSpec A("arm64-apple-ios"); + ArchSpec B("arm64-apple-ios-simulator"); + ASSERT_FALSE(A.IsExactMatch(B)); + ASSERT_FALSE(A.IsCompatibleMatch(B)); + ASSERT_FALSE(B.IsCompatibleMatch(A)); + ASSERT_FALSE(B.IsCompatibleMatch(A)); + } { ArchSpec A("arm64-*-*"); ArchSpec B("arm64-apple-ios"); Index: lldb/source/Utility/ArchSpec.cpp =================================================================== --- lldb/source/Utility/ArchSpec.cpp +++ lldb/source/Utility/ArchSpec.cpp @@ -987,6 +987,12 @@ if (lhs == rhs) return true; + // Apple simulators are a different platform than what they simulate. + // As the environments are different at this point, if one of them is a + // simulator, then they are different. + if (lhs == llvm::Triple::Simulator || rhs == llvm::Triple::Simulator) + return false; + // If any of the environment is unknown then they are compatible if (lhs == llvm::Triple::UnknownEnvironment || rhs == llvm::Triple::UnknownEnvironment)
Index: lldb/unittests/Utility/ArchSpecTest.cpp =================================================================== --- lldb/unittests/Utility/ArchSpecTest.cpp +++ lldb/unittests/Utility/ArchSpecTest.cpp @@ -306,6 +306,14 @@ ASSERT_FALSE(A.IsExactMatch(B)); ASSERT_FALSE(A.IsCompatibleMatch(B)); } + { + ArchSpec A("arm64-apple-ios"); + ArchSpec B("arm64-apple-ios-simulator"); + ASSERT_FALSE(A.IsExactMatch(B)); + ASSERT_FALSE(A.IsCompatibleMatch(B)); + ASSERT_FALSE(B.IsCompatibleMatch(A)); + ASSERT_FALSE(B.IsCompatibleMatch(A)); + } { ArchSpec A("arm64-*-*"); ArchSpec B("arm64-apple-ios"); Index: lldb/source/Utility/ArchSpec.cpp =================================================================== --- lldb/source/Utility/ArchSpec.cpp +++ lldb/source/Utility/ArchSpec.cpp @@ -987,6 +987,12 @@ if (lhs == rhs) return true; + // Apple simulators are a different platform than what they simulate. + // As the environments are different at this point, if one of them is a + // simulator, then they are different. + if (lhs == llvm::Triple::Simulator || rhs == llvm::Triple::Simulator) + return false; + // If any of the environment is unknown then they are compatible if (lhs == llvm::Triple::UnknownEnvironment || rhs == llvm::Triple::UnknownEnvironment)
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits