[Lldb-commits] [PATCH] D30807: Use LLVM's directory enumeration code

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 10 06:19:30 PST 2017


I can see both of them making sense, but I would actually prefer the
new behavior you inadvertently introduced. I've looked at the callers
and it seems no user sets find_directories to false, so I guess it's
fine to change the behavior, if we want to.

On 10 March 2017 at 14:08, Zachary Turner <zturner at google.com> wrote:
> You're right, I didn't notice that. But since you mention it, surely that
> had to have been a bug in the original implementation right? That flag isn't
> intended to be a synonym for "non recursive iteration ", because that's what
> the Next enumeration value is for. The algorithm would intentionally leave
> that decision up to the callback.
>
> Find directories seems to want to mean "should you call my callback with
> directories?"
>
> Imagine someone wants all files recursively but nothing else, that was
> impossible before, they would have to opt in to seeing each directory just
> so they could return Enter
>
> On Fri, Mar 10, 2017 at 2:27 AM Pavel Labath via Phabricator
> <reviews at reviews.llvm.org> wrote:
>>
>> labath added a comment.
>>
>>
>>
>>
>>
>> ================
>> Comment at: lldb/source/Host/common/FileSpec.cpp:786
>> +      continue;
>> +    if (!find_directories && fs::is_directory(Status))
>> +      continue;
>> ----------------
>> This looks like it changes behavior. Previously, if `find_directories` was
>> false this function would *not* recurse into them, whereas now it will. I
>> guess you did not intend to do that (?)
>>
>>
>> https://reviews.llvm.org/D30807
>>
>>
>>
>


More information about the lldb-commits mailing list