[PATCH] D11897: [libunwind] Make it possible to use libunwind without heap.

whitequark via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 03:53:57 PDT 2015


whitequark added inline comments.

================
Comment at: src/UnwindCursor.hpp:898
@@ -897,1 +897,3 @@
   #endif
+  #ifdef _LIBUNWIND_NO_HEAP
+        ;
----------------
compnerd wrote:
> Please use:
> 
>     #if !defined(_LIBUNWIND_NO_HEAP)
>         DwarfFDECache<A>::add(sects.dso_base, fdeInfo.pcStart, fdeInfo.pcEnd,
>                               fdeInfo.fdeStart);
>     #endif
> 
> rather than the empty clause with a semicolon.
> 
> Even better would be be make the add operation a no-op if built without support for the heap.  You could do that statically, avoiding the mess of conditional compilation.
This would break the preceding conditionally included:
```
if (sects.dwarf_index_section == 0)
```
I could refactor it.

How would you suggest doing it statically?


http://reviews.llvm.org/D11897





More information about the llvm-commits mailing list