[PATCH] D68033: [llvm-ar] Make paths case insensitive when on windows

Owen Reynolds via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 07:19:52 PDT 2019


gbreynoo marked an inline comment as done.
gbreynoo added inline comments.


================
Comment at: llvm/tools/llvm-ar/llvm-ar.cpp:496
 
+static bool comparePaths(StringRef Path1, const StringRef Path2) {
+#ifndef _WIN32
----------------
ruiu wrote:
> ruiu wrote:
> > I'd add a function comment here to explain what this function does for Windows. On Windows, we want a case-insensitive comparison as defined by the Unicode standard (which is I believe what CompareStringOrdinal implements), so that filenames in archives are compared case-insensitive manner.
> nit: remove `const` from Path2.
Use of `CompareStringOrdinal` it is not compliant to the Unicode standard as when string matching Windows file paths do not conform to the Unicode standard. I think this is fine though, using `CompareStringOrdinal` to mirror Windows behaviour makes more sense than a string comparison that conforms to the Unicode standard. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68033/new/

https://reviews.llvm.org/D68033





More information about the llvm-commits mailing list