[Lldb-commits] [lldb] 92d42b3 - Utility: ignore OS version on non-Darwin targets in `ArchSpec`

Saleem Abdulrasool via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 23 18:21:45 PDT 2020


Author: Saleem Abdulrasool
Date: 2020-09-23T18:21:34-07:00
New Revision: 92d42b32a9b7a085fd200a56022724a77cf12a2d

URL: https://github.com/llvm/llvm-project/commit/92d42b32a9b7a085fd200a56022724a77cf12a2d
DIFF: https://github.com/llvm/llvm-project/commit/92d42b32a9b7a085fd200a56022724a77cf12a2d.diff

LOG: Utility: ignore OS version on non-Darwin targets in `ArchSpec`

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

Added: 
    

Modified: 
    lldb/source/Utility/ArchSpec.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp
index 9cbd5df3a7b6..c7b56a8385f7 100644
--- a/lldb/source/Utility/ArchSpec.cpp
+++ b/lldb/source/Utility/ArchSpec.cpp
@@ -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;
       }
     }


        


More information about the lldb-commits mailing list