[lld] 77b4230 - Revert "[lld-macho][nfc] minor clean up, follow up to D98559"

Vy Nguyen via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 14:15:47 PDT 2021


Author: Vy Nguyen
Date: 2021-03-23T17:15:36-04:00
New Revision: 77b4230ed9bea541fd3fb04707e35308c2f34347

URL: https://github.com/llvm/llvm-project/commit/77b4230ed9bea541fd3fb04707e35308c2f34347
DIFF: https://github.com/llvm/llvm-project/commit/77b4230ed9bea541fd3fb04707e35308c2f34347.diff

LOG: Revert "[lld-macho][nfc] minor clean up, follow up to D98559"

This reverts commit 1bc33eb6a32bdb193a8b838df823b4563450f6b3.
tests failed on windows

Added: 
    

Modified: 
    lld/MachO/DriverUtils.cpp
    lld/test/MachO/dependency-info.s

Removed: 
    


################################################################################
diff  --git a/lld/MachO/DriverUtils.cpp b/lld/MachO/DriverUtils.cpp
index 49bd83ecf09a..a12e1c537c16 100644
--- a/lld/MachO/DriverUtils.cpp
+++ b/lld/MachO/DriverUtils.cpp
@@ -284,8 +284,8 @@ void macho::DependencyTracker::write(llvm::StringRef version,
   inputNames.reserve(inputs.size());
   for (InputFile *f : inputs)
     inputNames.push_back(f->getName());
-  llvm::sort(inputNames);
-
+  llvm::sort(inputNames,
+             [](const StringRef &a, const StringRef &b) { return a < b; });
   for (const StringRef &in : inputNames)
     addDep(DepOpCode::Input, in);
 

diff  --git a/lld/test/MachO/dependency-info.s b/lld/test/MachO/dependency-info.s
index c2638d399c96..f76605c35ae8 100644
--- a/lld/test/MachO/dependency-info.s
+++ b/lld/test/MachO/dependency-info.s
@@ -1,4 +1,7 @@
 # REQUIRES: x86
+## FIXME: Paths on windows have both `\` and '/', as a result, they are in a 
diff erent
+## order when sorted. Maybe create a separate test for that?
+# UNSUPPORTED: system-windows
 #
 # RUN: rm -rf %t
 # RUN: split-file %s %t


        


More information about the llvm-commits mailing list