[PATCH] D65829: [clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in ::create.
Puyan Lotfi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 6 14:55:33 PDT 2019
plotfi marked an inline comment as done.
plotfi added a comment.
In D65829#1617850 <https://reviews.llvm.org/D65829#1617850>, @lhames wrote:
> I think the right line is:
>
> logAllUnhandledErrors(DW.takeError(), errs(), "");
>
>
> It's a bit wordy, but will log a sensible error and works with and without ENABLE_ABI_BREAKING_CHECKS enabled.
>
> I'm not against improving the output for cantFail, nor totally against abusing cantFail in unit tests, but Puyan's right that it would be abuse: in production code cantFail should only be used at call sites where you know from context that the call //definitely// can't fail (e.g. subsequent calls to an API that can only fail on the first call).
I am happy with this. Thanks @lhames !
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65829/new/
https://reviews.llvm.org/D65829
More information about the cfe-commits
mailing list