Enabling exception handling in llvm pass

Hi everyone,

I have written a LLVM(llvm-3.4) pass which includes try-catch block. When
I am compiling error is displayed which says

cannot use 'try' with exceptions disabled

Please can someone tell me how to enable EH for the same.

The LLVM coding standards explicitly disallow exceptions

http://llvm.org/docs/CodingStandards.html#do-not-use-rtti-or-exceptions

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.