@@ -31,7 +31,7 @@ algorithm. Thus, the specification is said to add "zero-cost" to the normal
31
31
execution of an application.
32
32
33
33
A more complete description of the Itanium ABI exception handling runtime
34
- support of can be found at `Itanium C++ ABI: Exception Handling
34
+ support can be found at `Itanium C++ ABI: Exception Handling
35
35
<http://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html> `_. A description of the
36
36
exception frame format can be found at `Exception Frames
37
37
<http://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html> `_,
@@ -145,7 +145,7 @@ exception. In those circumstances, the LLVM C++ front-end replaces the call with
145
145
an ``invoke `` instruction. Unlike a call, the ``invoke `` has two potential
146
146
continuation points:
147
147
148
- #. where to continue when the call succeeds as per normal , and
148
+ #. where to continue when the call succeeds normally , and
149
149
150
150
#. where to continue if the call raises an exception, either by a throw or the
151
151
unwinding of a throw
@@ -280,7 +280,7 @@ Throw Filters
280
280
-------------
281
281
282
282
Prior to C++17, C++ allowed the specification of which exception types may be
283
- thrown from a function. To represent this, a top level landing pad may exist to
283
+ thrown from a function. To represent this, a top- level landing pad may exist to
284
284
filter out invalid types. To express this in LLVM code the :ref: `i_landingpad `
285
285
will have a filter clause. The clause consists of an array of type infos.
286
286
``landingpad `` will return a negative value
@@ -437,7 +437,7 @@ exception handling frame that defines information common to all functions in the
437
437
unit.
438
438
439
439
The format of this call frame information (CFI) is often platform-dependent,
440
- however. ARM, for example, defines their own format. Apple has their own compact
440
+ however. ARM, for example, defines its own format. Apple has its own compact
441
441
unwind info format. On Windows, another format is used for all architectures
442
442
since 32-bit x86. LLVM will emit whatever information is required by the
443
443
target.
@@ -467,7 +467,7 @@ on Itanium C++ ABI platforms. The fundamental difference between the two models
467
467
is that Itanium EH is designed around the idea of "successive unwinding," while
468
468
Windows EH is not.
469
469
470
- Under Itanium, throwing an exception typically involves allocating thread local
470
+ Under Itanium, throwing an exception typically involves allocating thread- local
471
471
memory to hold the exception, and calling into the EH runtime. The runtime
472
472
identifies frames with appropriate exception handling actions, and successively
473
473
resets the register context of the current thread to the most recently active
@@ -482,7 +482,7 @@ release its memory, and resume normal control flow.
482
482
The Windows EH model does not use these successive register context resets.
483
483
Instead, the active exception is typically described by a frame on the stack.
484
484
In the case of C++ exceptions, the exception object is allocated in stack memory
485
- and its address is passed to ``__CxxThrowException ``. General purpose structured
485
+ and its address is passed to ``__CxxThrowException ``. General- purpose structured
486
486
exceptions (SEH) are more analogous to Linux signals, and they are dispatched by
487
487
userspace DLLs provided with Windows. Each frame on the stack has an assigned EH
488
488
personality routine, which decides what actions to take to handle the exception.
@@ -504,15 +504,15 @@ The C++ personality also uses funclets to contain the code for catch blocks
504
504
(i.e. all user code between the braces in ``catch (Type obj) { ... } ``). The
505
505
runtime must use funclets for catch bodies because the C++ exception object is
506
506
allocated in a child stack frame of the function handling the exception. If the
507
- runtime rewound the stack back to frame of the catch, the memory holding the
507
+ runtime rewound the stack back to the frame of the catch, the memory holding the
508
508
exception would be overwritten quickly by subsequent function calls. The use of
509
509
funclets also allows ``__CxxFrameHandler3 `` to implement rethrow without
510
510
resorting to TLS. Instead, the runtime throws a special exception, and then uses
511
511
SEH (``__try / __except ``) to resume execution with new information in the child
512
512
frame.
513
513
514
514
In other words, the successive unwinding approach is incompatible with Visual
515
- C++ exceptions and general purpose Windows exception handling. Because the C++
515
+ C++ exceptions and general- purpose Windows exception handling. Because the C++
516
516
exception object lives in stack memory, LLVM cannot provide a custom personality
517
517
function that uses landingpads. Similarly, SEH does not provide any mechanism
518
518
to rethrow an exception or continue unwinding. Therefore, LLVM must use the IR
@@ -780,8 +780,8 @@ structure, which funclet-based personalities may require.
780
780
Exception Handling support on the target
781
781
=================================================
782
782
783
- In order to support exception handling on particular target, there are a few
784
- items need to be implemented.
783
+ In order to support exception handling on a particular target, there are a few
784
+ items that need to be implemented.
785
785
786
786
* CFI directives
787
787
@@ -791,7 +791,7 @@ items need to be implemented.
791
791
to specify how to calculate the CFA (Canonical Frame Address) and how register
792
792
is restored from the address pointed by the CFA with an offset. The assembler
793
793
is instructed by CFI directives to build ``.eh_frame `` section, which is used
794
- by th unwinder to unwind stack during exception handling.
794
+ by the unwinder to unwind the stack during exception handling.
795
795
796
796
* ``getExceptionPointerRegister `` and ``getExceptionSelectorRegister ``
797
797
@@ -807,25 +807,25 @@ items need to be implemented.
807
807
which adjusts the stack by offset and then jumps to the handler. ``__builtin_eh_return ``
808
808
is used in GCC unwinder (`libgcc <https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html >`_),
809
809
but not in LLVM unwinder (`libunwind <https://clang.llvm.org/docs/Toolchain.html#unwind-library >`_).
810
- If you are on the top of ``libgcc `` and have particular requirement on your target,
810
+ If you are on the top of ``libgcc `` and have a particular requirement on your target,
811
811
you have to handle ``EH_RETURN `` in ``TargetLowering ``.
812
812
813
813
If you don't leverage the existing runtime (``libstdc++ `` and ``libgcc ``),
814
- you have to take a look on `libc++ <https://libcxx.llvm.org/ >`_ and
814
+ you have to take a look at `libc++ <https://libcxx.llvm.org/ >`_ and
815
815
`libunwind <https://clang.llvm.org/docs/Toolchain.html#unwind-library >`_
816
- to see what have to be done there. For ``libunwind ``, you have to do the following
816
+ to see what has to be done there. For ``libunwind ``, you have to do the following:
817
817
818
818
* ``__libunwind_config.h ``
819
819
820
820
Define macros for your target.
821
821
822
822
* ``include/libunwind.h ``
823
823
824
- Define enum for the target registers.
824
+ Define an enum for the target registers.
825
825
826
826
* ``src/Registers.hpp ``
827
827
828
- Define ``Registers `` class for your target, implement setter and getter functions.
828
+ Define a ``Registers `` class for your target, implement setter and getter functions.
829
829
830
830
* ``src/UnwindCursor.hpp ``
831
831
@@ -834,8 +834,8 @@ to see what have to be done there. For ``libunwind``, you have to do the followi
834
834
835
835
* ``src/UnwindRegistersRestore.S ``
836
836
837
- Write an assembly function to restore all your target registers from the memory.
837
+ Write an assembly function to restore all your target registers from memory.
838
838
839
839
* ``src/UnwindRegistersSave.S ``
840
840
841
- Write an assembly function to save all your target registers on the memory.
841
+ Write an assembly function to save all your target registers to memory.
0 commit comments