[all-commits] [llvm/llvm-project] 0b0672: [MC] Reject CFI advance_loc separated by a non-pri...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jun 26 14:26:19 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0b0672773e8b2ed01ad3fce103f4d84becfdd1ed
      https://github.com/llvm/llvm-project/commit/0b0672773e8b2ed01ad3fce103f4d84becfdd1ed
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-06-26 (Mon, 26 Jun 2023)

  Changed paths:
    M llvm/lib/MC/MCAssembler.cpp
    A llvm/test/MC/MachO/cfi-advance-loc-err.s

  Log Message:
  -----------
  [MC] Reject CFI advance_loc separated by a non-private label for Mach-O

Due to Mach-O's .subsections_via_symbols mechanism, non-private labels cannot
appear between .cfi_startproc/.cfi_endproc. Compilers do not produce such
labels, but hand-written assembly may. Give an error. Unfortunately,
emitDwarfAdvanceFrameAddr generated MCExpr doesn't have location
informatin.

Note: evaluateKnownAbsolute is to force folding A-B to a constant even if A and
B are separate by a non-private label. The function is a workaround for some
Mach-O assembler issues and should generally be avoided.

Reviewed By: efriedma

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




More information about the All-commits mailing list