[Lldb-commits] [PATCH] D20041: File path comparisons should be case-insensitive on OS X

Vyacheslav Karpukhin via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 5 04:34:39 PDT 2016


stigger added inline comments.

================
Comment at: include/lldb/Host/FileSpec.h:712
@@ +711,3 @@
+             PathSyntax syntax = ePathSyntaxHostNative,
+             llvm::Triple *triple = nullptr);
+
----------------
labath wrote:
> I don't think the default-null parameter here is a good idea. This means some of your file-specs will be case-sensitive and some will not (depending on whether the the person who created the FileSpec remembered to pass in the triple).
> 
> If it were up to me, I wouldn't even make case-sensitivity a property of the file spec. I think it should be a property of the comparison between them. Otherwise, what are you going to do when someone asks you to compare a case-insensitive "/foo/bar" with a case-sensitive "/Foo/Bar" ?
If we get rid of `PathSyntax`, then default-null is going to be an equivalent of `ePathSyntaxHostNative`, meaning "use host triple".

> Otherwise, what are you going to do when someone asks you to compare a case-insensitive "/foo/bar" with a case-sensitive "/Foo/Bar" ?

That's already handled in `FileSpec::Equal` and `FileSpec::Compare`: the comparison is case-insensitive only when both operands are case-insensitive.


https://reviews.llvm.org/D20041





More information about the lldb-commits mailing list