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. -- Thanks and Regards Awanish Pandey PhD, CSE IIT Kanpur
Dylan McKay via llvm-dev
2017-May-02 05:48 UTC
[llvm-dev] Enabling exception handling in llvm pass
The LLVM coding standards explicitly disallow exceptions http://llvm.org/docs/CodingStandards.html#do-not-use-rtti-or-exceptions On Tue, May 2, 2017 at 5:28 PM, via llvm-dev <llvm-dev at lists.llvm.org> wrote:> 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. > > > -- > Thanks and Regards > Awanish Pandey > PhD, CSE > IIT Kanpur > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170502/c8704723/attachment.html>
Tim Northover via llvm-dev
2017-May-02 13:25 UTC
[llvm-dev] Enabling exception handling in llvm pass
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 saysBy 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.