[llvm] r217625 - Misc cleanups to the FileSytem api.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Sep 11 16:52:39 PDT 2014


>> I didn't want to include any semantic change in the patch. The
>> original code would take the branch only if sys::fs::exists returned
>> no error. Using the simpler version would take the branch if there was
>> an error.
>>
>> To see the difference consider something like "permission denied". It
>> would not take the branch originally and will not with the way it is
>> currently written, but would with
>>
>> if (!sys::fs::exists(LockFileName.c_str()))
>>
>> Now, it may be a bug in the code, but it is probably better to fix
>> that in another patch.
>
>
> That's incredibly subtle. Can we rename exists to better reflect that?

I would call what the lock manager is doing subtle. The function
sys::fs::exists now seems pretty reasonable for the common
interpretation: a path that causes an error "doesn't exist". That is
the same interpretation used in can_write and can_execute.

Cheers,
Rafael



More information about the llvm-commits mailing list