HomePhabricator

Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

Authored by MaskRay on Mar 9 2021, 10:21 PM.

Description

Define __GCC_HAVE_DWARF2_CFI_ASM if applicable

In -fno-exceptions -fno-asynchronous-unwind-tables -g0 mode,
GCC does not emit .cfi_* directives.

% diff <(gcc -fno-asynchronous-unwind-tables -dM -E a.c) <(gcc -dM -E a.c)
130a131
> #define __GCC_HAVE_DWARF2_CFI_ASM 1

This macro is useful because code can decide whether inline asm should include .cfi_* directives.
.cfi_* directives without .cfi_startproc can cause assembler errors
(integrated assembler: this directive must appear between .cfi_startproc and .cfi_endproc directives).

Differential Revision: https://reviews.llvm.org/D97743

Details