[PATCH] D70600: [Error] Add stack traces for llvm::Error invariant violations.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 17:19:21 PST 2020


dblaikie added a comment.

In D70600#1802235 <https://reviews.llvm.org/D70600#1802235>, @lhames wrote:

> Oh, I remember part of my motivation for designing it this way: While failure values are expected to be expensive, we don't want to make them unnecessarily expensive, which is why the error-geneation-point trace is under a flag: You don't want to stack-trace every error that is ever generated. However, making this conditional means we need to check a global flag to decide whether we *should* do the stack trace. Once you're doing that, you may as well make your "flag" a pointer to the side table.


Oh, totally all for the conditional stack trace generation, and we've got lots of flags (cl::opts, env variable tests, some straight up global variables (the latter being fairly rare, but I think there's some precedent for them in LLVM?))  - but I think there's significantly (that's certainly a value judgment - impossible to quantify) complexity in having a mutable side table for those stack traces - so, for me at least, one doesn't follow from the other necessarily.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70600/new/

https://reviews.llvm.org/D70600





More information about the llvm-commits mailing list