[llvm-dev] Disabling Exception in LLVM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Disabling Exception in LLVM

Dean Michael Berris via llvm-dev
Hi all,
Can anyone explain why exceptions are disabled in LLVM, even if some C++ coding standard tells to use exceptions ?
Thanks,
Siddharth

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Disabling Exception in LLVM

Dean Michael Berris via llvm-dev
Siddharth,

I'm not sure what coding standards you refer to when you say "some C++ coding standard". This question is answered in the LLVM Coding Standards document here:


As such LLVM's coding standards prohibit the use of exceptions and RTTI.

-Chris

On May 1, 2018, at 10:02 AM, Siddharth Shankar Swain via llvm-dev <[hidden email]> wrote:

Hi all,
Can anyone explain why exceptions are disabled in LLVM, even if some C++ coding standard tells to use exceptions ?
Thanks,
Siddharth
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Disabling Exception in LLVM

Dean Michael Berris via llvm-dev
Hi Chris,
Thanks for answering, Can u clarify on this comment mentioned in https://github.com/Z3Prover/z3/issues/861 .

  cplusplus no exception support · Issue #861 · Z3Prover/z3 · GitHub
  • LLVM's source code does not use exceptions for performance reasons and so is compiled by default with -fno-exceptions. When using LLVM's libraries via it's C++ interface it is important to match how LLVM was built (i.e. do not mix code built with and without exception support).
  • The Clang compiler which is built on top of LLVM is also compiled without exceptions by default. However the built Clang can compile C++ code with or without exceptions (using the -fno-exceptions). flag. Said another way Clang's implementation doesn't use exceptions but Clang itself can compile C++ code with or without exception support.

Can anyone clarify on this comment ?

Thanks,
Siddharth

On Tue, May 1, 2018 at 11:02 PM, Chris Bieneman <[hidden email]> wrote:
Siddharth,

I'm not sure what coding standards you refer to when you say "some C++ coding standard". This question is answered in the LLVM Coding Standards document here:


As such LLVM's coding standards prohibit the use of exceptions and RTTI.

-Chris

On May 1, 2018, at 10:02 AM, Siddharth Shankar Swain via llvm-dev <[hidden email]> wrote:

Hi all,
Can anyone explain why exceptions are disabled in LLVM, even if some C++ coding standard tells to use exceptions ?
Thanks,
Siddharth
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Disabling Exception in LLVM

Dean Michael Berris via llvm-dev
LLVM does not allow the use of exceptions in our code. We do not allow throwing or catching them. That does not mean you cannot compile the code with exceptions enabled, it just means we don't use them.

Clang is a full C++ compiler. Even though LLVM & Clang do not use exceptions in their implementation, Clang does support compiling C++ code that uses exceptions.

Does this answer your question?
-Chris

On May 1, 2018, at 10:38 AM, Siddharth Shankar Swain <[hidden email]> wrote:

Hi Chris,
Thanks for answering, Can u clarify on this comment mentioned in https://github.com/Z3Prover/z3/issues/861 .

  cplusplus no exception support · Issue #861 · Z3Prover/z3 · GitHub
  • LLVM's source code does not use exceptions for performance reasons and so is compiled by default with -fno-exceptions. When using LLVM's libraries via it's C++ interface it is important to match how LLVM was built (i.e. do not mix code built with and without exception support).
  • The Clang compiler which is built on top of LLVM is also compiled without exceptions by default. However the built Clang can compile C++ code with or without exceptions (using the -fno-exceptions). flag. Said another way Clang's implementation doesn't use exceptions but Clang itself can compile C++ code with or without exception support.

Can anyone clarify on this comment ?

Thanks,
Siddharth

On Tue, May 1, 2018 at 11:02 PM, Chris Bieneman <[hidden email]> wrote:
Siddharth,

I'm not sure what coding standards you refer to when you say "some C++ coding standard". This question is answered in the LLVM Coding Standards document here:


As such LLVM's coding standards prohibit the use of exceptions and RTTI.

-Chris

On May 1, 2018, at 10:02 AM, Siddharth Shankar Swain via llvm-dev <[hidden email]> wrote:

Hi all,
Can anyone explain why exceptions are disabled in LLVM, even if some C++ coding standard tells to use exceptions ?
Thanks,
Siddharth
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev




_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Disabling Exception in LLVM

Dean Michael Berris via llvm-dev
Yes mostly, Thanks for the quick answer.

On Tue, May 1, 2018 at 11:16 PM, Chris Bieneman <[hidden email]> wrote:
LLVM does not allow the use of exceptions in our code. We do not allow throwing or catching them. That does not mean you cannot compile the code with exceptions enabled, it just means we don't use them.

Clang is a full C++ compiler. Even though LLVM & Clang do not use exceptions in their implementation, Clang does support compiling C++ code that uses exceptions.

Does this answer your question?
-Chris


On May 1, 2018, at 10:38 AM, Siddharth Shankar Swain <[hidden email]> wrote:

Hi Chris,
Thanks for answering, Can u clarify on this comment mentioned in https://github.com/Z3Prover/z3/issues/861 .

  cplusplus no exception support · Issue #861 · Z3Prover/z3 · GitHub
  • LLVM's source code does not use exceptions for performance reasons and so is compiled by default with -fno-exceptions. When using LLVM's libraries via it's C++ interface it is important to match how LLVM was built (i.e. do not mix code built with and without exception support).
  • The Clang compiler which is built on top of LLVM is also compiled without exceptions by default. However the built Clang can compile C++ code with or without exceptions (using the -fno-exceptions). flag. Said another way Clang's implementation doesn't use exceptions but Clang itself can compile C++ code with or without exception support.

Can anyone clarify on this comment ?

Thanks,
Siddharth

On Tue, May 1, 2018 at 11:02 PM, Chris Bieneman <[hidden email]> wrote:
Siddharth,

I'm not sure what coding standards you refer to when you say "some C++ coding standard". This question is answered in the LLVM Coding Standards document here:


As such LLVM's coding standards prohibit the use of exceptions and RTTI.

-Chris

On May 1, 2018, at 10:02 AM, Siddharth Shankar Swain via llvm-dev <[hidden email]> wrote:

Hi all,
Can anyone explain why exceptions are disabled in LLVM, even if some C++ coding standard tells to use exceptions ?
Thanks,
Siddharth
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev





_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev