[PATCH] D79306: llvm rejects DWARF operator DW_OP_push_object_address.

Alok Kumar Sharma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 02:05:42 PDT 2020


alok added a comment.

In D79306#2017039 <https://reviews.llvm.org/D79306#2017039>, @djtodoro wrote:

> I don't see you are touching the `DIExpression::ExprOperand::getSize()`.
>
> Can we verify the operation within `DWARFVerifier` ?


Thanks for your review. `DIExpression::ExprOperand::getSize()` does special handling for operators with size >1, default case is 1. Since DW_OP_push_object_address doesnt have argument, its size is 1. it need not special mention.

  switch (Op) {
  case dwarf::DW_OP_LLVM_convert:
  case dwarf::DW_OP_LLVM_fragment:
  case dwarf::DW_OP_bregx:
    return 3;
  case dwarf::DW_OP_constu:
  case dwarf::DW_OP_consts:
  case dwarf::DW_OP_deref_size:
  case dwarf::DW_OP_plus_uconst:
  case dwarf::DW_OP_LLVM_tag_offset:
  case dwarf::DW_OP_LLVM_entry_value:
  case dwarf::DW_OP_regx:
    return 2;
  default:
    return 1;
  }

I did not have any special verification for this (may be like other single sized operators), Please do let me know if have any verification in mind.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79306/new/

https://reviews.llvm.org/D79306





More information about the llvm-commits mailing list