[PATCH] D65829: [clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in ::create.

Lang Hames via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 14:54:26 PDT 2019


lhames added a comment.

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).


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