[PATCH] D38776: [codeview] Implement FPO data assembler directives

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 18:19:58 PDT 2017


rnk created this revision.
Herald added subscribers: hiraditya, kristof.beyls, mgorny, aemerson.

This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.

The directives are:

  .cv_fpo_proc _foo
  .cv_fpo_pushreg ebp/ebx/etc
  .cv_fpo_setframe ebp/esi/etc
  .cv_fpo_stackalloc 200
  .cv_fpo_endprologue
  .cv_fpo_endproc
  .cv_fpo_data _foo

I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.

I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28

Once we have cdb integration in debuginfo-tests, we can add integration
tests there.


https://reviews.llvm.org/D38776

Files:
  llvm/include/llvm/MC/MCCodeView.h
  llvm/include/llvm/MC/MCStreamer.h
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/lib/MC/MCParser/AsmParser.cpp
  llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
  llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
  llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
  llvm/lib/Target/X86/MCTargetDesc/X86TargetStreamer.h
  llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp
  llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp
  llvm/lib/Target/X86/X86AsmPrinter.cpp
  llvm/lib/Target/X86/X86AsmPrinter.h
  llvm/lib/Target/X86/X86FrameLowering.cpp
  llvm/lib/Target/X86/X86MCInstLower.cpp
  llvm/lib/Target/X86/X86Subtarget.h
  llvm/test/DebugInfo/COFF/asan-module-ctor.ll
  llvm/test/DebugInfo/COFF/fpo-csrs.ll
  llvm/test/DebugInfo/COFF/multifunction.ll
  llvm/test/DebugInfo/COFF/simple.ll
  llvm/test/MC/COFF/cv-fpo-csrs.s
  llvm/test/MC/COFF/cv-fpo-errors.s
  llvm/test/MC/COFF/cv-fpo-setframe.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38776.118520.patch
Type: text/x-patch
Size: 77571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171011/97d334a8/attachment.bin>


More information about the llvm-commits mailing list