[CIR] Simplify try-catch handling (#180857) With the new exception handling device, we no longer need to track the location of potential catch blocks, and so we no longer need to represent catch handlers on the EH stack. This allows us to significantly simplify the generation of try-catch blocks. This change emits catch blocks directly when visiting the try operation and removes unnecessary EH management code. This is not an exhaustive cleanup of the EH management code. Some things that may appear to be obvious simplifications (such as removing the union of bitfields in EHScope, and possibly making EHScopeStack just a stack of EHCleanups) are deferred until we have a better idea of how things like EH filters will be implemented. This change breaks lowering of cir.try operations to LLVM IR in a somewhat trivial way. Even before this PR, lowering of `cir.try` ops with catch handlers was not implemented. However, we had one test case where the only call in a try-region was marked with the `noexcept` attribute. Previously, we did not emit catch handlers in that circumstance. Now we do. As such, nothing that previously worked is broken by this patch, but there is one test that would now fail. I handled this by removing the RUN line for lowering this test to LLVM IR. I left the checks so this will be easy to re-enable when proper try-op lowering is implemented.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.