This is an archive of the discontinued LLVM Phabricator instance.

[MC] Move EH DWARF encodings from MC to CodeGen, NFC
ClosedPublic

Authored by rnk on Aug 9 2018, 1:51 PM.

Details

Summary

The TType encoding, LSDA encoding, and personality encoding are all
passed explicitly by CodeGen to the assembler through .cfi_* directives,
so only the AsmPrinter needs to know about them.

The FDE CFI encoding however, controls the encoding of the label
implicitly created by the .cfi_startproc directive. That directive seems
to be special in that it doesn't take an encoding, so the assembler just
has to know how to encode one DSO-local label reference from .eh_frame
to .text.

As a result, it looks like MC will continue to have to know when the
large code model is in use. Perhaps we could invent a '.cfi_startproc
[large]' flag so that this knowledge doesn't need to pollute the
assembler.

Event Timeline

rnk created this revision.Aug 9 2018, 1:51 PM
rnk planned changes to this revision.Aug 9 2018, 1:56 PM

Hm, this doesn't pass tests. Let me debug them first.

rnk updated this revision to Diff 159998.Aug 9 2018, 1:59 PM
  • Fix bug
davide accepted this revision.Aug 9 2018, 2:24 PM

Yeah, this is much more in line with what I had in mind than the original patch. Thanks for taking care of this!

This revision is now accepted and ready to land.Aug 9 2018, 2:24 PM
This revision was automatically updated to reflect the committed changes.