llvm-project/libunwind/src
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
..
AddressSpace.hpp Add FreeBSD _Unwind_Ptr typedef 2015-10-16 19:40:09 +00:00
CMakeLists.txt unwind: clean up warnings from the build 2015-04-25 02:06:15 +00:00
CompactUnwinder.hpp
DwarfInstructions.hpp Correct sense of unwind return address register range assertion 2015-08-13 13:45:45 +00:00
DwarfParser.hpp Make it possible to use libunwind without heap. 2015-11-09 06:57:29 +00:00
EHHeaderParser.hpp
Registers.hpp unwind: cleanup -Wunused-parameter 2015-09-01 04:29:03 +00:00
Unwind-EHABI.cpp [libunwind] Flip order of extern "C" and attribute(visibility) 2015-07-24 19:29:05 +00:00
Unwind-EHABI.h libunwind: Introduce __libunwind_config.h. 2015-07-19 15:23:10 +00:00
Unwind-sjlj.c
UnwindCursor.hpp Make it possible to use libunwind without heap. 2015-11-09 06:57:29 +00:00
UnwindLevel1-gcc-ext.c libunwind: Introduce __libunwind_config.h. 2015-07-19 15:23:10 +00:00
UnwindLevel1.c unwind: Fix libc++abi and libgcc build. 2015-07-24 00:16:48 +00:00
UnwindRegistersRestore.S [libunwind] Add support for OpenRISC 1000. 2015-08-31 05:26:37 +00:00
UnwindRegistersSave.S unwind: Allow the building of libunwind for MIPS. 2015-09-26 18:26:01 +00:00
Unwind_AppleExtras.cpp
assembly.h
config.h unwind: Allow the building of libunwind for MIPS. 2015-09-26 18:26:01 +00:00
dwarf2.h
libunwind.cpp unwind: Allow the building of libunwind for MIPS. 2015-09-26 18:26:01 +00:00
libunwind_ext.h libunwind: Introduce __libunwind_config.h. 2015-07-19 15:23:10 +00:00
unwind_ext.h