llvm-project/libunwind
Peter Zotov b0342a66a0 Make it possible to use libunwind without heap.
This patch allows to use libunwind on bare-metal systems that do not
include malloc/free by conditionally turning off nonessential
functionality that requires these functions.

The disabled functionality includes:

  * the .cfi_remember_state and .cfi_restore_state instructions;
  * the DWARF FDE cache.

The .cfi_{remember,restore}_state instructions don't seem to be used
by contemporary compilers. None of the LLVM backends emit it.

The DWARF FDE cache is bypassed if _LIBUNWIND_NO_HEAP is defined.
Specifically, entries are never added to it, so the search begins
and ends at the statically allocated, empty initial cache.

Such heap-less libunwind on a bare metal system is successfully used
in the ARTIQ project[1], and it is my hope that it will be useful
elsewhere.

[1]: http://m-labs.hk/artiq

Differential Revision: http://reviews.llvm.org/D11897

llvm-svn: 252452
2015-11-09 06:57:29 +00:00
..
cmake libunwind: add new build logic 2015-04-25 01:46:35 +00:00
include [libunwind] Add support for OpenRISC 1000. 2015-08-31 05:26:37 +00:00
src Make it possible to use libunwind without heap. 2015-11-09 06:57:29 +00:00
test Fix unw_getcontext() return value on AArch64. 2015-06-25 15:12:46 +00:00
.arcconfig Add ARC config 2015-05-09 20:56:15 +00:00
.clang-format unwind: add a .clang-format 2015-05-07 19:50:18 +00:00
CMakeLists.txt Revert test commit. 2015-08-06 23:31:37 +00:00