[all-commits] [llvm/llvm-project] 20f777: [MC] [Win64EH] Fill in FuncletOrFuncEnd if missing

Martin Storsjö via All-commits all-commits at lists.llvm.org
Sat Aug 29 05:16:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 20f7773bb4bb458c3f3b4e46d1601465e6479746
      https://github.com/llvm/llvm-project/commit/20f7773bb4bb458c3f3b4e46d1601465e6479746
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-08-29 (Sat, 29 Aug 2020)

  Changed paths:
    M llvm/include/llvm/MC/MCWinEH.h
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/test/MC/AArch64/seh.s

  Log Message:
  -----------
  [MC] [Win64EH] Fill in FuncletOrFuncEnd if missing

This can happen e.g. for code that declare .seh_proc/.seh_endproc
in assembly, or for code that use .seh_handlerdata (which triggers
the unwind info to be emitted before the end of the function).

The TextSection field must be made non-const to be able to use it
with Streamer.SwitchSection().

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


  Commit: 5b86d130e2baed7221b09087c506f5974fe65f22
      https://github.com/llvm/llvm-project/commit/5b86d130e2baed7221b09087c506f5974fe65f22
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-08-29 (Sat, 29 Aug 2020)

  Changed paths:
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCParser/COFFAsmParser.cpp
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
    M llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
    M llvm/test/CodeGen/AArch64/arm64-windows-calls.ll
    M llvm/test/CodeGen/AArch64/lrint-conv-fp16-win.ll
    M llvm/test/CodeGen/AArch64/lrint-conv-win.ll
    M llvm/test/CodeGen/AArch64/lround-conv-fp16-win.ll
    M llvm/test/CodeGen/AArch64/lround-conv-win.ll
    M llvm/test/CodeGen/AArch64/powi-windows.ll
    M llvm/test/CodeGen/AArch64/seh_funclet_x1.ll
    M llvm/test/CodeGen/AArch64/win64-jumptable.ll
    M llvm/test/CodeGen/AArch64/win_cst_pool.ll
    M llvm/test/CodeGen/AArch64/windows-extern-weak.ll
    M llvm/test/CodeGen/AArch64/wineh-try-catch-cbz.ll
    M llvm/test/CodeGen/AArch64/wineh-try-catch-nobase.ll
    M llvm/test/CodeGen/AArch64/wineh-try-catch-realign.ll
    M llvm/test/CodeGen/AArch64/wineh-try-catch-vla.ll
    M llvm/test/CodeGen/AArch64/wineh1.mir
    M llvm/test/MC/AArch64/seh.s

  Log Message:
  -----------
  [AArch64] Generate and parse SEH assembly directives

This ensures that you get the same output regardless if generating
code directly to an object file or if generating assembly and
assembling that.

Add implementations of the EmitARM64WinCFI*() methods in
AArch64TargetAsmStreamer, and fill in one blank in MCAsmStreamer.

Add corresponding directive handlers in AArch64AsmParser and
COFFAsmParser.

Some SEH directive names have been picked to match the prior art
for SEH assembly directives for x86_64, e.g. the spelling of
".seh_startepilogue" matching the preexisting ".seh_endprologue".

For the directives for saving registers, the exact spelling
from the arm64 documentation is picked, e.g. ".seh_save_reg" (to follow
that naming for all the other ones, e.g. ".seh_save_fregp_x"), while
the corresponding one for x86_64 is plain ".seh_savereg" without the
second underscore.

Directives in the epilogues have the same names as in prologues,
e.g. .seh_savereg, even though the registers are restored, not
saved, at that point.

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


Compare: https://github.com/llvm/llvm-project/compare/71ac9105cd39...5b86d130e2ba


More information about the All-commits mailing list