Utility: ignore OS version on non-Darwin targets in `ArchSpec`
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 23 Sep 2020 20:57:55 +0000 (20:57 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 24 Sep 2020 01:21:34 +0000 (18:21 -0700)
The OS version field is generally not very helpful for non-Darwin
targets.  On Linux, it identifies the kernel version which moves
out-of-sync with the userspace.  On Windows, this field actually ends up
corresponding to the Visual Studio toolset version instead of the OS
version.  Consider non-Darwin targets without an OS version to be fully
specified.

Differential Revision: https://reviews.llvm.org/D88181
Reviewed By: Jonas Devlieghere, Dave Lee

lldb/source/Utility/ArchSpec.cpp

index 9cbd5df..c7b56a8 100644 (file)
@@ -1426,7 +1426,8 @@ bool ArchSpec::IsFullySpecifiedTriple() const {
     if ((user_specified_triple.getVendor() != llvm::Triple::UnknownVendor) ||
         TripleVendorWasSpecified()) {
       const unsigned unspecified = 0;
-      if (user_specified_triple.getOSMajorVersion() != unspecified) {
+      if (!user_specified_triple.isOSDarwin() ||
+          user_specified_triple.getOSMajorVersion() != unspecified) {
         user_triple_fully_specified = true;
       }
     }