[llvm-dev] Enabling exception handling in llvm pass

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue May 2 06:25:36 PDT 2017


On 1 May 2017 at 22:28, via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> I have written a LLVM(llvm-3.4) pass which includes try-catch block. When
> I am compiling error is displayed which says

By default LLVM is compiled without support for exceptions and RTTI to
get more efficient code (since as Dylan said they're not used in LLVM
itself). If you're using "llvm-config --cxxflags" for your own code
you'll be getting those options ("-fno-exceptions -fno-rtti") too.

So your options are to either filter those out when compiling your own
code or (if LLVM itself has to be involved in the RTTI or exceptions)
recompile LLVM with those features enabledIn CMake that would mean
setting LLVM_ENABLE_EH, goodness knows what if you're still using
autotools)

Cheers.

Tim.


More information about the llvm-dev mailing list