[PATCH] Support: Add dwarf::getVirtuality()

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Feb 6 16:00:20 PST 2015


DW_VIRTUALITY_* (the last DW_* thing that my upcoming assembly patches
use) is a bit different from DW_TAG, DW_LANG and DW_ATE.

There are only three valid values:

  - 0x0 (none),
  - 0x1 (virtual), and
  - 0x2 (pure_virtual),

and there isn't a `DW_VIRTUALITY_lo_user` or `DW_VIRTUALITY_hi_user`.

The assembly code needs to know the valid numeric range, so I've added
a `DW_VIRTUALITY_max` that also points at `0x2`.  I've also added a
`DW_VIRTUALITY_invalid` to `LLVMConstants` to return as an error code
from `getVirtuality()`.

I was about to commit without asking, but since it's a little different
I thought I'd check.  Does this make sense to others?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Support-Use-Dwarf.def-for-DW_VIRTUALITY-NFC.patch
Type: application/octet-stream
Size: 4239 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150206/4a3e04e7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Support-Add-dwarf-getVirtuality.patch
Type: application/octet-stream
Size: 3363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150206/4a3e04e7/attachment-0001.obj>


More information about the llvm-commits mailing list