[PATCH] D44808: Fix lib.exe detection when running within MSVC toolchain
Alexandre Ganea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 9 18:54:16 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL329658: [llvm-ar] Fix lib.exe detection when running within MSVC toolchain (authored by aganea, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D44808?vs=141771&id=141781#toc
Repository:
rL LLVM
https://reviews.llvm.org/D44808
Files:
llvm/trunk/test/tools/llvm-ar/case-detection.test
llvm/trunk/tools/llvm-ar/llvm-ar.cpp
Index: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
===================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp
@@ -109,9 +109,9 @@
)";
void printHelpMessage() {
- if (Stem.find("ranlib") != StringRef::npos)
+ if (Stem.find_lower("ranlib") != StringRef::npos)
outs() << RanlibHelp;
- else if (Stem.find("ar") != StringRef::npos)
+ else if (Stem.find_lower("ar") != StringRef::npos)
outs() << ArHelp;
}
@@ -960,16 +960,16 @@
llvm::InitializeAllAsmParsers();
Stem = sys::path::stem(ToolName);
- if (Stem.find("dlltool") != StringRef::npos)
+ if (Stem.find_lower("dlltool") != StringRef::npos)
return dlltoolDriverMain(makeArrayRef(argv, argc));
- if (Stem.find("ranlib") != StringRef::npos)
+ if (Stem.find_lower("ranlib") != StringRef::npos)
return ranlib_main(argc, argv);
- if (Stem.find("lib") != StringRef::npos)
+ if (Stem.find_lower("lib") != StringRef::npos)
return libDriverMain(makeArrayRef(argv, argc));
- if (Stem.find("ar") != StringRef::npos)
+ if (Stem.find_lower("ar") != StringRef::npos)
return ar_main(argc, argv);
fail("Not ranlib, ar, lib or dlltool!");
}
Index: llvm/trunk/test/tools/llvm-ar/case-detection.test
===================================================================
--- llvm/trunk/test/tools/llvm-ar/case-detection.test
+++ llvm/trunk/test/tools/llvm-ar/case-detection.test
@@ -0,0 +1,11 @@
+-- Test CamelCase tool name to ensure detection works properly
+
+RUN: yaml2obj %S/Inputs/coff.yaml -o %t.obj
+RUN: rm -rf %t1
+RUN: mkdir %t1
+RUN: cp llvm-ar %t1/Lib
+RUN: %t1/Lib /OUT:%t.lib %t.obj | FileCheck %s -allow-empty
+RUN: cp llvm-ar %t1/Ar
+RUN: %t1/Ar crs %t.ar %t.obj | FileCheck %s -allow-empty
+
+CHECK-NOT: OVERVIEW: LLVM Archiver (llvm-ar)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44808.141781.patch
Type: text/x-patch
Size: 1833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180410/add369c9/attachment.bin>
More information about the llvm-commits
mailing list