[PATCH] D37823: Filenames are case-insensitive on Windows, so .DEF is the same as .def.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 13 13:10:11 PDT 2017


ruiu created this revision.

Filenames are case-insensitive on Windows, so .DEF is the same as .def.


https://reviews.llvm.org/D37823

Files:
  lld/MinGW/Driver.cpp
  lld/test/MinGW/driver.test


Index: lld/test/MinGW/driver.test
===================================================================
--- lld/test/MinGW/driver.test
+++ lld/test/MinGW/driver.test
@@ -26,8 +26,11 @@
 SHARED:      -out:a.dll
 SHARED-SAME: -dll
 
-RUN: ld.lld -### foo.o -m i386pep -shared foo.def | FileCheck -check-prefix=DEF %s
-DEF: -def:foo.def
+RUN: ld.lld -### foo.o -m i386pep -shared foo.def | FileCheck -check-prefix=DEF1 %s
+DEF1: -def:foo.def
+
+RUN: ld.lld -### foo.o -m i386pep -shared FOO.DEF | FileCheck -check-prefix=DEF2 %s
+DEF2: -def:FOO.DEF
 
 RUN: ld.lld -### foo.o -m i386pep -o bar.exe | FileCheck -check-prefix=OUT %s
 OUT: -out:bar.exe
Index: lld/MinGW/Driver.cpp
===================================================================
--- lld/MinGW/Driver.cpp
+++ lld/MinGW/Driver.cpp
@@ -180,7 +180,7 @@
   for (auto *A : Args) {
     switch (A->getOption().getUnaliasedOption().getID()) {
     case OPT_INPUT:
-      if (StringRef(A->getValue()).endswith(".def"))
+      if (StringRef(A->getValue()).endswith_lower(".def"))
         Add("-def:" + StringRef(A->getValue()));
       else
         Add(Prefix + StringRef(A->getValue()));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37823.115106.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170913/1d3dc0e8/attachment.bin>


More information about the llvm-commits mailing list