This is an archive of the discontinued LLVM Phabricator instance.

CodeView: Provide a .def file with the register ids
ClosedPublic

Authored by hans on Oct 2 2017, 3:57 PM.

Details

Summary

The list of register ids was previously written out in a couple of dirrent places. This puts it in a .def file and also adds a few more registers (e.g. the x87 regs) which should lead to more readable dumps, but I didn't include the whole list since that seems unnecessary.

X86_MC::initLLVMToSEHAndCVRegMapping is pretty ugly, but at least it's not relying on magic constants anymore. The TODO of using tablegen still stands.

Diff Detail

Repository
rL LLVM

Event Timeline

hans created this revision.Oct 2 2017, 3:57 PM
rnk added inline comments.Oct 2 2017, 5:04 PM
include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
240 ↗(On Diff #117439)

Does anything prevent us from removing the AMD64_ prefix?

hans added inline comments.Oct 2 2017, 5:18 PM
include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
240 ↗(On Diff #117439)

cvconst.h has both CV_REG_YMM0 (252) and CV_AMD64_YMM0 (368).

I dropped the CV_REG_YMM* ones, because 252 is also CV_AMD64_XMM8, and with duplicate names we can't build switch cases from this.

I suppose we could drop the prefix, but I figured there's some value in being closer to the original names maybe :-/

rnk added inline comments.Oct 2 2017, 5:26 PM
include/llvm/DebugInfo/CodeView/CodeViewRegisters.def
240 ↗(On Diff #117439)

Darn. I guess I'd say, just prefix the ones that are different for x86 vs x64. We'll need both values (eventually) if we want to support debug info of variables in YMM registers.

hans updated this revision to Diff 117540.Oct 3 2017, 9:33 AM

Dropping the AMD64_ prefixes except for the YMM registers.

rnk accepted this revision.Oct 3 2017, 10:36 AM

lgtm

This revision is now accepted and ready to land.Oct 3 2017, 10:36 AM
This revision was automatically updated to reflect the committed changes.