[PATCH] D30768: [PATCH][VFS] Ignore broken symlinks in the directory iterator.
Juergen Ributzka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 9 14:28:58 PST 2017
ributzka added inline comments.
================
Comment at: lib/Basic/VirtualFileSystem.cpp:1873
vfs::directory_iterator I = FS->dir_begin(State->top()->getName(), EC);
- if (EC)
+ if (EC && EC != std::errc::no_such_file_or_directory)
return *this;
----------------
bruno wrote:
> Can you add a comment explaining why you are doing it? I would prefer if we reset the `EC` state here than having the callers ignoring `EC` results.
If we reset the EC here, then the caller won't know that there was an issue. The idea is that we still want the caller to check EC. It should be up to the caller to decide how to act on this particular error.
I guess since the caller has to check for the error anyway I could even remove this check completely and not check EC at all here.
https://reviews.llvm.org/D30768
More information about the cfe-commits
mailing list