[llvm-dev] Examples of exception-free code

A. Ilchinger via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 3 02:05:53 PDT 2018


Hello,

as I understand, the LLVM project prohibits the use of exceptions. I
don't want to start a discussion about this decision, but I'd love to
see what alternative error handling is used.

Could you please point me to some good code examples in the LLVM tree
where one can see how exceptions are avoided? Skimming through the code
I found different approaches (private ctor and create() method with
error return code; using only the ctor and ignoring possible allocation
errors; ...)
Surely, the use of the right error handling strategy is highly
situational, but LLVM also improved over time and without deeper
knowledge of the code base it is impossible for me to see which parts
are "good" and which parts are older and might need refactoring.

Kind regards
Andreas


More information about the llvm-dev mailing list